@aptos-labs/ts-sdk 0.0.6 → 0.0.7

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.
Files changed (205) hide show
  1. package/README.md +9 -4
  2. package/dist/browser/index.d.ts +564 -338
  3. package/dist/browser/index.global.js +46 -25
  4. package/dist/browser/index.global.js.map +1 -1
  5. package/dist/common/index.d.ts +564 -338
  6. package/dist/common/index.js +45 -24
  7. package/dist/common/index.js.map +1 -1
  8. package/dist/esm/api/account.mjs +1 -1
  9. package/dist/esm/api/ans.d.mts +212 -18
  10. package/dist/esm/api/ans.mjs +1 -1
  11. package/dist/esm/api/aptos.d.mts +8 -0
  12. package/dist/esm/api/aptos.mjs +1 -1
  13. package/dist/esm/api/coin.d.mts +2 -2
  14. package/dist/esm/api/coin.mjs +1 -1
  15. package/dist/esm/api/digitalAsset.d.mts +3 -3
  16. package/dist/esm/api/digitalAsset.mjs +1 -1
  17. package/dist/esm/api/event.mjs +1 -1
  18. package/dist/esm/api/faucet.mjs +1 -1
  19. package/dist/esm/api/fungibleAsset.mjs +1 -1
  20. package/dist/esm/api/general.mjs +1 -1
  21. package/dist/esm/api/index.d.mts +4 -0
  22. package/dist/esm/api/index.mjs +1 -1
  23. package/dist/esm/api/staking.mjs +1 -1
  24. package/dist/esm/api/transaction.mjs +1 -1
  25. package/dist/esm/api/transactionSubmission/build.d.mts +53 -0
  26. package/dist/esm/api/transactionSubmission/build.mjs +2 -0
  27. package/dist/esm/api/transactionSubmission/build.mjs.map +1 -0
  28. package/dist/esm/api/transactionSubmission/sign.d.mts +50 -0
  29. package/dist/esm/api/transactionSubmission/sign.mjs +2 -0
  30. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -0
  31. package/dist/esm/api/transactionSubmission/simulate.d.mts +53 -0
  32. package/dist/esm/api/transactionSubmission/simulate.mjs +2 -0
  33. package/dist/esm/api/transactionSubmission/simulate.mjs.map +1 -0
  34. package/dist/esm/api/transactionSubmission/submit.d.mts +51 -0
  35. package/dist/esm/api/transactionSubmission/submit.mjs +2 -0
  36. package/dist/esm/api/transactionSubmission/submit.mjs.map +1 -0
  37. package/dist/esm/api/transactionSubmission.d.mts +9 -60
  38. package/dist/esm/api/transactionSubmission.mjs +1 -1
  39. package/dist/esm/{chunk-NGCFPQ22.mjs → chunk-2OZRBXLM.mjs} +2 -2
  40. package/dist/esm/{chunk-TQD4IGUM.mjs → chunk-33T7WTB6.mjs} +2 -2
  41. package/dist/esm/chunk-3732I6BR.mjs +2 -0
  42. package/dist/esm/chunk-3732I6BR.mjs.map +1 -0
  43. package/dist/esm/chunk-3VZ3OZKC.mjs +2 -0
  44. package/dist/esm/chunk-3VZ3OZKC.mjs.map +1 -0
  45. package/dist/esm/chunk-4KTQIWUP.mjs +2 -0
  46. package/dist/esm/chunk-4KTQIWUP.mjs.map +1 -0
  47. package/dist/esm/chunk-5LO7FR2P.mjs +2 -0
  48. package/dist/esm/chunk-5LO7FR2P.mjs.map +1 -0
  49. package/dist/esm/{chunk-Q6N6QACD.mjs → chunk-67OGU66P.mjs} +2 -2
  50. package/dist/esm/{chunk-V45RFKH7.mjs → chunk-72F5YXGC.mjs} +2 -2
  51. package/dist/esm/chunk-72F5YXGC.mjs.map +1 -0
  52. package/dist/esm/{chunk-2W744GUN.mjs → chunk-BFQRMCY2.mjs} +2 -2
  53. package/dist/esm/{chunk-WKY5ENCK.mjs → chunk-BM4HBROC.mjs} +2 -2
  54. package/dist/esm/chunk-DRPMIJH7.mjs +2 -0
  55. package/dist/esm/chunk-DRPMIJH7.mjs.map +1 -0
  56. package/dist/esm/{chunk-UPLWWSB4.mjs → chunk-GAI75GOG.mjs} +2 -2
  57. package/dist/esm/{chunk-7MNEEVXY.mjs → chunk-GU4OUKAF.mjs} +2 -2
  58. package/dist/esm/{chunk-EQ5BEDJ7.mjs → chunk-HO7K2UAK.mjs} +2 -2
  59. package/dist/esm/{chunk-U3LO2FSJ.mjs → chunk-IBH7IOIM.mjs} +2 -2
  60. package/dist/esm/{chunk-R26XML3D.mjs → chunk-J5BH7V37.mjs} +2 -2
  61. package/dist/esm/chunk-L7AA75WZ.mjs +2 -0
  62. package/dist/esm/chunk-L7AA75WZ.mjs.map +1 -0
  63. package/dist/esm/chunk-LACQ537H.mjs +2 -0
  64. package/dist/esm/{chunk-NYFVEKF6.mjs.map → chunk-LACQ537H.mjs.map} +1 -1
  65. package/dist/esm/{chunk-EGOYLZBU.mjs → chunk-LDAD54H5.mjs} +2 -2
  66. package/dist/esm/chunk-LXW3A3MJ.mjs +2 -0
  67. package/dist/esm/chunk-LXW3A3MJ.mjs.map +1 -0
  68. package/dist/esm/{chunk-4RVIA63I.mjs → chunk-M2V2POWK.mjs} +2 -2
  69. package/dist/esm/{chunk-3JVGSFHP.mjs → chunk-ND3ZQKTT.mjs} +2 -2
  70. package/dist/esm/chunk-O2B54NZT.mjs +2 -0
  71. package/dist/esm/chunk-O2B54NZT.mjs.map +1 -0
  72. package/dist/esm/chunk-OCW2L33Q.mjs +2 -0
  73. package/dist/esm/chunk-OCW2L33Q.mjs.map +1 -0
  74. package/dist/esm/{chunk-VMQWW5UT.mjs → chunk-OCYS4V2V.mjs} +2 -2
  75. package/dist/esm/{chunk-BWMNPUTK.mjs → chunk-OSTH5JRX.mjs} +2 -2
  76. package/dist/esm/chunk-OSTH5JRX.mjs.map +1 -0
  77. package/dist/esm/{chunk-Z2UDRTHA.mjs → chunk-OVHY6ZUJ.mjs} +2 -2
  78. package/dist/esm/chunk-PZCMSHY6.mjs +2 -0
  79. package/dist/esm/{chunk-P32MY5YF.mjs → chunk-RHS5ROLP.mjs} +2 -2
  80. package/dist/esm/chunk-RHS5ROLP.mjs.map +1 -0
  81. package/dist/esm/{chunk-BFSEVKNA.mjs → chunk-RKKU2SY5.mjs} +2 -2
  82. package/dist/esm/chunk-TGKB6ALT.mjs +2 -0
  83. package/dist/esm/chunk-TGKB6ALT.mjs.map +1 -0
  84. package/dist/esm/{chunk-GEFQFRL3.mjs → chunk-TPWSHFFI.mjs} +2 -2
  85. package/dist/esm/{chunk-WX43AJTD.mjs → chunk-UDBH4CER.mjs} +42 -21
  86. package/dist/esm/chunk-UDBH4CER.mjs.map +1 -0
  87. package/dist/esm/{chunk-VYAVLUPJ.mjs → chunk-WEJAI26R.mjs} +2 -2
  88. package/dist/esm/{chunk-JDS7K2WI.mjs → chunk-WL4OXZLN.mjs} +2 -2
  89. package/dist/esm/{chunk-AAIBCWZY.mjs → chunk-Y2HRRUZ6.mjs} +2 -2
  90. package/dist/esm/{chunk-J5ZFOJN2.mjs → chunk-ZLW65YCO.mjs} +2 -2
  91. package/dist/esm/chunk-ZUHN56GM.mjs +2 -0
  92. package/dist/esm/chunk-ZUHN56GM.mjs.map +1 -0
  93. package/dist/esm/client/core.mjs +1 -1
  94. package/dist/esm/client/get.mjs +1 -1
  95. package/dist/esm/client/index.mjs +1 -1
  96. package/dist/esm/client/post.mjs +1 -1
  97. package/dist/esm/core/account.mjs +1 -1
  98. package/dist/esm/core/authenticationKey.mjs +1 -1
  99. package/dist/esm/core/crypto/index.mjs +1 -1
  100. package/dist/esm/core/index.mjs +1 -1
  101. package/dist/esm/index.d.mts +6 -2
  102. package/dist/esm/index.mjs +1 -1
  103. package/dist/esm/internal/account.mjs +1 -1
  104. package/dist/esm/internal/ans.d.mts +80 -13
  105. package/dist/esm/internal/ans.mjs +1 -1
  106. package/dist/esm/internal/coin.d.mts +2 -2
  107. package/dist/esm/internal/coin.mjs +1 -1
  108. package/dist/esm/internal/digitalAsset.d.mts +3 -3
  109. package/dist/esm/internal/digitalAsset.mjs +1 -1
  110. package/dist/esm/internal/event.mjs +1 -1
  111. package/dist/esm/internal/faucet.d.mts +3 -3
  112. package/dist/esm/internal/faucet.mjs +1 -1
  113. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  114. package/dist/esm/internal/general.mjs +1 -1
  115. package/dist/esm/internal/staking.d.mts +2 -2
  116. package/dist/esm/internal/staking.mjs +1 -1
  117. package/dist/esm/internal/transaction.mjs +1 -1
  118. package/dist/esm/internal/transactionSubmission.d.mts +13 -44
  119. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  120. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  121. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  122. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  123. package/dist/esm/transactions/index.d.mts +1 -1
  124. package/dist/esm/transactions/index.mjs +1 -1
  125. package/dist/esm/transactions/instances/index.mjs +1 -1
  126. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  127. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  128. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  129. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  130. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  131. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  132. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  133. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +3 -6
  134. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  135. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  136. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  137. package/dist/esm/transactions/types.d.mts +15 -41
  138. package/dist/esm/types/generated/operations.d.mts +28 -2
  139. package/dist/esm/types/generated/queries.d.mts +5 -2
  140. package/dist/esm/types/generated/queries.mjs +1 -1
  141. package/dist/esm/types/index.d.mts +1 -1
  142. package/dist/esm/types/indexer.d.mts +3 -2
  143. package/package.json +1 -1
  144. package/src/api/ans.ts +250 -11
  145. package/src/api/aptos.ts +20 -0
  146. package/src/api/coin.ts +2 -2
  147. package/src/api/digitalAsset.ts +3 -3
  148. package/src/api/transactionSubmission/build.ts +42 -0
  149. package/src/api/transactionSubmission/sign.ts +44 -0
  150. package/src/api/transactionSubmission/simulate.ts +56 -0
  151. package/src/api/transactionSubmission/submit.ts +53 -0
  152. package/src/api/transactionSubmission.ts +4 -143
  153. package/src/internal/ans.ts +406 -20
  154. package/src/internal/coin.ts +3 -3
  155. package/src/internal/digitalAsset.ts +5 -5
  156. package/src/internal/queries/ansTokenFragment.graphql +9 -0
  157. package/src/internal/queries/getNames.graphql +11 -0
  158. package/src/internal/transactionSubmission.ts +29 -21
  159. package/src/transactions/transactionBuilder/transactionBuilder.ts +20 -43
  160. package/src/transactions/types.ts +14 -45
  161. package/src/types/generated/operations.ts +29 -0
  162. package/src/types/generated/queries.ts +34 -0
  163. package/src/types/indexer.ts +3 -0
  164. package/dist/esm/chunk-BP5ZO7NK.mjs +0 -2
  165. package/dist/esm/chunk-BP5ZO7NK.mjs.map +0 -1
  166. package/dist/esm/chunk-BWMNPUTK.mjs.map +0 -1
  167. package/dist/esm/chunk-EYXHVA6W.mjs +0 -2
  168. package/dist/esm/chunk-EYXHVA6W.mjs.map +0 -1
  169. package/dist/esm/chunk-IG5CHHSI.mjs +0 -2
  170. package/dist/esm/chunk-IG5CHHSI.mjs.map +0 -1
  171. package/dist/esm/chunk-IXMB2GOK.mjs +0 -2
  172. package/dist/esm/chunk-IXMB2GOK.mjs.map +0 -1
  173. package/dist/esm/chunk-NTD3H2S4.mjs +0 -2
  174. package/dist/esm/chunk-NTD3H2S4.mjs.map +0 -1
  175. package/dist/esm/chunk-NYFVEKF6.mjs +0 -2
  176. package/dist/esm/chunk-P32MY5YF.mjs.map +0 -1
  177. package/dist/esm/chunk-UNQNACJT.mjs +0 -2
  178. package/dist/esm/chunk-V45RFKH7.mjs.map +0 -1
  179. package/dist/esm/chunk-VOYW2TZW.mjs +0 -2
  180. package/dist/esm/chunk-VOYW2TZW.mjs.map +0 -1
  181. package/dist/esm/chunk-WX43AJTD.mjs.map +0 -1
  182. package/dist/esm/chunk-Y5DJPHJT.mjs +0 -2
  183. package/dist/esm/chunk-Y5DJPHJT.mjs.map +0 -1
  184. /package/dist/esm/{chunk-NGCFPQ22.mjs.map → chunk-2OZRBXLM.mjs.map} +0 -0
  185. /package/dist/esm/{chunk-TQD4IGUM.mjs.map → chunk-33T7WTB6.mjs.map} +0 -0
  186. /package/dist/esm/{chunk-Q6N6QACD.mjs.map → chunk-67OGU66P.mjs.map} +0 -0
  187. /package/dist/esm/{chunk-2W744GUN.mjs.map → chunk-BFQRMCY2.mjs.map} +0 -0
  188. /package/dist/esm/{chunk-WKY5ENCK.mjs.map → chunk-BM4HBROC.mjs.map} +0 -0
  189. /package/dist/esm/{chunk-UPLWWSB4.mjs.map → chunk-GAI75GOG.mjs.map} +0 -0
  190. /package/dist/esm/{chunk-7MNEEVXY.mjs.map → chunk-GU4OUKAF.mjs.map} +0 -0
  191. /package/dist/esm/{chunk-EQ5BEDJ7.mjs.map → chunk-HO7K2UAK.mjs.map} +0 -0
  192. /package/dist/esm/{chunk-U3LO2FSJ.mjs.map → chunk-IBH7IOIM.mjs.map} +0 -0
  193. /package/dist/esm/{chunk-R26XML3D.mjs.map → chunk-J5BH7V37.mjs.map} +0 -0
  194. /package/dist/esm/{chunk-EGOYLZBU.mjs.map → chunk-LDAD54H5.mjs.map} +0 -0
  195. /package/dist/esm/{chunk-4RVIA63I.mjs.map → chunk-M2V2POWK.mjs.map} +0 -0
  196. /package/dist/esm/{chunk-3JVGSFHP.mjs.map → chunk-ND3ZQKTT.mjs.map} +0 -0
  197. /package/dist/esm/{chunk-VMQWW5UT.mjs.map → chunk-OCYS4V2V.mjs.map} +0 -0
  198. /package/dist/esm/{chunk-Z2UDRTHA.mjs.map → chunk-OVHY6ZUJ.mjs.map} +0 -0
  199. /package/dist/esm/{chunk-UNQNACJT.mjs.map → chunk-PZCMSHY6.mjs.map} +0 -0
  200. /package/dist/esm/{chunk-BFSEVKNA.mjs.map → chunk-RKKU2SY5.mjs.map} +0 -0
  201. /package/dist/esm/{chunk-GEFQFRL3.mjs.map → chunk-TPWSHFFI.mjs.map} +0 -0
  202. /package/dist/esm/{chunk-VYAVLUPJ.mjs.map → chunk-WEJAI26R.mjs.map} +0 -0
  203. /package/dist/esm/{chunk-JDS7K2WI.mjs.map → chunk-WL4OXZLN.mjs.map} +0 -0
  204. /package/dist/esm/{chunk-AAIBCWZY.mjs.map → chunk-Y2HRRUZ6.mjs.map} +0 -0
  205. /package/dist/esm/{chunk-J5ZFOJN2.mjs.map → chunk-ZLW65YCO.mjs.map} +0 -0
@@ -521,6 +521,17 @@ type GetFungibleAssetMetadataQuery = {
521
521
  token_standard: string;
522
522
  }>;
523
523
  };
524
+ type GetNamesQuery = {
525
+ current_aptos_names: Array<{
526
+ domain?: string | null;
527
+ expiration_timestamp?: any | null;
528
+ registered_address?: string | null;
529
+ subdomain?: string | null;
530
+ token_standard?: string | null;
531
+ is_primary?: boolean | null;
532
+ owner_address?: string | null;
533
+ }>;
534
+ };
524
535
  type GetNumberOfDelegatorsQuery = {
525
536
  num_active_delegator_per_pool: Array<{
526
537
  num_active_delegator?: any | null;
@@ -672,6 +683,7 @@ type GetCurrentFungibleAssetBalancesResponse = GetCurrentFungibleAssetBalancesQu
672
683
  type GetTokenActivityResponse = GetTokenActivityQuery["token_activities_v2"];
673
684
  type GetCurrentTokenOwnershipResponse = GetCurrentTokenOwnershipQuery["current_token_ownerships_v2"][0];
674
685
  type GetOwnedTokensResponse = GetCurrentTokenOwnershipQuery["current_token_ownerships_v2"];
686
+ type GetANSNameResponse = GetNamesQuery["current_aptos_names"];
675
687
  /**
676
688
  * A generic type that being passed by each function and holds an
677
689
  * array of properties we can sort the query by
@@ -4623,18 +4635,7 @@ interface InputGenerateSingleSignerRawTransactionArgs {
4623
4635
  sender: AccountAddressInput;
4624
4636
  payload: AnyTransactionPayloadInstance;
4625
4637
  options?: InputGenerateTransactionOptions;
4626
- }
4627
- /**
4628
- * Interface of the arguments to generate a fee payer transaction.
4629
- * Used to provide to `generateTransaction()` method in the transaction builder flow
4630
- */
4631
- interface InputGenerateFeePayerRawTransactionArgs {
4632
- aptosConfig: AptosConfig;
4633
- sender: AccountAddressInput;
4634
- payload: AnyTransactionPayloadInstance;
4635
- feePayerAddress: AccountAddressInput;
4636
- secondarySignerAddresses?: AccountAddressInput[];
4637
- options?: InputGenerateTransactionOptions;
4638
+ feePayerAddress?: AccountAddressInput;
4638
4639
  }
4639
4640
  /**
4640
4641
  * Interface of the arguments to generate a multi-agent transaction.
@@ -4646,30 +4647,21 @@ interface InputGenerateMultiAgentRawTransactionArgs {
4646
4647
  payload: AnyTransactionPayloadInstance;
4647
4648
  secondarySignerAddresses: AccountAddressInput[];
4648
4649
  options?: InputGenerateTransactionOptions;
4650
+ feePayerAddress?: AccountAddressInput;
4649
4651
  }
4650
4652
  /**
4651
4653
  * Unified type that holds all the interfaces to generate different transaction types
4652
4654
  */
4653
- type InputGenerateRawTransactionArgs = InputGenerateSingleSignerRawTransactionArgs | InputGenerateFeePayerRawTransactionArgs | InputGenerateMultiAgentRawTransactionArgs;
4655
+ type InputGenerateRawTransactionArgs = InputGenerateSingleSignerRawTransactionArgs | InputGenerateMultiAgentRawTransactionArgs;
4654
4656
  /**
4655
4657
  * Interface that holds the return data when generating a single signer transaction
4656
4658
  *
4657
4659
  * @param rawTransaction a bcs serialized raw transaction
4658
4660
  */
4659
- interface InputSingleSignerTransaction {
4660
- rawTransaction: RawTransaction;
4661
- }
4662
- /**
4663
- * Interface that holds the return data when generating a fee payer transaction
4664
- *
4665
- * @param rawTransaction a bcs serialized raw transaction
4666
- * @param secondarySignerAddresses optional. secondary signer addresses for multi-agent transaction
4667
- * @param feePayerAddress fee payer address for a fee payer transaction (aka Sponsored Transaction)
4668
- */
4669
- interface InputFeePayerTransaction {
4661
+ interface SingleSignerTransaction {
4670
4662
  rawTransaction: RawTransaction;
4671
- feePayerAddress: AccountAddress;
4672
- secondarySignerAddresses?: AccountAddress[];
4663
+ feePayerAddress?: AccountAddress;
4664
+ secondarySignerAddresses?: undefined;
4673
4665
  }
4674
4666
  /**
4675
4667
  * Interface that holds the return data when generating a multi-agent transaction.
@@ -4677,14 +4669,15 @@ interface InputFeePayerTransaction {
4677
4669
  * @param rawTransaction a bcs serialized raw transaction
4678
4670
  * @param secondarySignerAddresses secondary signer addresses for multi-agent transaction
4679
4671
  */
4680
- interface InputMultiAgentTransaction {
4672
+ interface MultiAgentTransaction {
4681
4673
  rawTransaction: RawTransaction;
4682
4674
  secondarySignerAddresses: AccountAddress[];
4675
+ feePayerAddress?: AccountAddress;
4683
4676
  }
4684
4677
  /**
4685
4678
  * Unified type that holds all the return interfaces when generating different transaction types
4686
4679
  */
4687
- type AnyRawTransaction = InputSingleSignerTransaction | InputFeePayerTransaction | InputMultiAgentTransaction;
4680
+ type AnyRawTransaction = SingleSignerTransaction | MultiAgentTransaction;
4688
4681
  type InputSimulateTransactionData = {
4689
4682
  /**
4690
4683
  * The transaction to simulate, probably generated by `generateTransaction()`
@@ -4714,32 +4707,25 @@ type InputSimulateTransactionOptions = {
4714
4707
  */
4715
4708
  interface InputGenerateSingleSignerRawTransactionData {
4716
4709
  sender: AccountAddressInput;
4717
- options?: InputGenerateTransactionOptions;
4718
4710
  data: InputGenerateTransactionPayloadData;
4719
- }
4720
- /**
4721
- * Interface that holds the user data input when generating a fee payer transaction
4722
- */
4723
- interface InputGenerateFeePayerRawTransactionData {
4724
- sender: AccountAddressInput;
4725
- hasFeePayer: true;
4726
- secondarySignerAddresses?: AccountAddressInput[];
4727
4711
  options?: InputGenerateTransactionOptions;
4728
- data: InputGenerateTransactionPayloadData;
4712
+ withFeePayer?: boolean;
4713
+ secondarySignerAddresses?: undefined;
4729
4714
  }
4730
4715
  /**
4731
4716
  * Interface that holds the user data input when generating a multi-agent transaction
4732
4717
  */
4733
4718
  interface InputGenerateMultiAgentRawTransactionData {
4734
4719
  sender: AccountAddressInput;
4720
+ data: InputGenerateTransactionPayloadData;
4735
4721
  secondarySignerAddresses: AccountAddressInput[];
4736
4722
  options?: InputGenerateTransactionOptions;
4737
- data: InputGenerateTransactionPayloadData;
4723
+ withFeePayer?: boolean;
4738
4724
  }
4739
4725
  /**
4740
4726
  * Unified type that holds all the user data input interfaces when generating different transaction types
4741
4727
  */
4742
- type InputGenerateTransactionData = InputGenerateMultiAgentRawTransactionData | InputGenerateFeePayerRawTransactionData | InputGenerateSingleSignerRawTransactionData;
4728
+ type InputGenerateTransactionData = InputGenerateSingleSignerRawTransactionData | InputGenerateMultiAgentRawTransactionData;
4743
4729
  /**
4744
4730
  * Interface that holds the user data input when submitting a transaction
4745
4731
  */
@@ -4772,7 +4758,7 @@ declare class Coin {
4772
4758
  amount: AnyNumber;
4773
4759
  coinType?: MoveStructId;
4774
4760
  options?: InputGenerateTransactionOptions;
4775
- }): Promise<InputSingleSignerTransaction>;
4761
+ }): Promise<SingleSignerTransaction>;
4776
4762
  }
4777
4763
 
4778
4764
  /**
@@ -4834,7 +4820,7 @@ declare class DigitalAsset {
4834
4820
  name: string;
4835
4821
  uri: string;
4836
4822
  options?: InputGenerateTransactionOptions;
4837
- } & CreateCollectionOptions): Promise<InputSingleSignerTransaction>;
4823
+ } & CreateCollectionOptions): Promise<SingleSignerTransaction>;
4838
4824
  /**
4839
4825
  * Queries data of a specific collection by the collection creator address and the collection name.
4840
4826
  *
@@ -4889,7 +4875,7 @@ declare class DigitalAsset {
4889
4875
  name: string;
4890
4876
  uri: string;
4891
4877
  options?: InputGenerateTransactionOptions;
4892
- }): Promise<InputSingleSignerTransaction>;
4878
+ }): Promise<SingleSignerTransaction>;
4893
4879
  /**
4894
4880
  * Gets token data given the address of a token.
4895
4881
  *
@@ -5234,7 +5220,7 @@ interface RegisterNameParameters {
5234
5220
  name: string;
5235
5221
  expiration: {
5236
5222
  policy: "domain";
5237
- years: 1;
5223
+ years?: 1;
5238
5224
  } | {
5239
5225
  policy: "subdomain:follow-domain";
5240
5226
  } | {
@@ -5242,10 +5228,29 @@ interface RegisterNameParameters {
5242
5228
  expirationDate: Date;
5243
5229
  };
5244
5230
  transferable?: boolean;
5245
- toAddress?: HexInput;
5246
- targetAddress?: HexInput;
5231
+ toAddress?: AccountAddressInput;
5232
+ targetAddress?: AccountAddressInput;
5247
5233
  options?: InputGenerateTransactionOptions;
5248
5234
  }
5235
+ interface QueryNamesOptions {
5236
+ options?: {
5237
+ pagination?: PaginationArgs;
5238
+ orderBy?: OrderBy<GetANSNameResponse[0]>;
5239
+ where?: CurrentAptosNamesBoolExp;
5240
+ };
5241
+ }
5242
+ interface GetAccountNamesArgs extends QueryNamesOptions {
5243
+ accountAddress: AccountAddressInput;
5244
+ }
5245
+ interface GetAccountDomainsArgs extends QueryNamesOptions {
5246
+ accountAddress: AccountAddressInput;
5247
+ }
5248
+ interface GetAccountSubdomainsArgs extends QueryNamesOptions {
5249
+ accountAddress: AccountAddressInput;
5250
+ }
5251
+ interface GetDomainSubdomainsArgs extends QueryNamesOptions {
5252
+ domain: string;
5253
+ }
5249
5254
 
5250
5255
  /**
5251
5256
  * A class to handle all `ANS` operations
@@ -5254,11 +5259,12 @@ declare class ANS {
5254
5259
  readonly config: AptosConfig;
5255
5260
  constructor(config: AptosConfig);
5256
5261
  /**
5257
- * Retrieve the owner address of a domain name or subdomain name.
5262
+ * Retrieve the owner address of a domain name or subdomain name from the contract.
5258
5263
  *
5259
5264
  * ```ts
5260
- * getOwnerAddress({name: "test.aptos"})
5261
5265
  * // Will return the owner address of "test.aptos.apt" or undefined
5266
+ * const owner = await aptos.getOwnerAddress({name: "test.aptos"})
5267
+ * // owner = 0x123...
5262
5268
  * ```
5263
5269
  *
5264
5270
  * @param args.name - A string of the name to retrieve
@@ -5269,26 +5275,219 @@ declare class ANS {
5269
5275
  name: string;
5270
5276
  }): Promise<MoveAddressType | undefined>;
5271
5277
  /**
5272
- * Registers a new domain or subdomain name
5278
+ * Retrieve the expiration time of a domain name or subdomain name from the contract.
5279
+ *
5280
+ * ```ts
5281
+ * // Will return the expiration of "test.aptos.apt" or undefined
5282
+ * const exp = await aptos.getExpiration({name: "test.aptos"})
5283
+ * // new Date(exp) would give you the date in question: 2021-01-01T00:00:00.000Z
5284
+ * ```
5285
+ *
5286
+ * @param args.name - A string of the name to retrieve
5287
+ *
5288
+ * @returns number as a unix timestamp in seconds.
5289
+ */
5290
+ getExpiration(args: {
5291
+ name: string;
5292
+ }): Promise<number | undefined>;
5293
+ /**
5294
+ * Retrieve the target address of a domain or subdomain name. This is the
5295
+ * address the name points to for use on chain. Note, the target address can
5296
+ * point to addresses that are not the owner of the name
5297
+ *
5298
+ * ```ts
5299
+ * const targetAddr = await aptos.getTargetAddress({name: "test.aptos"})
5300
+ * // targetAddr = 0x123...
5301
+ * ```
5302
+ *
5303
+ * @param args.name - A string of the name: primary, primary.apt, secondary.primary, secondary.primary.apt, etc.
5304
+ *
5305
+ * @returns MoveAddressType if the name has a target, undefined otherwise
5306
+ */
5307
+ getTargetAddress(args: {
5308
+ name: string;
5309
+ }): Promise<MoveAddressType | undefined>;
5310
+ /**
5311
+ * Sets the target address of a domain or subdomain name. This is the
5312
+ * address the name points to for use on chain. Note, the target address can
5313
+ * point to addresses that are not the owner of the name
5314
+ *
5315
+ * ```ts
5316
+ * await aptos.setTargetAddress({sender: alice, name: "test.aptos", address: bob.accountAddress.toString})
5317
+ * const address = await aptos.getTargetAddress({name: "test.aptos"})
5318
+ * // address = bob.accountAddress.toString()
5319
+ * ```
5320
+ *
5321
+ * @param args.name - A string of the name: test.aptos.apt, test.apt, test, test.aptos, etc.
5322
+ * @param args.address - A AccountAddressInput of the address to set the domain or subdomain to
5323
+ *
5324
+ * @returns SingleSignerTransaction
5325
+ */
5326
+ setTargetAddress(args: {
5327
+ sender: Account$1;
5328
+ name: string;
5329
+ address: AccountAddressInput;
5330
+ options?: InputGenerateTransactionOptions;
5331
+ }): Promise<SingleSignerTransaction>;
5332
+ /**
5333
+ * Retrieve the primary name for an account. An account can have
5334
+ * multiple names that target it, but only a single name that is primary. An
5335
+ * account also may not have a primary name.
5336
+ *
5337
+ * ```ts
5338
+ * const name = await aptos.getPrimaryName({address: alice.accountAddress.toString()})
5339
+ * // name = test.aptos
5340
+ * ```
5341
+ *
5342
+ * @param args.address - A AccountAddressInput (address) of the account
5343
+ *
5344
+ * @returns a string if the account has a primary name, undefined otherwise
5345
+ */
5346
+ getPrimaryName(args: {
5347
+ address: AccountAddressInput;
5348
+ }): Promise<string | undefined>;
5349
+ /**
5350
+ * Sets the primary name for the sender. An account can have
5351
+ * multiple names that target it, but only a single name that is primary. An
5352
+ * account also may not have a primary name.
5353
+ *
5354
+ * ```ts
5355
+ * await aptos.setPrimaryName({sender: alice, name: "test.aptos"})
5356
+ * const primaryName = await aptos.getPrimaryName({address: alice.accountAddress.toString()})
5357
+ * // primaryName = test.aptos
5358
+ * ```
5359
+ *
5360
+ * @param args.sender - The sender account
5361
+ * @param args.name - A string of the name: test, test.apt, test.aptos, test.aptos.apt, etc.
5362
+ *
5363
+ * @returns SingleSignerTransaction
5364
+ */
5365
+ setPrimaryName(args: {
5366
+ sender: Account$1;
5367
+ name: string | null;
5368
+ options?: InputGenerateTransactionOptions;
5369
+ }): Promise<SingleSignerTransaction>;
5370
+ /**
5371
+ * Registers a new name
5372
+ *
5373
+ * ```ts
5374
+ * // An example of registering a subdomain name assuming def.apt is already registered
5375
+ * // and belongs to the sender alice.
5376
+ * const txn = aptos.registerName({
5377
+ * sender: alice,
5378
+ * name: "test.aptos.apt",
5379
+ * expiration: {
5380
+ * policy: "subdomain:independent",
5381
+ * expirationDate: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000),
5382
+ * },
5383
+ * });
5384
+ * ```
5273
5385
  *
5274
5386
  * @param args.sender - The sender account
5275
- * @param args.name - A string or {domainName: string, subdomainName?: string} of the name to register. This
5276
- * can be inclusive or exclusive of the .apt suffix.
5277
- * Examples include: "xyz", "xyz.apt", "xyz.kyc.apt", {domainName: "xyz"}, {domainName: "kyc", subdomainName: "xyz"}.
5387
+ * @param args.name - A string of the name to register. This can be inclusive or exclusive of the .apt suffix.
5388
+ * Examples include: "test", "test.apt", "test.aptos.apt", etc.
5278
5389
  * @param args.expiration - An object with the expiration policy of the name.
5279
5390
  * @param args.expiration.policy - 'domain' | 'subdomain:follow-domain' | 'subdomain:independent'
5280
5391
  * - domain: Years is required and the name will expire after the given number of years.
5281
5392
  * - subdomain:follow-domain: The name will expire at the same time as the domain name.
5282
5393
  * - subdomain:independent: The name will expire at the given date.
5394
+ * @param args.expiration.expirationDate - A javascript date of when the subdomain will expire. Only applicable when
5395
+ * the policy is set to 'subdomain:independent'.
5283
5396
  * @param args.transferable - Determines if the subdomain being minted is soul-bound. Applicable only to subdomains.
5284
5397
  * @param args.targetAddress optional - The address the domain name will resolve to. If not provided,
5285
5398
  * the sender's address will be used.
5286
5399
  * @param args.toAddress optional - The address to send the domain name to. If not provided,
5287
5400
  * the transaction will be sent to the router.
5288
5401
  *
5289
- * @returns InputSingleSignerTransaction
5402
+ * @returns SingleSignerTransaction
5403
+ */
5404
+ registerName(args: Omit<RegisterNameParameters, "aptosConfig">): Promise<SingleSignerTransaction>;
5405
+ /**
5406
+ * Renews a domain name
5407
+ *
5408
+ * Note: If a domain name was minted with V1 of the contract, it will automatically be upgraded to V2 via this transaction.
5409
+ *
5410
+ * ```ts
5411
+ * await aptos.renewDomain({sender: alice, name: "test"})
5412
+ * // test.apt will be renewed for one year
5413
+ * ```
5414
+ *
5415
+ * @param args.sender - The sender account
5416
+ * @param args.name - A string of the domain the subdomain will be under. The signer must be the domain owner.
5417
+ * Subdomains cannot be renewed.
5418
+ * @param args.years - The number of years to renew the name. Currently only one year is permitted.
5419
+ *
5420
+ * @returns SingleSignerTransaction
5421
+ */
5422
+ renewDomain(args: {
5423
+ sender: Account$1;
5424
+ name: string;
5425
+ years?: 1;
5426
+ options?: InputGenerateTransactionOptions;
5427
+ }): Promise<SingleSignerTransaction>;
5428
+ /**
5429
+ * Fetches a single name from the indexer
5430
+ * @param args.name - A string of the name to retrieve, e.g. "test.aptos.apt"
5431
+ * or "test.apt" or "test". Can be inclusive or exclusive of the .apt suffix.
5432
+ * Can be a subdomain.
5433
+ *
5434
+ * @returns A promise of an ANSName or undefined
5435
+ */
5436
+ getName(args: {
5437
+ name: string;
5438
+ }): Promise<GetANSNameResponse[0] | undefined>;
5439
+ /**
5440
+ * Fetches all names for an account (both top level domains and subdomains)
5441
+ *
5442
+ * @param args
5443
+ * @param args.accountAddress - A AccountAddressInput of the address to retrieve names for.
5444
+ * @param args.options.pagination.offset - Optional, the offset to start from when fetching names
5445
+ * @param args.options.pagination.limit - Optional, A number of the names to fetch per request
5446
+ * @param args.options.orderBy - The order to sort the names by
5447
+ * @param args.options.where - Additional filters to apply to the query
5448
+ *
5449
+ * @returns a promise of an array of ANSName
5450
+ */
5451
+ getAccountNames(args: GetAccountNamesArgs): Promise<GetANSNameResponse>;
5452
+ /**
5453
+ * Fetches all top level domain names for an account
5454
+ *
5455
+ * @param args
5456
+ * @param args.accountAddress - A AccountAddressInput of the address to retrieve domain names for.
5457
+ * @param args.options.pagination.offset - Optional, the offset to start from when fetching names
5458
+ * @param args.options.pagination.limit - Optional, A number of the names to fetch per request
5459
+ * @param args.options.orderBy - The order to sort the names by
5460
+ * @param args.options.where - Additional filters to apply to the query
5461
+ *
5462
+ * @returns a promise of an array of ANSName
5463
+ */
5464
+ getAccountDomains(args: GetAccountDomainsArgs): Promise<GetANSNameResponse>;
5465
+ /**
5466
+ * Fetches all subdomains names for an account
5467
+ *
5468
+ * @param args
5469
+ * @param args.accountAddress - A AccountAddressInput of the address to retrieve subdomains names for.
5470
+ * @param args.options.pagination.offset - Optional, the offset to start from when fetching names
5471
+ * @param args.options.pagination.limit - Optional, A number of the names to fetch per request
5472
+ * @param args.options.orderBy - The order to sort the names by
5473
+ * @param args.options.where - Additional filters to apply to the query
5474
+ *
5475
+ * @returns a promise of an array of ANSName
5476
+ */
5477
+ getAccountSubdomains(args: GetAccountSubdomainsArgs): Promise<GetANSNameResponse>;
5478
+ /**
5479
+ * Fetches all subdomains names for a given domain. Note, this will not return the domain itself.
5480
+ *
5481
+ * @param args
5482
+ * @param args.domain - A string of the domain name: eg. "test.apt" or "test" (without the suffix of .apt)
5483
+ * @param args.options.pagination.offset - Optional, the offset to start from when fetching names
5484
+ * @param args.options.pagination.limit - Optional, A number of the names to fetch per request
5485
+ * @param args.options.orderBy - The order to sort the names by
5486
+ * @param args.options.where - Additional filters to apply to the query
5487
+ *
5488
+ * @returns a promise of an array of ANSName
5290
5489
  */
5291
- registerName(args: Omit<RegisterNameParameters, "aptosConfig">): Promise<InputSingleSignerTransaction>;
5490
+ getDomainSubdomains(args: GetDomainSubdomainsArgs): Promise<GetANSNameResponse>;
5292
5491
  }
5293
5492
 
5294
5493
  /**
@@ -5424,57 +5623,6 @@ declare class Transaction {
5424
5623
  declare class TransactionSubmission {
5425
5624
  readonly config: AptosConfig;
5426
5625
  constructor(config: AptosConfig);
5427
- /**
5428
- * We are defining function signatures, each with its specific input and output.
5429
- * These are the possible function signature for `generateTransaction` function.
5430
- * When we call `generateTransaction` function with the relevant type properties,
5431
- * Typescript can infer the return type based on the appropriate function overload.
5432
- */
5433
- generateTransaction(args: InputGenerateSingleSignerRawTransactionData): Promise<InputSingleSignerTransaction>;
5434
- generateTransaction(args: InputGenerateFeePayerRawTransactionData): Promise<InputFeePayerTransaction>;
5435
- generateTransaction(args: InputGenerateMultiAgentRawTransactionData): Promise<InputMultiAgentTransaction>;
5436
- generateTransaction(args: InputGenerateTransactionData): Promise<AnyRawTransaction>;
5437
- /**
5438
- * Sign a transaction that can later be submitted to chain
5439
- *
5440
- * @param args.signer The signer account to sign the transaction
5441
- * @param args.transaction An instance of a RawTransaction, plus optional secondary/fee payer addresses
5442
- * @param args.asFeePayer optional. If the signer is also the fee payer
5443
- * ```
5444
- * {
5445
- * rawTransaction: RawTransaction,
5446
- * secondarySignerAddresses?: Array<AccountAddress>,
5447
- * feePayerAddress?: AccountAddress
5448
- * }
5449
- * ```
5450
- *
5451
- * @return The signer AccountAuthenticator
5452
- */
5453
- signTransaction(args: {
5454
- signer: Account$1;
5455
- transaction: AnyRawTransaction;
5456
- asFeePayer?: boolean;
5457
- }): AccountAuthenticator;
5458
- /**
5459
- * Simulates a transaction before singing it.
5460
- *
5461
- * @param args.signerPublicKey The signer public key
5462
- * @param args.transaction The raw transaction to simulate
5463
- * @param args.secondarySignersPublicKeys optional. For when the transaction is a multi signers transaction
5464
- * @param args.feePayerPublicKey optional. For when the transaction is a fee payer (aka sponsored) transaction
5465
- * @param args.options optional. A config to simulate the transaction with
5466
- */
5467
- simulateTransaction(args: InputSimulateTransactionData): Promise<Array<UserTransactionResponse>>;
5468
- /**
5469
- * Submit transaction to chain
5470
- *
5471
- * @param args.transaction A aptos transaction type
5472
- * @param args.senderAuthenticator The account authenticator of the transaction sender
5473
- * @param args.secondarySignerAuthenticators optional. For when the transaction is a multi signers transaction
5474
- *
5475
- * @return PendingTransactionResponse
5476
- */
5477
- submitTransaction(args: InputSubmitTransactionData): Promise<PendingTransactionResponse>;
5478
5626
  /**
5479
5627
  * Sign and submit a single signer transaction to chain
5480
5628
  *
@@ -5512,7 +5660,7 @@ declare class TransactionSubmission {
5512
5660
  metadataBytes: HexInput;
5513
5661
  moduleBytecode: Array<HexInput>;
5514
5662
  options?: InputGenerateTransactionOptions;
5515
- }): Promise<InputSingleSignerTransaction>;
5663
+ }): Promise<SingleSignerTransaction>;
5516
5664
  /**
5517
5665
  * Rotate an account's auth key. After rotation, only the new private key can be used to sign txns for
5518
5666
  * the account.
@@ -5529,249 +5677,73 @@ declare class TransactionSubmission {
5529
5677
  }): Promise<TransactionResponse>;
5530
5678
  }
5531
5679
 
5680
+ declare function isBool(arg: SimpleEntryFunctionArgumentTypes): arg is boolean;
5681
+ declare function isString(arg: any): arg is string;
5682
+ declare function isNumber(arg: SimpleEntryFunctionArgumentTypes): arg is number;
5683
+ declare function isLargeNumber(arg: SimpleEntryFunctionArgumentTypes): arg is number | bigint | string;
5684
+ declare function isNull(arg: SimpleEntryFunctionArgumentTypes): arg is null | undefined;
5685
+ declare function isBcsBool(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is Bool;
5686
+ declare function isBcsAddress(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is AccountAddress;
5687
+ declare function isBcsString(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is MoveString;
5688
+ declare function isBcsFixedBytes(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is FixedBytes;
5689
+ declare function isBcsU8(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U8;
5690
+ declare function isBcsU16(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U16;
5691
+ declare function isBcsU32(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U32;
5692
+ declare function isBcsU64(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U64;
5693
+ declare function isBcsU128(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U128;
5694
+ declare function isBcsU256(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U256;
5695
+ declare function isScriptDataInput(arg: InputGenerateTransactionPayloadDataWithRemoteABI | InputGenerateTransactionPayloadData): arg is InputScriptData;
5696
+ declare function throwTypeMismatch(expectedType: string, position: number): void;
5532
5697
  /**
5533
- * This class is the main entry point into Aptos's
5534
- * APIs and separates functionality into different namespaces.
5698
+ * Finds first non-signer arg.
5535
5699
  *
5536
- * To use the SDK, create a new Aptos instance to get access
5537
- * to all the sdk functionality.
5700
+ * A function is often defined with a `signer` or `&signer` arguments at the start, which are filled in
5701
+ * by signatures, and not by the caller.
5702
+ * @param functionAbi
5538
5703
  */
5539
- declare class Aptos {
5540
- readonly config: AptosConfig;
5541
- readonly account: Account;
5542
- readonly ans: ANS;
5543
- readonly coin: Coin;
5544
- readonly digitalAsset: DigitalAsset;
5545
- readonly event: Event;
5546
- readonly faucet: Faucet;
5547
- readonly fungibleAsset: FungibleAsset;
5548
- readonly general: General;
5549
- readonly staking: Staking;
5550
- readonly transaction: Transaction;
5551
- readonly transactionSubmission: TransactionSubmission;
5552
- constructor(settings?: AptosConfig);
5553
- }
5554
- interface Aptos extends Account, Coin, DigitalAsset, Event, Faucet, FungibleAsset, General, Staking, Transaction, ANS, TransactionSubmission {
5555
- }
5704
+ declare function findFirstNonSignerArg(functionAbi: MoveFunction): number;
5705
+ declare function getFunctionParts(functionArg: MoveFunctionId): {
5706
+ moduleAddress: string;
5707
+ moduleName: string;
5708
+ functionName: string;
5709
+ };
5556
5710
 
5557
5711
  /**
5558
- * The API response type
5559
- *
5560
- * @param status - the response status. i.e. 200
5561
- * @param statusText - the response message
5562
- * @param data the response data
5563
- * @param url the url the request was made to
5564
- * @param headers the response headers
5565
- * @param config (optional) - the request object
5566
- * @param request (optional) - the request object
5712
+ * We are defining function signatures, each with its specific input and output.
5713
+ * These are the possible function signature for our `generateTransactionPayload` function.
5714
+ * When we call our `generateTransactionPayload` function with the relevant type properties,
5715
+ * Typescript can infer the return type based on the appropriate function overload.
5567
5716
  */
5568
- interface AptosResponse<Req, Res> {
5569
- status: number;
5570
- statusText: string;
5571
- data: Res;
5572
- url: string;
5573
- headers: any;
5574
- config?: any;
5575
- request?: Req;
5576
- }
5717
+ declare function generateTransactionPayload(args: InputScriptData): Promise<TransactionPayloadScript>;
5718
+ declare function generateTransactionPayload(args: InputEntryFunctionDataWithRemoteABI): Promise<TransactionPayloadEntryFunction>;
5719
+ declare function generateTransactionPayload(args: InputMultiSigDataWithRemoteABI): Promise<TransactionPayloadMultisig>;
5720
+ declare function generateTransactionPayloadWithABI(args: InputEntryFunctionData, functionAbi: EntryFunctionABI): TransactionPayloadEntryFunction;
5721
+ declare function generateTransactionPayloadWithABI(args: InputMultiSigData, functionAbi: EntryFunctionABI): TransactionPayloadMultisig;
5577
5722
  /**
5578
- * The type returned from an API error
5723
+ * Generates a raw transaction
5579
5724
  *
5580
- * @param name - the error name "AptosApiError"
5581
- * @param url the url the request was made to
5582
- * @param status - the response status. i.e. 400
5583
- * @param statusText - the response message
5584
- * @param data the response data
5585
- * @param request - the AptosRequest
5725
+ * @param args.aptosConfig AptosConfig
5726
+ * @param args.sender The transaction's sender account address as a hex input
5727
+ * @param args.payload The transaction payload - can create by using generateTransactionPayload()
5728
+ *
5729
+ * @returns RawTransaction
5586
5730
  */
5587
- declare class AptosApiError extends Error {
5588
- readonly url: string;
5589
- readonly status: number;
5590
- readonly statusText: string;
5591
- readonly data: any;
5592
- readonly request: AptosRequest;
5593
- constructor(request: AptosRequest, response: AptosResponse<any, any>, message: string);
5594
- }
5595
-
5731
+ declare function generateRawTransaction(args: {
5732
+ aptosConfig: AptosConfig;
5733
+ sender: AccountAddressInput;
5734
+ payload: AnyTransactionPayloadInstance;
5735
+ options?: InputGenerateTransactionOptions;
5736
+ }): Promise<RawTransaction>;
5596
5737
  /**
5597
- * Given a url and method, sends the request with axios and
5598
- * returns the response.
5738
+ * We are defining function signatures, each with its specific input and output.
5739
+ * These are the possible function signature for our `generateTransaction` function.
5740
+ * When we call our `generateTransaction` function with the relevant type properties,
5741
+ * Typescript can infer the return type based on the appropriate function overload.
5599
5742
  */
5600
- declare function request<Req, Res>(options: ClientRequest<Req>, client: Client): Promise<ClientResponse<Res>>;
5743
+ declare function buildTransaction(args: InputGenerateSingleSignerRawTransactionArgs): Promise<SingleSignerTransaction>;
5744
+ declare function buildTransaction(args: InputGenerateMultiAgentRawTransactionArgs): Promise<MultiAgentTransaction>;
5601
5745
  /**
5602
- * The main function to use when doing an API request.
5603
- *
5604
- * @param options AptosRequest
5605
- * @param aptosConfig The config information for the SDK client instance
5606
- * @returns the response or AptosApiError
5607
- */
5608
- declare function aptosRequest<Req extends {}, Res extends {}>(options: AptosRequest, aptosConfig: AptosConfig): Promise<AptosResponse<Req, Res>>;
5609
-
5610
- type GetRequestOptions = {
5611
- /**
5612
- * The config for the API client
5613
- */
5614
- aptosConfig: AptosConfig;
5615
- /**
5616
- * The type of API endpoint to call e.g. fullnode, indexer, etc
5617
- */
5618
- type: AptosApiType;
5619
- /**
5620
- * The name of the API method
5621
- */
5622
- originMethod: string;
5623
- /**
5624
- * The URL path to the API method
5625
- */
5626
- path: string;
5627
- /**
5628
- * The content type of the request body
5629
- */
5630
- contentType?: MimeType;
5631
- /**
5632
- * The accepted content type of the response of the API
5633
- */
5634
- acceptType?: MimeType;
5635
- /**
5636
- * The query parameters for the request
5637
- */
5638
- params?: Record<string, string | AnyNumber | boolean | undefined>;
5639
- /**
5640
- * Specific client overrides for this request to override aptosConfig
5641
- */
5642
- overrides?: ClientConfig;
5643
- };
5644
- type GetAptosRequestOptions = Omit<GetRequestOptions, "type">;
5645
- /**
5646
- * Main function to do a Get request
5647
- *
5648
- * @param options GetRequestOptions
5649
- * @returns
5650
- */
5651
- declare function get<Req extends {}, Res extends {}>(options: GetRequestOptions): Promise<AptosResponse<Req, Res>>;
5652
- declare function getAptosFullNode<Req extends {}, Res extends {}>(options: GetAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
5653
- declare function paginateWithCursor<Req extends Record<string, any>, Res extends any[]>(options: GetAptosRequestOptions): Promise<Res>;
5654
-
5655
- type PostRequestOptions = {
5656
- /**
5657
- * The config for the API client
5658
- */
5659
- aptosConfig: AptosConfig;
5660
- /**
5661
- * The type of API endpoint to call e.g. fullnode, indexer, etc
5662
- */
5663
- type: AptosApiType;
5664
- /**
5665
- * The name of the API method
5666
- */
5667
- originMethod: string;
5668
- /**
5669
- * The URL path to the API method
5670
- */
5671
- path: string;
5672
- /**
5673
- * The content type of the request body
5674
- */
5675
- contentType?: MimeType;
5676
- /**
5677
- * The accepted content type of the response of the API
5678
- */
5679
- acceptType?: MimeType;
5680
- /**
5681
- * The query parameters for the request
5682
- */
5683
- params?: Record<string, string | AnyNumber | boolean | undefined>;
5684
- /**
5685
- * The body of the request, should match the content type of the request
5686
- */
5687
- body?: any;
5688
- /**
5689
- * Specific client overrides for this request to override aptosConfig
5690
- */
5691
- overrides?: ClientConfig;
5692
- };
5693
- type PostAptosRequestOptions = Omit<PostRequestOptions, "type">;
5694
- /**
5695
- * Main function to do a Post request
5696
- *
5697
- * @param options PostRequestOptions
5698
- * @returns
5699
- */
5700
- declare function post<Req extends {}, Res extends {}>(options: PostRequestOptions): Promise<AptosResponse<Req, Res>>;
5701
- declare function postAptosFullNode<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
5702
- declare function postAptosIndexer<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
5703
- declare function postAptosFaucet<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
5704
-
5705
- declare function isBool(arg: SimpleEntryFunctionArgumentTypes): arg is boolean;
5706
- declare function isString(arg: any): arg is string;
5707
- declare function isNumber(arg: SimpleEntryFunctionArgumentTypes): arg is number;
5708
- declare function isLargeNumber(arg: SimpleEntryFunctionArgumentTypes): arg is number | bigint | string;
5709
- declare function isNull(arg: SimpleEntryFunctionArgumentTypes): arg is null | undefined;
5710
- declare function isBcsBool(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is Bool;
5711
- declare function isBcsAddress(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is AccountAddress;
5712
- declare function isBcsString(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is MoveString;
5713
- declare function isBcsFixedBytes(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is FixedBytes;
5714
- declare function isBcsU8(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U8;
5715
- declare function isBcsU16(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U16;
5716
- declare function isBcsU32(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U32;
5717
- declare function isBcsU64(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U64;
5718
- declare function isBcsU128(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U128;
5719
- declare function isBcsU256(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes): arg is U256;
5720
- declare function isScriptDataInput(arg: InputGenerateTransactionPayloadDataWithRemoteABI | InputGenerateTransactionPayloadData): arg is InputScriptData;
5721
- declare function throwTypeMismatch(expectedType: string, position: number): void;
5722
- /**
5723
- * Finds first non-signer arg.
5724
- *
5725
- * A function is often defined with a `signer` or `&signer` arguments at the start, which are filled in
5726
- * by signatures, and not by the caller.
5727
- * @param functionAbi
5728
- */
5729
- declare function findFirstNonSignerArg(functionAbi: MoveFunction): number;
5730
- declare function getFunctionParts(functionArg: MoveFunctionId): {
5731
- moduleAddress: string;
5732
- moduleName: string;
5733
- functionName: string;
5734
- };
5735
-
5736
- /**
5737
- * We are defining function signatures, each with its specific input and output.
5738
- * These are the possible function signature for our `generateTransactionPayload` function.
5739
- * When we call our `generateTransactionPayload` function with the relevant type properties,
5740
- * Typescript can infer the return type based on the appropriate function overload.
5741
- */
5742
- declare function generateTransactionPayload(args: InputScriptData): Promise<TransactionPayloadScript>;
5743
- declare function generateTransactionPayload(args: InputEntryFunctionDataWithRemoteABI): Promise<TransactionPayloadEntryFunction>;
5744
- declare function generateTransactionPayload(args: InputMultiSigDataWithRemoteABI): Promise<TransactionPayloadMultisig>;
5745
- declare function generateTransactionPayload(args: InputGenerateTransactionPayloadDataWithRemoteABI): Promise<AnyTransactionPayloadInstance>;
5746
- declare function generateTransactionPayloadWithABI(args: InputEntryFunctionData, functionAbi: EntryFunctionABI): TransactionPayloadEntryFunction;
5747
- declare function generateTransactionPayloadWithABI(args: InputMultiSigData, functionAbi: EntryFunctionABI): TransactionPayloadMultisig;
5748
- /**
5749
- * Generates a raw transaction
5750
- *
5751
- * @param args.aptosConfig AptosConfig
5752
- * @param args.sender The transaction's sender account address as a hex input
5753
- * @param args.payload The transaction payload - can create by using generateTransactionPayload()
5754
- *
5755
- * @returns RawTransaction
5756
- */
5757
- declare function generateRawTransaction(args: {
5758
- aptosConfig: AptosConfig;
5759
- sender: AccountAddressInput;
5760
- payload: AnyTransactionPayloadInstance;
5761
- options?: InputGenerateTransactionOptions;
5762
- }): Promise<RawTransaction>;
5763
- /**
5764
- * We are defining function signatures, each with its specific input and output.
5765
- * These are the possible function signature for our `generateTransaction` function.
5766
- * When we call our `generateTransaction` function with the relevant type properties,
5767
- * Typescript can infer the return type based on the appropriate function overload.
5768
- */
5769
- declare function buildTransaction(args: InputGenerateSingleSignerRawTransactionArgs): Promise<InputSingleSignerTransaction>;
5770
- declare function buildTransaction(args: InputGenerateFeePayerRawTransactionArgs): Promise<InputFeePayerTransaction>;
5771
- declare function buildTransaction(args: InputGenerateMultiAgentRawTransactionArgs): Promise<InputMultiAgentTransaction>;
5772
- declare function buildTransaction(args: InputGenerateRawTransactionArgs): Promise<AnyRawTransaction>;
5773
- /**
5774
- * Simulate a transaction before signing and submit to chain
5746
+ * Simulate a transaction before signing and submit to chain
5775
5747
  *
5776
5748
  * @param args.transaction A aptos transaction type to sign
5777
5749
  * @param args.signerPublicKey The signer public key
@@ -5880,4 +5852,258 @@ declare function parseTypeTag(typeStr: string, options?: {
5880
5852
  allowGenerics?: boolean;
5881
5853
  }): TypeTag;
5882
5854
 
5883
- export { APTOS_BIP44_REGEX, APTOS_COIN, APTOS_HARDENED_REGEX, Account$1 as Account, AccountAddress, AccountAddressInput, AccountAuthenticator, AccountAuthenticatorEd25519, AccountAuthenticatorMultiEd25519, AccountAuthenticatorMultiKey, AccountAuthenticatorSingleKey, AccountAuthenticatorVariant, AccountData, AccountEd25519Signature, AccountMultiEd25519Signature, AccountSecp256k1Signature, AccountSignature, AddressInvalidReason, AnyNumber, AnyPublicKeyVariant, AnyRawTransaction, AnyRawTransactionInstance, AnySignatureVariant, AnyTransactionPayloadInstance, Aptos, AptosApiError, AptosApiType, AptosConfig, AptosRequest, AptosResponse, AptosSettings, AuthenticationKey, AuthenticationKeyScheme, Block, BlockMetadataTransactionResponse, Bool, CKDPriv, ChainId, Client, ClientConfig, ClientRequest, ClientResponse, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_NETWORK, DEFAULT_TXN_EXP_SEC_FROM_NOW, DEFAULT_TXN_TIMEOUT_SEC, DecodedTableData, DeletedTableData, DeriveScheme, DerivedKeys, Deserializable, Deserializer, DirectWriteSet, Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature, EntryFunction, EntryFunctionABI, EntryFunctionArgument, EntryFunctionArgumentTypes, EntryFunctionBytes, EntryFunctionPayloadResponse, Event$1 as Event, EventGuid, FeePayerRawTransaction, FixedBytes, GasEstimation, GenerateAccount, GenerateAccountWithEd25519, GenerateAccountWithSingleSignerSecp256k1Key, GenesisPayload, GenesisTransactionResponse, GetAccountCoinsDataResponse, GetAccountCollectionsWithOwnedTokenResponse, GetAccountOwnedObjectsResponse, GetAccountOwnedTokensFromCollectionResponse, GetAccountOwnedTokensQueryResponse, GetAptosRequestOptions, GetChainTopUserTransactionsResponse, GetCollectionDataResponse, GetCurrentFungibleAssetBalancesResponse, GetCurrentTokenOwnershipResponse, GetDelegatedStakingActivitiesResponse, GetEventsResponse, GetFungibleAssetActivitiesResponse, GetFungibleAssetMetadataResponse, GetNumberOfDelegatorsResponse, GetOwnedTokensResponse, GetProcessorStatusResponse, GetRequestOptions, GetTokenActivityResponse, GetTokenDataResponse, GraphqlQuery, HARDENED_OFFSET, Hex, HexInput, HexInvalidReason, Identifier, InputEntryFunctionData, InputEntryFunctionDataWithRemoteABI, InputFeePayerTransaction, InputGenerateFeePayerRawTransactionArgs, InputGenerateFeePayerRawTransactionData, InputGenerateMultiAgentRawTransactionArgs, InputGenerateMultiAgentRawTransactionData, InputGenerateRawTransactionArgs, InputGenerateSingleSignerRawTransactionArgs, InputGenerateSingleSignerRawTransactionData, InputGenerateTransactionData, InputGenerateTransactionOptions, InputGenerateTransactionPayloadData, InputGenerateTransactionPayloadDataWithRemoteABI, InputMultiAgentTransaction, InputMultiSigData, InputMultiSigDataWithRemoteABI, InputScriptData, InputSimulateTransactionData, InputSimulateTransactionOptions, InputSingleSignerTransaction, InputSubmitTransactionData, InputViewRequestData, KeyType, LedgerInfo, LedgerVersion, MimeType, ModuleId, MoveAbility, MoveAddressType, MoveFunction, MoveFunctionGenericTypeParam, MoveFunctionId, MoveFunctionVisibility, MoveModule, MoveModuleBytecode, MoveModuleId, MoveObjectType, MoveOption, MoveOptionType, MoveResource, MoveScriptBytecode, MoveString, MoveStruct, MoveStructField, MoveStructId, MoveStructType, MoveType, MoveUint128Type, MoveUint16Type, MoveUint256Type, MoveUint32Type, MoveUint64Type, MoveUint8Type, MoveValue, MoveVector, MultiAgentRawTransaction, MultiEd25519PublicKey, MultiEd25519Signature, MultiKey, MultiSig, MultisigPayloadResponse, MultisigTransactionPayload, Network, NetworkToChainId, NetworkToFaucetAPI, NetworkToIndexerAPI, NetworkToNetworkName, NetworkToNodeAPI, OrderBy, OrderByValue, PaginationArgs, ParsingError, ParsingResult, PendingTransactionResponse, PostAptosRequestOptions, PostRequestOptions, PrivateKey, PublicKey, RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT, RawTransaction, RawTransactionWithData, RoleType, RotationProofChallenge, Script, ScriptFunctionArgument, ScriptFunctionArgumentTypes, ScriptPayloadResponse, ScriptTransactionArgumentVariants, ScriptWriteSet, Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1Signature, Serializable, Serializer, Signature, SignedTransaction, SigningScheme, SigningSchemeInput, SimpleEntryFunctionArgumentTypes, StateCheckpointTransactionResponse, StructTag, TableItemRequest, TokenStandard, TransactionArgument, TransactionAuthenticator, TransactionAuthenticatorEd25519, TransactionAuthenticatorFeePayer, TransactionAuthenticatorMultiAgent, TransactionAuthenticatorMultiEd25519, TransactionAuthenticatorSingleSender, TransactionAuthenticatorVariant, TransactionEd25519Signature, TransactionFeePayerSignature, TransactionMultiAgentSignature, TransactionMultiEd25519Signature, TransactionPayload, TransactionPayloadEntryFunction, TransactionPayloadMultisig, TransactionPayloadResponse, TransactionPayloadScript, TransactionPayloadVariants, TransactionResponse, TransactionResponseType, TransactionSecp256k1Signature, TransactionSignature, TransactionVariants, TypeTag, TypeTagAddress, TypeTagBool, TypeTagGeneric, TypeTagParserError, TypeTagParserErrorType, TypeTagReference, TypeTagSigner, TypeTagStruct, TypeTagU128, TypeTagU16, TypeTagU256, TypeTagU32, TypeTagU64, TypeTagU8, TypeTagVariants, TypeTagVector, U128, U16, U256, U32, U64, U8, Uint128, Uint16, Uint256, Uint32, Uint64, Uint8, UserTransactionResponse, ViewRequest, WaitForTransactionOptions, WriteSet, WriteSetChange, WriteSetChangeDeleteModule, WriteSetChangeDeleteResource, WriteSetChangeDeleteTableItem, WriteSetChangeWriteModule, WriteSetChangeWriteResource, WriteSetChangeWriteTableItem, aptosCoinStructTag, aptosRequest, buildTransaction, convertArgument, deriveKey, deriveTransactionType, deserializeFromScriptArgument, ensureBoolean, fetchEntryFunctionAbi, findFirstNonSignerArg, generateMultiSignersSignedTransaction, generateRawTransaction, generateSignedTransaction, generateSignedTransactionForSimulation, generateTransactionPayload, generateTransactionPayloadWithABI, get, getAptosFullNode, getAuthenticatorForSimulation, getFunctionParts, getSigningMessage, isBcsAddress, isBcsBool, isBcsFixedBytes, isBcsString, isBcsU128, isBcsU16, isBcsU256, isBcsU32, isBcsU64, isBcsU8, isBool, isLargeNumber, isNull, isNumber, isScriptDataInput, isString, isValidBIP44Path, isValidHardenedPath, mnemonicToSeed, objectStructTag, optionStructTag, outOfRangeErrorMessage, paginateWithCursor, parseTypeTag, post, postAptosFaucet, postAptosFullNode, postAptosIndexer, request, sign, splitPath, standardizeTypeTags, stringStructTag, throwTypeMismatch, validateNumberInRange };
5855
+ /**
5856
+ * A class to handle all `Build` transaction operations
5857
+ */
5858
+ declare class Build {
5859
+ readonly config: AptosConfig;
5860
+ constructor(config: AptosConfig);
5861
+ transaction(args: {
5862
+ sender: AccountAddressInput;
5863
+ data: InputGenerateTransactionPayloadData;
5864
+ options?: InputGenerateTransactionOptions;
5865
+ withFeePayer?: boolean;
5866
+ }): Promise<SingleSignerTransaction>;
5867
+ multiAgentTransaction(args: {
5868
+ sender: AccountAddressInput;
5869
+ data: InputGenerateTransactionPayloadData;
5870
+ secondarySignerAddresses: AccountAddressInput[];
5871
+ options?: InputGenerateTransactionOptions;
5872
+ withFeePayer?: boolean;
5873
+ }): Promise<MultiAgentTransaction>;
5874
+ }
5875
+
5876
+ /**
5877
+ * A class to handle all `Sign` transaction operations
5878
+ */
5879
+ declare class Sign {
5880
+ readonly config: AptosConfig;
5881
+ constructor(config: AptosConfig);
5882
+ transaction(args: {
5883
+ signer: Account$1;
5884
+ transaction: AnyRawTransaction;
5885
+ }): AccountAuthenticator;
5886
+ transactionAsFeePayer(args: {
5887
+ signer: Account$1;
5888
+ transaction: AnyRawTransaction;
5889
+ }): AccountAuthenticator;
5890
+ }
5891
+
5892
+ /**
5893
+ * A class to handle all `Simulate` transaction operations
5894
+ */
5895
+ declare class Simulate {
5896
+ readonly config: AptosConfig;
5897
+ constructor(config: AptosConfig);
5898
+ transaction(args: {
5899
+ signerPublicKey: PublicKey;
5900
+ transaction: AnyRawTransaction;
5901
+ feePayerPublicKey?: PublicKey;
5902
+ options?: InputSimulateTransactionOptions;
5903
+ }): Promise<Array<UserTransactionResponse>>;
5904
+ multiAgentTransaction(args: {
5905
+ signerPublicKey: PublicKey;
5906
+ transaction: AnyRawTransaction;
5907
+ secondarySignersPublicKeys: Array<PublicKey>;
5908
+ feePayerPublicKey?: PublicKey;
5909
+ options?: InputSimulateTransactionOptions;
5910
+ }): Promise<Array<UserTransactionResponse>>;
5911
+ }
5912
+
5913
+ /**
5914
+ * A class to handle all `Submit` transaction operations
5915
+ */
5916
+ declare class Submit {
5917
+ readonly config: AptosConfig;
5918
+ constructor(config: AptosConfig);
5919
+ transaction(args: {
5920
+ transaction: AnyRawTransaction;
5921
+ senderAuthenticator: AccountAuthenticator;
5922
+ feePayerAuthenticator?: AccountAuthenticator;
5923
+ }): Promise<PendingTransactionResponse>;
5924
+ multiAgentTransaction(args: {
5925
+ transaction: AnyRawTransaction;
5926
+ senderAuthenticator: AccountAuthenticator;
5927
+ additionalSignersAuthenticators: Array<AccountAuthenticator>;
5928
+ feePayerAuthenticator?: AccountAuthenticator;
5929
+ }): Promise<PendingTransactionResponse>;
5930
+ }
5931
+
5932
+ /**
5933
+ * This class is the main entry point into Aptos's
5934
+ * APIs and separates functionality into different namespaces.
5935
+ *
5936
+ * To use the SDK, create a new Aptos instance to get access
5937
+ * to all the sdk functionality.
5938
+ */
5939
+ declare class Aptos {
5940
+ readonly config: AptosConfig;
5941
+ readonly account: Account;
5942
+ readonly ans: ANS;
5943
+ readonly coin: Coin;
5944
+ readonly digitalAsset: DigitalAsset;
5945
+ readonly event: Event;
5946
+ readonly faucet: Faucet;
5947
+ readonly fungibleAsset: FungibleAsset;
5948
+ readonly general: General;
5949
+ readonly staking: Staking;
5950
+ readonly transaction: Transaction;
5951
+ readonly transactionSubmission: TransactionSubmission;
5952
+ readonly build: Build;
5953
+ readonly sign: Sign;
5954
+ readonly simulate: Simulate;
5955
+ readonly submit: Submit;
5956
+ constructor(settings?: AptosConfig);
5957
+ }
5958
+ interface Aptos extends Account, Coin, DigitalAsset, Event, Faucet, FungibleAsset, General, Staking, Transaction, ANS, TransactionSubmission {
5959
+ }
5960
+
5961
+ /**
5962
+ * The API response type
5963
+ *
5964
+ * @param status - the response status. i.e. 200
5965
+ * @param statusText - the response message
5966
+ * @param data the response data
5967
+ * @param url the url the request was made to
5968
+ * @param headers the response headers
5969
+ * @param config (optional) - the request object
5970
+ * @param request (optional) - the request object
5971
+ */
5972
+ interface AptosResponse<Req, Res> {
5973
+ status: number;
5974
+ statusText: string;
5975
+ data: Res;
5976
+ url: string;
5977
+ headers: any;
5978
+ config?: any;
5979
+ request?: Req;
5980
+ }
5981
+ /**
5982
+ * The type returned from an API error
5983
+ *
5984
+ * @param name - the error name "AptosApiError"
5985
+ * @param url the url the request was made to
5986
+ * @param status - the response status. i.e. 400
5987
+ * @param statusText - the response message
5988
+ * @param data the response data
5989
+ * @param request - the AptosRequest
5990
+ */
5991
+ declare class AptosApiError extends Error {
5992
+ readonly url: string;
5993
+ readonly status: number;
5994
+ readonly statusText: string;
5995
+ readonly data: any;
5996
+ readonly request: AptosRequest;
5997
+ constructor(request: AptosRequest, response: AptosResponse<any, any>, message: string);
5998
+ }
5999
+
6000
+ /**
6001
+ * Given a url and method, sends the request with axios and
6002
+ * returns the response.
6003
+ */
6004
+ declare function request<Req, Res>(options: ClientRequest<Req>, client: Client): Promise<ClientResponse<Res>>;
6005
+ /**
6006
+ * The main function to use when doing an API request.
6007
+ *
6008
+ * @param options AptosRequest
6009
+ * @param aptosConfig The config information for the SDK client instance
6010
+ * @returns the response or AptosApiError
6011
+ */
6012
+ declare function aptosRequest<Req extends {}, Res extends {}>(options: AptosRequest, aptosConfig: AptosConfig): Promise<AptosResponse<Req, Res>>;
6013
+
6014
+ type GetRequestOptions = {
6015
+ /**
6016
+ * The config for the API client
6017
+ */
6018
+ aptosConfig: AptosConfig;
6019
+ /**
6020
+ * The type of API endpoint to call e.g. fullnode, indexer, etc
6021
+ */
6022
+ type: AptosApiType;
6023
+ /**
6024
+ * The name of the API method
6025
+ */
6026
+ originMethod: string;
6027
+ /**
6028
+ * The URL path to the API method
6029
+ */
6030
+ path: string;
6031
+ /**
6032
+ * The content type of the request body
6033
+ */
6034
+ contentType?: MimeType;
6035
+ /**
6036
+ * The accepted content type of the response of the API
6037
+ */
6038
+ acceptType?: MimeType;
6039
+ /**
6040
+ * The query parameters for the request
6041
+ */
6042
+ params?: Record<string, string | AnyNumber | boolean | undefined>;
6043
+ /**
6044
+ * Specific client overrides for this request to override aptosConfig
6045
+ */
6046
+ overrides?: ClientConfig;
6047
+ };
6048
+ type GetAptosRequestOptions = Omit<GetRequestOptions, "type">;
6049
+ /**
6050
+ * Main function to do a Get request
6051
+ *
6052
+ * @param options GetRequestOptions
6053
+ * @returns
6054
+ */
6055
+ declare function get<Req extends {}, Res extends {}>(options: GetRequestOptions): Promise<AptosResponse<Req, Res>>;
6056
+ declare function getAptosFullNode<Req extends {}, Res extends {}>(options: GetAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
6057
+ declare function paginateWithCursor<Req extends Record<string, any>, Res extends any[]>(options: GetAptosRequestOptions): Promise<Res>;
6058
+
6059
+ type PostRequestOptions = {
6060
+ /**
6061
+ * The config for the API client
6062
+ */
6063
+ aptosConfig: AptosConfig;
6064
+ /**
6065
+ * The type of API endpoint to call e.g. fullnode, indexer, etc
6066
+ */
6067
+ type: AptosApiType;
6068
+ /**
6069
+ * The name of the API method
6070
+ */
6071
+ originMethod: string;
6072
+ /**
6073
+ * The URL path to the API method
6074
+ */
6075
+ path: string;
6076
+ /**
6077
+ * The content type of the request body
6078
+ */
6079
+ contentType?: MimeType;
6080
+ /**
6081
+ * The accepted content type of the response of the API
6082
+ */
6083
+ acceptType?: MimeType;
6084
+ /**
6085
+ * The query parameters for the request
6086
+ */
6087
+ params?: Record<string, string | AnyNumber | boolean | undefined>;
6088
+ /**
6089
+ * The body of the request, should match the content type of the request
6090
+ */
6091
+ body?: any;
6092
+ /**
6093
+ * Specific client overrides for this request to override aptosConfig
6094
+ */
6095
+ overrides?: ClientConfig;
6096
+ };
6097
+ type PostAptosRequestOptions = Omit<PostRequestOptions, "type">;
6098
+ /**
6099
+ * Main function to do a Post request
6100
+ *
6101
+ * @param options PostRequestOptions
6102
+ * @returns
6103
+ */
6104
+ declare function post<Req extends {}, Res extends {}>(options: PostRequestOptions): Promise<AptosResponse<Req, Res>>;
6105
+ declare function postAptosFullNode<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
6106
+ declare function postAptosIndexer<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
6107
+ declare function postAptosFaucet<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
6108
+
6109
+ export { APTOS_BIP44_REGEX, APTOS_COIN, APTOS_HARDENED_REGEX, Account$1 as Account, AccountAddress, AccountAddressInput, AccountAuthenticator, AccountAuthenticatorEd25519, AccountAuthenticatorMultiEd25519, AccountAuthenticatorMultiKey, AccountAuthenticatorSingleKey, AccountAuthenticatorVariant, AccountData, AccountEd25519Signature, AccountMultiEd25519Signature, AccountSecp256k1Signature, AccountSignature, AddressInvalidReason, AnyNumber, AnyPublicKeyVariant, AnyRawTransaction, AnyRawTransactionInstance, AnySignatureVariant, AnyTransactionPayloadInstance, Aptos, AptosApiError, AptosApiType, AptosConfig, AptosRequest, AptosResponse, AptosSettings, AuthenticationKey, AuthenticationKeyScheme, Block, BlockMetadataTransactionResponse, Bool, CKDPriv, ChainId, Client, ClientConfig, ClientRequest, ClientResponse, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_NETWORK, DEFAULT_TXN_EXP_SEC_FROM_NOW, DEFAULT_TXN_TIMEOUT_SEC, DecodedTableData, DeletedTableData, DeriveScheme, DerivedKeys, Deserializable, Deserializer, DirectWriteSet, Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature, EntryFunction, EntryFunctionABI, EntryFunctionArgument, EntryFunctionArgumentTypes, EntryFunctionBytes, EntryFunctionPayloadResponse, Event$1 as Event, EventGuid, FeePayerRawTransaction, FixedBytes, GasEstimation, GenerateAccount, GenerateAccountWithEd25519, GenerateAccountWithSingleSignerSecp256k1Key, GenesisPayload, GenesisTransactionResponse, GetANSNameResponse, GetAccountCoinsDataResponse, GetAccountCollectionsWithOwnedTokenResponse, GetAccountOwnedObjectsResponse, GetAccountOwnedTokensFromCollectionResponse, GetAccountOwnedTokensQueryResponse, GetAptosRequestOptions, GetChainTopUserTransactionsResponse, GetCollectionDataResponse, GetCurrentFungibleAssetBalancesResponse, GetCurrentTokenOwnershipResponse, GetDelegatedStakingActivitiesResponse, GetEventsResponse, GetFungibleAssetActivitiesResponse, GetFungibleAssetMetadataResponse, GetNumberOfDelegatorsResponse, GetOwnedTokensResponse, GetProcessorStatusResponse, GetRequestOptions, GetTokenActivityResponse, GetTokenDataResponse, GraphqlQuery, HARDENED_OFFSET, Hex, HexInput, HexInvalidReason, Identifier, InputEntryFunctionData, InputEntryFunctionDataWithRemoteABI, InputGenerateMultiAgentRawTransactionArgs, InputGenerateMultiAgentRawTransactionData, InputGenerateRawTransactionArgs, InputGenerateSingleSignerRawTransactionArgs, InputGenerateSingleSignerRawTransactionData, InputGenerateTransactionData, InputGenerateTransactionOptions, InputGenerateTransactionPayloadData, InputGenerateTransactionPayloadDataWithRemoteABI, InputMultiSigData, InputMultiSigDataWithRemoteABI, InputScriptData, InputSimulateTransactionData, InputSimulateTransactionOptions, InputSubmitTransactionData, InputViewRequestData, KeyType, LedgerInfo, LedgerVersion, MimeType, ModuleId, MoveAbility, MoveAddressType, MoveFunction, MoveFunctionGenericTypeParam, MoveFunctionId, MoveFunctionVisibility, MoveModule, MoveModuleBytecode, MoveModuleId, MoveObjectType, MoveOption, MoveOptionType, MoveResource, MoveScriptBytecode, MoveString, MoveStruct, MoveStructField, MoveStructId, MoveStructType, MoveType, MoveUint128Type, MoveUint16Type, MoveUint256Type, MoveUint32Type, MoveUint64Type, MoveUint8Type, MoveValue, MoveVector, MultiAgentRawTransaction, MultiAgentTransaction, MultiEd25519PublicKey, MultiEd25519Signature, MultiKey, MultiSig, MultisigPayloadResponse, MultisigTransactionPayload, Network, NetworkToChainId, NetworkToFaucetAPI, NetworkToIndexerAPI, NetworkToNetworkName, NetworkToNodeAPI, OrderBy, OrderByValue, PaginationArgs, ParsingError, ParsingResult, PendingTransactionResponse, PostAptosRequestOptions, PostRequestOptions, PrivateKey, PublicKey, RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT, RawTransaction, RawTransactionWithData, RoleType, RotationProofChallenge, Script, ScriptFunctionArgument, ScriptFunctionArgumentTypes, ScriptPayloadResponse, ScriptTransactionArgumentVariants, ScriptWriteSet, Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1Signature, Serializable, Serializer, Signature, SignedTransaction, SigningScheme, SigningSchemeInput, SimpleEntryFunctionArgumentTypes, SingleSignerTransaction, StateCheckpointTransactionResponse, StructTag, TableItemRequest, TokenStandard, TransactionArgument, TransactionAuthenticator, TransactionAuthenticatorEd25519, TransactionAuthenticatorFeePayer, TransactionAuthenticatorMultiAgent, TransactionAuthenticatorMultiEd25519, TransactionAuthenticatorSingleSender, TransactionAuthenticatorVariant, TransactionEd25519Signature, TransactionFeePayerSignature, TransactionMultiAgentSignature, TransactionMultiEd25519Signature, TransactionPayload, TransactionPayloadEntryFunction, TransactionPayloadMultisig, TransactionPayloadResponse, TransactionPayloadScript, TransactionPayloadVariants, TransactionResponse, TransactionResponseType, TransactionSecp256k1Signature, TransactionSignature, TransactionVariants, TypeTag, TypeTagAddress, TypeTagBool, TypeTagGeneric, TypeTagParserError, TypeTagParserErrorType, TypeTagReference, TypeTagSigner, TypeTagStruct, TypeTagU128, TypeTagU16, TypeTagU256, TypeTagU32, TypeTagU64, TypeTagU8, TypeTagVariants, TypeTagVector, U128, U16, U256, U32, U64, U8, Uint128, Uint16, Uint256, Uint32, Uint64, Uint8, UserTransactionResponse, ViewRequest, WaitForTransactionOptions, WriteSet, WriteSetChange, WriteSetChangeDeleteModule, WriteSetChangeDeleteResource, WriteSetChangeDeleteTableItem, WriteSetChangeWriteModule, WriteSetChangeWriteResource, WriteSetChangeWriteTableItem, aptosCoinStructTag, aptosRequest, buildTransaction, convertArgument, deriveKey, deriveTransactionType, deserializeFromScriptArgument, ensureBoolean, fetchEntryFunctionAbi, findFirstNonSignerArg, generateMultiSignersSignedTransaction, generateRawTransaction, generateSignedTransaction, generateSignedTransactionForSimulation, generateTransactionPayload, generateTransactionPayloadWithABI, get, getAptosFullNode, getAuthenticatorForSimulation, getFunctionParts, getSigningMessage, isBcsAddress, isBcsBool, isBcsFixedBytes, isBcsString, isBcsU128, isBcsU16, isBcsU256, isBcsU32, isBcsU64, isBcsU8, isBool, isLargeNumber, isNull, isNumber, isScriptDataInput, isString, isValidBIP44Path, isValidHardenedPath, mnemonicToSeed, objectStructTag, optionStructTag, outOfRangeErrorMessage, paginateWithCursor, parseTypeTag, post, postAptosFaucet, postAptosFullNode, postAptosIndexer, request, sign, splitPath, standardizeTypeTags, stringStructTag, throwTypeMismatch, validateNumberInRange };