diff --git a/api/api.gen.go b/api/api.gen.go index 1669e864..2392fbb4 100644 --- a/api/api.gen.go +++ b/api/api.gen.go @@ -1,4 +1,4 @@ -// sequence-api v0.4.0 c91b18dc2728a16b4dc1ae54b849062553a0e600 +// sequence-api v0.4.0 7578ce7543fbe82fa6e423652b4fa3d384362329 // -- // Code generated by webrpc-gen@v0.18.7 with golang generator. DO NOT EDIT. // @@ -31,7 +31,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "c91b18dc2728a16b4dc1ae54b849062553a0e600" + return "7578ce7543fbe82fa6e423652b4fa3d384362329" } // @@ -80,6 +80,102 @@ func (x *SortOrder) Is(values ...SortOrder) bool { return false } +type SardinePaymentType uint32 + +const ( + SardinePaymentType_ach SardinePaymentType = 0 + SardinePaymentType_debit SardinePaymentType = 1 + SardinePaymentType_credit SardinePaymentType = 2 + SardinePaymentType_us_debit SardinePaymentType = 3 + SardinePaymentType_international_debit SardinePaymentType = 4 + SardinePaymentType_international_credit SardinePaymentType = 5 +) + +var SardinePaymentType_name = map[uint32]string{ + 0: "ach", + 1: "debit", + 2: "credit", + 3: "us_debit", + 4: "international_debit", + 5: "international_credit", +} + +var SardinePaymentType_value = map[string]uint32{ + "ach": 0, + "debit": 1, + "credit": 2, + "us_debit": 3, + "international_debit": 4, + "international_credit": 5, +} + +func (x SardinePaymentType) String() string { + return SardinePaymentType_name[uint32(x)] +} + +func (x SardinePaymentType) MarshalText() ([]byte, error) { + return []byte(SardinePaymentType_name[uint32(x)]), nil +} + +func (x *SardinePaymentType) UnmarshalText(b []byte) error { + *x = SardinePaymentType(SardinePaymentType_value[string(b)]) + return nil +} + +func (x *SardinePaymentType) Is(values ...SardinePaymentType) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + +type SardineQuoteType uint32 + +const ( + SardineQuoteType_buy SardineQuoteType = 0 + SardineQuoteType_sell SardineQuoteType = 1 +) + +var SardineQuoteType_name = map[uint32]string{ + 0: "buy", + 1: "sell", +} + +var SardineQuoteType_value = map[string]uint32{ + "buy": 0, + "sell": 1, +} + +func (x SardineQuoteType) String() string { + return SardineQuoteType_name[uint32(x)] +} + +func (x SardineQuoteType) MarshalText() ([]byte, error) { + return []byte(SardineQuoteType_name[uint32(x)]), nil +} + +func (x *SardineQuoteType) UnmarshalText(b []byte) error { + *x = SardineQuoteType(SardineQuoteType_value[string(b)]) + return nil +} + +func (x *SardineQuoteType) Is(values ...SardineQuoteType) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + type TokenType uint8 const ( @@ -328,12 +424,12 @@ type SortBy struct { Order SortOrder `json:"order"` } -type NftCheckoutParams struct { +type SardineNFTCheckoutParams struct { Name string `json:"name"` - ImageUrl string `json:"imageUrl"` + ImageURL string `json:"imageUrl"` Network string `json:"network"` RecipientAddress string `json:"recipientAddress"` - BlockchainNftId string `json:"blockchainNftId"` + BlockchainNFTID string `json:"blockchainNftId"` ContractAddress string `json:"contractAddress"` Quantity int `json:"quantity"` Decimals *int `json:"decimals"` @@ -346,20 +442,20 @@ type NftCheckoutParams struct { ApprovedSpenderAddress *string `json:"approvedSpenderAddress"` } -type NftCheckout struct { +type SardineNFTCheckout struct { Token string `json:"token"` ExpiresAt string `json:"expiresAt"` - OrderId string `json:"orderId"` + OrderID string `json:"orderId"` } type SardineOrder struct { - Id string `json:"id"` + ID string `json:"id"` CreatedAt *time.Time `json:"createdAt"` - ReferenceId string `json:"referenceId"` + ReferenceID string `json:"referenceId"` Status string `json:"status"` FiatCurrency string `json:"fiatCurrency"` FiatExchangeRateUSD float64 `json:"fiatExchangeRateUSD"` - TransactionId string `json:"transactionId"` + TransactionID string `json:"transactionId"` ExpiresAt *time.Time `json:"expiresAt"` Total float64 `json:"total"` SubTotal float64 `json:"subTotal"` @@ -370,12 +466,118 @@ type SardineOrder struct { TransactionType string `json:"transactionType"` Name string `json:"name"` Price int `json:"price"` - ImageUrl string `json:"imageUrl"` + ImageURL string `json:"imageUrl"` ContractAddress *string `json:"contractAddress"` TransactionHash *string `json:"transactionHash"` RecipientAddress string `json:"recipientAddress"` } +type SardineRegion struct { + CountryCode string `json:"countryCode"` + IsAllowedOnRamp bool `json:"isAllowedOnRamp"` + IsAllowedOnNFT bool `json:"isAllowedOnNFT"` + IsBasicKycRequired []string `json:"isBasicKycRequired"` + IsSsnRequired []string `json:"isSsnRequired"` + Name string `json:"name"` + CurrencyCode string `json:"currencyCode"` + IsPayrollSupported bool `json:"isPayrollSupported"` + SupportedDocuments []string `json:"supportedDocuments"` + PaymentMethods []*SardineRegionPaymentMethod `json:"paymentMethods"` + States []*SardineRegionState `json:"states"` +} + +type SardineRegionPaymentMethod struct { + Name string `json:"name"` + IsAllowedOnRamp bool `json:"isAllowedOnRamp"` + IsAllowedOnNFT bool `json:"isAllowedOnNFT"` + SubTypes []string `json:"subTypes"` + Type string `json:"type"` + SubType string `json:"subType"` +} + +type SardineRegionState struct { + Code string `json:"code"` + Name string `json:"name"` + IsAllowedOnRamp bool `json:"isAllowedOnRamp"` + IsAllowedOnNFT bool `json:"isAllowedOnNFT"` +} + +type SardineSupportedToken struct { + Network string `json:"network,omitempty"` + AssetSymbol string `json:"assetSymbol,omitempty"` + AssetName string `json:"assetName,omitempty"` + ChainID string `json:"chainId,omitempty"` + TokenName string `json:"tokenName,omitempty"` + Token string `json:"token,omitempty"` + TokenAddress string `json:"tokenAddress,omitempty"` +} + +type SardineEnabledToken struct { + Network string `json:"network,omitempty"` + AssetSymbol string `json:"assetSymbol,omitempty"` + AssetName string `json:"assetName,omitempty"` + ChainID string `json:"chainId,omitempty"` + TokenName string `json:"tokenName,omitempty"` + Token string `json:"token,omitempty"` + TokenAddress string `json:"tokenAddress,omitempty"` +} + +type SardineGetQuoteParams struct { + // Cryptocurrency asset user wants to purchase + AssetType string `json:"assetType"` + // Blockchain on which the asset_type is present + Network string `json:"network"` + // Amount the user wants to buy or sell. + Total uint64 `json:"total"` + // The currency type in which the quote is supplied. Default 'USD' + Currency *string `json:"currency"` + // The payment method that the user will use for the transaction + PaymentType *SardinePaymentType `json:"paymentType"` + // Select for the required activity buy for on ramp and sell for off ramp. Default 'buy' + QuoteType *SardineQuoteType `json:"quoteType"` + // Wallet address of User. This is used to calculate if User has previously used Sardine, and provide them with a more accurate quote. + WalletAddress *string `json:"walletAddress"` +} + +type SardineQuote struct { + Quantity float64 `json:"quantity"` + Network string `json:"network"` + AssetType string `json:"assetType"` + Total float64 `json:"total"` + Currency string `json:"currency"` + ExpiresAt string `json:"expiresAt"` + PaymentType string `json:"paymentType"` + Price float64 `json:"price"` + Subtotal float64 `json:"subtotal"` + TransactionFee float64 `json:"transactionFee"` + NetworkFee float64 `json:"networkFee"` + HighNetworkFee bool `json:"highNetworkFee"` + MinTransactionValue float64 `json:"minTransactionValue"` + MaxTransactionValue float64 `json:"maxTransactionValue"` + LiquidityProvider string `json:"liquidityProvider"` +} + +type SardineFiatCurrency struct { + CurrencyCode string `json:"currencyCode"` + Name string `json:"name"` + CurrencySymbol string `json:"currencySymbol"` + PaymentOptions []*SardinePaymentOption `json:"paymentOptions"` + SupportingCountries []string `json:"supportingCountries"` +} + +type SardinePaymentOption struct { + Name string `json:"name"` + DailyLimit float64 `json:"dailyLimit"` + WeeklyLimit float64 `json:"weeklyLimit"` + MonthlyLimit float64 `json:"monthlyLimit"` + MaxAmount float64 `json:"maxAmount"` + MinAmount float64 `json:"minAmount"` + SubTypes []string `json:"subTypes"` + Type string `json:"type"` + SubType string `json:"subType"` + ProcessingTime string `json:"processingTime"` +} + type SwapQuote struct { CurrencyAddress string `json:"currencyAddress"` CurrencyBalance prototyp.BigInt `json:"currencyBalance"` @@ -474,14 +676,22 @@ var WebRPCServices = map[string][]string{ "UserStorageDelete", "UserStorageFetchAll", "GetMoonpayLink", - "GetSardineClientToken", - "GetSardineNFTCheckoutToken", - "GetSardineNFTCheckoutOrderStatus", "ResolveENSAddress", "IsValidSignature", "IsValidMessageSignature", "IsValidTypedDataSignature", "IsValidETHAuthProof", + "SardineGetClientToken", + "SardineGetNFTCheckoutToken", + "SardineGetNFTCheckoutOrderStatus", + "SardineGetSupportedRegions", + "SardineGetSupportedFiatCurrencies", + "SardineGetSupportedTokens", + "SardineGetEnabledTokens", + "SardineGetQuote", + "GetSardineClientToken", + "GetSardineNFTCheckoutToken", + "GetSardineNFTCheckoutOrderStatus", "GetCoinPrices", "GetCollectiblePrices", "GetExchangeRate", @@ -558,9 +768,6 @@ type API interface { // Wallet utils // GetMoonpayLink(ctx context.Context, url string) (string, error) - GetSardineClientToken(ctx context.Context) (string, error) - GetSardineNFTCheckoutToken(ctx context.Context, params *NftCheckoutParams) (*NftCheckout, error) - GetSardineNFTCheckoutOrderStatus(ctx context.Context, orderId string) (*SardineOrder, error) // - IsUsingGoogleMail(domain: string) => (yes: bool) ResolveENSAddress(ctx context.Context, ens string) (string, bool, error) // TODO: we can add walletContext optional in the future when we need it @@ -569,6 +776,20 @@ type API interface { IsValidMessageSignature(ctx context.Context, chainId string, walletAddress string, message string, signature string) (bool, error) IsValidTypedDataSignature(ctx context.Context, chainId string, walletAddress string, typedData interface{}, signature string) (bool, error) IsValidETHAuthProof(ctx context.Context, chainId string, walletAddress string, ethAuthProofString string) (bool, error) + SardineGetClientToken(ctx context.Context) (string, error) + SardineGetNFTCheckoutToken(ctx context.Context, params *SardineNFTCheckoutParams) (*SardineNFTCheckout, error) + SardineGetNFTCheckoutOrderStatus(ctx context.Context, orderId string) (*SardineOrder, error) + SardineGetSupportedRegions(ctx context.Context) ([]*SardineRegion, error) + SardineGetSupportedFiatCurrencies(ctx context.Context) ([]*SardineFiatCurrency, error) + SardineGetSupportedTokens(ctx context.Context) ([]*SardineSupportedToken, error) + SardineGetEnabledTokens(ctx context.Context) ([]*SardineEnabledToken, error) + SardineGetQuote(ctx context.Context, params *SardineGetQuoteParams) (*SardineQuote, error) + // Deprecated use SardineGetClientToken() + GetSardineClientToken(ctx context.Context) (string, error) + // Deprecated use SardineGetNFTCheckoutToken() + GetSardineNFTCheckoutToken(ctx context.Context, params *SardineNFTCheckoutParams) (*SardineNFTCheckout, error) + // Deprecated use SardineGetNFTCheckoutOrderStatus() + GetSardineNFTCheckoutOrderStatus(ctx context.Context, orderId string) (*SardineOrder, error) // // Price Feed // @@ -673,9 +894,6 @@ type APIClient interface { // Wallet utils // GetMoonpayLink(ctx context.Context, url string) (string, error) - GetSardineClientToken(ctx context.Context) (string, error) - GetSardineNFTCheckoutToken(ctx context.Context, params *NftCheckoutParams) (*NftCheckout, error) - GetSardineNFTCheckoutOrderStatus(ctx context.Context, orderId string) (*SardineOrder, error) // - IsUsingGoogleMail(domain: string) => (yes: bool) ResolveENSAddress(ctx context.Context, ens string) (string, bool, error) // TODO: we can add walletContext optional in the future when we need it @@ -684,6 +902,20 @@ type APIClient interface { IsValidMessageSignature(ctx context.Context, chainId string, walletAddress string, message string, signature string) (bool, error) IsValidTypedDataSignature(ctx context.Context, chainId string, walletAddress string, typedData interface{}, signature string) (bool, error) IsValidETHAuthProof(ctx context.Context, chainId string, walletAddress string, ethAuthProofString string) (bool, error) + SardineGetClientToken(ctx context.Context) (string, error) + SardineGetNFTCheckoutToken(ctx context.Context, params *SardineNFTCheckoutParams) (*SardineNFTCheckout, error) + SardineGetNFTCheckoutOrderStatus(ctx context.Context, orderId string) (*SardineOrder, error) + SardineGetSupportedRegions(ctx context.Context) ([]*SardineRegion, error) + SardineGetSupportedFiatCurrencies(ctx context.Context) ([]*SardineFiatCurrency, error) + SardineGetSupportedTokens(ctx context.Context) ([]*SardineSupportedToken, error) + SardineGetEnabledTokens(ctx context.Context) ([]*SardineEnabledToken, error) + SardineGetQuote(ctx context.Context, params *SardineGetQuoteParams) (*SardineQuote, error) + // Deprecated use SardineGetClientToken() + GetSardineClientToken(ctx context.Context) (string, error) + // Deprecated use SardineGetNFTCheckoutToken() + GetSardineNFTCheckoutToken(ctx context.Context, params *SardineNFTCheckoutParams) (*SardineNFTCheckout, error) + // Deprecated use SardineGetNFTCheckoutOrderStatus() + GetSardineNFTCheckoutOrderStatus(ctx context.Context, orderId string) (*SardineOrder, error) // // Price Feed // @@ -750,12 +982,12 @@ const APIPathPrefix = "/rpc/API/" type aPIClient struct { client HTTPClient - urls [57]string + urls [65]string } func NewAPIClient(addr string, client HTTPClient) APIClient { prefix := urlBase(addr) + APIPathPrefix - urls := [57]string{ + urls := [65]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", @@ -778,14 +1010,22 @@ func NewAPIClient(addr string, client HTTPClient) APIClient { prefix + "UserStorageDelete", prefix + "UserStorageFetchAll", prefix + "GetMoonpayLink", - prefix + "GetSardineClientToken", - prefix + "GetSardineNFTCheckoutToken", - prefix + "GetSardineNFTCheckoutOrderStatus", prefix + "ResolveENSAddress", prefix + "IsValidSignature", prefix + "IsValidMessageSignature", prefix + "IsValidTypedDataSignature", prefix + "IsValidETHAuthProof", + prefix + "SardineGetClientToken", + prefix + "SardineGetNFTCheckoutToken", + prefix + "SardineGetNFTCheckoutOrderStatus", + prefix + "SardineGetSupportedRegions", + prefix + "SardineGetSupportedFiatCurrencies", + prefix + "SardineGetSupportedTokens", + prefix + "SardineGetEnabledTokens", + prefix + "SardineGetQuote", + prefix + "GetSardineClientToken", + prefix + "GetSardineNFTCheckoutToken", + prefix + "GetSardineNFTCheckoutOrderStatus", prefix + "GetCoinPrices", prefix + "GetCollectiblePrices", prefix + "GetExchangeRate", @@ -1246,12 +1486,16 @@ func (c *aPIClient) GetMoonpayLink(ctx context.Context, url string) (string, err return out.Ret0, err } -func (c *aPIClient) GetSardineClientToken(ctx context.Context) (string, error) { +func (c *aPIClient) ResolveENSAddress(ctx context.Context, ens string) (string, bool, error) { + in := struct { + Arg0 string `json:"ens"` + }{ens} out := struct { - Ret0 string `json:"token"` + Ret0 string `json:"address"` + Ret1 bool `json:"ok"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[22], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[22], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1259,15 +1503,18 @@ func (c *aPIClient) GetSardineClientToken(ctx context.Context) (string, error) { } } - return out.Ret0, err + return out.Ret0, out.Ret1, err } -func (c *aPIClient) GetSardineNFTCheckoutToken(ctx context.Context, params *NftCheckoutParams) (*NftCheckout, error) { +func (c *aPIClient) IsValidSignature(ctx context.Context, chainId string, walletAddress string, digest string, signature string) (bool, error) { in := struct { - Arg0 *NftCheckoutParams `json:"params"` - }{params} + Arg0 string `json:"chainId"` + Arg1 string `json:"walletAddress"` + Arg2 string `json:"digest"` + Arg3 string `json:"signature"` + }{chainId, walletAddress, digest, signature} out := struct { - Ret0 *NftCheckout `json:"resp"` + Ret0 bool `json:"isValid"` }{} resp, err := doHTTPRequest(ctx, c.client, c.urls[23], in, &out) @@ -1281,12 +1528,15 @@ func (c *aPIClient) GetSardineNFTCheckoutToken(ctx context.Context, params *NftC return out.Ret0, err } -func (c *aPIClient) GetSardineNFTCheckoutOrderStatus(ctx context.Context, orderId string) (*SardineOrder, error) { +func (c *aPIClient) IsValidMessageSignature(ctx context.Context, chainId string, walletAddress string, message string, signature string) (bool, error) { in := struct { - Arg0 string `json:"orderId"` - }{orderId} + Arg0 string `json:"chainId"` + Arg1 string `json:"walletAddress"` + Arg2 string `json:"message"` + Arg3 string `json:"signature"` + }{chainId, walletAddress, message, signature} out := struct { - Ret0 *SardineOrder `json:"resp"` + Ret0 bool `json:"isValid"` }{} resp, err := doHTTPRequest(ctx, c.client, c.urls[24], in, &out) @@ -1300,13 +1550,15 @@ func (c *aPIClient) GetSardineNFTCheckoutOrderStatus(ctx context.Context, orderI return out.Ret0, err } -func (c *aPIClient) ResolveENSAddress(ctx context.Context, ens string) (string, bool, error) { +func (c *aPIClient) IsValidTypedDataSignature(ctx context.Context, chainId string, walletAddress string, typedData interface{}, signature string) (bool, error) { in := struct { - Arg0 string `json:"ens"` - }{ens} + Arg0 string `json:"chainId"` + Arg1 string `json:"walletAddress"` + Arg2 interface{} `json:"typedData"` + Arg3 string `json:"signature"` + }{chainId, walletAddress, typedData, signature} out := struct { - Ret0 string `json:"address"` - Ret1 bool `json:"ok"` + Ret0 bool `json:"isValid"` }{} resp, err := doHTTPRequest(ctx, c.client, c.urls[25], in, &out) @@ -1317,16 +1569,15 @@ func (c *aPIClient) ResolveENSAddress(ctx context.Context, ens string) (string, } } - return out.Ret0, out.Ret1, err + return out.Ret0, err } -func (c *aPIClient) IsValidSignature(ctx context.Context, chainId string, walletAddress string, digest string, signature string) (bool, error) { +func (c *aPIClient) IsValidETHAuthProof(ctx context.Context, chainId string, walletAddress string, ethAuthProofString string) (bool, error) { in := struct { Arg0 string `json:"chainId"` Arg1 string `json:"walletAddress"` - Arg2 string `json:"digest"` - Arg3 string `json:"signature"` - }{chainId, walletAddress, digest, signature} + Arg2 string `json:"ethAuthProofString"` + }{chainId, walletAddress, ethAuthProofString} out := struct { Ret0 bool `json:"isValid"` }{} @@ -1342,18 +1593,12 @@ func (c *aPIClient) IsValidSignature(ctx context.Context, chainId string, wallet return out.Ret0, err } -func (c *aPIClient) IsValidMessageSignature(ctx context.Context, chainId string, walletAddress string, message string, signature string) (bool, error) { - in := struct { - Arg0 string `json:"chainId"` - Arg1 string `json:"walletAddress"` - Arg2 string `json:"message"` - Arg3 string `json:"signature"` - }{chainId, walletAddress, message, signature} +func (c *aPIClient) SardineGetClientToken(ctx context.Context) (string, error) { out := struct { - Ret0 bool `json:"isValid"` + Ret0 string `json:"token"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[27], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[27], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1364,15 +1609,12 @@ func (c *aPIClient) IsValidMessageSignature(ctx context.Context, chainId string, return out.Ret0, err } -func (c *aPIClient) IsValidTypedDataSignature(ctx context.Context, chainId string, walletAddress string, typedData interface{}, signature string) (bool, error) { +func (c *aPIClient) SardineGetNFTCheckoutToken(ctx context.Context, params *SardineNFTCheckoutParams) (*SardineNFTCheckout, error) { in := struct { - Arg0 string `json:"chainId"` - Arg1 string `json:"walletAddress"` - Arg2 interface{} `json:"typedData"` - Arg3 string `json:"signature"` - }{chainId, walletAddress, typedData, signature} + Arg0 *SardineNFTCheckoutParams `json:"params"` + }{params} out := struct { - Ret0 bool `json:"isValid"` + Ret0 *SardineNFTCheckout `json:"resp"` }{} resp, err := doHTTPRequest(ctx, c.client, c.urls[28], in, &out) @@ -1386,14 +1628,12 @@ func (c *aPIClient) IsValidTypedDataSignature(ctx context.Context, chainId strin return out.Ret0, err } -func (c *aPIClient) IsValidETHAuthProof(ctx context.Context, chainId string, walletAddress string, ethAuthProofString string) (bool, error) { +func (c *aPIClient) SardineGetNFTCheckoutOrderStatus(ctx context.Context, orderId string) (*SardineOrder, error) { in := struct { - Arg0 string `json:"chainId"` - Arg1 string `json:"walletAddress"` - Arg2 string `json:"ethAuthProofString"` - }{chainId, walletAddress, ethAuthProofString} + Arg0 string `json:"orderId"` + }{orderId} out := struct { - Ret0 bool `json:"isValid"` + Ret0 *SardineOrder `json:"resp"` }{} resp, err := doHTTPRequest(ctx, c.client, c.urls[29], in, &out) @@ -1407,6 +1647,143 @@ func (c *aPIClient) IsValidETHAuthProof(ctx context.Context, chainId string, wal return out.Ret0, err } +func (c *aPIClient) SardineGetSupportedRegions(ctx context.Context) ([]*SardineRegion, error) { + out := struct { + Ret0 []*SardineRegion `json:"regions"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[30], nil, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCause(fmt.Errorf("failed to close response body: %w", cerr)) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) SardineGetSupportedFiatCurrencies(ctx context.Context) ([]*SardineFiatCurrency, error) { + out := struct { + Ret0 []*SardineFiatCurrency `json:"tokens"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[31], nil, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCause(fmt.Errorf("failed to close response body: %w", cerr)) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) SardineGetSupportedTokens(ctx context.Context) ([]*SardineSupportedToken, error) { + out := struct { + Ret0 []*SardineSupportedToken `json:"tokens"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[32], nil, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCause(fmt.Errorf("failed to close response body: %w", cerr)) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) SardineGetEnabledTokens(ctx context.Context) ([]*SardineEnabledToken, error) { + out := struct { + Ret0 []*SardineEnabledToken `json:"tokens"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[33], nil, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCause(fmt.Errorf("failed to close response body: %w", cerr)) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) SardineGetQuote(ctx context.Context, params *SardineGetQuoteParams) (*SardineQuote, error) { + in := struct { + Arg0 *SardineGetQuoteParams `json:"params"` + }{params} + out := struct { + Ret0 *SardineQuote `json:"quote"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[34], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCause(fmt.Errorf("failed to close response body: %w", cerr)) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) GetSardineClientToken(ctx context.Context) (string, error) { + out := struct { + Ret0 string `json:"token"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[35], nil, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCause(fmt.Errorf("failed to close response body: %w", cerr)) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) GetSardineNFTCheckoutToken(ctx context.Context, params *SardineNFTCheckoutParams) (*SardineNFTCheckout, error) { + in := struct { + Arg0 *SardineNFTCheckoutParams `json:"params"` + }{params} + out := struct { + Ret0 *SardineNFTCheckout `json:"resp"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[36], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCause(fmt.Errorf("failed to close response body: %w", cerr)) + } + } + + return out.Ret0, err +} + +func (c *aPIClient) GetSardineNFTCheckoutOrderStatus(ctx context.Context, orderId string) (*SardineOrder, error) { + in := struct { + Arg0 string `json:"orderId"` + }{orderId} + out := struct { + Ret0 *SardineOrder `json:"resp"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[37], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCause(fmt.Errorf("failed to close response body: %w", cerr)) + } + } + + return out.Ret0, err +} + func (c *aPIClient) GetCoinPrices(ctx context.Context, tokens []*Token) ([]*TokenPrice, error) { in := struct { Arg0 []*Token `json:"tokens"` @@ -1415,7 +1792,7 @@ func (c *aPIClient) GetCoinPrices(ctx context.Context, tokens []*Token) ([]*Toke Ret0 []*TokenPrice `json:"tokenPrices"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[30], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[38], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1434,7 +1811,7 @@ func (c *aPIClient) GetCollectiblePrices(ctx context.Context, tokens []*Token) ( Ret0 []*TokenPrice `json:"tokenPrices"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[31], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[39], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1453,7 +1830,7 @@ func (c *aPIClient) GetExchangeRate(ctx context.Context, toCurrency string) (*Ex Ret0 *ExchangeRate `json:"exchangeRate"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[32], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[40], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1473,7 +1850,7 @@ func (c *aPIClient) MemoryStore(ctx context.Context, key string, value string) ( Ret0 bool `json:"ok"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[33], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[41], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1492,7 +1869,7 @@ func (c *aPIClient) MemoryLoad(ctx context.Context, key string) (string, error) Ret0 string `json:"value"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[34], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[42], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1508,7 +1885,7 @@ func (c *aPIClient) GetInviteInfo(ctx context.Context) (*InviteInfo, error) { Ret0 *InviteInfo `json:"inviteInfo"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[35], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[43], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1527,7 +1904,7 @@ func (c *aPIClient) IsValidAccessCode(ctx context.Context, accessCode string) (b Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[36], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[44], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1547,7 +1924,7 @@ func (c *aPIClient) InternalClaimAccessCode(ctx context.Context, address string, Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[37], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[45], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1567,7 +1944,7 @@ func (c *aPIClient) BlockNumberAtTime(ctx context.Context, chainId uint64, times Ret0 []uint64 `json:"blocks"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[38], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[46], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1589,7 +1966,7 @@ func (c *aPIClient) PaperSessionSecret(ctx context.Context, chainName string, co Ret0 string `json:"secret"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[39], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[47], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1611,7 +1988,7 @@ func (c *aPIClient) PaperSessionSecret2(ctx context.Context, chainName string, c Ret0 string `json:"secret"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[40], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[48], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1636,7 +2013,7 @@ func (c *aPIClient) LinkWallet(ctx context.Context, parentWalletAddress string, Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[41], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[49], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1658,7 +2035,7 @@ func (c *aPIClient) GetLinkedWallets(ctx context.Context, parentWalletAddress st Ret0 []string `json:"linkedWallets"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[42], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[50], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1683,7 +2060,7 @@ func (c *aPIClient) RemoveLinkedWallet(ctx context.Context, parentWalletAddress Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[43], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[51], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1703,7 +2080,7 @@ func (c *aPIClient) GenerateWaaSVerificationURL(ctx context.Context, walletAddre Ret1 string `json:"verificationURL"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[44], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[52], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1725,7 +2102,7 @@ func (c *aPIClient) ValidateWaaSVerificationNonce(ctx context.Context, nonce str Ret0 string `json:"walletAddress"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[45], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[53], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1748,7 +2125,7 @@ func (c *aPIClient) GetSwapQuotes(ctx context.Context, userAddress string, curre Ret0 []*SwapQuote `json:"swapQuotes"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[46], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[54], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1767,7 +2144,7 @@ func (c *aPIClient) AddCurrencyGroup(ctx context.Context, currencyGroup *Currenc Ret0 uint64 `json:"groupId"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[47], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[55], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1783,7 +2160,7 @@ func (c *aPIClient) UpdateCurrencyGroup(ctx context.Context, currencyGroup *Curr Arg0 *CurrencyGroup `json:"currencyGroup"` }{currencyGroup} - resp, err := doHTTPRequest(ctx, c.client, c.urls[48], in, nil) + resp, err := doHTTPRequest(ctx, c.client, c.urls[56], in, nil) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1799,7 +2176,7 @@ func (c *aPIClient) ListCurrencyGroups(ctx context.Context) ([]*CurrencyGroup, e Ret0 []*CurrencyGroup `json:"currencyGroups"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[49], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[57], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1818,7 +2195,7 @@ func (c *aPIClient) DeleteCurrencyGroup(ctx context.Context, groupId uint64) (bo Ret0 bool `json:"ok"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[50], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[58], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1837,7 +2214,7 @@ func (c *aPIClient) AddInventoryPaymentConfig(ctx context.Context, config *Inven Ret0 uint64 `json:"configId"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[51], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[59], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1856,7 +2233,7 @@ func (c *aPIClient) GetInventoryPaymentConfig(ctx context.Context, configId uint Ret0 *InventoryPaymentConfig `json:"config"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[52], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[60], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1875,7 +2252,7 @@ func (c *aPIClient) ListInventoryPaymentConfigs(ctx context.Context, projectId u Ret0 []*InventoryPaymentConfig `json:"configs"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[53], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[61], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1891,7 +2268,7 @@ func (c *aPIClient) UpdateInventoryPaymentConfig(ctx context.Context, config *In Arg0 *InventoryPaymentConfig `json:"config"` }{config} - resp, err := doHTTPRequest(ctx, c.client, c.urls[54], in, nil) + resp, err := doHTTPRequest(ctx, c.client, c.urls[62], in, nil) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1910,7 +2287,7 @@ func (c *aPIClient) DeleteInventoryPaymentConfig(ctx context.Context, configId u Ret0 bool `json:"ok"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[55], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[63], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1932,7 +2309,7 @@ func (c *aPIClient) RequestInventoryPayment(ctx context.Context, configId uint64 Ret0 *InventoryPaymentResponse `json:"payment"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[56], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[64], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil {