@0xsequence/api 2.3.8 → 2.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/api.gen.ts CHANGED
@@ -1,75 +1,76 @@
1
1
  /* eslint-disable */
2
- // sequence-api v0.4.0 2409c101bc62a1b7aa797e099d913b1c4046e9f6
2
+ // sequence-api v0.4.0 fce15c8cb22b7e081fc97615dbf78baf9d718749
3
3
  // --
4
- // Code generated by webrpc-gen@v0.24.0 with typescript generator. DO NOT EDIT.
4
+ // Code generated by webrpc-gen@v0.25.3 with typescript generator. DO NOT EDIT.
5
5
  //
6
6
  // webrpc-gen -schema=api.ridl -target=typescript -client -out=./clients/api.gen.ts
7
7
 
8
- export const WebrpcHeader = 'Webrpc'
8
+ export const WebrpcHeader = "Webrpc"
9
9
 
10
- export const WebrpcHeaderValue = 'webrpc@v0.24.0;gen-typescript@v0.16.3;sequence-api@v0.4.0'
10
+ export const WebrpcHeaderValue = "webrpc@v0.25.3;gen-typescript@v0.17.0;sequence-api@v0.4.0"
11
11
 
12
12
  // WebRPC description and code-gen version
13
- export const WebRPCVersion = 'v1'
13
+ export const WebRPCVersion = "v1"
14
14
 
15
15
  // Schema version of your RIDL schema
16
- export const WebRPCSchemaVersion = 'v0.4.0'
16
+ export const WebRPCSchemaVersion = "v0.4.0"
17
17
 
18
18
  // Schema hash generated from your RIDL schema
19
- export const WebRPCSchemaHash = '2409c101bc62a1b7aa797e099d913b1c4046e9f6'
19
+ export const WebRPCSchemaHash = "fce15c8cb22b7e081fc97615dbf78baf9d718749"
20
20
 
21
21
  type WebrpcGenVersions = {
22
- webrpcGenVersion: string
23
- codeGenName: string
24
- codeGenVersion: string
25
- schemaName: string
26
- schemaVersion: string
27
- }
22
+ webrpcGenVersion: string;
23
+ codeGenName: string;
24
+ codeGenVersion: string;
25
+ schemaName: string;
26
+ schemaVersion: string;
27
+ };
28
28
 
29
29
  export function VersionFromHeader(headers: Headers): WebrpcGenVersions {
30
- const headerValue = headers.get(WebrpcHeader)
30
+ const headerValue = headers.get(WebrpcHeader);
31
31
  if (!headerValue) {
32
32
  return {
33
- webrpcGenVersion: '',
34
- codeGenName: '',
35
- codeGenVersion: '',
36
- schemaName: '',
37
- schemaVersion: ''
38
- }
33
+ webrpcGenVersion: "",
34
+ codeGenName: "",
35
+ codeGenVersion: "",
36
+ schemaName: "",
37
+ schemaVersion: "",
38
+ };
39
39
  }
40
40
 
41
- return parseWebrpcGenVersions(headerValue)
41
+ return parseWebrpcGenVersions(headerValue);
42
42
  }
43
43
 
44
44
  function parseWebrpcGenVersions(header: string): WebrpcGenVersions {
45
- const versions = header.split(';')
45
+ const versions = header.split(";");
46
46
  if (versions.length < 3) {
47
47
  return {
48
- webrpcGenVersion: '',
49
- codeGenName: '',
50
- codeGenVersion: '',
51
- schemaName: '',
52
- schemaVersion: ''
53
- }
48
+ webrpcGenVersion: "",
49
+ codeGenName: "",
50
+ codeGenVersion: "",
51
+ schemaName: "",
52
+ schemaVersion: "",
53
+ };
54
54
  }
55
55
 
56
- const [_, webrpcGenVersion] = versions[0]!.split('@')
57
- const [codeGenName, codeGenVersion] = versions[1]!.split('@')
58
- const [schemaName, schemaVersion] = versions[2]!.split('@')
56
+ const [_, webrpcGenVersion] = versions[0]!.split("@");
57
+ const [codeGenName, codeGenVersion] = versions[1]!.split("@");
58
+ const [schemaName, schemaVersion] = versions[2]!.split("@");
59
59
 
60
60
  return {
61
- webrpcGenVersion: webrpcGenVersion ?? '',
62
- codeGenName: codeGenName ?? '',
63
- codeGenVersion: codeGenVersion ?? '',
64
- schemaName: schemaName ?? '',
65
- schemaVersion: schemaVersion ?? ''
66
- }
61
+ webrpcGenVersion: webrpcGenVersion ?? "",
62
+ codeGenName: codeGenName ?? "",
63
+ codeGenVersion: codeGenVersion ?? "",
64
+ schemaName: schemaName ?? "",
65
+ schemaVersion: schemaVersion ?? "",
66
+ };
67
67
  }
68
68
 
69
69
  //
70
70
  // Types
71
71
  //
72
72
 
73
+
73
74
  export enum SortOrder {
74
75
  DESC = 'DESC',
75
76
  ASC = 'ASC'
@@ -116,7 +117,7 @@ export interface RuntimeStatus {
116
117
  branch: string
117
118
  commitHash: string
118
119
  checks: RuntimeChecks
119
- numTxnsRelayed: { [key: string]: NumTxnsRelayed }
120
+ numTxnsRelayed: {[key: string]: NumTxnsRelayed}
120
121
  }
121
122
 
122
123
  export interface NumTxnsRelayed {
@@ -126,7 +127,8 @@ export interface NumTxnsRelayed {
126
127
  period: number
127
128
  }
128
129
 
129
- export interface RuntimeChecks {}
130
+ export interface RuntimeChecks {
131
+ }
130
132
 
131
133
  export interface SequenceContext {
132
134
  factory: string
@@ -443,34 +445,36 @@ export interface SardinePaymentOption {
443
445
  processingTime: string
444
446
  }
445
447
 
446
- export interface SwapPermit2Price {
447
- currencyAddress: string
448
- currencyBalance: string
449
- price: string
450
- maxPrice: string
451
- transactionValue: string
448
+ export interface LifiToken {
449
+ chainId: number
450
+ address: string
451
+ symbol: string
452
+ name: string
453
+ decimals: number
454
+ priceUsd: string
455
+ coinKey: string
456
+ logoUri: string
452
457
  }
453
458
 
454
- export interface SwapPermit2Quote {
455
- currencyAddress: string
456
- currencyBalance: string
457
- price: string
458
- maxPrice: string
459
- to: string
460
- transactionData: string
461
- transactionValue: string
462
- approveData: string
459
+ export interface LifiSwapRoute {
460
+ fromChainId: number
461
+ toChainId: number
462
+ fromTokens: Array<LifiToken>
463
+ toTokens: Array<LifiToken>
463
464
  }
464
465
 
465
- export interface SwapPrice {
466
- currencyAddress: string
467
- currencyBalance: string
468
- price: string
469
- maxPrice: string
470
- transactionValue: string
466
+ export interface GetLifiSwapQuoteParams {
467
+ chainId: number
468
+ walletAddress: string
469
+ fromTokenAddress: string
470
+ toTokenAddress: string
471
+ fromTokenAmount: string
472
+ toTokenAmount: string
473
+ includeApprove: boolean
474
+ slippageBps: number
471
475
  }
472
476
 
473
- export interface SwapQuote {
477
+ export interface LifiSwapQuote {
474
478
  currencyAddress: string
475
479
  currencyBalance: string
476
480
  price: string
@@ -479,6 +483,8 @@ export interface SwapQuote {
479
483
  transactionData: string
480
484
  transactionValue: string
481
485
  approveData: string
486
+ amount: string
487
+ amountMin: string
482
488
  }
483
489
 
484
490
  export interface CurrencyGroup {
@@ -703,206 +709,225 @@ export interface TransakChain {
703
709
  }
704
710
 
705
711
  export interface API {
712
+ /**
713
+ *
714
+ * Runtime
715
+ *
716
+ */
706
717
  ping(headers?: object, signal?: AbortSignal): Promise<PingReturn>
707
718
  version(headers?: object, signal?: AbortSignal): Promise<VersionReturn>
708
719
  runtimeStatus(headers?: object, signal?: AbortSignal): Promise<RuntimeStatusReturn>
709
720
  clock(headers?: object, signal?: AbortSignal): Promise<ClockReturn>
710
721
  getSequenceContext(headers?: object, signal?: AbortSignal): Promise<GetSequenceContextReturn>
722
+ /**
723
+ *
724
+ * Auth
725
+ *
726
+ * TODO: rename 'ewtString' arg to 'ethauthProof'
727
+ */
711
728
  getAuthToken(args: GetAuthTokenArgs, headers?: object, signal?: AbortSignal): Promise<GetAuthTokenReturn>
712
729
  getAuthToken2(args: GetAuthToken2Args, headers?: object, signal?: AbortSignal): Promise<GetAuthToken2Return>
713
- sendPasswordlessLink(
714
- args: SendPasswordlessLinkArgs,
715
- headers?: object,
716
- signal?: AbortSignal
717
- ): Promise<SendPasswordlessLinkReturn>
730
+ sendPasswordlessLink(args: SendPasswordlessLinkArgs, headers?: object, signal?: AbortSignal): Promise<SendPasswordlessLinkReturn>
718
731
  registerPublicKey(args: RegisterPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise<RegisterPublicKeyReturn>
719
732
  getPublicKey(args: GetPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise<GetPublicKeyReturn>
733
+ /**
734
+ *
735
+ * Contacts / Friends
736
+ *
737
+ */
720
738
  friendList(args: FriendListArgs, headers?: object, signal?: AbortSignal): Promise<FriendListReturn>
721
739
  getFriendByAddress(args: GetFriendByAddressArgs, headers?: object, signal?: AbortSignal): Promise<GetFriendByAddressReturn>
722
740
  searchFriends(args: SearchFriendsArgs, headers?: object, signal?: AbortSignal): Promise<SearchFriendsReturn>
723
741
  addFriend(args: AddFriendArgs, headers?: object, signal?: AbortSignal): Promise<AddFriendReturn>
724
- updateFriendNickname(
725
- args: UpdateFriendNicknameArgs,
726
- headers?: object,
727
- signal?: AbortSignal
728
- ): Promise<UpdateFriendNicknameReturn>
742
+ updateFriendNickname(args: UpdateFriendNicknameArgs, headers?: object, signal?: AbortSignal): Promise<UpdateFriendNicknameReturn>
729
743
  removeFriend(args: RemoveFriendArgs, headers?: object, signal?: AbortSignal): Promise<RemoveFriendReturn>
744
+ /**
745
+ *
746
+ * Chain-Utils
747
+ *
748
+ */
730
749
  contractCall(args: ContractCallArgs, headers?: object, signal?: AbortSignal): Promise<ContractCallReturn>
731
750
  decodeContractCall(args: DecodeContractCallArgs, headers?: object, signal?: AbortSignal): Promise<DecodeContractCallReturn>
732
- lookupContractCallSelectors(
733
- args: LookupContractCallSelectorsArgs,
734
- headers?: object,
735
- signal?: AbortSignal
736
- ): Promise<LookupContractCallSelectorsReturn>
751
+ lookupContractCallSelectors(args: LookupContractCallSelectorsArgs, headers?: object, signal?: AbortSignal): Promise<LookupContractCallSelectorsReturn>
752
+ /**
753
+ *
754
+ * User Storage
755
+ *
756
+ */
737
757
  userStorageFetch(args: UserStorageFetchArgs, headers?: object, signal?: AbortSignal): Promise<UserStorageFetchReturn>
738
758
  userStorageSave(args: UserStorageSaveArgs, headers?: object, signal?: AbortSignal): Promise<UserStorageSaveReturn>
739
759
  userStorageDelete(args: UserStorageDeleteArgs, headers?: object, signal?: AbortSignal): Promise<UserStorageDeleteReturn>
740
760
  userStorageFetchAll(args: UserStorageFetchAllArgs, headers?: object, signal?: AbortSignal): Promise<UserStorageFetchAllReturn>
761
+ /**
762
+ *
763
+ * Wallet utils
764
+ *
765
+ */
741
766
  getMoonpayLink(args: GetMoonpayLinkArgs, headers?: object, signal?: AbortSignal): Promise<GetMoonpayLinkReturn>
767
+ /**
768
+ * - IsUsingGoogleMail(domain: string) => (yes: bool)
769
+ */
742
770
  resolveENSAddress(args: ResolveENSAddressArgs, headers?: object, signal?: AbortSignal): Promise<ResolveENSAddressReturn>
771
+ /**
772
+ * TODO: we can add walletContext optional in the future when we need it
773
+ * NOTE: chainId can be either a number or canonical name
774
+ */
743
775
  isValidSignature(args: IsValidSignatureArgs, headers?: object, signal?: AbortSignal): Promise<IsValidSignatureReturn>
744
- isValidMessageSignature(
745
- args: IsValidMessageSignatureArgs,
746
- headers?: object,
747
- signal?: AbortSignal
748
- ): Promise<IsValidMessageSignatureReturn>
749
- isValidTypedDataSignature(
750
- args: IsValidTypedDataSignatureArgs,
751
- headers?: object,
752
- signal?: AbortSignal
753
- ): Promise<IsValidTypedDataSignatureReturn>
776
+ isValidMessageSignature(args: IsValidMessageSignatureArgs, headers?: object, signal?: AbortSignal): Promise<IsValidMessageSignatureReturn>
777
+ isValidTypedDataSignature(args: IsValidTypedDataSignatureArgs, headers?: object, signal?: AbortSignal): Promise<IsValidTypedDataSignatureReturn>
754
778
  isValidETHAuthProof(args: IsValidETHAuthProofArgs, headers?: object, signal?: AbortSignal): Promise<IsValidETHAuthProofReturn>
755
779
  sardineGetClientToken(headers?: object, signal?: AbortSignal): Promise<SardineGetClientTokenReturn>
756
- sardineGetNFTCheckoutToken(
757
- args: SardineGetNFTCheckoutTokenArgs,
758
- headers?: object,
759
- signal?: AbortSignal
760
- ): Promise<SardineGetNFTCheckoutTokenReturn>
761
- sardineGetNFTCheckoutOrderStatus(
762
- args: SardineGetNFTCheckoutOrderStatusArgs,
763
- headers?: object,
764
- signal?: AbortSignal
765
- ): Promise<SardineGetNFTCheckoutOrderStatusReturn>
780
+ sardineGetNFTCheckoutToken(args: SardineGetNFTCheckoutTokenArgs, headers?: object, signal?: AbortSignal): Promise<SardineGetNFTCheckoutTokenReturn>
781
+ sardineGetNFTCheckoutOrderStatus(args: SardineGetNFTCheckoutOrderStatusArgs, headers?: object, signal?: AbortSignal): Promise<SardineGetNFTCheckoutOrderStatusReturn>
766
782
  sardineGetSupportedRegions(headers?: object, signal?: AbortSignal): Promise<SardineGetSupportedRegionsReturn>
767
783
  sardineGetSupportedFiatCurrencies(headers?: object, signal?: AbortSignal): Promise<SardineGetSupportedFiatCurrenciesReturn>
768
784
  sardineGetSupportedTokens(headers?: object, signal?: AbortSignal): Promise<SardineGetSupportedTokensReturn>
769
- sardineGetSupportedTokenForSwap(
770
- args: SardineGetSupportedTokenForSwapArgs,
771
- headers?: object,
772
- signal?: AbortSignal
773
- ): Promise<SardineGetSupportedTokenForSwapReturn>
785
+ sardineGetSupportedTokenForSwap(args: SardineGetSupportedTokenForSwapArgs, headers?: object, signal?: AbortSignal): Promise<SardineGetSupportedTokenForSwapReturn>
774
786
  sardineGetEnabledTokens(headers?: object, signal?: AbortSignal): Promise<SardineGetEnabledTokensReturn>
775
787
  sardineGetQuote(args: SardineGetQuoteArgs, headers?: object, signal?: AbortSignal): Promise<SardineGetQuoteReturn>
788
+ /**
789
+ * Deprecated. Use SardineGetClientToken() instead.
790
+ */
776
791
  getSardineClientToken(headers?: object, signal?: AbortSignal): Promise<GetSardineClientTokenReturn>
777
- getSardineNFTCheckoutToken(
778
- args: GetSardineNFTCheckoutTokenArgs,
779
- headers?: object,
780
- signal?: AbortSignal
781
- ): Promise<GetSardineNFTCheckoutTokenReturn>
782
- getSardineNFTCheckoutOrderStatus(
783
- args: GetSardineNFTCheckoutOrderStatusArgs,
784
- headers?: object,
785
- signal?: AbortSignal
786
- ): Promise<GetSardineNFTCheckoutOrderStatusReturn>
792
+ /**
793
+ * Deprecated. Use SardineGetNFTCheckoutToken() instead.
794
+ */
795
+ getSardineNFTCheckoutToken(args: GetSardineNFTCheckoutTokenArgs, headers?: object, signal?: AbortSignal): Promise<GetSardineNFTCheckoutTokenReturn>
796
+ /**
797
+ * Deprecated. Use SardineGetNFTCheckoutOrderStatus() instead.
798
+ */
799
+ getSardineNFTCheckoutOrderStatus(args: GetSardineNFTCheckoutOrderStatusArgs, headers?: object, signal?: AbortSignal): Promise<GetSardineNFTCheckoutOrderStatusReturn>
787
800
  transakGetCountries(headers?: object, signal?: AbortSignal): Promise<TransakGetCountriesReturn>
788
801
  transakGetCryptoCurrencies(headers?: object, signal?: AbortSignal): Promise<TransakGetCryptoCurrenciesReturn>
789
802
  transakGetFiatCurrencies(headers?: object, signal?: AbortSignal): Promise<TransakGetFiatCurrenciesReturn>
790
803
  transakGetPrice(args: TransakGetPriceArgs, headers?: object, signal?: AbortSignal): Promise<TransakGetPriceReturn>
791
- transakGetSupportedNFTCheckoutChains(
792
- headers?: object,
793
- signal?: AbortSignal
794
- ): Promise<TransakGetSupportedNFTCheckoutChainsReturn>
804
+ transakGetSupportedNFTCheckoutChains(headers?: object, signal?: AbortSignal): Promise<TransakGetSupportedNFTCheckoutChainsReturn>
805
+ /**
806
+ *
807
+ * Price Feed
808
+ *
809
+ */
795
810
  getCoinPrices(args: GetCoinPricesArgs, headers?: object, signal?: AbortSignal): Promise<GetCoinPricesReturn>
796
- getCollectiblePrices(
797
- args: GetCollectiblePricesArgs,
798
- headers?: object,
799
- signal?: AbortSignal
800
- ): Promise<GetCollectiblePricesReturn>
811
+ getCollectiblePrices(args: GetCollectiblePricesArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectiblePricesReturn>
812
+ /**
813
+ *
814
+ * Price Feed utils
815
+ *
816
+ */
801
817
  getExchangeRate(args: GetExchangeRateArgs, headers?: object, signal?: AbortSignal): Promise<GetExchangeRateReturn>
818
+ /**
819
+ *
820
+ * Util / misc
821
+ *
822
+ */
802
823
  memoryStore(args: MemoryStoreArgs, headers?: object, signal?: AbortSignal): Promise<MemoryStoreReturn>
803
824
  memoryLoad(args: MemoryLoadArgs, headers?: object, signal?: AbortSignal): Promise<MemoryLoadReturn>
825
+ /**
826
+ *
827
+ * Legacy
828
+ *
829
+ */
804
830
  getInviteInfo(headers?: object, signal?: AbortSignal): Promise<GetInviteInfoReturn>
831
+ /**
832
+ * NOTE: we're still using this from SW-API to Sequence-API to claim invite code
833
+ */
805
834
  isValidAccessCode(args: IsValidAccessCodeArgs, headers?: object, signal?: AbortSignal): Promise<IsValidAccessCodeReturn>
806
- internalClaimAccessCode(
807
- args: InternalClaimAccessCodeArgs,
808
- headers?: object,
809
- signal?: AbortSignal
810
- ): Promise<InternalClaimAccessCodeReturn>
835
+ internalClaimAccessCode(args: InternalClaimAccessCodeArgs, headers?: object, signal?: AbortSignal): Promise<InternalClaimAccessCodeReturn>
836
+ /**
837
+ * Utils
838
+ */
811
839
  blockNumberAtTime(args: BlockNumberAtTimeArgs, headers?: object, signal?: AbortSignal): Promise<BlockNumberAtTimeReturn>
840
+ /**
841
+ *
842
+ * Paper
843
+ * TODO: deprecate in the future
844
+ *
845
+ */
812
846
  paperSessionSecret(args: PaperSessionSecretArgs, headers?: object, signal?: AbortSignal): Promise<PaperSessionSecretReturn>
813
847
  paperSessionSecret2(args: PaperSessionSecret2Args, headers?: object, signal?: AbortSignal): Promise<PaperSessionSecret2Return>
848
+ /**
849
+ *
850
+ * Linked wallets (v0 -- simple support)
851
+ *
852
+ */
814
853
  linkWallet(args: LinkWalletArgs, headers?: object, signal?: AbortSignal): Promise<LinkWalletReturn>
815
854
  getLinkedWallets(args: GetLinkedWalletsArgs, headers?: object, signal?: AbortSignal): Promise<GetLinkedWalletsReturn>
816
855
  removeLinkedWallet(args: RemoveLinkedWalletArgs, headers?: object, signal?: AbortSignal): Promise<RemoveLinkedWalletReturn>
817
- generateWaaSVerificationURL(
818
- args: GenerateWaaSVerificationURLArgs,
819
- headers?: object,
820
- signal?: AbortSignal
821
- ): Promise<GenerateWaaSVerificationURLReturn>
822
- validateWaaSVerificationNonce(
823
- args: ValidateWaaSVerificationNonceArgs,
824
- headers?: object,
825
- signal?: AbortSignal
826
- ): Promise<ValidateWaaSVerificationNonceReturn>
856
+ /**
857
+ * NOTE: these methods are deprecated, please do not use them. We may resurface them in the future, but just wanted
858
+ * to be clear, they are not necessary for our linked wallets.
859
+ */
860
+ generateWaaSVerificationURL(args: GenerateWaaSVerificationURLArgs, headers?: object, signal?: AbortSignal): Promise<GenerateWaaSVerificationURLReturn>
861
+ validateWaaSVerificationNonce(args: ValidateWaaSVerificationNonceArgs, headers?: object, signal?: AbortSignal): Promise<ValidateWaaSVerificationNonceReturn>
862
+ /**
863
+ *
864
+ *
865
+ * WaaS child wallet adoption
866
+ *
867
+ */
827
868
  listAdoptedWallets(args: ListAdoptedWalletsArgs, headers?: object, signal?: AbortSignal): Promise<ListAdoptedWalletsReturn>
828
- getSwapPermit2Price(args: GetSwapPermit2PriceArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPermit2PriceReturn>
829
- getSwapPermit2Prices(
830
- args: GetSwapPermit2PricesArgs,
831
- headers?: object,
832
- signal?: AbortSignal
833
- ): Promise<GetSwapPermit2PricesReturn>
834
- getSwapPermit2Quote(args: GetSwapPermit2QuoteArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPermit2QuoteReturn>
835
- getSwapPrice(args: GetSwapPriceArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPriceReturn>
836
- getSwapPrices(args: GetSwapPricesArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPricesReturn>
837
- getSwapQuote(args: GetSwapQuoteArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapQuoteReturn>
838
- getSwapQuoteV2(args: GetSwapQuoteV2Args, headers?: object, signal?: AbortSignal): Promise<GetSwapQuoteV2Return>
839
- intentQuery(args: IntentQueryArgs, headers?: object, signal?: AbortSignal): Promise<IntentQueryReturn>
869
+ /**
870
+ *
871
+ * Currency abstraction
872
+ *
873
+ */
874
+ getLifiChains(headers?: object, signal?: AbortSignal): Promise<GetLifiChainsReturn>
875
+ getLifiTokens(args: GetLifiTokensArgs, headers?: object, signal?: AbortSignal): Promise<GetLifiTokensReturn>
876
+ getLifiSwapRoutes(args: GetLifiSwapRoutesArgs, headers?: object, signal?: AbortSignal): Promise<GetLifiSwapRoutesReturn>
877
+ getLifiSwapQuote(args: GetLifiSwapQuoteArgs, headers?: object, signal?: AbortSignal): Promise<GetLifiSwapQuoteReturn>
878
+ /**
879
+ *
880
+ * Inventory, payments and management
881
+ *
882
+ */
840
883
  listCurrencyGroups(headers?: object, signal?: AbortSignal): Promise<ListCurrencyGroupsReturn>
841
- addOffchainInventory(
842
- args: AddOffchainInventoryArgs,
843
- headers?: object,
844
- signal?: AbortSignal
845
- ): Promise<AddOffchainInventoryReturn>
846
- getOffchainInventory(
847
- args: GetOffchainInventoryArgs,
848
- headers?: object,
849
- signal?: AbortSignal
850
- ): Promise<GetOffchainInventoryReturn>
851
- listOffchainInventories(
852
- args: ListOffchainInventoriesArgs,
853
- headers?: object,
854
- signal?: AbortSignal
855
- ): Promise<ListOffchainInventoriesReturn>
856
- updateOffchainInventory(
857
- args: UpdateOffchainInventoryArgs,
858
- headers?: object,
859
- signal?: AbortSignal
860
- ): Promise<UpdateOffchainInventoryReturn>
861
- deleteOffchainInventory(
862
- args: DeleteOffchainInventoryArgs,
863
- headers?: object,
864
- signal?: AbortSignal
865
- ): Promise<DeleteOffchainInventoryReturn>
866
- requestOffchainPayment(
867
- args: RequestOffchainPaymentArgs,
868
- headers?: object,
869
- signal?: AbortSignal
870
- ): Promise<RequestOffchainPaymentReturn>
871
- listOffchainPayments(
872
- args: ListOffchainPaymentsArgs,
873
- headers?: object,
874
- signal?: AbortSignal
875
- ): Promise<ListOffchainPaymentsReturn>
884
+ addOffchainInventory(args: AddOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise<AddOffchainInventoryReturn>
885
+ getOffchainInventory(args: GetOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise<GetOffchainInventoryReturn>
886
+ listOffchainInventories(args: ListOffchainInventoriesArgs, headers?: object, signal?: AbortSignal): Promise<ListOffchainInventoriesReturn>
887
+ updateOffchainInventory(args: UpdateOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise<UpdateOffchainInventoryReturn>
888
+ deleteOffchainInventory(args: DeleteOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise<DeleteOffchainInventoryReturn>
889
+ requestOffchainPayment(args: RequestOffchainPaymentArgs, headers?: object, signal?: AbortSignal): Promise<RequestOffchainPaymentReturn>
890
+ listOffchainPayments(args: ListOffchainPaymentsArgs, headers?: object, signal?: AbortSignal): Promise<ListOffchainPaymentsReturn>
891
+ /**
892
+ *
893
+ * Packs
894
+ *
895
+ */
876
896
  savePack(args: SavePackArgs, headers?: object, signal?: AbortSignal): Promise<SavePackReturn>
877
897
  getPack(args: GetPackArgs, headers?: object, signal?: AbortSignal): Promise<GetPackReturn>
878
898
  deletePack(args: DeletePackArgs, headers?: object, signal?: AbortSignal): Promise<DeletePackReturn>
879
899
  updatePackContent(args: UpdatePackContentArgs, headers?: object, signal?: AbortSignal): Promise<UpdatePackContentReturn>
880
900
  }
881
901
 
882
- export interface PingArgs {}
902
+ export interface PingArgs {
903
+ }
883
904
 
884
905
  export interface PingReturn {
885
- status: boolean
906
+ status: boolean
907
+ }
908
+ export interface VersionArgs {
886
909
  }
887
- export interface VersionArgs {}
888
910
 
889
911
  export interface VersionReturn {
890
- version: Version
912
+ version: Version
913
+ }
914
+ export interface RuntimeStatusArgs {
891
915
  }
892
- export interface RuntimeStatusArgs {}
893
916
 
894
917
  export interface RuntimeStatusReturn {
895
- status: RuntimeStatus
918
+ status: RuntimeStatus
919
+ }
920
+ export interface ClockArgs {
896
921
  }
897
- export interface ClockArgs {}
898
922
 
899
923
  export interface ClockReturn {
900
- serverTime: string
924
+ serverTime: string
925
+ }
926
+ export interface GetSequenceContextArgs {
901
927
  }
902
- export interface GetSequenceContextArgs {}
903
928
 
904
929
  export interface GetSequenceContextReturn {
905
- data: SequenceContext
930
+ data: SequenceContext
906
931
  }
907
932
  export interface GetAuthTokenArgs {
908
933
  ewtString: string
@@ -913,7 +938,7 @@ export interface GetAuthTokenReturn {
913
938
  status: boolean
914
939
  jwtToken: string
915
940
  address: string
916
- user?: User
941
+ user?: User
917
942
  }
918
943
  export interface GetAuthToken2Args {
919
944
  ewtString: string
@@ -924,7 +949,7 @@ export interface GetAuthToken2Return {
924
949
  status: boolean
925
950
  jwtToken: string
926
951
  address: string
927
- user?: User
952
+ user?: User
928
953
  }
929
954
  export interface SendPasswordlessLinkArgs {
930
955
  email: string
@@ -933,21 +958,21 @@ export interface SendPasswordlessLinkArgs {
933
958
  }
934
959
 
935
960
  export interface SendPasswordlessLinkReturn {
936
- status: boolean
961
+ status: boolean
937
962
  }
938
963
  export interface RegisterPublicKeyArgs {
939
964
  publicKey: PublicKey
940
965
  }
941
966
 
942
967
  export interface RegisterPublicKeyReturn {
943
- status: boolean
968
+ status: boolean
944
969
  }
945
970
  export interface GetPublicKeyArgs {
946
971
  id: string
947
972
  }
948
973
 
949
974
  export interface GetPublicKeyReturn {
950
- publicKey: PublicKey
975
+ publicKey: PublicKey
951
976
  }
952
977
  export interface FriendListArgs {
953
978
  nickname?: string
@@ -956,7 +981,7 @@ export interface FriendListArgs {
956
981
 
957
982
  export interface FriendListReturn {
958
983
  page: Page
959
- friends: Array<Friend>
984
+ friends: Array<Friend>
960
985
  }
961
986
  export interface GetFriendByAddressArgs {
962
987
  friendAddress: string
@@ -964,7 +989,7 @@ export interface GetFriendByAddressArgs {
964
989
 
965
990
  export interface GetFriendByAddressReturn {
966
991
  status: boolean
967
- friend: Friend
992
+ friend: Friend
968
993
  }
969
994
  export interface SearchFriendsArgs {
970
995
  filterUsername: string
@@ -972,7 +997,7 @@ export interface SearchFriendsArgs {
972
997
  }
973
998
 
974
999
  export interface SearchFriendsReturn {
975
- friends: Array<Friend>
1000
+ friends: Array<Friend>
976
1001
  }
977
1002
  export interface AddFriendArgs {
978
1003
  friendAddress: string
@@ -981,7 +1006,7 @@ export interface AddFriendArgs {
981
1006
 
982
1007
  export interface AddFriendReturn {
983
1008
  status: boolean
984
- friend?: Friend
1009
+ friend?: Friend
985
1010
  }
986
1011
  export interface UpdateFriendNicknameArgs {
987
1012
  friendAddress: string
@@ -990,14 +1015,14 @@ export interface UpdateFriendNicknameArgs {
990
1015
 
991
1016
  export interface UpdateFriendNicknameReturn {
992
1017
  status: boolean
993
- friend?: Friend
1018
+ friend?: Friend
994
1019
  }
995
1020
  export interface RemoveFriendArgs {
996
1021
  friendAddress: string
997
1022
  }
998
1023
 
999
1024
  export interface RemoveFriendReturn {
1000
- status: boolean
1025
+ status: boolean
1001
1026
  }
1002
1027
  export interface ContractCallArgs {
1003
1028
  chainID: string
@@ -1008,28 +1033,28 @@ export interface ContractCallArgs {
1008
1033
  }
1009
1034
 
1010
1035
  export interface ContractCallReturn {
1011
- returns: Array<string>
1036
+ returns: Array<string>
1012
1037
  }
1013
1038
  export interface DecodeContractCallArgs {
1014
1039
  callData: string
1015
1040
  }
1016
1041
 
1017
1042
  export interface DecodeContractCallReturn {
1018
- call: ContractCall
1043
+ call: ContractCall
1019
1044
  }
1020
1045
  export interface LookupContractCallSelectorsArgs {
1021
1046
  selectors: Array<string>
1022
1047
  }
1023
1048
 
1024
1049
  export interface LookupContractCallSelectorsReturn {
1025
- signatures: Array<Array<string>>
1050
+ signatures: Array<Array<string>>
1026
1051
  }
1027
1052
  export interface UserStorageFetchArgs {
1028
1053
  key: string
1029
1054
  }
1030
1055
 
1031
1056
  export interface UserStorageFetchReturn {
1032
- object: any
1057
+ object: any
1033
1058
  }
1034
1059
  export interface UserStorageSaveArgs {
1035
1060
  key: string
@@ -1037,28 +1062,28 @@ export interface UserStorageSaveArgs {
1037
1062
  }
1038
1063
 
1039
1064
  export interface UserStorageSaveReturn {
1040
- ok: boolean
1065
+ ok: boolean
1041
1066
  }
1042
1067
  export interface UserStorageDeleteArgs {
1043
1068
  key: string
1044
1069
  }
1045
1070
 
1046
1071
  export interface UserStorageDeleteReturn {
1047
- ok: boolean
1072
+ ok: boolean
1048
1073
  }
1049
1074
  export interface UserStorageFetchAllArgs {
1050
1075
  keys?: Array<string>
1051
1076
  }
1052
1077
 
1053
1078
  export interface UserStorageFetchAllReturn {
1054
- objects: { [key: string]: any }
1079
+ objects: {[key: string]: any}
1055
1080
  }
1056
1081
  export interface GetMoonpayLinkArgs {
1057
1082
  url: string
1058
1083
  }
1059
1084
 
1060
1085
  export interface GetMoonpayLinkReturn {
1061
- signedUrl: string
1086
+ signedUrl: string
1062
1087
  }
1063
1088
  export interface ResolveENSAddressArgs {
1064
1089
  ens: string
@@ -1066,7 +1091,7 @@ export interface ResolveENSAddressArgs {
1066
1091
 
1067
1092
  export interface ResolveENSAddressReturn {
1068
1093
  address: string
1069
- ok: boolean
1094
+ ok: boolean
1070
1095
  }
1071
1096
  export interface IsValidSignatureArgs {
1072
1097
  chainId: string
@@ -1076,7 +1101,7 @@ export interface IsValidSignatureArgs {
1076
1101
  }
1077
1102
 
1078
1103
  export interface IsValidSignatureReturn {
1079
- isValid: boolean
1104
+ isValid: boolean
1080
1105
  }
1081
1106
  export interface IsValidMessageSignatureArgs {
1082
1107
  chainId: string
@@ -1086,7 +1111,7 @@ export interface IsValidMessageSignatureArgs {
1086
1111
  }
1087
1112
 
1088
1113
  export interface IsValidMessageSignatureReturn {
1089
- isValid: boolean
1114
+ isValid: boolean
1090
1115
  }
1091
1116
  export interface IsValidTypedDataSignatureArgs {
1092
1117
  chainId: string
@@ -1096,7 +1121,7 @@ export interface IsValidTypedDataSignatureArgs {
1096
1121
  }
1097
1122
 
1098
1123
  export interface IsValidTypedDataSignatureReturn {
1099
- isValid: boolean
1124
+ isValid: boolean
1100
1125
  }
1101
1126
  export interface IsValidETHAuthProofArgs {
1102
1127
  chainId: string
@@ -1105,41 +1130,45 @@ export interface IsValidETHAuthProofArgs {
1105
1130
  }
1106
1131
 
1107
1132
  export interface IsValidETHAuthProofReturn {
1108
- isValid: boolean
1133
+ isValid: boolean
1134
+ }
1135
+ export interface SardineGetClientTokenArgs {
1109
1136
  }
1110
- export interface SardineGetClientTokenArgs {}
1111
1137
 
1112
1138
  export interface SardineGetClientTokenReturn {
1113
- token: string
1139
+ token: string
1114
1140
  }
1115
1141
  export interface SardineGetNFTCheckoutTokenArgs {
1116
1142
  params: SardineNFTCheckoutParams
1117
1143
  }
1118
1144
 
1119
1145
  export interface SardineGetNFTCheckoutTokenReturn {
1120
- resp: SardineNFTCheckout
1146
+ resp: SardineNFTCheckout
1121
1147
  }
1122
1148
  export interface SardineGetNFTCheckoutOrderStatusArgs {
1123
1149
  orderId: string
1124
1150
  }
1125
1151
 
1126
1152
  export interface SardineGetNFTCheckoutOrderStatusReturn {
1127
- resp: SardineOrder
1153
+ resp: SardineOrder
1154
+ }
1155
+ export interface SardineGetSupportedRegionsArgs {
1128
1156
  }
1129
- export interface SardineGetSupportedRegionsArgs {}
1130
1157
 
1131
1158
  export interface SardineGetSupportedRegionsReturn {
1132
- regions: Array<SardineRegion>
1159
+ regions: Array<SardineRegion>
1160
+ }
1161
+ export interface SardineGetSupportedFiatCurrenciesArgs {
1133
1162
  }
1134
- export interface SardineGetSupportedFiatCurrenciesArgs {}
1135
1163
 
1136
1164
  export interface SardineGetSupportedFiatCurrenciesReturn {
1137
- tokens: Array<SardineFiatCurrency>
1165
+ tokens: Array<SardineFiatCurrency>
1166
+ }
1167
+ export interface SardineGetSupportedTokensArgs {
1138
1168
  }
1139
- export interface SardineGetSupportedTokensArgs {}
1140
1169
 
1141
1170
  export interface SardineGetSupportedTokensReturn {
1142
- tokens: Array<SardineSupportedToken>
1171
+ tokens: Array<SardineSupportedToken>
1143
1172
  }
1144
1173
  export interface SardineGetSupportedTokenForSwapArgs {
1145
1174
  network: string
@@ -1147,86 +1176,92 @@ export interface SardineGetSupportedTokenForSwapArgs {
1147
1176
  }
1148
1177
 
1149
1178
  export interface SardineGetSupportedTokenForSwapReturn {
1150
- token: SardineSupportedTokenForSwap
1179
+ token: SardineSupportedTokenForSwap
1180
+ }
1181
+ export interface SardineGetEnabledTokensArgs {
1151
1182
  }
1152
- export interface SardineGetEnabledTokensArgs {}
1153
1183
 
1154
1184
  export interface SardineGetEnabledTokensReturn {
1155
- tokens: Array<SardineEnabledToken>
1185
+ tokens: Array<SardineEnabledToken>
1156
1186
  }
1157
1187
  export interface SardineGetQuoteArgs {
1158
1188
  params: SardineGetQuoteParams
1159
1189
  }
1160
1190
 
1161
1191
  export interface SardineGetQuoteReturn {
1162
- quote: SardineQuote
1192
+ quote: SardineQuote
1193
+ }
1194
+ export interface GetSardineClientTokenArgs {
1163
1195
  }
1164
- export interface GetSardineClientTokenArgs {}
1165
1196
 
1166
1197
  export interface GetSardineClientTokenReturn {
1167
- token: string
1198
+ token: string
1168
1199
  }
1169
1200
  export interface GetSardineNFTCheckoutTokenArgs {
1170
1201
  params: SardineNFTCheckoutParams
1171
1202
  }
1172
1203
 
1173
1204
  export interface GetSardineNFTCheckoutTokenReturn {
1174
- resp: SardineNFTCheckout
1205
+ resp: SardineNFTCheckout
1175
1206
  }
1176
1207
  export interface GetSardineNFTCheckoutOrderStatusArgs {
1177
1208
  orderId: string
1178
1209
  }
1179
1210
 
1180
1211
  export interface GetSardineNFTCheckoutOrderStatusReturn {
1181
- resp: SardineOrder
1212
+ resp: SardineOrder
1213
+ }
1214
+ export interface TransakGetCountriesArgs {
1182
1215
  }
1183
- export interface TransakGetCountriesArgs {}
1184
1216
 
1185
1217
  export interface TransakGetCountriesReturn {
1186
- regions: Array<TransakCountry>
1218
+ regions: Array<TransakCountry>
1219
+ }
1220
+ export interface TransakGetCryptoCurrenciesArgs {
1187
1221
  }
1188
- export interface TransakGetCryptoCurrenciesArgs {}
1189
1222
 
1190
1223
  export interface TransakGetCryptoCurrenciesReturn {
1191
- currencies: Array<TransakCryptoCurrency>
1224
+ currencies: Array<TransakCryptoCurrency>
1225
+ }
1226
+ export interface TransakGetFiatCurrenciesArgs {
1192
1227
  }
1193
- export interface TransakGetFiatCurrenciesArgs {}
1194
1228
 
1195
1229
  export interface TransakGetFiatCurrenciesReturn {
1196
- currencies: Array<TransakFiatCurrency>
1230
+ currencies: Array<TransakFiatCurrency>
1197
1231
  }
1198
1232
  export interface TransakGetPriceArgs {
1199
1233
  params: TransakGetPriceParams
1200
1234
  }
1201
1235
 
1202
1236
  export interface TransakGetPriceReturn {
1203
- price: TransakPrice
1237
+ price: TransakPrice
1238
+ }
1239
+ export interface TransakGetSupportedNFTCheckoutChainsArgs {
1204
1240
  }
1205
- export interface TransakGetSupportedNFTCheckoutChainsArgs {}
1206
1241
 
1207
1242
  export interface TransakGetSupportedNFTCheckoutChainsReturn {
1208
- chains: Array<TransakChain>
1243
+ chains: Array<TransakChain>
1209
1244
  }
1210
1245
  export interface GetCoinPricesArgs {
1211
1246
  tokens: Array<Token>
1212
1247
  }
1213
1248
 
1214
1249
  export interface GetCoinPricesReturn {
1215
- tokenPrices: Array<TokenPrice>
1250
+ tokenPrices: Array<TokenPrice>
1216
1251
  }
1217
1252
  export interface GetCollectiblePricesArgs {
1218
1253
  tokens: Array<Token>
1219
1254
  }
1220
1255
 
1221
1256
  export interface GetCollectiblePricesReturn {
1222
- tokenPrices: Array<TokenPrice>
1257
+ tokenPrices: Array<TokenPrice>
1223
1258
  }
1224
1259
  export interface GetExchangeRateArgs {
1225
1260
  toCurrency: string
1226
1261
  }
1227
1262
 
1228
1263
  export interface GetExchangeRateReturn {
1229
- exchangeRate: ExchangeRate
1264
+ exchangeRate: ExchangeRate
1230
1265
  }
1231
1266
  export interface MemoryStoreArgs {
1232
1267
  key: string
@@ -1234,26 +1269,27 @@ export interface MemoryStoreArgs {
1234
1269
  }
1235
1270
 
1236
1271
  export interface MemoryStoreReturn {
1237
- ok: boolean
1272
+ ok: boolean
1238
1273
  }
1239
1274
  export interface MemoryLoadArgs {
1240
1275
  key: string
1241
1276
  }
1242
1277
 
1243
1278
  export interface MemoryLoadReturn {
1244
- value: string
1279
+ value: string
1280
+ }
1281
+ export interface GetInviteInfoArgs {
1245
1282
  }
1246
- export interface GetInviteInfoArgs {}
1247
1283
 
1248
1284
  export interface GetInviteInfoReturn {
1249
- inviteInfo: InviteInfo
1285
+ inviteInfo: InviteInfo
1250
1286
  }
1251
1287
  export interface IsValidAccessCodeArgs {
1252
1288
  accessCode: string
1253
1289
  }
1254
1290
 
1255
1291
  export interface IsValidAccessCodeReturn {
1256
- status: boolean
1292
+ status: boolean
1257
1293
  }
1258
1294
  export interface InternalClaimAccessCodeArgs {
1259
1295
  address: string
@@ -1261,7 +1297,7 @@ export interface InternalClaimAccessCodeArgs {
1261
1297
  }
1262
1298
 
1263
1299
  export interface InternalClaimAccessCodeReturn {
1264
- status: boolean
1300
+ status: boolean
1265
1301
  }
1266
1302
  export interface BlockNumberAtTimeArgs {
1267
1303
  chainId: number
@@ -1269,7 +1305,7 @@ export interface BlockNumberAtTimeArgs {
1269
1305
  }
1270
1306
 
1271
1307
  export interface BlockNumberAtTimeReturn {
1272
- blocks: Array<number>
1308
+ blocks: Array<number>
1273
1309
  }
1274
1310
  export interface PaperSessionSecretArgs {
1275
1311
  chainName: string
@@ -1279,7 +1315,7 @@ export interface PaperSessionSecretArgs {
1279
1315
  }
1280
1316
 
1281
1317
  export interface PaperSessionSecretReturn {
1282
- secret: string
1318
+ secret: string
1283
1319
  }
1284
1320
  export interface PaperSessionSecret2Args {
1285
1321
  chainName: string
@@ -1289,7 +1325,7 @@ export interface PaperSessionSecret2Args {
1289
1325
  }
1290
1326
 
1291
1327
  export interface PaperSessionSecret2Return {
1292
- secret: string
1328
+ secret: string
1293
1329
  }
1294
1330
  export interface LinkWalletArgs {
1295
1331
  parentWalletAddress: string
@@ -1303,7 +1339,7 @@ export interface LinkWalletArgs {
1303
1339
  }
1304
1340
 
1305
1341
  export interface LinkWalletReturn {
1306
- status: boolean
1342
+ status: boolean
1307
1343
  }
1308
1344
  export interface GetLinkedWalletsArgs {
1309
1345
  parentWalletAddress: string
@@ -1313,7 +1349,7 @@ export interface GetLinkedWalletsArgs {
1313
1349
  }
1314
1350
 
1315
1351
  export interface GetLinkedWalletsReturn {
1316
- linkedWallets: Array<LinkedWallet>
1352
+ linkedWallets: Array<LinkedWallet>
1317
1353
  }
1318
1354
  export interface RemoveLinkedWalletArgs {
1319
1355
  parentWalletAddress: string
@@ -1324,7 +1360,7 @@ export interface RemoveLinkedWalletArgs {
1324
1360
  }
1325
1361
 
1326
1362
  export interface RemoveLinkedWalletReturn {
1327
- status: boolean
1363
+ status: boolean
1328
1364
  }
1329
1365
  export interface GenerateWaaSVerificationURLArgs {
1330
1366
  walletAddress: string
@@ -1332,7 +1368,7 @@ export interface GenerateWaaSVerificationURLArgs {
1332
1368
 
1333
1369
  export interface GenerateWaaSVerificationURLReturn {
1334
1370
  nonce: string
1335
- verificationURL: string
1371
+ verificationURL: string
1336
1372
  }
1337
1373
  export interface ValidateWaaSVerificationNonceArgs {
1338
1374
  nonce: string
@@ -1342,7 +1378,7 @@ export interface ValidateWaaSVerificationNonceArgs {
1342
1378
  }
1343
1379
 
1344
1380
  export interface ValidateWaaSVerificationNonceReturn {
1345
- walletAddress: string
1381
+ walletAddress: string
1346
1382
  }
1347
1383
  export interface ListAdoptedWalletsArgs {
1348
1384
  page?: Page
@@ -1350,136 +1386,75 @@ export interface ListAdoptedWalletsArgs {
1350
1386
 
1351
1387
  export interface ListAdoptedWalletsReturn {
1352
1388
  page: Page
1353
- wallets: Array<AdoptedChildWallet>
1389
+ wallets: Array<AdoptedChildWallet>
1354
1390
  }
1355
- export interface GetSwapPermit2PriceArgs {
1356
- buyCurrencyAddress: string
1357
- sellCurrencyAddress: string
1358
- buyAmount: string
1359
- chainId: number
1360
- slippagePercentage?: number
1391
+ export interface GetLifiChainsArgs {
1361
1392
  }
1362
1393
 
1363
- export interface GetSwapPermit2PriceReturn {
1364
- swapPermit2Price: SwapPermit2Price
1394
+ export interface GetLifiChainsReturn {
1395
+ chains: Array<number>
1365
1396
  }
1366
- export interface GetSwapPermit2PricesArgs {
1367
- userAddress: string
1368
- buyCurrencyAddress: string
1369
- buyAmount: string
1370
- chainId: number
1371
- slippagePercentage?: number
1397
+ export interface GetLifiTokensArgs {
1398
+ chainIds: Array<number>
1372
1399
  }
1373
1400
 
1374
- export interface GetSwapPermit2PricesReturn {
1375
- swapPermit2Prices: Array<SwapPermit2Price>
1401
+ export interface GetLifiTokensReturn {
1402
+ tokens: Array<Token>
1376
1403
  }
1377
- export interface GetSwapPermit2QuoteArgs {
1378
- userAddress: string
1379
- buyCurrencyAddress: string
1380
- sellCurrencyAddress: string
1381
- buyAmount: string
1404
+ export interface GetLifiSwapRoutesArgs {
1382
1405
  chainId: number
1383
- includeApprove: boolean
1384
- slippagePercentage?: number
1406
+ toTokenAddress: string
1385
1407
  }
1386
1408
 
1387
- export interface GetSwapPermit2QuoteReturn {
1388
- swapPermit2Quote: SwapPermit2Quote
1409
+ export interface GetLifiSwapRoutesReturn {
1410
+ routes: Array<LifiSwapRoute>
1389
1411
  }
1390
- export interface GetSwapPriceArgs {
1391
- buyCurrencyAddress: string
1392
- sellCurrencyAddress: string
1393
- buyAmount: string
1394
- chainId: number
1395
- slippagePercentage?: number
1412
+ export interface GetLifiSwapQuoteArgs {
1413
+ params: GetLifiSwapQuoteParams
1396
1414
  }
1397
1415
 
1398
- export interface GetSwapPriceReturn {
1399
- swapPrice: SwapPrice
1416
+ export interface GetLifiSwapQuoteReturn {
1417
+ quote: LifiSwapQuote
1400
1418
  }
1401
- export interface GetSwapPricesArgs {
1402
- userAddress: string
1403
- buyCurrencyAddress: string
1404
- buyAmount: string
1405
- chainId: number
1406
- slippagePercentage?: number
1419
+ export interface ListCurrencyGroupsArgs {
1407
1420
  }
1408
1421
 
1409
- export interface GetSwapPricesReturn {
1410
- swapPrices: Array<SwapPrice>
1411
- }
1412
- export interface GetSwapQuoteArgs {
1413
- userAddress: string
1414
- buyCurrencyAddress: string
1415
- sellCurrencyAddress: string
1416
- buyAmount: string
1417
- chainId: number
1418
- includeApprove: boolean
1419
- slippagePercentage?: number
1420
- }
1421
-
1422
- export interface GetSwapQuoteReturn {
1423
- swapQuote: SwapQuote
1424
- }
1425
- export interface GetSwapQuoteV2Args {
1426
- userAddress: string
1427
- buyCurrencyAddress: string
1428
- sellCurrencyAddress: string
1429
- buyAmount: string
1430
- chainId: number
1431
- includeApprove: boolean
1432
- slippagePercentage?: number
1433
- }
1434
-
1435
- export interface GetSwapQuoteV2Return {
1436
- swapQuote: SwapQuote
1437
- }
1438
- export interface IntentQueryArgs {
1439
- wallet: string
1440
- preconditions: Array<IntentPrecondition>
1441
- }
1442
-
1443
- export interface IntentQueryReturn {
1444
- solutions: Array<IntentSolution>
1445
- }
1446
- export interface ListCurrencyGroupsArgs {}
1447
-
1448
1422
  export interface ListCurrencyGroupsReturn {
1449
- currencyGroups: Array<CurrencyGroup>
1423
+ currencyGroups: Array<CurrencyGroup>
1450
1424
  }
1451
1425
  export interface AddOffchainInventoryArgs {
1452
1426
  inventory: OffchainInventory
1453
1427
  }
1454
1428
 
1455
1429
  export interface AddOffchainInventoryReturn {
1456
- inventoryId: number
1430
+ inventoryId: number
1457
1431
  }
1458
1432
  export interface GetOffchainInventoryArgs {
1459
1433
  inventoryId: number
1460
1434
  }
1461
1435
 
1462
1436
  export interface GetOffchainInventoryReturn {
1463
- inventory: OffchainInventory
1437
+ inventory: OffchainInventory
1464
1438
  }
1465
1439
  export interface ListOffchainInventoriesArgs {
1466
1440
  projectId: number
1467
1441
  }
1468
1442
 
1469
1443
  export interface ListOffchainInventoriesReturn {
1470
- inventory: Array<OffchainInventory>
1444
+ inventory: Array<OffchainInventory>
1471
1445
  }
1472
1446
  export interface UpdateOffchainInventoryArgs {
1473
1447
  inventory: OffchainInventory
1474
1448
  }
1475
1449
 
1476
- export interface UpdateOffchainInventoryReturn {}
1450
+ export interface UpdateOffchainInventoryReturn {
1451
+ }
1477
1452
  export interface DeleteOffchainInventoryArgs {
1478
1453
  inventoryId: number
1479
1454
  }
1480
1455
 
1481
1456
  export interface DeleteOffchainInventoryReturn {
1482
- ok: boolean
1457
+ ok: boolean
1483
1458
  }
1484
1459
  export interface RequestOffchainPaymentArgs {
1485
1460
  inventoryId: number
@@ -1489,7 +1464,7 @@ export interface RequestOffchainPaymentArgs {
1489
1464
  }
1490
1465
 
1491
1466
  export interface RequestOffchainPaymentReturn {
1492
- payment: PaymentResponse
1467
+ payment: PaymentResponse
1493
1468
  }
1494
1469
  export interface ListOffchainPaymentsArgs {
1495
1470
  inventoryId: number
@@ -1498,14 +1473,14 @@ export interface ListOffchainPaymentsArgs {
1498
1473
 
1499
1474
  export interface ListOffchainPaymentsReturn {
1500
1475
  page: Page
1501
- payments: Array<OffchainPayment>
1476
+ payments: Array<OffchainPayment>
1502
1477
  }
1503
1478
  export interface SavePackArgs {
1504
1479
  pack: Pack
1505
1480
  }
1506
1481
 
1507
1482
  export interface SavePackReturn {
1508
- merkleRoot: string
1483
+ merkleRoot: string
1509
1484
  }
1510
1485
  export interface GetPackArgs {
1511
1486
  contractAddress: string
@@ -1513,7 +1488,7 @@ export interface GetPackArgs {
1513
1488
  }
1514
1489
 
1515
1490
  export interface GetPackReturn {
1516
- pack: Pack
1491
+ pack: Pack
1517
1492
  }
1518
1493
  export interface DeletePackArgs {
1519
1494
  contractAddress: string
@@ -1521,16 +1496,18 @@ export interface DeletePackArgs {
1521
1496
  }
1522
1497
 
1523
1498
  export interface DeletePackReturn {
1524
- status: boolean
1499
+ status: boolean
1525
1500
  }
1526
1501
  export interface UpdatePackContentArgs {
1527
1502
  pack: Pack
1528
1503
  }
1529
1504
 
1530
1505
  export interface UpdatePackContentReturn {
1531
- merkleRoot: string
1506
+ merkleRoot: string
1532
1507
  }
1533
1508
 
1509
+
1510
+
1534
1511
  //
1535
1512
  // Client
1536
1513
  //
@@ -1547,1401 +1524,1147 @@ export class API implements API {
1547
1524
  private url(name: string): string {
1548
1525
  return this.hostname + this.path + name
1549
1526
  }
1550
-
1527
+
1551
1528
  ping = (headers?: object, signal?: AbortSignal): Promise<PingReturn> => {
1552
- return this.fetch(this.url('Ping'), createHTTPRequest({}, headers, signal)).then(
1553
- res => {
1554
- return buildResponse(res).then(_data => {
1555
- return {
1556
- status: <boolean>_data.status
1557
- }
1558
- })
1559
- },
1560
- error => {
1561
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1562
- }
1563
- )
1529
+ return this.fetch(
1530
+ this.url('Ping'),
1531
+ createHTTPRequest({}, headers, signal)
1532
+ ).then((res) => {
1533
+ return buildResponse(res).then(_data => {
1534
+ return {
1535
+ status: <boolean>(_data.status),
1536
+ }
1537
+ })
1538
+ }, (error) => {
1539
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1540
+ })
1564
1541
  }
1565
-
1542
+
1566
1543
  version = (headers?: object, signal?: AbortSignal): Promise<VersionReturn> => {
1567
- return this.fetch(this.url('Version'), createHTTPRequest({}, headers, signal)).then(
1568
- res => {
1569
- return buildResponse(res).then(_data => {
1570
- return {
1571
- version: <Version>_data.version
1572
- }
1573
- })
1574
- },
1575
- error => {
1576
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1577
- }
1578
- )
1544
+ return this.fetch(
1545
+ this.url('Version'),
1546
+ createHTTPRequest({}, headers, signal)
1547
+ ).then((res) => {
1548
+ return buildResponse(res).then(_data => {
1549
+ return {
1550
+ version: <Version>(_data.version),
1551
+ }
1552
+ })
1553
+ }, (error) => {
1554
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1555
+ })
1579
1556
  }
1580
-
1557
+
1581
1558
  runtimeStatus = (headers?: object, signal?: AbortSignal): Promise<RuntimeStatusReturn> => {
1582
- return this.fetch(this.url('RuntimeStatus'), createHTTPRequest({}, headers, signal)).then(
1583
- res => {
1584
- return buildResponse(res).then(_data => {
1585
- return {
1586
- status: <RuntimeStatus>_data.status
1587
- }
1588
- })
1589
- },
1590
- error => {
1591
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1592
- }
1593
- )
1559
+ return this.fetch(
1560
+ this.url('RuntimeStatus'),
1561
+ createHTTPRequest({}, headers, signal)
1562
+ ).then((res) => {
1563
+ return buildResponse(res).then(_data => {
1564
+ return {
1565
+ status: <RuntimeStatus>(_data.status),
1566
+ }
1567
+ })
1568
+ }, (error) => {
1569
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1570
+ })
1594
1571
  }
1595
-
1572
+
1596
1573
  clock = (headers?: object, signal?: AbortSignal): Promise<ClockReturn> => {
1597
- return this.fetch(this.url('Clock'), createHTTPRequest({}, headers, signal)).then(
1598
- res => {
1599
- return buildResponse(res).then(_data => {
1600
- return {
1601
- serverTime: <string>_data.serverTime
1602
- }
1603
- })
1604
- },
1605
- error => {
1606
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1607
- }
1608
- )
1574
+ return this.fetch(
1575
+ this.url('Clock'),
1576
+ createHTTPRequest({}, headers, signal)
1577
+ ).then((res) => {
1578
+ return buildResponse(res).then(_data => {
1579
+ return {
1580
+ serverTime: <string>(_data.serverTime),
1581
+ }
1582
+ })
1583
+ }, (error) => {
1584
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1585
+ })
1609
1586
  }
1610
-
1587
+
1611
1588
  getSequenceContext = (headers?: object, signal?: AbortSignal): Promise<GetSequenceContextReturn> => {
1612
- return this.fetch(this.url('GetSequenceContext'), createHTTPRequest({}, headers, signal)).then(
1613
- res => {
1614
- return buildResponse(res).then(_data => {
1615
- return {
1616
- data: <SequenceContext>_data.data
1617
- }
1618
- })
1619
- },
1620
- error => {
1621
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1622
- }
1623
- )
1589
+ return this.fetch(
1590
+ this.url('GetSequenceContext'),
1591
+ createHTTPRequest({}, headers, signal)
1592
+ ).then((res) => {
1593
+ return buildResponse(res).then(_data => {
1594
+ return {
1595
+ data: <SequenceContext>(_data.data),
1596
+ }
1597
+ })
1598
+ }, (error) => {
1599
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1600
+ })
1624
1601
  }
1625
-
1602
+
1626
1603
  getAuthToken = (args: GetAuthTokenArgs, headers?: object, signal?: AbortSignal): Promise<GetAuthTokenReturn> => {
1627
- return this.fetch(this.url('GetAuthToken'), createHTTPRequest(args, headers, signal)).then(
1628
- res => {
1629
- return buildResponse(res).then(_data => {
1630
- return {
1631
- status: <boolean>_data.status,
1632
- jwtToken: <string>_data.jwtToken,
1633
- address: <string>_data.address,
1634
- user: <User>_data.user
1635
- }
1636
- })
1637
- },
1638
- error => {
1639
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1640
- }
1641
- )
1604
+ return this.fetch(
1605
+ this.url('GetAuthToken'),
1606
+ createHTTPRequest(args, headers, signal)).then((res) => {
1607
+ return buildResponse(res).then(_data => {
1608
+ return {
1609
+ status: <boolean>(_data.status),
1610
+ jwtToken: <string>(_data.jwtToken),
1611
+ address: <string>(_data.address),
1612
+ user: <User>(_data.user),
1613
+ }
1614
+ })
1615
+ }, (error) => {
1616
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1617
+ })
1642
1618
  }
1643
-
1619
+
1644
1620
  getAuthToken2 = (args: GetAuthToken2Args, headers?: object, signal?: AbortSignal): Promise<GetAuthToken2Return> => {
1645
- return this.fetch(this.url('GetAuthToken2'), createHTTPRequest(args, headers, signal)).then(
1646
- res => {
1647
- return buildResponse(res).then(_data => {
1648
- return {
1649
- status: <boolean>_data.status,
1650
- jwtToken: <string>_data.jwtToken,
1651
- address: <string>_data.address,
1652
- user: <User>_data.user
1653
- }
1654
- })
1655
- },
1656
- error => {
1657
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1658
- }
1659
- )
1660
- }
1661
-
1662
- sendPasswordlessLink = (
1663
- args: SendPasswordlessLinkArgs,
1664
- headers?: object,
1665
- signal?: AbortSignal
1666
- ): Promise<SendPasswordlessLinkReturn> => {
1667
- return this.fetch(this.url('SendPasswordlessLink'), createHTTPRequest(args, headers, signal)).then(
1668
- res => {
1669
- return buildResponse(res).then(_data => {
1670
- return {
1671
- status: <boolean>_data.status
1672
- }
1673
- })
1674
- },
1675
- error => {
1676
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1677
- }
1678
- )
1621
+ return this.fetch(
1622
+ this.url('GetAuthToken2'),
1623
+ createHTTPRequest(args, headers, signal)).then((res) => {
1624
+ return buildResponse(res).then(_data => {
1625
+ return {
1626
+ status: <boolean>(_data.status),
1627
+ jwtToken: <string>(_data.jwtToken),
1628
+ address: <string>(_data.address),
1629
+ user: <User>(_data.user),
1630
+ }
1631
+ })
1632
+ }, (error) => {
1633
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1634
+ })
1635
+ }
1636
+
1637
+ sendPasswordlessLink = (args: SendPasswordlessLinkArgs, headers?: object, signal?: AbortSignal): Promise<SendPasswordlessLinkReturn> => {
1638
+ return this.fetch(
1639
+ this.url('SendPasswordlessLink'),
1640
+ createHTTPRequest(args, headers, signal)).then((res) => {
1641
+ return buildResponse(res).then(_data => {
1642
+ return {
1643
+ status: <boolean>(_data.status),
1644
+ }
1645
+ })
1646
+ }, (error) => {
1647
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1648
+ })
1679
1649
  }
1680
-
1650
+
1681
1651
  registerPublicKey = (args: RegisterPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise<RegisterPublicKeyReturn> => {
1682
- return this.fetch(this.url('RegisterPublicKey'), createHTTPRequest(args, headers, signal)).then(
1683
- res => {
1684
- return buildResponse(res).then(_data => {
1685
- return {
1686
- status: <boolean>_data.status
1687
- }
1688
- })
1689
- },
1690
- error => {
1691
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1692
- }
1693
- )
1652
+ return this.fetch(
1653
+ this.url('RegisterPublicKey'),
1654
+ createHTTPRequest(args, headers, signal)).then((res) => {
1655
+ return buildResponse(res).then(_data => {
1656
+ return {
1657
+ status: <boolean>(_data.status),
1658
+ }
1659
+ })
1660
+ }, (error) => {
1661
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1662
+ })
1694
1663
  }
1695
-
1664
+
1696
1665
  getPublicKey = (args: GetPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise<GetPublicKeyReturn> => {
1697
- return this.fetch(this.url('GetPublicKey'), createHTTPRequest(args, headers, signal)).then(
1698
- res => {
1699
- return buildResponse(res).then(_data => {
1700
- return {
1701
- publicKey: <PublicKey>_data.publicKey
1702
- }
1703
- })
1704
- },
1705
- error => {
1706
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1707
- }
1708
- )
1666
+ return this.fetch(
1667
+ this.url('GetPublicKey'),
1668
+ createHTTPRequest(args, headers, signal)).then((res) => {
1669
+ return buildResponse(res).then(_data => {
1670
+ return {
1671
+ publicKey: <PublicKey>(_data.publicKey),
1672
+ }
1673
+ })
1674
+ }, (error) => {
1675
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1676
+ })
1709
1677
  }
1710
-
1678
+
1711
1679
  friendList = (args: FriendListArgs, headers?: object, signal?: AbortSignal): Promise<FriendListReturn> => {
1712
- return this.fetch(this.url('FriendList'), createHTTPRequest(args, headers, signal)).then(
1713
- res => {
1714
- return buildResponse(res).then(_data => {
1715
- return {
1716
- page: <Page>_data.page,
1717
- friends: <Array<Friend>>_data.friends
1718
- }
1719
- })
1720
- },
1721
- error => {
1722
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1723
- }
1724
- )
1725
- }
1726
-
1727
- getFriendByAddress = (
1728
- args: GetFriendByAddressArgs,
1729
- headers?: object,
1730
- signal?: AbortSignal
1731
- ): Promise<GetFriendByAddressReturn> => {
1732
- return this.fetch(this.url('GetFriendByAddress'), createHTTPRequest(args, headers, signal)).then(
1733
- res => {
1734
- return buildResponse(res).then(_data => {
1735
- return {
1736
- status: <boolean>_data.status,
1737
- friend: <Friend>_data.friend
1738
- }
1739
- })
1740
- },
1741
- error => {
1742
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1743
- }
1744
- )
1680
+ return this.fetch(
1681
+ this.url('FriendList'),
1682
+ createHTTPRequest(args, headers, signal)).then((res) => {
1683
+ return buildResponse(res).then(_data => {
1684
+ return {
1685
+ page: <Page>(_data.page),
1686
+ friends: <Array<Friend>>(_data.friends),
1687
+ }
1688
+ })
1689
+ }, (error) => {
1690
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1691
+ })
1692
+ }
1693
+
1694
+ getFriendByAddress = (args: GetFriendByAddressArgs, headers?: object, signal?: AbortSignal): Promise<GetFriendByAddressReturn> => {
1695
+ return this.fetch(
1696
+ this.url('GetFriendByAddress'),
1697
+ createHTTPRequest(args, headers, signal)).then((res) => {
1698
+ return buildResponse(res).then(_data => {
1699
+ return {
1700
+ status: <boolean>(_data.status),
1701
+ friend: <Friend>(_data.friend),
1702
+ }
1703
+ })
1704
+ }, (error) => {
1705
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1706
+ })
1745
1707
  }
1746
-
1708
+
1747
1709
  searchFriends = (args: SearchFriendsArgs, headers?: object, signal?: AbortSignal): Promise<SearchFriendsReturn> => {
1748
- return this.fetch(this.url('SearchFriends'), createHTTPRequest(args, headers, signal)).then(
1749
- res => {
1750
- return buildResponse(res).then(_data => {
1751
- return {
1752
- friends: <Array<Friend>>_data.friends
1753
- }
1754
- })
1755
- },
1756
- error => {
1757
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1758
- }
1759
- )
1710
+ return this.fetch(
1711
+ this.url('SearchFriends'),
1712
+ createHTTPRequest(args, headers, signal)).then((res) => {
1713
+ return buildResponse(res).then(_data => {
1714
+ return {
1715
+ friends: <Array<Friend>>(_data.friends),
1716
+ }
1717
+ })
1718
+ }, (error) => {
1719
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1720
+ })
1760
1721
  }
1761
-
1722
+
1762
1723
  addFriend = (args: AddFriendArgs, headers?: object, signal?: AbortSignal): Promise<AddFriendReturn> => {
1763
- return this.fetch(this.url('AddFriend'), createHTTPRequest(args, headers, signal)).then(
1764
- res => {
1765
- return buildResponse(res).then(_data => {
1766
- return {
1767
- status: <boolean>_data.status,
1768
- friend: <Friend>_data.friend
1769
- }
1770
- })
1771
- },
1772
- error => {
1773
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1774
- }
1775
- )
1776
- }
1777
-
1778
- updateFriendNickname = (
1779
- args: UpdateFriendNicknameArgs,
1780
- headers?: object,
1781
- signal?: AbortSignal
1782
- ): Promise<UpdateFriendNicknameReturn> => {
1783
- return this.fetch(this.url('UpdateFriendNickname'), createHTTPRequest(args, headers, signal)).then(
1784
- res => {
1785
- return buildResponse(res).then(_data => {
1786
- return {
1787
- status: <boolean>_data.status,
1788
- friend: <Friend>_data.friend
1789
- }
1790
- })
1791
- },
1792
- error => {
1793
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1794
- }
1795
- )
1724
+ return this.fetch(
1725
+ this.url('AddFriend'),
1726
+ createHTTPRequest(args, headers, signal)).then((res) => {
1727
+ return buildResponse(res).then(_data => {
1728
+ return {
1729
+ status: <boolean>(_data.status),
1730
+ friend: <Friend>(_data.friend),
1731
+ }
1732
+ })
1733
+ }, (error) => {
1734
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1735
+ })
1736
+ }
1737
+
1738
+ updateFriendNickname = (args: UpdateFriendNicknameArgs, headers?: object, signal?: AbortSignal): Promise<UpdateFriendNicknameReturn> => {
1739
+ return this.fetch(
1740
+ this.url('UpdateFriendNickname'),
1741
+ createHTTPRequest(args, headers, signal)).then((res) => {
1742
+ return buildResponse(res).then(_data => {
1743
+ return {
1744
+ status: <boolean>(_data.status),
1745
+ friend: <Friend>(_data.friend),
1746
+ }
1747
+ })
1748
+ }, (error) => {
1749
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1750
+ })
1796
1751
  }
1797
-
1752
+
1798
1753
  removeFriend = (args: RemoveFriendArgs, headers?: object, signal?: AbortSignal): Promise<RemoveFriendReturn> => {
1799
- return this.fetch(this.url('RemoveFriend'), createHTTPRequest(args, headers, signal)).then(
1800
- res => {
1801
- return buildResponse(res).then(_data => {
1802
- return {
1803
- status: <boolean>_data.status
1804
- }
1805
- })
1806
- },
1807
- error => {
1808
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1809
- }
1810
- )
1754
+ return this.fetch(
1755
+ this.url('RemoveFriend'),
1756
+ createHTTPRequest(args, headers, signal)).then((res) => {
1757
+ return buildResponse(res).then(_data => {
1758
+ return {
1759
+ status: <boolean>(_data.status),
1760
+ }
1761
+ })
1762
+ }, (error) => {
1763
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1764
+ })
1811
1765
  }
1812
-
1766
+
1813
1767
  contractCall = (args: ContractCallArgs, headers?: object, signal?: AbortSignal): Promise<ContractCallReturn> => {
1814
- return this.fetch(this.url('ContractCall'), createHTTPRequest(args, headers, signal)).then(
1815
- res => {
1816
- return buildResponse(res).then(_data => {
1817
- return {
1818
- returns: <Array<string>>_data.returns
1819
- }
1820
- })
1821
- },
1822
- error => {
1823
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1824
- }
1825
- )
1826
- }
1827
-
1828
- decodeContractCall = (
1829
- args: DecodeContractCallArgs,
1830
- headers?: object,
1831
- signal?: AbortSignal
1832
- ): Promise<DecodeContractCallReturn> => {
1833
- return this.fetch(this.url('DecodeContractCall'), createHTTPRequest(args, headers, signal)).then(
1834
- res => {
1835
- return buildResponse(res).then(_data => {
1836
- return {
1837
- call: <ContractCall>_data.call
1838
- }
1839
- })
1840
- },
1841
- error => {
1842
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1843
- }
1844
- )
1845
- }
1846
-
1847
- lookupContractCallSelectors = (
1848
- args: LookupContractCallSelectorsArgs,
1849
- headers?: object,
1850
- signal?: AbortSignal
1851
- ): Promise<LookupContractCallSelectorsReturn> => {
1852
- return this.fetch(this.url('LookupContractCallSelectors'), createHTTPRequest(args, headers, signal)).then(
1853
- res => {
1854
- return buildResponse(res).then(_data => {
1855
- return {
1856
- signatures: <Array<Array<string>>>_data.signatures
1857
- }
1858
- })
1859
- },
1860
- error => {
1861
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1862
- }
1863
- )
1768
+ return this.fetch(
1769
+ this.url('ContractCall'),
1770
+ createHTTPRequest(args, headers, signal)).then((res) => {
1771
+ return buildResponse(res).then(_data => {
1772
+ return {
1773
+ returns: <Array<string>>(_data.returns),
1774
+ }
1775
+ })
1776
+ }, (error) => {
1777
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1778
+ })
1779
+ }
1780
+
1781
+ decodeContractCall = (args: DecodeContractCallArgs, headers?: object, signal?: AbortSignal): Promise<DecodeContractCallReturn> => {
1782
+ return this.fetch(
1783
+ this.url('DecodeContractCall'),
1784
+ createHTTPRequest(args, headers, signal)).then((res) => {
1785
+ return buildResponse(res).then(_data => {
1786
+ return {
1787
+ call: <ContractCall>(_data.call),
1788
+ }
1789
+ })
1790
+ }, (error) => {
1791
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1792
+ })
1793
+ }
1794
+
1795
+ lookupContractCallSelectors = (args: LookupContractCallSelectorsArgs, headers?: object, signal?: AbortSignal): Promise<LookupContractCallSelectorsReturn> => {
1796
+ return this.fetch(
1797
+ this.url('LookupContractCallSelectors'),
1798
+ createHTTPRequest(args, headers, signal)).then((res) => {
1799
+ return buildResponse(res).then(_data => {
1800
+ return {
1801
+ signatures: <Array<Array<string>>>(_data.signatures),
1802
+ }
1803
+ })
1804
+ }, (error) => {
1805
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1806
+ })
1864
1807
  }
1865
-
1808
+
1866
1809
  userStorageFetch = (args: UserStorageFetchArgs, headers?: object, signal?: AbortSignal): Promise<UserStorageFetchReturn> => {
1867
- return this.fetch(this.url('UserStorageFetch'), createHTTPRequest(args, headers, signal)).then(
1868
- res => {
1869
- return buildResponse(res).then(_data => {
1870
- return {
1871
- object: <any>_data.object
1872
- }
1873
- })
1874
- },
1875
- error => {
1876
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1877
- }
1878
- )
1810
+ return this.fetch(
1811
+ this.url('UserStorageFetch'),
1812
+ createHTTPRequest(args, headers, signal)).then((res) => {
1813
+ return buildResponse(res).then(_data => {
1814
+ return {
1815
+ object: <any>(_data.object),
1816
+ }
1817
+ })
1818
+ }, (error) => {
1819
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1820
+ })
1879
1821
  }
1880
-
1822
+
1881
1823
  userStorageSave = (args: UserStorageSaveArgs, headers?: object, signal?: AbortSignal): Promise<UserStorageSaveReturn> => {
1882
- return this.fetch(this.url('UserStorageSave'), createHTTPRequest(args, headers, signal)).then(
1883
- res => {
1884
- return buildResponse(res).then(_data => {
1885
- return {
1886
- ok: <boolean>_data.ok
1887
- }
1888
- })
1889
- },
1890
- error => {
1891
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1892
- }
1893
- )
1824
+ return this.fetch(
1825
+ this.url('UserStorageSave'),
1826
+ createHTTPRequest(args, headers, signal)).then((res) => {
1827
+ return buildResponse(res).then(_data => {
1828
+ return {
1829
+ ok: <boolean>(_data.ok),
1830
+ }
1831
+ })
1832
+ }, (error) => {
1833
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1834
+ })
1894
1835
  }
1895
-
1836
+
1896
1837
  userStorageDelete = (args: UserStorageDeleteArgs, headers?: object, signal?: AbortSignal): Promise<UserStorageDeleteReturn> => {
1897
- return this.fetch(this.url('UserStorageDelete'), createHTTPRequest(args, headers, signal)).then(
1898
- res => {
1899
- return buildResponse(res).then(_data => {
1900
- return {
1901
- ok: <boolean>_data.ok
1902
- }
1903
- })
1904
- },
1905
- error => {
1906
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1907
- }
1908
- )
1909
- }
1910
-
1911
- userStorageFetchAll = (
1912
- args: UserStorageFetchAllArgs,
1913
- headers?: object,
1914
- signal?: AbortSignal
1915
- ): Promise<UserStorageFetchAllReturn> => {
1916
- return this.fetch(this.url('UserStorageFetchAll'), createHTTPRequest(args, headers, signal)).then(
1917
- res => {
1918
- return buildResponse(res).then(_data => {
1919
- return {
1920
- objects: <{ [key: string]: any }>_data.objects
1921
- }
1922
- })
1923
- },
1924
- error => {
1925
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1926
- }
1927
- )
1838
+ return this.fetch(
1839
+ this.url('UserStorageDelete'),
1840
+ createHTTPRequest(args, headers, signal)).then((res) => {
1841
+ return buildResponse(res).then(_data => {
1842
+ return {
1843
+ ok: <boolean>(_data.ok),
1844
+ }
1845
+ })
1846
+ }, (error) => {
1847
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1848
+ })
1849
+ }
1850
+
1851
+ userStorageFetchAll = (args: UserStorageFetchAllArgs, headers?: object, signal?: AbortSignal): Promise<UserStorageFetchAllReturn> => {
1852
+ return this.fetch(
1853
+ this.url('UserStorageFetchAll'),
1854
+ createHTTPRequest(args, headers, signal)).then((res) => {
1855
+ return buildResponse(res).then(_data => {
1856
+ return {
1857
+ objects: <{[key: string]: any}>(_data.objects),
1858
+ }
1859
+ })
1860
+ }, (error) => {
1861
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1862
+ })
1928
1863
  }
1929
-
1864
+
1930
1865
  getMoonpayLink = (args: GetMoonpayLinkArgs, headers?: object, signal?: AbortSignal): Promise<GetMoonpayLinkReturn> => {
1931
- return this.fetch(this.url('GetMoonpayLink'), createHTTPRequest(args, headers, signal)).then(
1932
- res => {
1933
- return buildResponse(res).then(_data => {
1934
- return {
1935
- signedUrl: <string>_data.signedUrl
1936
- }
1937
- })
1938
- },
1939
- error => {
1940
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1941
- }
1942
- )
1866
+ return this.fetch(
1867
+ this.url('GetMoonpayLink'),
1868
+ createHTTPRequest(args, headers, signal)).then((res) => {
1869
+ return buildResponse(res).then(_data => {
1870
+ return {
1871
+ signedUrl: <string>(_data.signedUrl),
1872
+ }
1873
+ })
1874
+ }, (error) => {
1875
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1876
+ })
1943
1877
  }
1944
-
1878
+
1945
1879
  resolveENSAddress = (args: ResolveENSAddressArgs, headers?: object, signal?: AbortSignal): Promise<ResolveENSAddressReturn> => {
1946
- return this.fetch(this.url('ResolveENSAddress'), createHTTPRequest(args, headers, signal)).then(
1947
- res => {
1948
- return buildResponse(res).then(_data => {
1949
- return {
1950
- address: <string>_data.address,
1951
- ok: <boolean>_data.ok
1952
- }
1953
- })
1954
- },
1955
- error => {
1956
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1957
- }
1958
- )
1880
+ return this.fetch(
1881
+ this.url('ResolveENSAddress'),
1882
+ createHTTPRequest(args, headers, signal)).then((res) => {
1883
+ return buildResponse(res).then(_data => {
1884
+ return {
1885
+ address: <string>(_data.address),
1886
+ ok: <boolean>(_data.ok),
1887
+ }
1888
+ })
1889
+ }, (error) => {
1890
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1891
+ })
1959
1892
  }
1960
-
1893
+
1961
1894
  isValidSignature = (args: IsValidSignatureArgs, headers?: object, signal?: AbortSignal): Promise<IsValidSignatureReturn> => {
1962
- return this.fetch(this.url('IsValidSignature'), createHTTPRequest(args, headers, signal)).then(
1963
- res => {
1964
- return buildResponse(res).then(_data => {
1965
- return {
1966
- isValid: <boolean>_data.isValid
1967
- }
1968
- })
1969
- },
1970
- error => {
1971
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1972
- }
1973
- )
1974
- }
1975
-
1976
- isValidMessageSignature = (
1977
- args: IsValidMessageSignatureArgs,
1978
- headers?: object,
1979
- signal?: AbortSignal
1980
- ): Promise<IsValidMessageSignatureReturn> => {
1981
- return this.fetch(this.url('IsValidMessageSignature'), createHTTPRequest(args, headers, signal)).then(
1982
- res => {
1983
- return buildResponse(res).then(_data => {
1984
- return {
1985
- isValid: <boolean>_data.isValid
1986
- }
1987
- })
1988
- },
1989
- error => {
1990
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1991
- }
1992
- )
1993
- }
1994
-
1995
- isValidTypedDataSignature = (
1996
- args: IsValidTypedDataSignatureArgs,
1997
- headers?: object,
1998
- signal?: AbortSignal
1999
- ): Promise<IsValidTypedDataSignatureReturn> => {
2000
- return this.fetch(this.url('IsValidTypedDataSignature'), createHTTPRequest(args, headers, signal)).then(
2001
- res => {
2002
- return buildResponse(res).then(_data => {
2003
- return {
2004
- isValid: <boolean>_data.isValid
2005
- }
2006
- })
2007
- },
2008
- error => {
2009
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2010
- }
2011
- )
2012
- }
2013
-
2014
- isValidETHAuthProof = (
2015
- args: IsValidETHAuthProofArgs,
2016
- headers?: object,
2017
- signal?: AbortSignal
2018
- ): Promise<IsValidETHAuthProofReturn> => {
2019
- return this.fetch(this.url('IsValidETHAuthProof'), createHTTPRequest(args, headers, signal)).then(
2020
- res => {
2021
- return buildResponse(res).then(_data => {
2022
- return {
2023
- isValid: <boolean>_data.isValid
2024
- }
2025
- })
2026
- },
2027
- error => {
2028
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2029
- }
2030
- )
1895
+ return this.fetch(
1896
+ this.url('IsValidSignature'),
1897
+ createHTTPRequest(args, headers, signal)).then((res) => {
1898
+ return buildResponse(res).then(_data => {
1899
+ return {
1900
+ isValid: <boolean>(_data.isValid),
1901
+ }
1902
+ })
1903
+ }, (error) => {
1904
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1905
+ })
1906
+ }
1907
+
1908
+ isValidMessageSignature = (args: IsValidMessageSignatureArgs, headers?: object, signal?: AbortSignal): Promise<IsValidMessageSignatureReturn> => {
1909
+ return this.fetch(
1910
+ this.url('IsValidMessageSignature'),
1911
+ createHTTPRequest(args, headers, signal)).then((res) => {
1912
+ return buildResponse(res).then(_data => {
1913
+ return {
1914
+ isValid: <boolean>(_data.isValid),
1915
+ }
1916
+ })
1917
+ }, (error) => {
1918
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1919
+ })
1920
+ }
1921
+
1922
+ isValidTypedDataSignature = (args: IsValidTypedDataSignatureArgs, headers?: object, signal?: AbortSignal): Promise<IsValidTypedDataSignatureReturn> => {
1923
+ return this.fetch(
1924
+ this.url('IsValidTypedDataSignature'),
1925
+ createHTTPRequest(args, headers, signal)).then((res) => {
1926
+ return buildResponse(res).then(_data => {
1927
+ return {
1928
+ isValid: <boolean>(_data.isValid),
1929
+ }
1930
+ })
1931
+ }, (error) => {
1932
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1933
+ })
1934
+ }
1935
+
1936
+ isValidETHAuthProof = (args: IsValidETHAuthProofArgs, headers?: object, signal?: AbortSignal): Promise<IsValidETHAuthProofReturn> => {
1937
+ return this.fetch(
1938
+ this.url('IsValidETHAuthProof'),
1939
+ createHTTPRequest(args, headers, signal)).then((res) => {
1940
+ return buildResponse(res).then(_data => {
1941
+ return {
1942
+ isValid: <boolean>(_data.isValid),
1943
+ }
1944
+ })
1945
+ }, (error) => {
1946
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1947
+ })
2031
1948
  }
2032
-
1949
+
2033
1950
  sardineGetClientToken = (headers?: object, signal?: AbortSignal): Promise<SardineGetClientTokenReturn> => {
2034
- return this.fetch(this.url('SardineGetClientToken'), createHTTPRequest({}, headers, signal)).then(
2035
- res => {
2036
- return buildResponse(res).then(_data => {
2037
- return {
2038
- token: <string>_data.token
2039
- }
2040
- })
2041
- },
2042
- error => {
2043
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2044
- }
2045
- )
2046
- }
2047
-
2048
- sardineGetNFTCheckoutToken = (
2049
- args: SardineGetNFTCheckoutTokenArgs,
2050
- headers?: object,
2051
- signal?: AbortSignal
2052
- ): Promise<SardineGetNFTCheckoutTokenReturn> => {
2053
- return this.fetch(this.url('SardineGetNFTCheckoutToken'), createHTTPRequest(args, headers, signal)).then(
2054
- res => {
2055
- return buildResponse(res).then(_data => {
2056
- return {
2057
- resp: <SardineNFTCheckout>_data.resp
2058
- }
2059
- })
2060
- },
2061
- error => {
2062
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2063
- }
2064
- )
2065
- }
2066
-
2067
- sardineGetNFTCheckoutOrderStatus = (
2068
- args: SardineGetNFTCheckoutOrderStatusArgs,
2069
- headers?: object,
2070
- signal?: AbortSignal
2071
- ): Promise<SardineGetNFTCheckoutOrderStatusReturn> => {
2072
- return this.fetch(this.url('SardineGetNFTCheckoutOrderStatus'), createHTTPRequest(args, headers, signal)).then(
2073
- res => {
2074
- return buildResponse(res).then(_data => {
2075
- return {
2076
- resp: <SardineOrder>_data.resp
2077
- }
2078
- })
2079
- },
2080
- error => {
2081
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2082
- }
2083
- )
1951
+ return this.fetch(
1952
+ this.url('SardineGetClientToken'),
1953
+ createHTTPRequest({}, headers, signal)
1954
+ ).then((res) => {
1955
+ return buildResponse(res).then(_data => {
1956
+ return {
1957
+ token: <string>(_data.token),
1958
+ }
1959
+ })
1960
+ }, (error) => {
1961
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1962
+ })
1963
+ }
1964
+
1965
+ sardineGetNFTCheckoutToken = (args: SardineGetNFTCheckoutTokenArgs, headers?: object, signal?: AbortSignal): Promise<SardineGetNFTCheckoutTokenReturn> => {
1966
+ return this.fetch(
1967
+ this.url('SardineGetNFTCheckoutToken'),
1968
+ createHTTPRequest(args, headers, signal)).then((res) => {
1969
+ return buildResponse(res).then(_data => {
1970
+ return {
1971
+ resp: <SardineNFTCheckout>(_data.resp),
1972
+ }
1973
+ })
1974
+ }, (error) => {
1975
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1976
+ })
1977
+ }
1978
+
1979
+ sardineGetNFTCheckoutOrderStatus = (args: SardineGetNFTCheckoutOrderStatusArgs, headers?: object, signal?: AbortSignal): Promise<SardineGetNFTCheckoutOrderStatusReturn> => {
1980
+ return this.fetch(
1981
+ this.url('SardineGetNFTCheckoutOrderStatus'),
1982
+ createHTTPRequest(args, headers, signal)).then((res) => {
1983
+ return buildResponse(res).then(_data => {
1984
+ return {
1985
+ resp: <SardineOrder>(_data.resp),
1986
+ }
1987
+ })
1988
+ }, (error) => {
1989
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1990
+ })
2084
1991
  }
2085
-
1992
+
2086
1993
  sardineGetSupportedRegions = (headers?: object, signal?: AbortSignal): Promise<SardineGetSupportedRegionsReturn> => {
2087
- return this.fetch(this.url('SardineGetSupportedRegions'), createHTTPRequest({}, headers, signal)).then(
2088
- res => {
2089
- return buildResponse(res).then(_data => {
2090
- return {
2091
- regions: <Array<SardineRegion>>_data.regions
2092
- }
2093
- })
2094
- },
2095
- error => {
2096
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2097
- }
2098
- )
2099
- }
2100
-
2101
- sardineGetSupportedFiatCurrencies = (
2102
- headers?: object,
2103
- signal?: AbortSignal
2104
- ): Promise<SardineGetSupportedFiatCurrenciesReturn> => {
2105
- return this.fetch(this.url('SardineGetSupportedFiatCurrencies'), createHTTPRequest({}, headers, signal)).then(
2106
- res => {
2107
- return buildResponse(res).then(_data => {
2108
- return {
2109
- tokens: <Array<SardineFiatCurrency>>_data.tokens
2110
- }
2111
- })
2112
- },
2113
- error => {
2114
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2115
- }
2116
- )
1994
+ return this.fetch(
1995
+ this.url('SardineGetSupportedRegions'),
1996
+ createHTTPRequest({}, headers, signal)
1997
+ ).then((res) => {
1998
+ return buildResponse(res).then(_data => {
1999
+ return {
2000
+ regions: <Array<SardineRegion>>(_data.regions),
2001
+ }
2002
+ })
2003
+ }, (error) => {
2004
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2005
+ })
2006
+ }
2007
+
2008
+ sardineGetSupportedFiatCurrencies = (headers?: object, signal?: AbortSignal): Promise<SardineGetSupportedFiatCurrenciesReturn> => {
2009
+ return this.fetch(
2010
+ this.url('SardineGetSupportedFiatCurrencies'),
2011
+ createHTTPRequest({}, headers, signal)
2012
+ ).then((res) => {
2013
+ return buildResponse(res).then(_data => {
2014
+ return {
2015
+ tokens: <Array<SardineFiatCurrency>>(_data.tokens),
2016
+ }
2017
+ })
2018
+ }, (error) => {
2019
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2020
+ })
2117
2021
  }
2118
-
2022
+
2119
2023
  sardineGetSupportedTokens = (headers?: object, signal?: AbortSignal): Promise<SardineGetSupportedTokensReturn> => {
2120
- return this.fetch(this.url('SardineGetSupportedTokens'), createHTTPRequest({}, headers, signal)).then(
2121
- res => {
2122
- return buildResponse(res).then(_data => {
2123
- return {
2124
- tokens: <Array<SardineSupportedToken>>_data.tokens
2125
- }
2126
- })
2127
- },
2128
- error => {
2129
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2130
- }
2131
- )
2132
- }
2133
-
2134
- sardineGetSupportedTokenForSwap = (
2135
- args: SardineGetSupportedTokenForSwapArgs,
2136
- headers?: object,
2137
- signal?: AbortSignal
2138
- ): Promise<SardineGetSupportedTokenForSwapReturn> => {
2139
- return this.fetch(this.url('SardineGetSupportedTokenForSwap'), createHTTPRequest(args, headers, signal)).then(
2140
- res => {
2141
- return buildResponse(res).then(_data => {
2142
- return {
2143
- token: <SardineSupportedTokenForSwap>_data.token
2144
- }
2145
- })
2146
- },
2147
- error => {
2148
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2149
- }
2150
- )
2024
+ return this.fetch(
2025
+ this.url('SardineGetSupportedTokens'),
2026
+ createHTTPRequest({}, headers, signal)
2027
+ ).then((res) => {
2028
+ return buildResponse(res).then(_data => {
2029
+ return {
2030
+ tokens: <Array<SardineSupportedToken>>(_data.tokens),
2031
+ }
2032
+ })
2033
+ }, (error) => {
2034
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2035
+ })
2036
+ }
2037
+
2038
+ sardineGetSupportedTokenForSwap = (args: SardineGetSupportedTokenForSwapArgs, headers?: object, signal?: AbortSignal): Promise<SardineGetSupportedTokenForSwapReturn> => {
2039
+ return this.fetch(
2040
+ this.url('SardineGetSupportedTokenForSwap'),
2041
+ createHTTPRequest(args, headers, signal)).then((res) => {
2042
+ return buildResponse(res).then(_data => {
2043
+ return {
2044
+ token: <SardineSupportedTokenForSwap>(_data.token),
2045
+ }
2046
+ })
2047
+ }, (error) => {
2048
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2049
+ })
2151
2050
  }
2152
-
2051
+
2153
2052
  sardineGetEnabledTokens = (headers?: object, signal?: AbortSignal): Promise<SardineGetEnabledTokensReturn> => {
2154
- return this.fetch(this.url('SardineGetEnabledTokens'), createHTTPRequest({}, headers, signal)).then(
2155
- res => {
2156
- return buildResponse(res).then(_data => {
2157
- return {
2158
- tokens: <Array<SardineEnabledToken>>_data.tokens
2159
- }
2160
- })
2161
- },
2162
- error => {
2163
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2164
- }
2165
- )
2053
+ return this.fetch(
2054
+ this.url('SardineGetEnabledTokens'),
2055
+ createHTTPRequest({}, headers, signal)
2056
+ ).then((res) => {
2057
+ return buildResponse(res).then(_data => {
2058
+ return {
2059
+ tokens: <Array<SardineEnabledToken>>(_data.tokens),
2060
+ }
2061
+ })
2062
+ }, (error) => {
2063
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2064
+ })
2166
2065
  }
2167
-
2066
+
2168
2067
  sardineGetQuote = (args: SardineGetQuoteArgs, headers?: object, signal?: AbortSignal): Promise<SardineGetQuoteReturn> => {
2169
- return this.fetch(this.url('SardineGetQuote'), createHTTPRequest(args, headers, signal)).then(
2170
- res => {
2171
- return buildResponse(res).then(_data => {
2172
- return {
2173
- quote: <SardineQuote>_data.quote
2174
- }
2175
- })
2176
- },
2177
- error => {
2178
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2179
- }
2180
- )
2068
+ return this.fetch(
2069
+ this.url('SardineGetQuote'),
2070
+ createHTTPRequest(args, headers, signal)).then((res) => {
2071
+ return buildResponse(res).then(_data => {
2072
+ return {
2073
+ quote: <SardineQuote>(_data.quote),
2074
+ }
2075
+ })
2076
+ }, (error) => {
2077
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2078
+ })
2181
2079
  }
2182
-
2080
+
2183
2081
  getSardineClientToken = (headers?: object, signal?: AbortSignal): Promise<GetSardineClientTokenReturn> => {
2184
- return this.fetch(this.url('GetSardineClientToken'), createHTTPRequest({}, headers, signal)).then(
2185
- res => {
2186
- return buildResponse(res).then(_data => {
2187
- return {
2188
- token: <string>_data.token
2189
- }
2190
- })
2191
- },
2192
- error => {
2193
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2194
- }
2195
- )
2196
- }
2197
-
2198
- getSardineNFTCheckoutToken = (
2199
- args: GetSardineNFTCheckoutTokenArgs,
2200
- headers?: object,
2201
- signal?: AbortSignal
2202
- ): Promise<GetSardineNFTCheckoutTokenReturn> => {
2203
- return this.fetch(this.url('GetSardineNFTCheckoutToken'), createHTTPRequest(args, headers, signal)).then(
2204
- res => {
2205
- return buildResponse(res).then(_data => {
2206
- return {
2207
- resp: <SardineNFTCheckout>_data.resp
2208
- }
2209
- })
2210
- },
2211
- error => {
2212
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2213
- }
2214
- )
2215
- }
2216
-
2217
- getSardineNFTCheckoutOrderStatus = (
2218
- args: GetSardineNFTCheckoutOrderStatusArgs,
2219
- headers?: object,
2220
- signal?: AbortSignal
2221
- ): Promise<GetSardineNFTCheckoutOrderStatusReturn> => {
2222
- return this.fetch(this.url('GetSardineNFTCheckoutOrderStatus'), createHTTPRequest(args, headers, signal)).then(
2223
- res => {
2224
- return buildResponse(res).then(_data => {
2225
- return {
2226
- resp: <SardineOrder>_data.resp
2227
- }
2228
- })
2229
- },
2230
- error => {
2231
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2232
- }
2233
- )
2082
+ return this.fetch(
2083
+ this.url('GetSardineClientToken'),
2084
+ createHTTPRequest({}, headers, signal)
2085
+ ).then((res) => {
2086
+ return buildResponse(res).then(_data => {
2087
+ return {
2088
+ token: <string>(_data.token),
2089
+ }
2090
+ })
2091
+ }, (error) => {
2092
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2093
+ })
2094
+ }
2095
+
2096
+ getSardineNFTCheckoutToken = (args: GetSardineNFTCheckoutTokenArgs, headers?: object, signal?: AbortSignal): Promise<GetSardineNFTCheckoutTokenReturn> => {
2097
+ return this.fetch(
2098
+ this.url('GetSardineNFTCheckoutToken'),
2099
+ createHTTPRequest(args, headers, signal)).then((res) => {
2100
+ return buildResponse(res).then(_data => {
2101
+ return {
2102
+ resp: <SardineNFTCheckout>(_data.resp),
2103
+ }
2104
+ })
2105
+ }, (error) => {
2106
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2107
+ })
2108
+ }
2109
+
2110
+ getSardineNFTCheckoutOrderStatus = (args: GetSardineNFTCheckoutOrderStatusArgs, headers?: object, signal?: AbortSignal): Promise<GetSardineNFTCheckoutOrderStatusReturn> => {
2111
+ return this.fetch(
2112
+ this.url('GetSardineNFTCheckoutOrderStatus'),
2113
+ createHTTPRequest(args, headers, signal)).then((res) => {
2114
+ return buildResponse(res).then(_data => {
2115
+ return {
2116
+ resp: <SardineOrder>(_data.resp),
2117
+ }
2118
+ })
2119
+ }, (error) => {
2120
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2121
+ })
2234
2122
  }
2235
-
2123
+
2236
2124
  transakGetCountries = (headers?: object, signal?: AbortSignal): Promise<TransakGetCountriesReturn> => {
2237
- return this.fetch(this.url('TransakGetCountries'), createHTTPRequest({}, headers, signal)).then(
2238
- res => {
2239
- return buildResponse(res).then(_data => {
2240
- return {
2241
- regions: <Array<TransakCountry>>_data.regions
2242
- }
2243
- })
2244
- },
2245
- error => {
2246
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2247
- }
2248
- )
2125
+ return this.fetch(
2126
+ this.url('TransakGetCountries'),
2127
+ createHTTPRequest({}, headers, signal)
2128
+ ).then((res) => {
2129
+ return buildResponse(res).then(_data => {
2130
+ return {
2131
+ regions: <Array<TransakCountry>>(_data.regions),
2132
+ }
2133
+ })
2134
+ }, (error) => {
2135
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2136
+ })
2249
2137
  }
2250
-
2138
+
2251
2139
  transakGetCryptoCurrencies = (headers?: object, signal?: AbortSignal): Promise<TransakGetCryptoCurrenciesReturn> => {
2252
- return this.fetch(this.url('TransakGetCryptoCurrencies'), createHTTPRequest({}, headers, signal)).then(
2253
- res => {
2254
- return buildResponse(res).then(_data => {
2255
- return {
2256
- currencies: <Array<TransakCryptoCurrency>>_data.currencies
2257
- }
2258
- })
2259
- },
2260
- error => {
2261
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2262
- }
2263
- )
2140
+ return this.fetch(
2141
+ this.url('TransakGetCryptoCurrencies'),
2142
+ createHTTPRequest({}, headers, signal)
2143
+ ).then((res) => {
2144
+ return buildResponse(res).then(_data => {
2145
+ return {
2146
+ currencies: <Array<TransakCryptoCurrency>>(_data.currencies),
2147
+ }
2148
+ })
2149
+ }, (error) => {
2150
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2151
+ })
2264
2152
  }
2265
-
2153
+
2266
2154
  transakGetFiatCurrencies = (headers?: object, signal?: AbortSignal): Promise<TransakGetFiatCurrenciesReturn> => {
2267
- return this.fetch(this.url('TransakGetFiatCurrencies'), createHTTPRequest({}, headers, signal)).then(
2268
- res => {
2269
- return buildResponse(res).then(_data => {
2270
- return {
2271
- currencies: <Array<TransakFiatCurrency>>_data.currencies
2272
- }
2273
- })
2274
- },
2275
- error => {
2276
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2277
- }
2278
- )
2155
+ return this.fetch(
2156
+ this.url('TransakGetFiatCurrencies'),
2157
+ createHTTPRequest({}, headers, signal)
2158
+ ).then((res) => {
2159
+ return buildResponse(res).then(_data => {
2160
+ return {
2161
+ currencies: <Array<TransakFiatCurrency>>(_data.currencies),
2162
+ }
2163
+ })
2164
+ }, (error) => {
2165
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2166
+ })
2279
2167
  }
2280
-
2168
+
2281
2169
  transakGetPrice = (args: TransakGetPriceArgs, headers?: object, signal?: AbortSignal): Promise<TransakGetPriceReturn> => {
2282
- return this.fetch(this.url('TransakGetPrice'), createHTTPRequest(args, headers, signal)).then(
2283
- res => {
2284
- return buildResponse(res).then(_data => {
2285
- return {
2286
- price: <TransakPrice>_data.price
2287
- }
2288
- })
2289
- },
2290
- error => {
2291
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2292
- }
2293
- )
2294
- }
2295
-
2296
- transakGetSupportedNFTCheckoutChains = (
2297
- headers?: object,
2298
- signal?: AbortSignal
2299
- ): Promise<TransakGetSupportedNFTCheckoutChainsReturn> => {
2300
- return this.fetch(this.url('TransakGetSupportedNFTCheckoutChains'), createHTTPRequest({}, headers, signal)).then(
2301
- res => {
2302
- return buildResponse(res).then(_data => {
2303
- return {
2304
- chains: <Array<TransakChain>>_data.chains
2305
- }
2306
- })
2307
- },
2308
- error => {
2309
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2310
- }
2311
- )
2170
+ return this.fetch(
2171
+ this.url('TransakGetPrice'),
2172
+ createHTTPRequest(args, headers, signal)).then((res) => {
2173
+ return buildResponse(res).then(_data => {
2174
+ return {
2175
+ price: <TransakPrice>(_data.price),
2176
+ }
2177
+ })
2178
+ }, (error) => {
2179
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2180
+ })
2181
+ }
2182
+
2183
+ transakGetSupportedNFTCheckoutChains = (headers?: object, signal?: AbortSignal): Promise<TransakGetSupportedNFTCheckoutChainsReturn> => {
2184
+ return this.fetch(
2185
+ this.url('TransakGetSupportedNFTCheckoutChains'),
2186
+ createHTTPRequest({}, headers, signal)
2187
+ ).then((res) => {
2188
+ return buildResponse(res).then(_data => {
2189
+ return {
2190
+ chains: <Array<TransakChain>>(_data.chains),
2191
+ }
2192
+ })
2193
+ }, (error) => {
2194
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2195
+ })
2312
2196
  }
2313
-
2197
+
2314
2198
  getCoinPrices = (args: GetCoinPricesArgs, headers?: object, signal?: AbortSignal): Promise<GetCoinPricesReturn> => {
2315
- return this.fetch(this.url('GetCoinPrices'), createHTTPRequest(args, headers, signal)).then(
2316
- res => {
2317
- return buildResponse(res).then(_data => {
2318
- return {
2319
- tokenPrices: <Array<TokenPrice>>_data.tokenPrices
2320
- }
2321
- })
2322
- },
2323
- error => {
2324
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2325
- }
2326
- )
2327
- }
2328
-
2329
- getCollectiblePrices = (
2330
- args: GetCollectiblePricesArgs,
2331
- headers?: object,
2332
- signal?: AbortSignal
2333
- ): Promise<GetCollectiblePricesReturn> => {
2334
- return this.fetch(this.url('GetCollectiblePrices'), createHTTPRequest(args, headers, signal)).then(
2335
- res => {
2336
- return buildResponse(res).then(_data => {
2337
- return {
2338
- tokenPrices: <Array<TokenPrice>>_data.tokenPrices
2339
- }
2340
- })
2341
- },
2342
- error => {
2343
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2344
- }
2345
- )
2199
+ return this.fetch(
2200
+ this.url('GetCoinPrices'),
2201
+ createHTTPRequest(args, headers, signal)).then((res) => {
2202
+ return buildResponse(res).then(_data => {
2203
+ return {
2204
+ tokenPrices: <Array<TokenPrice>>(_data.tokenPrices),
2205
+ }
2206
+ })
2207
+ }, (error) => {
2208
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2209
+ })
2210
+ }
2211
+
2212
+ getCollectiblePrices = (args: GetCollectiblePricesArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectiblePricesReturn> => {
2213
+ return this.fetch(
2214
+ this.url('GetCollectiblePrices'),
2215
+ createHTTPRequest(args, headers, signal)).then((res) => {
2216
+ return buildResponse(res).then(_data => {
2217
+ return {
2218
+ tokenPrices: <Array<TokenPrice>>(_data.tokenPrices),
2219
+ }
2220
+ })
2221
+ }, (error) => {
2222
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2223
+ })
2346
2224
  }
2347
-
2225
+
2348
2226
  getExchangeRate = (args: GetExchangeRateArgs, headers?: object, signal?: AbortSignal): Promise<GetExchangeRateReturn> => {
2349
- return this.fetch(this.url('GetExchangeRate'), createHTTPRequest(args, headers, signal)).then(
2350
- res => {
2351
- return buildResponse(res).then(_data => {
2352
- return {
2353
- exchangeRate: <ExchangeRate>_data.exchangeRate
2354
- }
2355
- })
2356
- },
2357
- error => {
2358
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2359
- }
2360
- )
2227
+ return this.fetch(
2228
+ this.url('GetExchangeRate'),
2229
+ createHTTPRequest(args, headers, signal)).then((res) => {
2230
+ return buildResponse(res).then(_data => {
2231
+ return {
2232
+ exchangeRate: <ExchangeRate>(_data.exchangeRate),
2233
+ }
2234
+ })
2235
+ }, (error) => {
2236
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2237
+ })
2361
2238
  }
2362
-
2239
+
2363
2240
  memoryStore = (args: MemoryStoreArgs, headers?: object, signal?: AbortSignal): Promise<MemoryStoreReturn> => {
2364
- return this.fetch(this.url('MemoryStore'), createHTTPRequest(args, headers, signal)).then(
2365
- res => {
2366
- return buildResponse(res).then(_data => {
2367
- return {
2368
- ok: <boolean>_data.ok
2369
- }
2370
- })
2371
- },
2372
- error => {
2373
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2374
- }
2375
- )
2241
+ return this.fetch(
2242
+ this.url('MemoryStore'),
2243
+ createHTTPRequest(args, headers, signal)).then((res) => {
2244
+ return buildResponse(res).then(_data => {
2245
+ return {
2246
+ ok: <boolean>(_data.ok),
2247
+ }
2248
+ })
2249
+ }, (error) => {
2250
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2251
+ })
2376
2252
  }
2377
-
2253
+
2378
2254
  memoryLoad = (args: MemoryLoadArgs, headers?: object, signal?: AbortSignal): Promise<MemoryLoadReturn> => {
2379
- return this.fetch(this.url('MemoryLoad'), createHTTPRequest(args, headers, signal)).then(
2380
- res => {
2381
- return buildResponse(res).then(_data => {
2382
- return {
2383
- value: <string>_data.value
2384
- }
2385
- })
2386
- },
2387
- error => {
2388
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2389
- }
2390
- )
2255
+ return this.fetch(
2256
+ this.url('MemoryLoad'),
2257
+ createHTTPRequest(args, headers, signal)).then((res) => {
2258
+ return buildResponse(res).then(_data => {
2259
+ return {
2260
+ value: <string>(_data.value),
2261
+ }
2262
+ })
2263
+ }, (error) => {
2264
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2265
+ })
2391
2266
  }
2392
-
2267
+
2393
2268
  getInviteInfo = (headers?: object, signal?: AbortSignal): Promise<GetInviteInfoReturn> => {
2394
- return this.fetch(this.url('GetInviteInfo'), createHTTPRequest({}, headers, signal)).then(
2395
- res => {
2396
- return buildResponse(res).then(_data => {
2397
- return {
2398
- inviteInfo: <InviteInfo>_data.inviteInfo
2399
- }
2400
- })
2401
- },
2402
- error => {
2403
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2404
- }
2405
- )
2269
+ return this.fetch(
2270
+ this.url('GetInviteInfo'),
2271
+ createHTTPRequest({}, headers, signal)
2272
+ ).then((res) => {
2273
+ return buildResponse(res).then(_data => {
2274
+ return {
2275
+ inviteInfo: <InviteInfo>(_data.inviteInfo),
2276
+ }
2277
+ })
2278
+ }, (error) => {
2279
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2280
+ })
2406
2281
  }
2407
-
2282
+
2408
2283
  isValidAccessCode = (args: IsValidAccessCodeArgs, headers?: object, signal?: AbortSignal): Promise<IsValidAccessCodeReturn> => {
2409
- return this.fetch(this.url('IsValidAccessCode'), createHTTPRequest(args, headers, signal)).then(
2410
- res => {
2411
- return buildResponse(res).then(_data => {
2412
- return {
2413
- status: <boolean>_data.status
2414
- }
2415
- })
2416
- },
2417
- error => {
2418
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2419
- }
2420
- )
2421
- }
2422
-
2423
- internalClaimAccessCode = (
2424
- args: InternalClaimAccessCodeArgs,
2425
- headers?: object,
2426
- signal?: AbortSignal
2427
- ): Promise<InternalClaimAccessCodeReturn> => {
2428
- return this.fetch(this.url('InternalClaimAccessCode'), createHTTPRequest(args, headers, signal)).then(
2429
- res => {
2430
- return buildResponse(res).then(_data => {
2431
- return {
2432
- status: <boolean>_data.status
2433
- }
2434
- })
2435
- },
2436
- error => {
2437
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2438
- }
2439
- )
2284
+ return this.fetch(
2285
+ this.url('IsValidAccessCode'),
2286
+ createHTTPRequest(args, headers, signal)).then((res) => {
2287
+ return buildResponse(res).then(_data => {
2288
+ return {
2289
+ status: <boolean>(_data.status),
2290
+ }
2291
+ })
2292
+ }, (error) => {
2293
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2294
+ })
2295
+ }
2296
+
2297
+ internalClaimAccessCode = (args: InternalClaimAccessCodeArgs, headers?: object, signal?: AbortSignal): Promise<InternalClaimAccessCodeReturn> => {
2298
+ return this.fetch(
2299
+ this.url('InternalClaimAccessCode'),
2300
+ createHTTPRequest(args, headers, signal)).then((res) => {
2301
+ return buildResponse(res).then(_data => {
2302
+ return {
2303
+ status: <boolean>(_data.status),
2304
+ }
2305
+ })
2306
+ }, (error) => {
2307
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2308
+ })
2440
2309
  }
2441
-
2310
+
2442
2311
  blockNumberAtTime = (args: BlockNumberAtTimeArgs, headers?: object, signal?: AbortSignal): Promise<BlockNumberAtTimeReturn> => {
2443
- return this.fetch(this.url('BlockNumberAtTime'), createHTTPRequest(args, headers, signal)).then(
2444
- res => {
2445
- return buildResponse(res).then(_data => {
2446
- return {
2447
- blocks: <Array<number>>_data.blocks
2448
- }
2449
- })
2450
- },
2451
- error => {
2452
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2453
- }
2454
- )
2455
- }
2456
-
2457
- paperSessionSecret = (
2458
- args: PaperSessionSecretArgs,
2459
- headers?: object,
2460
- signal?: AbortSignal
2461
- ): Promise<PaperSessionSecretReturn> => {
2462
- return this.fetch(this.url('PaperSessionSecret'), createHTTPRequest(args, headers, signal)).then(
2463
- res => {
2464
- return buildResponse(res).then(_data => {
2465
- return {
2466
- secret: <string>_data.secret
2467
- }
2468
- })
2469
- },
2470
- error => {
2471
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2472
- }
2473
- )
2474
- }
2475
-
2476
- paperSessionSecret2 = (
2477
- args: PaperSessionSecret2Args,
2478
- headers?: object,
2479
- signal?: AbortSignal
2480
- ): Promise<PaperSessionSecret2Return> => {
2481
- return this.fetch(this.url('PaperSessionSecret2'), createHTTPRequest(args, headers, signal)).then(
2482
- res => {
2483
- return buildResponse(res).then(_data => {
2484
- return {
2485
- secret: <string>_data.secret
2486
- }
2487
- })
2488
- },
2489
- error => {
2490
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2491
- }
2492
- )
2312
+ return this.fetch(
2313
+ this.url('BlockNumberAtTime'),
2314
+ createHTTPRequest(args, headers, signal)).then((res) => {
2315
+ return buildResponse(res).then(_data => {
2316
+ return {
2317
+ blocks: <Array<number>>(_data.blocks),
2318
+ }
2319
+ })
2320
+ }, (error) => {
2321
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2322
+ })
2323
+ }
2324
+
2325
+ paperSessionSecret = (args: PaperSessionSecretArgs, headers?: object, signal?: AbortSignal): Promise<PaperSessionSecretReturn> => {
2326
+ return this.fetch(
2327
+ this.url('PaperSessionSecret'),
2328
+ createHTTPRequest(args, headers, signal)).then((res) => {
2329
+ return buildResponse(res).then(_data => {
2330
+ return {
2331
+ secret: <string>(_data.secret),
2332
+ }
2333
+ })
2334
+ }, (error) => {
2335
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2336
+ })
2337
+ }
2338
+
2339
+ paperSessionSecret2 = (args: PaperSessionSecret2Args, headers?: object, signal?: AbortSignal): Promise<PaperSessionSecret2Return> => {
2340
+ return this.fetch(
2341
+ this.url('PaperSessionSecret2'),
2342
+ createHTTPRequest(args, headers, signal)).then((res) => {
2343
+ return buildResponse(res).then(_data => {
2344
+ return {
2345
+ secret: <string>(_data.secret),
2346
+ }
2347
+ })
2348
+ }, (error) => {
2349
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2350
+ })
2493
2351
  }
2494
-
2352
+
2495
2353
  linkWallet = (args: LinkWalletArgs, headers?: object, signal?: AbortSignal): Promise<LinkWalletReturn> => {
2496
- return this.fetch(this.url('LinkWallet'), createHTTPRequest(args, headers, signal)).then(
2497
- res => {
2498
- return buildResponse(res).then(_data => {
2499
- return {
2500
- status: <boolean>_data.status
2501
- }
2502
- })
2503
- },
2504
- error => {
2505
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2506
- }
2507
- )
2354
+ return this.fetch(
2355
+ this.url('LinkWallet'),
2356
+ createHTTPRequest(args, headers, signal)).then((res) => {
2357
+ return buildResponse(res).then(_data => {
2358
+ return {
2359
+ status: <boolean>(_data.status),
2360
+ }
2361
+ })
2362
+ }, (error) => {
2363
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2364
+ })
2508
2365
  }
2509
-
2366
+
2510
2367
  getLinkedWallets = (args: GetLinkedWalletsArgs, headers?: object, signal?: AbortSignal): Promise<GetLinkedWalletsReturn> => {
2511
- return this.fetch(this.url('GetLinkedWallets'), createHTTPRequest(args, headers, signal)).then(
2512
- res => {
2513
- return buildResponse(res).then(_data => {
2514
- return {
2515
- linkedWallets: <Array<LinkedWallet>>_data.linkedWallets
2516
- }
2517
- })
2518
- },
2519
- error => {
2520
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2521
- }
2522
- )
2523
- }
2524
-
2525
- removeLinkedWallet = (
2526
- args: RemoveLinkedWalletArgs,
2527
- headers?: object,
2528
- signal?: AbortSignal
2529
- ): Promise<RemoveLinkedWalletReturn> => {
2530
- return this.fetch(this.url('RemoveLinkedWallet'), createHTTPRequest(args, headers, signal)).then(
2531
- res => {
2532
- return buildResponse(res).then(_data => {
2533
- return {
2534
- status: <boolean>_data.status
2535
- }
2536
- })
2537
- },
2538
- error => {
2539
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2540
- }
2541
- )
2542
- }
2543
-
2544
- generateWaaSVerificationURL = (
2545
- args: GenerateWaaSVerificationURLArgs,
2546
- headers?: object,
2547
- signal?: AbortSignal
2548
- ): Promise<GenerateWaaSVerificationURLReturn> => {
2549
- return this.fetch(this.url('GenerateWaaSVerificationURL'), createHTTPRequest(args, headers, signal)).then(
2550
- res => {
2551
- return buildResponse(res).then(_data => {
2552
- return {
2553
- nonce: <string>_data.nonce,
2554
- verificationURL: <string>_data.verificationURL
2555
- }
2556
- })
2557
- },
2558
- error => {
2559
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2560
- }
2561
- )
2562
- }
2563
-
2564
- validateWaaSVerificationNonce = (
2565
- args: ValidateWaaSVerificationNonceArgs,
2566
- headers?: object,
2567
- signal?: AbortSignal
2568
- ): Promise<ValidateWaaSVerificationNonceReturn> => {
2569
- return this.fetch(this.url('ValidateWaaSVerificationNonce'), createHTTPRequest(args, headers, signal)).then(
2570
- res => {
2571
- return buildResponse(res).then(_data => {
2572
- return {
2573
- walletAddress: <string>_data.walletAddress
2574
- }
2575
- })
2576
- },
2577
- error => {
2578
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2579
- }
2580
- )
2581
- }
2582
-
2583
- listAdoptedWallets = (
2584
- args: ListAdoptedWalletsArgs,
2585
- headers?: object,
2586
- signal?: AbortSignal
2587
- ): Promise<ListAdoptedWalletsReturn> => {
2588
- return this.fetch(this.url('ListAdoptedWallets'), createHTTPRequest(args, headers, signal)).then(
2589
- res => {
2590
- return buildResponse(res).then(_data => {
2591
- return {
2592
- page: <Page>_data.page,
2593
- wallets: <Array<AdoptedChildWallet>>_data.wallets
2594
- }
2595
- })
2596
- },
2597
- error => {
2598
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2599
- }
2600
- )
2601
- }
2602
-
2603
- getSwapPermit2Price = (
2604
- args: GetSwapPermit2PriceArgs,
2605
- headers?: object,
2606
- signal?: AbortSignal
2607
- ): Promise<GetSwapPermit2PriceReturn> => {
2608
- return this.fetch(this.url('GetSwapPermit2Price'), createHTTPRequest(args, headers, signal)).then(
2609
- res => {
2610
- return buildResponse(res).then(_data => {
2611
- return {
2612
- swapPermit2Price: <SwapPermit2Price>_data.swapPermit2Price
2613
- }
2614
- })
2615
- },
2616
- error => {
2617
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2618
- }
2619
- )
2620
- }
2621
-
2622
- getSwapPermit2Prices = (
2623
- args: GetSwapPermit2PricesArgs,
2624
- headers?: object,
2625
- signal?: AbortSignal
2626
- ): Promise<GetSwapPermit2PricesReturn> => {
2627
- return this.fetch(this.url('GetSwapPermit2Prices'), createHTTPRequest(args, headers, signal)).then(
2628
- res => {
2629
- return buildResponse(res).then(_data => {
2630
- return {
2631
- swapPermit2Prices: <Array<SwapPermit2Price>>_data.swapPermit2Prices
2632
- }
2633
- })
2634
- },
2635
- error => {
2636
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2637
- }
2638
- )
2639
- }
2640
-
2641
- getSwapPermit2Quote = (
2642
- args: GetSwapPermit2QuoteArgs,
2643
- headers?: object,
2644
- signal?: AbortSignal
2645
- ): Promise<GetSwapPermit2QuoteReturn> => {
2646
- return this.fetch(this.url('GetSwapPermit2Quote'), createHTTPRequest(args, headers, signal)).then(
2647
- res => {
2648
- return buildResponse(res).then(_data => {
2649
- return {
2650
- swapPermit2Quote: <SwapPermit2Quote>_data.swapPermit2Quote
2651
- }
2652
- })
2653
- },
2654
- error => {
2655
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2656
- }
2657
- )
2658
- }
2659
-
2660
- getSwapPrice = (args: GetSwapPriceArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPriceReturn> => {
2661
- return this.fetch(this.url('GetSwapPrice'), createHTTPRequest(args, headers, signal)).then(
2662
- res => {
2663
- return buildResponse(res).then(_data => {
2664
- return {
2665
- swapPrice: <SwapPrice>_data.swapPrice
2666
- }
2667
- })
2668
- },
2669
- error => {
2670
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2671
- }
2672
- )
2673
- }
2674
-
2675
- getSwapPrices = (args: GetSwapPricesArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPricesReturn> => {
2676
- return this.fetch(this.url('GetSwapPrices'), createHTTPRequest(args, headers, signal)).then(
2677
- res => {
2678
- return buildResponse(res).then(_data => {
2679
- return {
2680
- swapPrices: <Array<SwapPrice>>_data.swapPrices
2681
- }
2682
- })
2683
- },
2684
- error => {
2685
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2686
- }
2687
- )
2688
- }
2689
-
2690
- getSwapQuote = (args: GetSwapQuoteArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapQuoteReturn> => {
2691
- return this.fetch(this.url('GetSwapQuote'), createHTTPRequest(args, headers, signal)).then(
2692
- res => {
2693
- return buildResponse(res).then(_data => {
2694
- return {
2695
- swapQuote: <SwapQuote>_data.swapQuote
2696
- }
2697
- })
2698
- },
2699
- error => {
2700
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2701
- }
2702
- )
2703
- }
2704
-
2705
- getSwapQuoteV2 = (args: GetSwapQuoteV2Args, headers?: object, signal?: AbortSignal): Promise<GetSwapQuoteV2Return> => {
2706
- return this.fetch(this.url('GetSwapQuoteV2'), createHTTPRequest(args, headers, signal)).then(
2707
- res => {
2708
- return buildResponse(res).then(_data => {
2709
- return {
2710
- swapQuote: <SwapQuote>_data.swapQuote
2711
- }
2712
- })
2713
- },
2714
- error => {
2715
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2716
- }
2717
- )
2718
- }
2719
-
2720
- intentQuery = (args: IntentQueryArgs, headers?: object, signal?: AbortSignal): Promise<IntentQueryReturn> => {
2721
- return this.fetch(this.url('IntentQuery'), createHTTPRequest(args, headers, signal)).then(
2722
- res => {
2723
- return buildResponse(res).then(_data => {
2724
- return {
2725
- solutions: <Array<IntentSolution>>_data.solutions
2726
- }
2727
- })
2728
- },
2729
- error => {
2730
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2731
- }
2732
- )
2368
+ return this.fetch(
2369
+ this.url('GetLinkedWallets'),
2370
+ createHTTPRequest(args, headers, signal)).then((res) => {
2371
+ return buildResponse(res).then(_data => {
2372
+ return {
2373
+ linkedWallets: <Array<LinkedWallet>>(_data.linkedWallets),
2374
+ }
2375
+ })
2376
+ }, (error) => {
2377
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2378
+ })
2379
+ }
2380
+
2381
+ removeLinkedWallet = (args: RemoveLinkedWalletArgs, headers?: object, signal?: AbortSignal): Promise<RemoveLinkedWalletReturn> => {
2382
+ return this.fetch(
2383
+ this.url('RemoveLinkedWallet'),
2384
+ createHTTPRequest(args, headers, signal)).then((res) => {
2385
+ return buildResponse(res).then(_data => {
2386
+ return {
2387
+ status: <boolean>(_data.status),
2388
+ }
2389
+ })
2390
+ }, (error) => {
2391
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2392
+ })
2393
+ }
2394
+
2395
+ generateWaaSVerificationURL = (args: GenerateWaaSVerificationURLArgs, headers?: object, signal?: AbortSignal): Promise<GenerateWaaSVerificationURLReturn> => {
2396
+ return this.fetch(
2397
+ this.url('GenerateWaaSVerificationURL'),
2398
+ createHTTPRequest(args, headers, signal)).then((res) => {
2399
+ return buildResponse(res).then(_data => {
2400
+ return {
2401
+ nonce: <string>(_data.nonce),
2402
+ verificationURL: <string>(_data.verificationURL),
2403
+ }
2404
+ })
2405
+ }, (error) => {
2406
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2407
+ })
2408
+ }
2409
+
2410
+ validateWaaSVerificationNonce = (args: ValidateWaaSVerificationNonceArgs, headers?: object, signal?: AbortSignal): Promise<ValidateWaaSVerificationNonceReturn> => {
2411
+ return this.fetch(
2412
+ this.url('ValidateWaaSVerificationNonce'),
2413
+ createHTTPRequest(args, headers, signal)).then((res) => {
2414
+ return buildResponse(res).then(_data => {
2415
+ return {
2416
+ walletAddress: <string>(_data.walletAddress),
2417
+ }
2418
+ })
2419
+ }, (error) => {
2420
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2421
+ })
2422
+ }
2423
+
2424
+ listAdoptedWallets = (args: ListAdoptedWalletsArgs, headers?: object, signal?: AbortSignal): Promise<ListAdoptedWalletsReturn> => {
2425
+ return this.fetch(
2426
+ this.url('ListAdoptedWallets'),
2427
+ createHTTPRequest(args, headers, signal)).then((res) => {
2428
+ return buildResponse(res).then(_data => {
2429
+ return {
2430
+ page: <Page>(_data.page),
2431
+ wallets: <Array<AdoptedChildWallet>>(_data.wallets),
2432
+ }
2433
+ })
2434
+ }, (error) => {
2435
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2436
+ })
2437
+ }
2438
+
2439
+ getLifiChains = (headers?: object, signal?: AbortSignal): Promise<GetLifiChainsReturn> => {
2440
+ return this.fetch(
2441
+ this.url('GetLifiChains'),
2442
+ createHTTPRequest({}, headers, signal)
2443
+ ).then((res) => {
2444
+ return buildResponse(res).then(_data => {
2445
+ return {
2446
+ chains: <Array<number>>(_data.chains),
2447
+ }
2448
+ })
2449
+ }, (error) => {
2450
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2451
+ })
2452
+ }
2453
+
2454
+ getLifiTokens = (args: GetLifiTokensArgs, headers?: object, signal?: AbortSignal): Promise<GetLifiTokensReturn> => {
2455
+ return this.fetch(
2456
+ this.url('GetLifiTokens'),
2457
+ createHTTPRequest(args, headers, signal)).then((res) => {
2458
+ return buildResponse(res).then(_data => {
2459
+ return {
2460
+ tokens: <Array<Token>>(_data.tokens),
2461
+ }
2462
+ })
2463
+ }, (error) => {
2464
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2465
+ })
2466
+ }
2467
+
2468
+ getLifiSwapRoutes = (args: GetLifiSwapRoutesArgs, headers?: object, signal?: AbortSignal): Promise<GetLifiSwapRoutesReturn> => {
2469
+ return this.fetch(
2470
+ this.url('GetLifiSwapRoutes'),
2471
+ createHTTPRequest(args, headers, signal)).then((res) => {
2472
+ return buildResponse(res).then(_data => {
2473
+ return {
2474
+ routes: <Array<LifiSwapRoute>>(_data.routes),
2475
+ }
2476
+ })
2477
+ }, (error) => {
2478
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2479
+ })
2480
+ }
2481
+
2482
+ getLifiSwapQuote = (args: GetLifiSwapQuoteArgs, headers?: object, signal?: AbortSignal): Promise<GetLifiSwapQuoteReturn> => {
2483
+ return this.fetch(
2484
+ this.url('GetLifiSwapQuote'),
2485
+ createHTTPRequest(args, headers, signal)).then((res) => {
2486
+ return buildResponse(res).then(_data => {
2487
+ return {
2488
+ quote: <LifiSwapQuote>(_data.quote),
2489
+ }
2490
+ })
2491
+ }, (error) => {
2492
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2493
+ })
2733
2494
  }
2734
-
2495
+
2735
2496
  listCurrencyGroups = (headers?: object, signal?: AbortSignal): Promise<ListCurrencyGroupsReturn> => {
2736
- return this.fetch(this.url('ListCurrencyGroups'), createHTTPRequest({}, headers, signal)).then(
2737
- res => {
2738
- return buildResponse(res).then(_data => {
2739
- return {
2740
- currencyGroups: <Array<CurrencyGroup>>_data.currencyGroups
2741
- }
2742
- })
2743
- },
2744
- error => {
2745
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2746
- }
2747
- )
2748
- }
2749
-
2750
- addOffchainInventory = (
2751
- args: AddOffchainInventoryArgs,
2752
- headers?: object,
2753
- signal?: AbortSignal
2754
- ): Promise<AddOffchainInventoryReturn> => {
2755
- return this.fetch(this.url('AddOffchainInventory'), createHTTPRequest(args, headers, signal)).then(
2756
- res => {
2757
- return buildResponse(res).then(_data => {
2758
- return {
2759
- inventoryId: <number>_data.inventoryId
2760
- }
2761
- })
2762
- },
2763
- error => {
2764
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2765
- }
2766
- )
2767
- }
2768
-
2769
- getOffchainInventory = (
2770
- args: GetOffchainInventoryArgs,
2771
- headers?: object,
2772
- signal?: AbortSignal
2773
- ): Promise<GetOffchainInventoryReturn> => {
2774
- return this.fetch(this.url('GetOffchainInventory'), createHTTPRequest(args, headers, signal)).then(
2775
- res => {
2776
- return buildResponse(res).then(_data => {
2777
- return {
2778
- inventory: <OffchainInventory>_data.inventory
2779
- }
2780
- })
2781
- },
2782
- error => {
2783
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2784
- }
2785
- )
2786
- }
2787
-
2788
- listOffchainInventories = (
2789
- args: ListOffchainInventoriesArgs,
2790
- headers?: object,
2791
- signal?: AbortSignal
2792
- ): Promise<ListOffchainInventoriesReturn> => {
2793
- return this.fetch(this.url('ListOffchainInventories'), createHTTPRequest(args, headers, signal)).then(
2794
- res => {
2795
- return buildResponse(res).then(_data => {
2796
- return {
2797
- inventory: <Array<OffchainInventory>>_data.inventory
2798
- }
2799
- })
2800
- },
2801
- error => {
2802
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2803
- }
2804
- )
2805
- }
2806
-
2807
- updateOffchainInventory = (
2808
- args: UpdateOffchainInventoryArgs,
2809
- headers?: object,
2810
- signal?: AbortSignal
2811
- ): Promise<UpdateOffchainInventoryReturn> => {
2812
- return this.fetch(this.url('UpdateOffchainInventory'), createHTTPRequest(args, headers, signal)).then(
2813
- res => {
2814
- return buildResponse(res).then(_data => {
2815
- return {}
2816
- })
2817
- },
2818
- error => {
2819
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2820
- }
2821
- )
2822
- }
2823
-
2824
- deleteOffchainInventory = (
2825
- args: DeleteOffchainInventoryArgs,
2826
- headers?: object,
2827
- signal?: AbortSignal
2828
- ): Promise<DeleteOffchainInventoryReturn> => {
2829
- return this.fetch(this.url('DeleteOffchainInventory'), createHTTPRequest(args, headers, signal)).then(
2830
- res => {
2831
- return buildResponse(res).then(_data => {
2832
- return {
2833
- ok: <boolean>_data.ok
2834
- }
2835
- })
2836
- },
2837
- error => {
2838
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2839
- }
2840
- )
2841
- }
2842
-
2843
- requestOffchainPayment = (
2844
- args: RequestOffchainPaymentArgs,
2845
- headers?: object,
2846
- signal?: AbortSignal
2847
- ): Promise<RequestOffchainPaymentReturn> => {
2848
- return this.fetch(this.url('RequestOffchainPayment'), createHTTPRequest(args, headers, signal)).then(
2849
- res => {
2850
- return buildResponse(res).then(_data => {
2851
- return {
2852
- payment: <PaymentResponse>_data.payment
2853
- }
2854
- })
2855
- },
2856
- error => {
2857
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2858
- }
2859
- )
2860
- }
2861
-
2862
- listOffchainPayments = (
2863
- args: ListOffchainPaymentsArgs,
2864
- headers?: object,
2865
- signal?: AbortSignal
2866
- ): Promise<ListOffchainPaymentsReturn> => {
2867
- return this.fetch(this.url('ListOffchainPayments'), createHTTPRequest(args, headers, signal)).then(
2868
- res => {
2869
- return buildResponse(res).then(_data => {
2870
- return {
2871
- page: <Page>_data.page,
2872
- payments: <Array<OffchainPayment>>_data.payments
2873
- }
2874
- })
2875
- },
2876
- error => {
2877
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2878
- }
2879
- )
2497
+ return this.fetch(
2498
+ this.url('ListCurrencyGroups'),
2499
+ createHTTPRequest({}, headers, signal)
2500
+ ).then((res) => {
2501
+ return buildResponse(res).then(_data => {
2502
+ return {
2503
+ currencyGroups: <Array<CurrencyGroup>>(_data.currencyGroups),
2504
+ }
2505
+ })
2506
+ }, (error) => {
2507
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2508
+ })
2509
+ }
2510
+
2511
+ addOffchainInventory = (args: AddOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise<AddOffchainInventoryReturn> => {
2512
+ return this.fetch(
2513
+ this.url('AddOffchainInventory'),
2514
+ createHTTPRequest(args, headers, signal)).then((res) => {
2515
+ return buildResponse(res).then(_data => {
2516
+ return {
2517
+ inventoryId: <number>(_data.inventoryId),
2518
+ }
2519
+ })
2520
+ }, (error) => {
2521
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2522
+ })
2523
+ }
2524
+
2525
+ getOffchainInventory = (args: GetOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise<GetOffchainInventoryReturn> => {
2526
+ return this.fetch(
2527
+ this.url('GetOffchainInventory'),
2528
+ createHTTPRequest(args, headers, signal)).then((res) => {
2529
+ return buildResponse(res).then(_data => {
2530
+ return {
2531
+ inventory: <OffchainInventory>(_data.inventory),
2532
+ }
2533
+ })
2534
+ }, (error) => {
2535
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2536
+ })
2537
+ }
2538
+
2539
+ listOffchainInventories = (args: ListOffchainInventoriesArgs, headers?: object, signal?: AbortSignal): Promise<ListOffchainInventoriesReturn> => {
2540
+ return this.fetch(
2541
+ this.url('ListOffchainInventories'),
2542
+ createHTTPRequest(args, headers, signal)).then((res) => {
2543
+ return buildResponse(res).then(_data => {
2544
+ return {
2545
+ inventory: <Array<OffchainInventory>>(_data.inventory),
2546
+ }
2547
+ })
2548
+ }, (error) => {
2549
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2550
+ })
2551
+ }
2552
+
2553
+ updateOffchainInventory = (args: UpdateOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise<UpdateOffchainInventoryReturn> => {
2554
+ return this.fetch(
2555
+ this.url('UpdateOffchainInventory'),
2556
+ createHTTPRequest(args, headers, signal)).then((res) => {
2557
+ return buildResponse(res).then(_data => {
2558
+ return {}
2559
+ })
2560
+ }, (error) => {
2561
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2562
+ })
2563
+ }
2564
+
2565
+ deleteOffchainInventory = (args: DeleteOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise<DeleteOffchainInventoryReturn> => {
2566
+ return this.fetch(
2567
+ this.url('DeleteOffchainInventory'),
2568
+ createHTTPRequest(args, headers, signal)).then((res) => {
2569
+ return buildResponse(res).then(_data => {
2570
+ return {
2571
+ ok: <boolean>(_data.ok),
2572
+ }
2573
+ })
2574
+ }, (error) => {
2575
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2576
+ })
2577
+ }
2578
+
2579
+ requestOffchainPayment = (args: RequestOffchainPaymentArgs, headers?: object, signal?: AbortSignal): Promise<RequestOffchainPaymentReturn> => {
2580
+ return this.fetch(
2581
+ this.url('RequestOffchainPayment'),
2582
+ createHTTPRequest(args, headers, signal)).then((res) => {
2583
+ return buildResponse(res).then(_data => {
2584
+ return {
2585
+ payment: <PaymentResponse>(_data.payment),
2586
+ }
2587
+ })
2588
+ }, (error) => {
2589
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2590
+ })
2591
+ }
2592
+
2593
+ listOffchainPayments = (args: ListOffchainPaymentsArgs, headers?: object, signal?: AbortSignal): Promise<ListOffchainPaymentsReturn> => {
2594
+ return this.fetch(
2595
+ this.url('ListOffchainPayments'),
2596
+ createHTTPRequest(args, headers, signal)).then((res) => {
2597
+ return buildResponse(res).then(_data => {
2598
+ return {
2599
+ page: <Page>(_data.page),
2600
+ payments: <Array<OffchainPayment>>(_data.payments),
2601
+ }
2602
+ })
2603
+ }, (error) => {
2604
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2605
+ })
2880
2606
  }
2881
-
2607
+
2882
2608
  savePack = (args: SavePackArgs, headers?: object, signal?: AbortSignal): Promise<SavePackReturn> => {
2883
- return this.fetch(this.url('SavePack'), createHTTPRequest(args, headers, signal)).then(
2884
- res => {
2885
- return buildResponse(res).then(_data => {
2886
- return {
2887
- merkleRoot: <string>_data.merkleRoot
2888
- }
2889
- })
2890
- },
2891
- error => {
2892
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2893
- }
2894
- )
2609
+ return this.fetch(
2610
+ this.url('SavePack'),
2611
+ createHTTPRequest(args, headers, signal)).then((res) => {
2612
+ return buildResponse(res).then(_data => {
2613
+ return {
2614
+ merkleRoot: <string>(_data.merkleRoot),
2615
+ }
2616
+ })
2617
+ }, (error) => {
2618
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2619
+ })
2895
2620
  }
2896
-
2621
+
2897
2622
  getPack = (args: GetPackArgs, headers?: object, signal?: AbortSignal): Promise<GetPackReturn> => {
2898
- return this.fetch(this.url('GetPack'), createHTTPRequest(args, headers, signal)).then(
2899
- res => {
2900
- return buildResponse(res).then(_data => {
2901
- return {
2902
- pack: <Pack>_data.pack
2903
- }
2904
- })
2905
- },
2906
- error => {
2907
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2908
- }
2909
- )
2623
+ return this.fetch(
2624
+ this.url('GetPack'),
2625
+ createHTTPRequest(args, headers, signal)).then((res) => {
2626
+ return buildResponse(res).then(_data => {
2627
+ return {
2628
+ pack: <Pack>(_data.pack),
2629
+ }
2630
+ })
2631
+ }, (error) => {
2632
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2633
+ })
2910
2634
  }
2911
-
2635
+
2912
2636
  deletePack = (args: DeletePackArgs, headers?: object, signal?: AbortSignal): Promise<DeletePackReturn> => {
2913
- return this.fetch(this.url('DeletePack'), createHTTPRequest(args, headers, signal)).then(
2914
- res => {
2915
- return buildResponse(res).then(_data => {
2916
- return {
2917
- status: <boolean>_data.status
2918
- }
2919
- })
2920
- },
2921
- error => {
2922
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2923
- }
2924
- )
2637
+ return this.fetch(
2638
+ this.url('DeletePack'),
2639
+ createHTTPRequest(args, headers, signal)).then((res) => {
2640
+ return buildResponse(res).then(_data => {
2641
+ return {
2642
+ status: <boolean>(_data.status),
2643
+ }
2644
+ })
2645
+ }, (error) => {
2646
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2647
+ })
2925
2648
  }
2926
-
2649
+
2927
2650
  updatePackContent = (args: UpdatePackContentArgs, headers?: object, signal?: AbortSignal): Promise<UpdatePackContentReturn> => {
2928
- return this.fetch(this.url('UpdatePackContent'), createHTTPRequest(args, headers, signal)).then(
2929
- res => {
2930
- return buildResponse(res).then(_data => {
2931
- return {
2932
- merkleRoot: <string>_data.merkleRoot
2933
- }
2934
- })
2935
- },
2936
- error => {
2937
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2938
- }
2939
- )
2651
+ return this.fetch(
2652
+ this.url('UpdatePackContent'),
2653
+ createHTTPRequest(args, headers, signal)).then((res) => {
2654
+ return buildResponse(res).then(_data => {
2655
+ return {
2656
+ merkleRoot: <string>(_data.merkleRoot),
2657
+ }
2658
+ })
2659
+ }, (error) => {
2660
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
2661
+ })
2940
2662
  }
2663
+
2941
2664
  }
2942
2665
 
2943
- const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => {
2944
- const reqHeaders: { [key: string]: string } = { ...headers, 'Content-Type': 'application/json' }
2666
+ const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => {
2667
+ const reqHeaders: {[key: string]: string} = { ...headers, 'Content-Type': 'application/json' }
2945
2668
  reqHeaders[WebrpcHeader] = WebrpcHeaderValue
2946
2669
 
2947
2670
  return {
@@ -2957,18 +2680,18 @@ const buildResponse = (res: Response): Promise<any> => {
2957
2680
  let data
2958
2681
  try {
2959
2682
  data = JSON.parse(text)
2960
- } catch (error) {
2683
+ } catch(error) {
2961
2684
  let message = ''
2962
- if (error instanceof Error) {
2685
+ if (error instanceof Error) {
2963
2686
  message = error.message
2964
2687
  }
2965
2688
  throw WebrpcBadResponseError.new({
2966
2689
  status: res.status,
2967
- cause: `JSON.parse(): ${message}: response text: ${text}`
2968
- })
2690
+ cause: `JSON.parse(): ${message}: response text: ${text}`},
2691
+ )
2969
2692
  }
2970
2693
  if (!res.ok) {
2971
- const code: number = typeof data.code === 'number' ? data.code : 0
2694
+ const code: number = (typeof data.code === 'number') ? data.code : 0
2972
2695
  throw (webrpcErrorByCode[code] || WebrpcError).new(data)
2973
2696
  }
2974
2697
  return data
@@ -3150,6 +2873,7 @@ export class WebrpcStreamFinishedError extends WebrpcError {
3150
2873
  }
3151
2874
  }
3152
2875
 
2876
+
3153
2877
  // Schema errors
3154
2878
 
3155
2879
  export class UnauthorizedError extends WebrpcError {
@@ -3477,6 +3201,7 @@ export class UnsupportedNetworkError extends WebrpcError {
3477
3201
  }
3478
3202
  }
3479
3203
 
3204
+
3480
3205
  export enum errors {
3481
3206
  WebrpcEndpoint = 'WebrpcEndpoint',
3482
3207
  WebrpcRequestFailed = 'WebrpcRequestFailed',
@@ -3513,7 +3238,7 @@ export enum errors {
3513
3238
  Unavailable = 'Unavailable',
3514
3239
  QueryFailed = 'QueryFailed',
3515
3240
  NotFound = 'NotFound',
3516
- UnsupportedNetwork = 'UnsupportedNetwork'
3241
+ UnsupportedNetwork = 'UnsupportedNetwork',
3517
3242
  }
3518
3243
 
3519
3244
  export enum WebrpcErrorCodes {
@@ -3552,7 +3277,7 @@ export enum WebrpcErrorCodes {
3552
3277
  Unavailable = 2002,
3553
3278
  QueryFailed = 2003,
3554
3279
  NotFound = 3000,
3555
- UnsupportedNetwork = 3008
3280
+ UnsupportedNetwork = 3008,
3556
3281
  }
3557
3282
 
3558
3283
  export const webrpcErrorByCode: { [code: number]: any } = {
@@ -3591,7 +3316,8 @@ export const webrpcErrorByCode: { [code: number]: any } = {
3591
3316
  [2002]: UnavailableError,
3592
3317
  [2003]: QueryFailedError,
3593
3318
  [3000]: NotFoundError,
3594
- [3008]: UnsupportedNetworkError
3319
+ [3008]: UnsupportedNetworkError,
3595
3320
  }
3596
3321
 
3597
3322
  export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>
3323
+