From cdc66c56356417bf44c13edd860124cf23ba1593 Mon Sep 17 00:00:00 2001 From: VojtechVitek <139342+VojtechVitek@users.noreply.github.com> Date: Fri, 10 Jan 2025 12:31:18 +0000 Subject: [PATCH] [AUTOMATED] Update: api/proto/clients/api.gen.go --- api/api.gen.go | 663 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 572 insertions(+), 91 deletions(-) diff --git a/api/api.gen.go b/api/api.gen.go index a523eaa2..2898adfd 100644 --- a/api/api.gen.go +++ b/api/api.gen.go @@ -1,6 +1,6 @@ -// sequence-api v0.4.0 470a0f88ea399c2a57ff8c22da54358c033ed5f0 +// sequence-api v0.4.0 24814ebb88457c0545aa80e8388cb0f08ec59bec // -- -// Code generated by webrpc-gen@v0.18.7 with golang generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.20.3 with golang generator. DO NOT EDIT. // // webrpc-gen -schema=api.ridl -target=golang -pkg=api -client -out=./clients/api.gen.go package api @@ -31,7 +31,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "470a0f88ea399c2a57ff8c22da54358c033ed5f0" + return "24814ebb88457c0545aa80e8388cb0f08ec59bec" } // @@ -258,6 +258,12 @@ type SequenceContext struct { Utils string `json:"utils"` } +type PublicKey struct { + ID string `json:"id" db:"id"` + X string `json:"x" db:"x"` + Y string `json:"y" db:"y"` +} + // Users type User struct { Address prototyp.Hash `json:"address" db:"address"` @@ -580,10 +586,11 @@ type SardinePaymentOption struct { } type SwapPrice struct { - CurrencyAddress string `json:"currencyAddress"` - CurrencyBalance prototyp.BigInt `json:"currencyBalance"` - Price prototyp.BigInt `json:"price"` - To string `json:"to"` + CurrencyAddress string `json:"currencyAddress"` + CurrencyBalance prototyp.BigInt `json:"currencyBalance"` + Price prototyp.BigInt `json:"price"` + // Guaranteed price for the swap (incl slippage). + MaxPrice prototyp.BigInt `json:"maxPrice"` TransactionValue prototyp.BigInt `json:"transactionValue"` } @@ -591,7 +598,7 @@ type SwapQuote struct { CurrencyAddress string `json:"currencyAddress"` CurrencyBalance prototyp.BigInt `json:"currencyBalance"` Price prototyp.BigInt `json:"price"` - // Guaranteed price for the swap. + // Guaranteed price for the swap (incl slippage). MaxPrice prototyp.BigInt `json:"maxPrice"` // to must be approved to access maxPrice of currencyAddress for the sender To string `json:"to"` @@ -658,6 +665,355 @@ type PaymentResponse struct { TxData string `json:"txData"` } +type AdoptedChildWallet struct { + Address string `json:"address"` +} + +var ( + methods = map[string]method{ + "/rpc/API/Ping": { + Name: "Ping", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/Version": { + Name: "Version", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/RuntimeStatus": { + Name: "RuntimeStatus", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/Clock": { + Name: "Clock", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetSequenceContext": { + Name: "GetSequenceContext", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetAuthToken": { + Name: "GetAuthToken", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetAuthToken2": { + Name: "GetAuthToken2", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/SendPasswordlessLink": { + Name: "SendPasswordlessLink", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/RegisterPublicKey": { + Name: "RegisterPublicKey", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetPublicKey": { + Name: "GetPublicKey", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/FriendList": { + Name: "FriendList", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetFriendByAddress": { + Name: "GetFriendByAddress", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/SearchFriends": { + Name: "SearchFriends", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/AddFriend": { + Name: "AddFriend", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/UpdateFriendNickname": { + Name: "UpdateFriendNickname", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/RemoveFriend": { + Name: "RemoveFriend", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/ContractCall": { + Name: "ContractCall", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/DecodeContractCall": { + Name: "DecodeContractCall", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/LookupContractCallSelectors": { + Name: "LookupContractCallSelectors", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/UserStorageFetch": { + Name: "UserStorageFetch", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/UserStorageSave": { + Name: "UserStorageSave", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/UserStorageDelete": { + Name: "UserStorageDelete", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/UserStorageFetchAll": { + Name: "UserStorageFetchAll", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetMoonpayLink": { + Name: "GetMoonpayLink", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/ResolveENSAddress": { + Name: "ResolveENSAddress", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/IsValidSignature": { + Name: "IsValidSignature", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/IsValidMessageSignature": { + Name: "IsValidMessageSignature", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/IsValidTypedDataSignature": { + Name: "IsValidTypedDataSignature", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/IsValidETHAuthProof": { + Name: "IsValidETHAuthProof", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/SardineGetClientToken": { + Name: "SardineGetClientToken", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/SardineGetNFTCheckoutToken": { + Name: "SardineGetNFTCheckoutToken", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/SardineGetNFTCheckoutOrderStatus": { + Name: "SardineGetNFTCheckoutOrderStatus", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/SardineGetSupportedRegions": { + Name: "SardineGetSupportedRegions", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/SardineGetSupportedFiatCurrencies": { + Name: "SardineGetSupportedFiatCurrencies", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/SardineGetSupportedTokens": { + Name: "SardineGetSupportedTokens", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/SardineGetEnabledTokens": { + Name: "SardineGetEnabledTokens", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/SardineGetQuote": { + Name: "SardineGetQuote", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetSardineClientToken": { + Name: "GetSardineClientToken", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetSardineNFTCheckoutToken": { + Name: "GetSardineNFTCheckoutToken", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetSardineNFTCheckoutOrderStatus": { + Name: "GetSardineNFTCheckoutOrderStatus", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetCoinPrices": { + Name: "GetCoinPrices", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetCollectiblePrices": { + Name: "GetCollectiblePrices", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetExchangeRate": { + Name: "GetExchangeRate", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/MemoryStore": { + Name: "MemoryStore", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/MemoryLoad": { + Name: "MemoryLoad", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetInviteInfo": { + Name: "GetInviteInfo", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/IsValidAccessCode": { + Name: "IsValidAccessCode", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/InternalClaimAccessCode": { + Name: "InternalClaimAccessCode", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/BlockNumberAtTime": { + Name: "BlockNumberAtTime", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/PaperSessionSecret": { + Name: "PaperSessionSecret", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/PaperSessionSecret2": { + Name: "PaperSessionSecret2", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/LinkWallet": { + Name: "LinkWallet", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/GetLinkedWallets": { + Name: "GetLinkedWallets", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/RemoveLinkedWallet": { + Name: "RemoveLinkedWallet", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/GenerateWaaSVerificationURL": { + Name: "GenerateWaaSVerificationURL", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/ValidateWaaSVerificationNonce": { + Name: "ValidateWaaSVerificationNonce", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/ListAdoptedWallets": { + Name: "ListAdoptedWallets", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetSwapPrice": { + Name: "GetSwapPrice", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/GetSwapPrices": { + Name: "GetSwapPrices", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/GetSwapQuote": { + Name: "GetSwapQuote", + Service: "API", + Annotations: map[string]string{"public": ""}, + }, + "/rpc/API/ListCurrencyGroups": { + Name: "ListCurrencyGroups", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/AddOffchainInventory": { + Name: "AddOffchainInventory", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/GetOffchainInventory": { + Name: "GetOffchainInventory", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/ListOffchainInventories": { + Name: "ListOffchainInventories", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/UpdateOffchainInventory": { + Name: "UpdateOffchainInventory", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/DeleteOffchainInventory": { + Name: "DeleteOffchainInventory", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/RequestOffchainPayment": { + Name: "RequestOffchainPayment", + Service: "API", + Annotations: map[string]string{}, + }, + "/rpc/API/ListOffchainPayments": { + Name: "ListOffchainPayments", + Service: "API", + Annotations: map[string]string{}, + }, + } +) + var WebRPCServices = map[string][]string{ "API": { "Ping", @@ -668,6 +1024,8 @@ var WebRPCServices = map[string][]string{ "GetAuthToken", "GetAuthToken2", "SendPasswordlessLink", + "RegisterPublicKey", + "GetPublicKey", "FriendList", "GetFriendByAddress", "SearchFriends", @@ -714,6 +1072,8 @@ var WebRPCServices = map[string][]string{ "RemoveLinkedWallet", "GenerateWaaSVerificationURL", "ValidateWaaSVerificationNonce", + "ListAdoptedWallets", + "GetSwapPrice", "GetSwapPrices", "GetSwapQuote", "ListCurrencyGroups", @@ -747,6 +1107,8 @@ type API interface { GetAuthToken(ctx context.Context, ewtString string, testnetMode *bool) (bool, string, string, *User, error) GetAuthToken2(ctx context.Context, ewtString string, chainID string) (bool, string, string, *User, error) SendPasswordlessLink(ctx context.Context, email string, redirectUri string, intent string) (bool, error) + RegisterPublicKey(ctx context.Context, publicKey *PublicKey) (bool, error) + GetPublicKey(ctx context.Context, id string) (*PublicKey, error) // // Contacts / Friends // @@ -829,16 +1191,22 @@ type API interface { // LinkWallet(ctx context.Context, parentWalletAddress string, parentWalletMessage string, parentWalletSignature string, linkedWalletAddress string, linkedWalletMessage string, linkedWalletSignature string, signatureChainId string, linkedWalletType *string) (bool, error) GetLinkedWallets(ctx context.Context, parentWalletAddress string, parentWalletMessage string, parentWalletSignature string, signatureChainId string) ([]*LinkedWallet, error) - RemoveLinkedWallet(ctx context.Context, parentWalletAddress string, parentWalletMessage string, parentWalletSignature string, linkedWalletAddress string, linkedWalletMessage string, linkedWalletSignature string, signatureChainId string) (bool, error) + RemoveLinkedWallet(ctx context.Context, parentWalletAddress string, parentWalletMessage string, parentWalletSignature string, linkedWalletAddress string, signatureChainId string) (bool, error) // NOTE: these methods are deprecated, please do not use them. We may resurface them in the future, but just wanted // to be clear, they are not necessary for our linked wallets. GenerateWaaSVerificationURL(ctx context.Context, walletAddress string) (string, string, error) ValidateWaaSVerificationNonce(ctx context.Context, nonce string, signature string, sessionId string, chainId string) (string, error) // + // + // WaaS child wallet adoption + // + ListAdoptedWallets(ctx context.Context, page *Page) (*Page, []*AdoptedChildWallet, error) + // // Currency abstraction // - GetSwapPrices(ctx context.Context, userAddress string, buyCurrencyAddress string, buyAmount string, chainId uint64) ([]*SwapPrice, error) - GetSwapQuote(ctx context.Context, userAddress string, buyCurrencyAddress string, sellCurrencyAddress string, buyAmount string, chainId uint64, includeApprove bool) (*SwapQuote, error) + GetSwapPrice(ctx context.Context, buyCurrencyAddress string, sellCurrencyAddress string, buyAmount string, chainId uint64, slippagePercentage *uint64) (*SwapPrice, error) + GetSwapPrices(ctx context.Context, userAddress string, buyCurrencyAddress string, buyAmount string, chainId uint64, slippagePercentage *uint64) ([]*SwapPrice, error) + GetSwapQuote(ctx context.Context, userAddress string, buyCurrencyAddress string, sellCurrencyAddress string, buyAmount string, chainId uint64, includeApprove bool, slippagePercentage *uint64) (*SwapQuote, error) // // Inventory, payments and management // @@ -872,6 +1240,8 @@ type APIClient interface { GetAuthToken(ctx context.Context, ewtString string, testnetMode *bool) (bool, string, string, *User, error) GetAuthToken2(ctx context.Context, ewtString string, chainID string) (bool, string, string, *User, error) SendPasswordlessLink(ctx context.Context, email string, redirectUri string, intent string) (bool, error) + RegisterPublicKey(ctx context.Context, publicKey *PublicKey) (bool, error) + GetPublicKey(ctx context.Context, id string) (*PublicKey, error) // // Contacts / Friends // @@ -954,16 +1324,22 @@ type APIClient interface { // LinkWallet(ctx context.Context, parentWalletAddress string, parentWalletMessage string, parentWalletSignature string, linkedWalletAddress string, linkedWalletMessage string, linkedWalletSignature string, signatureChainId string, linkedWalletType *string) (bool, error) GetLinkedWallets(ctx context.Context, parentWalletAddress string, parentWalletMessage string, parentWalletSignature string, signatureChainId string) ([]*LinkedWallet, error) - RemoveLinkedWallet(ctx context.Context, parentWalletAddress string, parentWalletMessage string, parentWalletSignature string, linkedWalletAddress string, linkedWalletMessage string, linkedWalletSignature string, signatureChainId string) (bool, error) + RemoveLinkedWallet(ctx context.Context, parentWalletAddress string, parentWalletMessage string, parentWalletSignature string, linkedWalletAddress string, signatureChainId string) (bool, error) // NOTE: these methods are deprecated, please do not use them. We may resurface them in the future, but just wanted // to be clear, they are not necessary for our linked wallets. GenerateWaaSVerificationURL(ctx context.Context, walletAddress string) (string, string, error) ValidateWaaSVerificationNonce(ctx context.Context, nonce string, signature string, sessionId string, chainId string) (string, error) // + // + // WaaS child wallet adoption + // + ListAdoptedWallets(ctx context.Context, page *Page) (*Page, []*AdoptedChildWallet, error) + // // Currency abstraction // - GetSwapPrices(ctx context.Context, userAddress string, buyCurrencyAddress string, buyAmount string, chainId uint64) ([]*SwapPrice, error) - GetSwapQuote(ctx context.Context, userAddress string, buyCurrencyAddress string, sellCurrencyAddress string, buyAmount string, chainId uint64, includeApprove bool) (*SwapQuote, error) + GetSwapPrice(ctx context.Context, buyCurrencyAddress string, sellCurrencyAddress string, buyAmount string, chainId uint64, slippagePercentage *uint64) (*SwapPrice, error) + GetSwapPrices(ctx context.Context, userAddress string, buyCurrencyAddress string, buyAmount string, chainId uint64, slippagePercentage *uint64) ([]*SwapPrice, error) + GetSwapQuote(ctx context.Context, userAddress string, buyCurrencyAddress string, sellCurrencyAddress string, buyAmount string, chainId uint64, includeApprove bool, slippagePercentage *uint64) (*SwapQuote, error) // // Inventory, payments and management // @@ -985,12 +1361,12 @@ const APIPathPrefix = "/rpc/API/" type aPIClient struct { client HTTPClient - urls [64]string + urls [68]string } func NewAPIClient(addr string, client HTTPClient) APIClient { prefix := urlBase(addr) + APIPathPrefix - urls := [64]string{ + urls := [68]string{ prefix + "Ping", prefix + "Version", prefix + "RuntimeStatus", @@ -999,6 +1375,8 @@ func NewAPIClient(addr string, client HTTPClient) APIClient { prefix + "GetAuthToken", prefix + "GetAuthToken2", prefix + "SendPasswordlessLink", + prefix + "RegisterPublicKey", + prefix + "GetPublicKey", prefix + "FriendList", prefix + "GetFriendByAddress", prefix + "SearchFriends", @@ -1045,6 +1423,8 @@ func NewAPIClient(addr string, client HTTPClient) APIClient { prefix + "RemoveLinkedWallet", prefix + "GenerateWaaSVerificationURL", prefix + "ValidateWaaSVerificationNonce", + prefix + "ListAdoptedWallets", + prefix + "GetSwapPrice", prefix + "GetSwapPrices", prefix + "GetSwapQuote", prefix + "ListCurrencyGroups", @@ -1209,6 +1589,44 @@ func (c *aPIClient) SendPasswordlessLink(ctx context.Context, email string, redi return out.Ret0, err } +func (c *aPIClient) RegisterPublicKey(ctx context.Context, publicKey *PublicKey) (bool, error) { + in := struct { + Arg0 *PublicKey `json:"publicKey"` + }{publicKey} + out := struct { + Ret0 bool `json:"status"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[8], 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) GetPublicKey(ctx context.Context, id string) (*PublicKey, error) { + in := struct { + Arg0 string `json:"id"` + }{id} + out := struct { + Ret0 *PublicKey `json:"publicKey"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[9], 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) FriendList(ctx context.Context, nickname *string, page *Page) (*Page, []*Friend, error) { in := struct { Arg0 *string `json:"nickname"` @@ -1219,7 +1637,7 @@ func (c *aPIClient) FriendList(ctx context.Context, nickname *string, page *Page Ret1 []*Friend `json:"friends"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[8], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[10], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1239,7 +1657,7 @@ func (c *aPIClient) GetFriendByAddress(ctx context.Context, friendAddress string Ret1 *Friend `json:"friend"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[9], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[11], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1259,7 +1677,7 @@ func (c *aPIClient) SearchFriends(ctx context.Context, filterUsername string, pa Ret0 []*Friend `json:"friends"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[10], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1280,7 +1698,7 @@ func (c *aPIClient) AddFriend(ctx context.Context, friendAddress string, optiona Ret1 *Friend `json:"friend"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[11], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[13], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1301,7 +1719,7 @@ func (c *aPIClient) UpdateFriendNickname(ctx context.Context, friendAddress stri Ret1 *Friend `json:"friend"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[12], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[14], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1320,7 +1738,7 @@ func (c *aPIClient) RemoveFriend(ctx context.Context, friendAddress string) (boo Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[13], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[15], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1343,7 +1761,7 @@ func (c *aPIClient) ContractCall(ctx context.Context, chainID string, contract s Ret0 []string `json:"returns"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[14], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[16], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1362,7 +1780,7 @@ func (c *aPIClient) DecodeContractCall(ctx context.Context, callData string) (*C Ret0 *ContractCall `json:"call"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[15], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[17], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1381,7 +1799,7 @@ func (c *aPIClient) LookupContractCallSelectors(ctx context.Context, selectors [ Ret0 [][]string `json:"signatures"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[16], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[18], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1400,7 +1818,7 @@ func (c *aPIClient) UserStorageFetch(ctx context.Context, key string) (interface Ret0 interface{} `json:"object"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[17], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[19], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1420,7 +1838,7 @@ func (c *aPIClient) UserStorageSave(ctx context.Context, key string, object inte Ret0 bool `json:"ok"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[18], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[20], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1439,7 +1857,7 @@ func (c *aPIClient) UserStorageDelete(ctx context.Context, key string) (bool, er Ret0 bool `json:"ok"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[19], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[21], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1458,7 +1876,7 @@ func (c *aPIClient) UserStorageFetchAll(ctx context.Context, keys []string) (map Ret0 map[string]interface{} `json:"objects"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[20], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[22], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1477,7 +1895,7 @@ func (c *aPIClient) GetMoonpayLink(ctx context.Context, url string) (string, err Ret0 string `json:"signedUrl"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[21], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[23], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1497,7 +1915,7 @@ func (c *aPIClient) ResolveENSAddress(ctx context.Context, ens string) (string, Ret1 bool `json:"ok"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[22], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[24], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1519,7 +1937,7 @@ func (c *aPIClient) IsValidSignature(ctx context.Context, chainId string, wallet Ret0 bool `json:"isValid"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[23], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[25], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1541,7 +1959,7 @@ func (c *aPIClient) IsValidMessageSignature(ctx context.Context, chainId string, Ret0 bool `json:"isValid"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[24], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[26], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1563,7 +1981,7 @@ func (c *aPIClient) IsValidTypedDataSignature(ctx context.Context, chainId strin Ret0 bool `json:"isValid"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[25], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[27], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1584,7 +2002,7 @@ func (c *aPIClient) IsValidETHAuthProof(ctx context.Context, chainId string, wal Ret0 bool `json:"isValid"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[26], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[28], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1600,7 +2018,7 @@ func (c *aPIClient) SardineGetClientToken(ctx context.Context) (string, error) { Ret0 string `json:"token"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[27], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[29], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1619,7 +2037,7 @@ func (c *aPIClient) SardineGetNFTCheckoutToken(ctx context.Context, params *Sard Ret0 *SardineNFTCheckout `json:"resp"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[28], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[30], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1638,7 +2056,7 @@ func (c *aPIClient) SardineGetNFTCheckoutOrderStatus(ctx context.Context, orderI Ret0 *SardineOrder `json:"resp"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[29], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[31], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1654,7 +2072,7 @@ func (c *aPIClient) SardineGetSupportedRegions(ctx context.Context) ([]*SardineR Ret0 []*SardineRegion `json:"regions"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[30], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[32], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1670,7 +2088,7 @@ func (c *aPIClient) SardineGetSupportedFiatCurrencies(ctx context.Context) ([]*S Ret0 []*SardineFiatCurrency `json:"tokens"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[31], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[33], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1686,7 +2104,7 @@ func (c *aPIClient) SardineGetSupportedTokens(ctx context.Context) ([]*SardineSu Ret0 []*SardineSupportedToken `json:"tokens"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[32], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[34], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1702,7 +2120,7 @@ func (c *aPIClient) SardineGetEnabledTokens(ctx context.Context) ([]*SardineEnab Ret0 []*SardineEnabledToken `json:"tokens"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[33], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[35], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1721,7 +2139,7 @@ func (c *aPIClient) SardineGetQuote(ctx context.Context, params *SardineGetQuote Ret0 *SardineQuote `json:"quote"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[34], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[36], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1737,7 +2155,7 @@ func (c *aPIClient) GetSardineClientToken(ctx context.Context) (string, error) { Ret0 string `json:"token"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[35], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[37], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1756,7 +2174,7 @@ func (c *aPIClient) GetSardineNFTCheckoutToken(ctx context.Context, params *Sard Ret0 *SardineNFTCheckout `json:"resp"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[36], 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 { @@ -1775,7 +2193,7 @@ func (c *aPIClient) GetSardineNFTCheckoutOrderStatus(ctx context.Context, orderI Ret0 *SardineOrder `json:"resp"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[37], 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 { @@ -1794,7 +2212,7 @@ func (c *aPIClient) GetCoinPrices(ctx context.Context, tokens []*Token) ([]*Toke Ret0 []*TokenPrice `json:"tokenPrices"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[38], 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 { @@ -1813,7 +2231,7 @@ func (c *aPIClient) GetCollectiblePrices(ctx context.Context, tokens []*Token) ( Ret0 []*TokenPrice `json:"tokenPrices"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[39], 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 { @@ -1832,7 +2250,7 @@ func (c *aPIClient) GetExchangeRate(ctx context.Context, toCurrency string) (*Ex Ret0 *ExchangeRate `json:"exchangeRate"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[40], 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 { @@ -1852,7 +2270,7 @@ func (c *aPIClient) MemoryStore(ctx context.Context, key string, value string) ( Ret0 bool `json:"ok"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[41], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[43], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1871,7 +2289,7 @@ func (c *aPIClient) MemoryLoad(ctx context.Context, key string) (string, error) Ret0 string `json:"value"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[42], 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 { @@ -1887,7 +2305,7 @@ func (c *aPIClient) GetInviteInfo(ctx context.Context) (*InviteInfo, error) { Ret0 *InviteInfo `json:"inviteInfo"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[43], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[45], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1906,7 +2324,7 @@ func (c *aPIClient) IsValidAccessCode(ctx context.Context, accessCode string) (b Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[44], 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 { @@ -1926,7 +2344,7 @@ func (c *aPIClient) InternalClaimAccessCode(ctx context.Context, address string, Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[45], 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 { @@ -1946,7 +2364,7 @@ func (c *aPIClient) BlockNumberAtTime(ctx context.Context, chainId uint64, times Ret0 []uint64 `json:"blocks"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[46], 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 { @@ -1968,7 +2386,7 @@ func (c *aPIClient) PaperSessionSecret(ctx context.Context, chainName string, co Ret0 string `json:"secret"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[47], 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 { @@ -1990,7 +2408,7 @@ func (c *aPIClient) PaperSessionSecret2(ctx context.Context, chainName string, c Ret0 string `json:"secret"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[48], 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 { @@ -2016,7 +2434,7 @@ func (c *aPIClient) LinkWallet(ctx context.Context, parentWalletAddress string, Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[49], 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 { @@ -2038,7 +2456,7 @@ func (c *aPIClient) GetLinkedWallets(ctx context.Context, parentWalletAddress st Ret0 []*LinkedWallet `json:"linkedWallets"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[50], 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 { @@ -2049,21 +2467,19 @@ func (c *aPIClient) GetLinkedWallets(ctx context.Context, parentWalletAddress st return out.Ret0, err } -func (c *aPIClient) RemoveLinkedWallet(ctx context.Context, parentWalletAddress string, parentWalletMessage string, parentWalletSignature string, linkedWalletAddress string, linkedWalletMessage string, linkedWalletSignature string, signatureChainId string) (bool, error) { +func (c *aPIClient) RemoveLinkedWallet(ctx context.Context, parentWalletAddress string, parentWalletMessage string, parentWalletSignature string, linkedWalletAddress string, signatureChainId string) (bool, error) { in := struct { Arg0 string `json:"parentWalletAddress"` Arg1 string `json:"parentWalletMessage"` Arg2 string `json:"parentWalletSignature"` Arg3 string `json:"linkedWalletAddress"` - Arg4 string `json:"linkedWalletMessage"` - Arg5 string `json:"linkedWalletSignature"` - Arg6 string `json:"signatureChainId"` - }{parentWalletAddress, parentWalletMessage, parentWalletSignature, linkedWalletAddress, linkedWalletMessage, linkedWalletSignature, signatureChainId} + Arg4 string `json:"signatureChainId"` + }{parentWalletAddress, parentWalletMessage, parentWalletSignature, linkedWalletAddress, signatureChainId} out := struct { Ret0 bool `json:"status"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[51], 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 { @@ -2083,7 +2499,7 @@ func (c *aPIClient) GenerateWaaSVerificationURL(ctx context.Context, walletAddre Ret1 string `json:"verificationURL"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[52], 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 { @@ -2105,7 +2521,7 @@ func (c *aPIClient) ValidateWaaSVerificationNonce(ctx context.Context, nonce str Ret0 string `json:"walletAddress"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[53], 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 { @@ -2116,18 +2532,62 @@ func (c *aPIClient) ValidateWaaSVerificationNonce(ctx context.Context, nonce str return out.Ret0, err } -func (c *aPIClient) GetSwapPrices(ctx context.Context, userAddress string, buyCurrencyAddress string, buyAmount string, chainId uint64) ([]*SwapPrice, error) { +func (c *aPIClient) ListAdoptedWallets(ctx context.Context, page *Page) (*Page, []*AdoptedChildWallet, error) { in := struct { - Arg0 string `json:"userAddress"` - Arg1 string `json:"buyCurrencyAddress"` - Arg2 string `json:"buyAmount"` - Arg3 uint64 `json:"chainId"` - }{userAddress, buyCurrencyAddress, buyAmount, chainId} + Arg0 *Page `json:"page"` + }{page} + out := struct { + Ret0 *Page `json:"page"` + Ret1 []*AdoptedChildWallet `json:"wallets"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[56], 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, out.Ret1, err +} + +func (c *aPIClient) GetSwapPrice(ctx context.Context, buyCurrencyAddress string, sellCurrencyAddress string, buyAmount string, chainId uint64, slippagePercentage *uint64) (*SwapPrice, error) { + in := struct { + Arg0 string `json:"buyCurrencyAddress"` + Arg1 string `json:"sellCurrencyAddress"` + Arg2 string `json:"buyAmount"` + Arg3 uint64 `json:"chainId"` + Arg4 *uint64 `json:"slippagePercentage"` + }{buyCurrencyAddress, sellCurrencyAddress, buyAmount, chainId, slippagePercentage} + out := struct { + Ret0 *SwapPrice `json:"swapPrice"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[57], 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) GetSwapPrices(ctx context.Context, userAddress string, buyCurrencyAddress string, buyAmount string, chainId uint64, slippagePercentage *uint64) ([]*SwapPrice, error) { + in := struct { + Arg0 string `json:"userAddress"` + Arg1 string `json:"buyCurrencyAddress"` + Arg2 string `json:"buyAmount"` + Arg3 uint64 `json:"chainId"` + Arg4 *uint64 `json:"slippagePercentage"` + }{userAddress, buyCurrencyAddress, buyAmount, chainId, slippagePercentage} out := struct { Ret0 []*SwapPrice `json:"swapPrices"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[54], 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 { @@ -2138,20 +2598,21 @@ func (c *aPIClient) GetSwapPrices(ctx context.Context, userAddress string, buyCu return out.Ret0, err } -func (c *aPIClient) GetSwapQuote(ctx context.Context, userAddress string, buyCurrencyAddress string, sellCurrencyAddress string, buyAmount string, chainId uint64, includeApprove bool) (*SwapQuote, error) { +func (c *aPIClient) GetSwapQuote(ctx context.Context, userAddress string, buyCurrencyAddress string, sellCurrencyAddress string, buyAmount string, chainId uint64, includeApprove bool, slippagePercentage *uint64) (*SwapQuote, error) { in := struct { - Arg0 string `json:"userAddress"` - Arg1 string `json:"buyCurrencyAddress"` - Arg2 string `json:"sellCurrencyAddress"` - Arg3 string `json:"buyAmount"` - Arg4 uint64 `json:"chainId"` - Arg5 bool `json:"includeApprove"` - }{userAddress, buyCurrencyAddress, sellCurrencyAddress, buyAmount, chainId, includeApprove} + Arg0 string `json:"userAddress"` + Arg1 string `json:"buyCurrencyAddress"` + Arg2 string `json:"sellCurrencyAddress"` + Arg3 string `json:"buyAmount"` + Arg4 uint64 `json:"chainId"` + Arg5 bool `json:"includeApprove"` + Arg6 *uint64 `json:"slippagePercentage"` + }{userAddress, buyCurrencyAddress, sellCurrencyAddress, buyAmount, chainId, includeApprove, slippagePercentage} out := struct { Ret0 *SwapQuote `json:"swapQuote"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[55], 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 { @@ -2167,7 +2628,7 @@ func (c *aPIClient) ListCurrencyGroups(ctx context.Context) ([]*CurrencyGroup, e Ret0 []*CurrencyGroup `json:"currencyGroups"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[56], nil, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[60], nil, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -2186,7 +2647,7 @@ func (c *aPIClient) AddOffchainInventory(ctx context.Context, inventory *Offchai Ret0 uint64 `json:"inventoryId"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[57], 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 { @@ -2205,7 +2666,7 @@ func (c *aPIClient) GetOffchainInventory(ctx context.Context, inventoryId uint64 Ret0 *OffchainInventory `json:"inventory"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[58], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[62], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -2224,7 +2685,7 @@ func (c *aPIClient) ListOffchainInventories(ctx context.Context, projectId uint6 Ret0 []*OffchainInventory `json:"inventory"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[59], 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 { @@ -2240,7 +2701,7 @@ func (c *aPIClient) UpdateOffchainInventory(ctx context.Context, inventory *Offc Arg0 *OffchainInventory `json:"inventory"` }{inventory} - resp, err := doHTTPRequest(ctx, c.client, c.urls[60], in, nil) + resp, err := doHTTPRequest(ctx, c.client, c.urls[64], in, nil) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -2259,7 +2720,7 @@ func (c *aPIClient) DeleteOffchainInventory(ctx context.Context, inventoryId uin Ret0 bool `json:"ok"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[61], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[65], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -2281,7 +2742,7 @@ func (c *aPIClient) RequestOffchainPayment(ctx context.Context, inventoryId uint Ret0 *PaymentResponse `json:"payment"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[62], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[66], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -2302,7 +2763,7 @@ func (c *aPIClient) ListOffchainPayments(ctx context.Context, inventoryId uint64 Ret1 []*OffchainPayment `json:"payments"` }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[63], in, &out) + resp, err := doHTTPRequest(ctx, c.client, c.urls[67], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -2434,6 +2895,12 @@ func HTTPRequestHeaders(ctx context.Context) (http.Header, bool) { // Helpers // +type method struct { + Name string + Service string + Annotations map[string]string +} + type contextKey struct { name string } @@ -2466,6 +2933,20 @@ func RequestFromContext(ctx context.Context) *http.Request { return r } +func MethodCtx(ctx context.Context) (method, bool) { + req := RequestFromContext(ctx) + if req == nil { + return method{}, false + } + + m, ok := methods[req.URL.Path] + if !ok { + return method{}, false + } + + return m, true +} + // // Errors //