@aptos-labs/ts-sdk 0.0.2 → 0.0.3

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 (51) hide show
  1. package/README.md +32 -24
  2. package/dist/browser/index.global.js +25 -25
  3. package/dist/browser/index.global.js.map +1 -1
  4. package/dist/cjs/index.d.ts +665 -157
  5. package/dist/cjs/index.js +1291 -652
  6. package/dist/cjs/index.js.map +1 -1
  7. package/dist/esm/index.d.ts +665 -157
  8. package/dist/esm/index.mjs +1224 -650
  9. package/dist/esm/index.mjs.map +1 -1
  10. package/dist/types/index.d.ts +20 -19
  11. package/dist/types/index.js +4 -2
  12. package/dist/types/index.js.map +1 -1
  13. package/package.json +1 -1
  14. package/src/api/account.ts +2 -2
  15. package/src/api/coin.ts +5 -5
  16. package/src/api/digitalAsset.ts +5 -5
  17. package/src/api/event.ts +2 -2
  18. package/src/api/faucet.ts +7 -3
  19. package/src/api/transactionSubmission.ts +24 -24
  20. package/src/bcs/serializable/fixedBytes.ts +1 -1
  21. package/src/bcs/serializable/moveStructs.ts +16 -36
  22. package/src/core/account.ts +12 -8
  23. package/src/core/accountAddress.ts +4 -2
  24. package/src/core/authenticationKey.ts +24 -2
  25. package/src/core/crypto/anyPublicKey.ts +14 -18
  26. package/src/core/crypto/ed25519.ts +6 -0
  27. package/src/core/crypto/index.ts +1 -0
  28. package/src/core/crypto/multiKey.ts +122 -0
  29. package/src/core/crypto/secp256k1.ts +2 -0
  30. package/src/index.ts +1 -2
  31. package/src/internal/account.ts +5 -5
  32. package/src/internal/coin.ts +8 -8
  33. package/src/internal/digitalAsset.ts +7 -7
  34. package/src/internal/event.ts +2 -2
  35. package/src/internal/faucet.ts +9 -5
  36. package/src/internal/transactionSubmission.ts +40 -15
  37. package/src/transactions/authenticator/account.ts +39 -0
  38. package/src/transactions/authenticator/index.ts +5 -0
  39. package/src/transactions/authenticator/transaction.ts +6 -6
  40. package/src/transactions/index.ts +9 -0
  41. package/src/transactions/instances/index.ts +1 -0
  42. package/src/transactions/instances/transactionPayload.ts +13 -8
  43. package/src/transactions/transactionBuilder/helpers.ts +99 -0
  44. package/src/transactions/transactionBuilder/index.ts +6 -0
  45. package/src/transactions/transactionBuilder/remoteAbi.ts +339 -0
  46. package/src/transactions/{transaction_builder/transaction_builder.ts → transactionBuilder/transactionBuilder.ts} +149 -68
  47. package/src/transactions/typeTag/index.ts +385 -0
  48. package/src/transactions/typeTag/parser.ts +21 -8
  49. package/src/transactions/types.ts +87 -46
  50. package/src/types/index.ts +18 -16
  51. package/src/transactions/typeTag/typeTag.ts +0 -487
@@ -450,7 +450,7 @@ declare enum MimeType {
450
450
  */
451
451
  declare type HexInput = string | Uint8Array;
452
452
  /**
453
- * Script transaction arguments enum as they are represented in Rust
453
+ * TypeTag enum as they are represented in Rust
454
454
  * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/language_storage.rs#L27}
455
455
  */
456
456
  declare enum TypeTagVariants {
@@ -464,7 +464,9 @@ declare enum TypeTagVariants {
464
464
  Struct = 7,
465
465
  U16 = 8,
466
466
  U32 = 9,
467
- U256 = 10
467
+ U256 = 10,
468
+ Reference = 254,
469
+ Generic = 255
468
470
  }
469
471
  /**
470
472
  * Script transaction arguments enum as they are represented in Rust
@@ -507,7 +509,7 @@ declare enum TransactionAuthenticatorVariant {
507
509
  MultiEd25519 = 1,
508
510
  MultiAgent = 2,
509
511
  FeePayer = 3,
510
- SingleSenderTransactionAuthenticator = 4
512
+ SingleSender = 4
511
513
  }
512
514
  /**
513
515
  * Transaction Authenticator enum as they are represented in Rust
@@ -647,7 +649,7 @@ declare type GasEstimation = {
647
649
  prioritized_gas_estimate?: number;
648
650
  };
649
651
  declare type MoveResource = {
650
- type: MoveResourceType;
652
+ type: MoveStructType;
651
653
  data: {};
652
654
  };
653
655
  declare type AccountData = {
@@ -883,7 +885,7 @@ declare type DeletedTableData = {
883
885
  declare type TransactionPayloadResponse = EntryFunctionPayloadResponse | ScriptPayloadResponse | MultisigPayloadResponse;
884
886
  declare type EntryFunctionPayloadResponse = {
885
887
  type: string;
886
- function: MoveResourceType;
888
+ function: MoveStructType;
887
889
  /**
888
890
  * Type arguments of the function
889
891
  */
@@ -1019,12 +1021,11 @@ declare type MoveUint128Type = string;
1019
1021
  declare type MoveUint256Type = string;
1020
1022
  declare type MoveAddressType = string;
1021
1023
  declare type MoveObjectType = string;
1022
- declare type MoveStructType = `${string}::${string}::${string}`;
1023
1024
  declare type MoveOptionType = MoveType | null | undefined;
1024
1025
  /**
1025
- * String representation of a on-chain Move struct type.
1026
+ * This is the format for a fully qualified struct, resource, or entry function in Move.
1026
1027
  */
1027
- declare type MoveResourceType = `${string}::${string}::${string}`;
1028
+ declare type MoveStructType = `${string}::${string}::${string}`;
1028
1029
  declare type MoveType = boolean | string | MoveUint8Type | MoveUint16Type | MoveUint32Type | MoveUint64Type | MoveUint128Type | MoveUint256Type | MoveAddressType | MoveObjectType | MoveStructType | Array<MoveType>;
1029
1030
  /**
1030
1031
  * Possible Move values acceptable by move functions (entry, view)
@@ -1194,20 +1195,20 @@ declare type Block = {
1194
1195
  */
1195
1196
  declare type ViewRequestData = {
1196
1197
  function: MoveStructType;
1197
- typeArguments?: Array<MoveResourceType>;
1198
+ typeArguments?: Array<MoveStructType>;
1198
1199
  functionArguments?: Array<MoveValue>;
1199
1200
  };
1200
1201
  /**
1201
1202
  * View request for the Move view function API
1202
1203
  *
1203
- * `type MoveResourceType = ${string}::${string}::${string}`;
1204
+ * `type MoveStructType = ${string}::${string}::${string}`;
1204
1205
  */
1205
1206
  declare type ViewRequest = {
1206
- function: MoveResourceType;
1207
+ function: MoveStructType;
1207
1208
  /**
1208
1209
  * Type arguments of the function
1209
1210
  */
1210
- type_arguments: Array<MoveResourceType>;
1211
+ type_arguments: Array<MoveStructType>;
1211
1212
  /**
1212
1213
  * Arguments of the function
1213
1214
  */
@@ -1242,17 +1243,14 @@ declare enum SigningScheme {
1242
1243
  /**
1243
1244
  * For SingleKey ecdsa
1244
1245
  */
1245
- SingleKey = 2
1246
+ SingleKey = 2,
1247
+ MultiKey = 3
1246
1248
  }
1247
1249
  declare enum SigningSchemeInput {
1248
1250
  /**
1249
1251
  * For Ed25519PublicKey
1250
1252
  */
1251
1253
  Ed25519 = 0,
1252
- /**
1253
- * For MultiEd25519PublicKey
1254
- */
1255
- MultiEd25519 = 1,
1256
1254
  /**
1257
1255
  * For Secp256k1Ecdsa
1258
1256
  */
@@ -1283,6 +1281,9 @@ declare enum DeriveScheme {
1283
1281
  */
1284
1282
  DeriveResourceAccountAddress = 255
1285
1283
  }
1284
+ /**
1285
+ * Option properties to pass for waitForTransaction() function
1286
+ */
1286
1287
  declare type WaitForTransactionOptions = {
1287
1288
  timeoutSecs?: number;
1288
1289
  checkSuccess?: boolean;
@@ -1295,7 +1296,7 @@ declare type WaitForTransactionOptions = {
1295
1296
  * In this case `legacy` is always true
1296
1297
  */
1297
1298
  declare type GenerateAccountWithLegacyKey = {
1298
- scheme?: SigningSchemeInput.Ed25519 | SigningSchemeInput.MultiEd25519;
1299
+ scheme?: SigningSchemeInput.Ed25519;
1299
1300
  legacy: true;
1300
1301
  };
1301
1302
  /**
@@ -1312,4 +1313,4 @@ declare type GenerateAccountWithUnifiedKey = {
1312
1313
  */
1313
1314
  declare type GenerateAccount = GenerateAccountWithLegacyKey | GenerateAccountWithUnifiedKey;
1314
1315
 
1315
- export { AccountAuthenticatorVariant, AccountData, AccountEd25519Signature, AccountMultiEd25519Signature, AccountSecp256k1Signature, AccountSignature, AnyNumber, AnyPublicKeyVariant, AnySignatureVariant, AptosRequest, AptosSettings, AuthenticationKeyScheme, Block, BlockMetadataTransactionResponse, Client, ClientConfig, ClientRequest, ClientResponse, DecodedTableData, DeletedTableData, DeriveScheme, DirectWriteSet, EntryFunctionPayloadResponse, Event, EventGuid, GasEstimation, GenerateAccount, GenerateAccountWithLegacyKey, GenerateAccountWithUnifiedKey, GenesisPayload, GenesisTransactionResponse, GetAccountCoinsDataResponse, GetAccountCollectionsWithOwnedTokenResponse, GetAccountOwnedObjectsResponse, GetAccountOwnedTokensFromCollectionResponse, GetAccountOwnedTokensQueryResponse, GetChainTopUserTransactionsResponse, GetCollectionDataResponse, GetCurrentFungibleAssetBalancesResponse, GetCurrentTokenOwnershipResponse, GetDelegatedStakingActivitiesResponse, GetEventsResponse, GetFungibleAssetActivitiesResponse, GetFungibleAssetMetadataResponse, GetNumberOfDelegatorsResponse, GetOwnedTokensResponse, GetProcessorStatusResponse, GetTokenActivityResponse, GetTokenDataResponse, GraphqlQuery, HexInput, LedgerInfo, LedgerVersion, MimeType, MoveAbility, MoveAddressType, MoveFunction, MoveFunctionGenericTypeParam, MoveFunctionVisibility, MoveModule, MoveModuleBytecode, MoveModuleId, MoveObjectType, MoveOptionType, MoveResource, MoveResourceType, MoveScriptBytecode, MoveStruct, MoveStructField, MoveStructType, MoveType, MoveUint128Type, MoveUint16Type, MoveUint256Type, MoveUint32Type, MoveUint64Type, MoveUint8Type, MoveValue, MultisigPayloadResponse, OrderBy, OrderByValue, PaginationArgs, PendingTransactionResponse, RoleType, ScriptPayloadResponse, ScriptTransactionArgumentVariants, ScriptWriteSet, SigningScheme, SigningSchemeInput, StateCheckpointTransactionResponse, TableItemRequest, TokenStandard, TransactionAuthenticatorVariant, TransactionEd25519Signature, TransactionFeePayerSignature, TransactionMultiAgentSignature, TransactionMultiEd25519Signature, TransactionPayloadResponse, TransactionPayloadVariants, TransactionResponse, TransactionResponseType, TransactionSecp256k1Signature, TransactionSignature, TransactionVariants, TypeTagVariants, Uint128, Uint16, Uint256, Uint32, Uint64, Uint8, UserTransactionResponse, ViewRequest, ViewRequestData, WaitForTransactionOptions, WriteSet, WriteSetChange, WriteSetChangeDeleteModule, WriteSetChangeDeleteResource, WriteSetChangeDeleteTableItem, WriteSetChangeWriteModule, WriteSetChangeWriteResource, WriteSetChangeWriteTableItem };
1316
+ export { AccountAuthenticatorVariant, AccountData, AccountEd25519Signature, AccountMultiEd25519Signature, AccountSecp256k1Signature, AccountSignature, AnyNumber, AnyPublicKeyVariant, AnySignatureVariant, AptosRequest, AptosSettings, AuthenticationKeyScheme, Block, BlockMetadataTransactionResponse, Client, ClientConfig, ClientRequest, ClientResponse, DecodedTableData, DeletedTableData, DeriveScheme, DirectWriteSet, EntryFunctionPayloadResponse, Event, EventGuid, GasEstimation, GenerateAccount, GenerateAccountWithLegacyKey, GenerateAccountWithUnifiedKey, GenesisPayload, GenesisTransactionResponse, GetAccountCoinsDataResponse, GetAccountCollectionsWithOwnedTokenResponse, GetAccountOwnedObjectsResponse, GetAccountOwnedTokensFromCollectionResponse, GetAccountOwnedTokensQueryResponse, GetChainTopUserTransactionsResponse, GetCollectionDataResponse, GetCurrentFungibleAssetBalancesResponse, GetCurrentTokenOwnershipResponse, GetDelegatedStakingActivitiesResponse, GetEventsResponse, GetFungibleAssetActivitiesResponse, GetFungibleAssetMetadataResponse, GetNumberOfDelegatorsResponse, GetOwnedTokensResponse, GetProcessorStatusResponse, GetTokenActivityResponse, GetTokenDataResponse, GraphqlQuery, HexInput, LedgerInfo, LedgerVersion, MimeType, MoveAbility, MoveAddressType, MoveFunction, MoveFunctionGenericTypeParam, MoveFunctionVisibility, MoveModule, MoveModuleBytecode, MoveModuleId, MoveObjectType, MoveOptionType, MoveResource, MoveScriptBytecode, MoveStruct, MoveStructField, MoveStructType, MoveType, MoveUint128Type, MoveUint16Type, MoveUint256Type, MoveUint32Type, MoveUint64Type, MoveUint8Type, MoveValue, MultisigPayloadResponse, OrderBy, OrderByValue, PaginationArgs, PendingTransactionResponse, RoleType, ScriptPayloadResponse, ScriptTransactionArgumentVariants, ScriptWriteSet, SigningScheme, SigningSchemeInput, StateCheckpointTransactionResponse, TableItemRequest, TokenStandard, TransactionAuthenticatorVariant, TransactionEd25519Signature, TransactionFeePayerSignature, TransactionMultiAgentSignature, TransactionMultiEd25519Signature, TransactionPayloadResponse, TransactionPayloadVariants, TransactionResponse, TransactionResponseType, TransactionSecp256k1Signature, TransactionSignature, TransactionVariants, TypeTagVariants, Uint128, Uint16, Uint256, Uint32, Uint64, Uint8, UserTransactionResponse, ViewRequest, ViewRequestData, WaitForTransactionOptions, WriteSet, WriteSetChange, WriteSetChangeDeleteModule, WriteSetChangeDeleteResource, WriteSetChangeDeleteTableItem, WriteSetChangeWriteModule, WriteSetChangeWriteResource, WriteSetChangeWriteTableItem };
@@ -56,6 +56,8 @@ var TypeTagVariants = /* @__PURE__ */ ((TypeTagVariants2) => {
56
56
  TypeTagVariants2[TypeTagVariants2["U16"] = 8] = "U16";
57
57
  TypeTagVariants2[TypeTagVariants2["U32"] = 9] = "U32";
58
58
  TypeTagVariants2[TypeTagVariants2["U256"] = 10] = "U256";
59
+ TypeTagVariants2[TypeTagVariants2["Reference"] = 254] = "Reference";
60
+ TypeTagVariants2[TypeTagVariants2["Generic"] = 255] = "Generic";
59
61
  return TypeTagVariants2;
60
62
  })(TypeTagVariants || {});
61
63
  var ScriptTransactionArgumentVariants = /* @__PURE__ */ ((ScriptTransactionArgumentVariants2) => {
@@ -86,7 +88,7 @@ var TransactionAuthenticatorVariant = /* @__PURE__ */ ((TransactionAuthenticator
86
88
  TransactionAuthenticatorVariant2[TransactionAuthenticatorVariant2["MultiEd25519"] = 1] = "MultiEd25519";
87
89
  TransactionAuthenticatorVariant2[TransactionAuthenticatorVariant2["MultiAgent"] = 2] = "MultiAgent";
88
90
  TransactionAuthenticatorVariant2[TransactionAuthenticatorVariant2["FeePayer"] = 3] = "FeePayer";
89
- TransactionAuthenticatorVariant2[TransactionAuthenticatorVariant2["SingleSenderTransactionAuthenticator"] = 4] = "SingleSenderTransactionAuthenticator";
91
+ TransactionAuthenticatorVariant2[TransactionAuthenticatorVariant2["SingleSender"] = 4] = "SingleSender";
90
92
  return TransactionAuthenticatorVariant2;
91
93
  })(TransactionAuthenticatorVariant || {});
92
94
  var AccountAuthenticatorVariant = /* @__PURE__ */ ((AccountAuthenticatorVariant2) => {
@@ -136,11 +138,11 @@ var SigningScheme = /* @__PURE__ */ ((SigningScheme2) => {
136
138
  SigningScheme2[SigningScheme2["Ed25519"] = 0] = "Ed25519";
137
139
  SigningScheme2[SigningScheme2["MultiEd25519"] = 1] = "MultiEd25519";
138
140
  SigningScheme2[SigningScheme2["SingleKey"] = 2] = "SingleKey";
141
+ SigningScheme2[SigningScheme2["MultiKey"] = 3] = "MultiKey";
139
142
  return SigningScheme2;
140
143
  })(SigningScheme || {});
141
144
  var SigningSchemeInput = /* @__PURE__ */ ((SigningSchemeInput2) => {
142
145
  SigningSchemeInput2[SigningSchemeInput2["Ed25519"] = 0] = "Ed25519";
143
- SigningSchemeInput2[SigningSchemeInput2["MultiEd25519"] = 1] = "MultiEd25519";
144
146
  SigningSchemeInput2[SigningSchemeInput2["Secp256k1Ecdsa"] = 2] = "Secp256k1Ecdsa";
145
147
  return SigningSchemeInput2;
146
148
  })(SigningSchemeInput || {});
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Network } from \"../utils/apiEndpoints\";\n\nexport * from \"./indexer\";\n\nexport enum MimeType {\n /**\n * JSON representation, used for transaction submission and accept type JSON output\n */\n JSON = \"application/json\",\n /**\n * BCS representation, used for accept type BCS output\n */\n BCS = \"application/x-bcs\",\n /**\n * BCS representation, used for transaction submission in BCS input\n */\n BCS_SIGNED_TRANSACTION = \"application/x.aptos.signed_transaction+bcs\",\n}\n\n/**\n * Hex data as input to a function\n */\nexport type HexInput = string | Uint8Array;\n\n/**\n * Script transaction arguments enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/language_storage.rs#L27}\n */\nexport enum TypeTagVariants {\n Bool = 0,\n U8 = 1,\n U64 = 2,\n U128 = 3,\n Address = 4,\n Signer = 5,\n Vector = 6,\n Struct = 7,\n U16 = 8,\n U32 = 9,\n U256 = 10,\n}\n\n/**\n * Script transaction arguments enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/transaction_argument.rs#L11}\n */\nexport enum ScriptTransactionArgumentVariants {\n U8 = 0,\n U64 = 1,\n U128 = 2,\n Address = 3,\n U8Vector = 4,\n Bool = 5,\n U16 = 6,\n U32 = 7,\n U256 = 8,\n}\n\n/**\n * Transaction payload enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L478}\n */\nexport enum TransactionPayloadVariants {\n Script = 0,\n EntryFunction = 2,\n Multisig = 3,\n}\n\n/**\n * Transaction variants enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L440}\n */\nexport enum TransactionVariants {\n MultiAgentTransaction = 0,\n FeePayerTransaction = 1,\n}\n\n/**\n * Transaction Authenticator enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L44}\n */\nexport enum TransactionAuthenticatorVariant {\n Ed25519 = 0,\n MultiEd25519 = 1,\n MultiAgent = 2,\n FeePayer = 3,\n SingleSenderTransactionAuthenticator = 4,\n}\n\n/**\n * Transaction Authenticator enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L414}\n */\nexport enum AccountAuthenticatorVariant {\n Ed25519 = 0,\n MultiEd25519 = 1,\n SingleKey = 2,\n MultiKey = 3,\n}\n\nexport enum AnyPublicKeyVariant {\n Ed25519 = 0,\n Secp256k1 = 1,\n}\n\nexport enum AnySignatureVariant {\n Ed25519 = 0,\n Secp256k1 = 1,\n}\n\n/**\n * BCS types\n */\nexport type Uint8 = number;\nexport type Uint16 = number;\nexport type Uint32 = number;\nexport type Uint64 = bigint;\nexport type Uint128 = bigint;\nexport type Uint256 = bigint;\nexport type AnyNumber = number | bigint;\n\n/**\n * Set of configuration options that can be provided when initializing the SDK.\n * The purpose of these options is to configure various aspects of the SDK's\n * behavior and interaction with the Aptos network\n */\nexport type AptosSettings = {\n readonly network?: Network;\n\n readonly fullnode?: string;\n\n readonly faucet?: string;\n\n readonly indexer?: string;\n\n readonly clientConfig?: ClientConfig;\n\n readonly client?: Client;\n};\n\n/**\n *\n * Controls the number of results that are returned and the starting position of those results.\n * @param offset parameter specifies the starting position of the query result within the set of data. Default is 0.\n * @param limit specifies the maximum number of items or records to return in a query result. Default is 25.\n */\nexport interface PaginationArgs {\n offset?: AnyNumber;\n limit?: number;\n}\n\n/**\n * QUERY TYPES\n */\n\n/**\n * A configuration object we can pass with the request to the server.\n *\n * @param TOKEN - an auth token to send with the request\n * @param HEADERS - extra headers we want to send with the request\n * @param WITH_CREDENTIALS - whether to carry cookies. By default, it is set to true and cookies will be sent\n */\nexport type ClientConfig = {\n TOKEN?: string;\n HEADERS?: Record<string, string | number | boolean>;\n WITH_CREDENTIALS?: boolean;\n};\n\nexport interface ClientRequest<Req> {\n url: string;\n method: \"GET\" | \"POST\";\n body?: Req;\n contentType?: string;\n params?: any;\n overrides?: ClientConfig;\n headers?: Record<string, any>;\n}\n\nexport interface ClientResponse<Res> {\n status: number;\n statusText: string;\n data: Res;\n config?: any;\n request?: any;\n response?: any;\n headers?: any;\n}\n\nexport interface Client {\n provider<Req, Res>(requestOptions: ClientRequest<Req>): Promise<ClientResponse<Res>>;\n}\n\n/**\n * The API request type\n *\n * @param url - the url to make the request to, i.e https://fullnode.aptoslabs.devnet.com/v1\n * @param method - the request method \"GET\" | \"POST\"\n * @param endpoint (optional) - the endpoint to make the request to, i.e transactions\n * @param body (optional) - the body of the request\n * @param contentType (optional) - the content type to set the `content-type` header to,\n * by default is set to `application/json`\n * @param params (optional) - query params to add to the request\n * @param originMethod (optional) - the local method the request came from\n * @param overrides (optional) - a `ClientConfig` object type to override request data\n */\nexport type AptosRequest = {\n url: string;\n method: \"GET\" | \"POST\";\n path?: string;\n body?: any;\n contentType?: string;\n acceptType?: string;\n params?: Record<string, string | AnyNumber | boolean | undefined>;\n originMethod?: string;\n overrides?: ClientConfig;\n};\n\n/**\n * Specifies ledger version of transactions. By default latest version will be used\n */\nexport type LedgerVersion = {\n ledgerVersion?: AnyNumber;\n};\n\n/**\n * RESPONSE TYPES\n */\n\n/**\n * Type holding the outputs of the estimate gas API\n */\nexport type GasEstimation = {\n /**\n * The deprioritized estimate for the gas unit price\n */\n deprioritized_gas_estimate?: number;\n /**\n * The current estimate for the gas unit price\n */\n gas_estimate: number;\n /**\n * The prioritized estimate for the gas unit price\n */\n prioritized_gas_estimate?: number;\n};\n\nexport type MoveResource = {\n type: MoveResourceType;\n data: {};\n};\n\nexport type AccountData = {\n sequence_number: string;\n authentication_key: string;\n};\n\nexport type MoveModuleBytecode = {\n bytecode: string;\n abi?: MoveModule;\n};\n\n/**\n * TRANSACTION TYPES\n */\n\nexport enum TransactionResponseType {\n Pending = \"pending_transaction\",\n User = \"user_transaction\",\n Genesis = \"genesis_transaction\",\n BlockMetadata = \"block_metadata_transaction\",\n StateCheckpoint = \"state_checkpoint_transaction\",\n}\n\nexport type TransactionResponse =\n | PendingTransactionResponse\n | UserTransactionResponse\n | GenesisTransactionResponse\n | BlockMetadataTransactionResponse\n | StateCheckpointTransactionResponse;\n\nexport type PendingTransactionResponse = {\n type: TransactionResponseType.Pending;\n hash: string;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: TransactionPayloadResponse;\n signature?: TransactionSignature;\n};\n\nexport type UserTransactionResponse = {\n type: TransactionResponseType.User;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: TransactionPayloadResponse;\n signature?: TransactionSignature;\n /**\n * Events generated by the transaction\n */\n events: Array<Event>;\n timestamp: string;\n};\n\nexport type GenesisTransactionResponse = {\n type: TransactionResponseType.Genesis;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n payload: GenesisPayload;\n /**\n * Events emitted during genesis\n */\n events: Array<Event>;\n};\n\nexport type BlockMetadataTransactionResponse = {\n type: TransactionResponseType.BlockMetadata;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n id: string;\n epoch: string;\n round: string;\n /**\n * The events emitted at the block creation\n */\n events: Array<Event>;\n /**\n * Previous block votes\n */\n previous_block_votes_bitvec: Array<number>;\n proposer: string;\n /**\n * The indices of the proposers who failed to propose\n */\n failed_proposer_indices: Array<number>;\n timestamp: string;\n};\n\nexport type StateCheckpointTransactionResponse = {\n type: TransactionResponseType.StateCheckpoint;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n timestamp: string;\n};\n\n/**\n * WRITESET CHANGE TYPES\n */\n\nexport type WriteSetChange =\n | WriteSetChangeDeleteModule\n | WriteSetChangeDeleteResource\n | WriteSetChangeDeleteTableItem\n | WriteSetChangeWriteModule\n | WriteSetChangeWriteResource\n | WriteSetChangeWriteTableItem;\n\nexport type WriteSetChangeDeleteModule = {\n type: string;\n address: string;\n /**\n * State key hash\n */\n state_key_hash: string;\n module: MoveModuleId;\n};\n\nexport type WriteSetChangeDeleteResource = {\n type: string;\n address: string;\n state_key_hash: string;\n resource: string;\n};\n\nexport type WriteSetChangeDeleteTableItem = {\n type: string;\n state_key_hash: string;\n handle: string;\n key: string;\n data?: DeletedTableData;\n};\n\nexport type WriteSetChangeWriteModule = {\n type: string;\n address: string;\n state_key_hash: string;\n data: MoveModuleBytecode;\n};\n\nexport type WriteSetChangeWriteResource = {\n type: string;\n address: string;\n state_key_hash: string;\n data: MoveResource;\n};\n\nexport type WriteSetChangeWriteTableItem = {\n type: string;\n state_key_hash: string;\n handle: string;\n key: string;\n value: string;\n data?: DecodedTableData;\n};\n\nexport type DecodedTableData = {\n /**\n * Key of table in JSON\n */\n key: any;\n /**\n * Type of key\n */\n key_type: string;\n /**\n * Value of table in JSON\n */\n value: any;\n /**\n * Type of value\n */\n value_type: string;\n};\n\n/**\n * Deleted table data\n */\nexport type DeletedTableData = {\n /**\n * Deleted key\n */\n key: any;\n /**\n * Deleted key type\n */\n key_type: string;\n};\n\nexport type TransactionPayloadResponse = EntryFunctionPayloadResponse | ScriptPayloadResponse | MultisigPayloadResponse;\n\nexport type EntryFunctionPayloadResponse = {\n type: string;\n function: MoveResourceType;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<string>;\n /**\n * Arguments of the function\n */\n arguments: Array<any>;\n};\n\nexport type ScriptPayloadResponse = {\n type: string;\n code: MoveScriptBytecode;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<string>;\n /**\n * Arguments of the function\n */\n arguments: Array<any>;\n};\n\nexport type MultisigPayloadResponse = {\n type: string;\n multisig_address: string;\n transaction_payload?: EntryFunctionPayloadResponse;\n};\n\nexport type GenesisPayload = {\n type: string;\n write_set: WriteSet;\n};\n\n/**\n * Move script bytecode\n */\nexport type MoveScriptBytecode = {\n bytecode: string;\n abi?: MoveFunction;\n};\n\n/**\n * These are the JSON representations of transaction signatures returned from the node API.\n */\nexport type TransactionSignature =\n | TransactionEd25519Signature\n | TransactionSecp256k1Signature\n | TransactionMultiEd25519Signature\n | TransactionMultiAgentSignature\n | TransactionFeePayerSignature;\n\nexport type TransactionEd25519Signature = {\n type: string;\n public_key: string;\n signature: \"ed25519_signature\";\n};\n\nexport type TransactionSecp256k1Signature = {\n type: string;\n public_key: string;\n signature: \"secp256k1_ecdsa_signature\";\n};\n\nexport type TransactionMultiEd25519Signature = {\n type: \"multi_ed25519_signature\";\n /**\n * The public keys for the Ed25519 signature\n */\n public_keys: Array<string>;\n /**\n * Signature associated with the public keys in the same order\n */\n signatures: Array<string>;\n /**\n * The number of signatures required for a successful transaction\n */\n threshold: number;\n bitmap: string;\n};\n\nexport type TransactionMultiAgentSignature = {\n type: \"multi_agent_signature\";\n sender: AccountSignature;\n /**\n * The other involved parties' addresses\n */\n secondary_signer_addresses: Array<string>;\n /**\n * The associated signatures, in the same order as the secondary addresses\n */\n secondary_signers: Array<AccountSignature>;\n};\n\nexport type TransactionFeePayerSignature = {\n type: \"fee_payer_signature\";\n sender: AccountSignature;\n /**\n * The other involved parties' addresses\n */\n secondary_signer_addresses: Array<string>;\n /**\n * The associated signatures, in the same order as the secondary addresses\n */\n secondary_signers: Array<AccountSignature>;\n fee_payer_address: string;\n fee_payer_signer: AccountSignature;\n};\n\n/**\n * The union of all single account signatures.\n */\nexport type AccountSignature = AccountEd25519Signature | AccountSecp256k1Signature | AccountMultiEd25519Signature;\n\nexport type AccountEd25519Signature = TransactionEd25519Signature;\n\nexport type AccountSecp256k1Signature = TransactionSecp256k1Signature;\n\nexport type AccountMultiEd25519Signature = TransactionMultiEd25519Signature;\n\nexport type WriteSet = ScriptWriteSet | DirectWriteSet;\n\nexport type ScriptWriteSet = {\n type: string;\n execute_as: string;\n script: ScriptPayloadResponse;\n};\n\nexport type DirectWriteSet = {\n type: string;\n changes: Array<WriteSetChange>;\n events: Array<Event>;\n};\n\nexport type EventGuid = {\n creation_number: string;\n account_address: string;\n};\n\nexport type Event = {\n guid: EventGuid;\n sequence_number: string;\n type: string;\n /**\n * The JSON representation of the event\n */\n data: any;\n};\n\n/**\n * Map of Move types to local TypeScript types\n */\nexport type MoveUint8Type = number;\nexport type MoveUint16Type = number;\nexport type MoveUint32Type = number;\nexport type MoveUint64Type = string;\nexport type MoveUint128Type = string;\nexport type MoveUint256Type = string;\nexport type MoveAddressType = string;\nexport type MoveObjectType = string;\nexport type MoveStructType = `${string}::${string}::${string}`;\nexport type MoveOptionType = MoveType | null | undefined;\n/**\n * String representation of a on-chain Move struct type.\n */\nexport type MoveResourceType = `${string}::${string}::${string}`;\n\nexport type MoveType =\n | boolean\n | string\n | MoveUint8Type\n | MoveUint16Type\n | MoveUint32Type\n | MoveUint64Type\n | MoveUint128Type\n | MoveUint256Type\n | MoveAddressType\n | MoveObjectType\n | MoveStructType\n | Array<MoveType>;\n\n/**\n * Possible Move values acceptable by move functions (entry, view)\n *\n * Map of a Move value to the corresponding TypeScript value\n *\n * `Bool -> boolean`\n *\n * `u8, u16, u32 -> number`\n *\n * `u64, u128, u256 -> string`\n *\n * `String -> string`\n *\n * `Address -> 0x${string}`\n *\n * `Struct - 0x${string}::${string}::${string}`\n *\n * `Object -> 0x${string}`\n *\n * `Vector -> Array<MoveValue>`\n *\n * `Option -> MoveValue | null | undefined`\n */\nexport type MoveValue =\n | boolean\n | string\n | MoveUint8Type\n | MoveUint16Type\n | MoveUint32Type\n | MoveUint64Type\n | MoveUint128Type\n | MoveUint256Type\n | MoveAddressType\n | MoveObjectType\n | MoveStructType\n | MoveOptionType\n | Array<MoveValue>;\n\n/**\n * Move module id is a string representation of Move module.\n * Module name is case-sensitive.\n */\nexport type MoveModuleId = `${string}::${string}`;\n\n/**\n * Move function visibility\n */\nexport enum MoveFunctionVisibility {\n PRIVATE = \"private\",\n PUBLIC = \"public\",\n FRIEND = \"friend\",\n}\n\n/**\n * Move function ability\n */\nexport enum MoveAbility {\n STORE = \"store\",\n DROP = \"drop\",\n KEY = \"key\",\n COPY = \"copy\",\n}\n\n/**\n * Move abilities tied to the generic type param and associated with the function that uses it\n */\nexport type MoveFunctionGenericTypeParam = {\n constraints: Array<MoveAbility>;\n};\n\n/**\n * Move struct field\n */\nexport type MoveStructField = {\n name: string;\n type: string;\n};\n\n/**\n * A Move module\n */\nexport type MoveModule = {\n address: string;\n name: string;\n /**\n * Friends of the module\n */\n friends: Array<MoveModuleId>;\n /**\n * Public functions of the module\n */\n exposed_functions: Array<MoveFunction>;\n /**\n * Structs of the module\n */\n structs: Array<MoveStruct>;\n};\n\n/**\n * A move struct\n */\nexport type MoveStruct = {\n name: string;\n /**\n * Whether the struct is a native struct of Move\n */\n is_native: boolean;\n /**\n * Abilities associated with the struct\n */\n abilities: Array<MoveAbility>;\n /**\n * Generic types associated with the struct\n */\n generic_type_params: Array<MoveFunctionGenericTypeParam>;\n /**\n * Fields associated with the struct\n */\n fields: Array<MoveStructField>;\n};\n\n/**\n * Move function\n */\nexport type MoveFunction = {\n name: string;\n visibility: MoveFunctionVisibility;\n /**\n * Whether the function can be called as an entry function directly in a transaction\n */\n is_entry: boolean;\n /**\n * Whether the function is a view function or not\n */\n is_view: boolean;\n /**\n * Generic type params associated with the Move function\n */\n generic_type_params: Array<MoveFunctionGenericTypeParam>;\n /**\n * Parameters associated with the move function\n */\n params: Array<string>;\n /**\n * Return type of the function\n */\n return: Array<string>;\n};\n\nexport enum RoleType {\n VALIDATOR = \"validator\",\n FULL_NODE = \"full_node\",\n}\n\nexport type LedgerInfo = {\n /**\n * Chain ID of the current chain\n */\n chain_id: number;\n epoch: string;\n ledger_version: string;\n oldest_ledger_version: string;\n ledger_timestamp: string;\n node_role: RoleType;\n oldest_block_height: string;\n block_height: string;\n /**\n * Git hash of the build of the API endpoint. Can be used to determine the exact\n * software version used by the API endpoint.\n */\n git_hash?: string;\n};\n\n/**\n * A Block type\n */\nexport type Block = {\n block_height: string;\n block_hash: string;\n block_timestamp: string;\n first_version: string;\n last_version: string;\n /**\n * The transactions in the block in sequential order\n */\n transactions?: Array<TransactionResponse>;\n};\n\n/**\n * The data needed to generate a View Request payload\n */\nexport type ViewRequestData = {\n function: MoveStructType;\n typeArguments?: Array<MoveResourceType>;\n functionArguments?: Array<MoveValue>;\n};\n\n// REQUEST TYPES\n\n/**\n * View request for the Move view function API\n *\n * `type MoveResourceType = ${string}::${string}::${string}`;\n */\nexport type ViewRequest = {\n function: MoveResourceType;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<MoveResourceType>;\n /**\n * Arguments of the function\n */\n functionArguments: Array<MoveValue>;\n};\n\n/**\n * Table Item request for the GetTableItem API\n */\nexport type TableItemRequest = {\n key_type: MoveValue;\n value_type: MoveValue;\n /**\n * The value of the table item's key\n */\n key: any;\n};\n\n/**\n * A list of Authentication Key schemes that are supported by Aptos.\n *\n * They are combinations of signing schemes and derive schemes.\n */\nexport type AuthenticationKeyScheme = SigningScheme | DeriveScheme;\n\nexport enum SigningScheme {\n /**\n * For Ed25519PublicKey\n */\n Ed25519 = 0,\n /**\n * For MultiEd25519PublicKey\n */\n MultiEd25519 = 1,\n /**\n * For SingleKey ecdsa\n */\n SingleKey = 2,\n}\n\nexport enum SigningSchemeInput {\n /**\n * For Ed25519PublicKey\n */\n Ed25519 = 0,\n /**\n * For MultiEd25519PublicKey\n */\n MultiEd25519 = 1,\n /**\n * For Secp256k1Ecdsa\n */\n Secp256k1Ecdsa = 2,\n}\n\n/**\n * Scheme used for deriving account addresses from other data\n */\nexport enum DeriveScheme {\n /**\n * Derives an address using an AUID, used for objects\n */\n DeriveAuid = 251,\n /**\n * Derives an address from another object address\n */\n DeriveObjectAddressFromObject = 252,\n /**\n * Derives an address from a GUID, used for objects\n */\n DeriveObjectAddressFromGuid = 253,\n /**\n * Derives an address from seed bytes, used for named objects\n */\n DeriveObjectAddressFromSeed = 254,\n /**\n * Derives an address from seed bytes, used for resource accounts\n */\n DeriveResourceAccountAddress = 255,\n}\n\nexport type WaitForTransactionOptions = {\n timeoutSecs?: number;\n checkSuccess?: boolean;\n indexerVersionCheck?: boolean;\n};\n/**\n * Account input type to generate an account using Legacy\n * Ed25519 or MultiEd25519 keys or without a specified `scheme`.\n * If `scheme` is not specified, we default to ED25519\n * In this case `legacy` is always true\n */\nexport type GenerateAccountWithLegacyKey = {\n scheme?: SigningSchemeInput.Ed25519 | SigningSchemeInput.MultiEd25519;\n legacy: true;\n};\n\n/**\n * Account input type to generate an account using Unified\n * Secp256k1Ecdsa key\n * In this case `legacy` is always false\n */\nexport type GenerateAccountWithUnifiedKey = {\n scheme: SigningSchemeInput.Secp256k1Ecdsa | SigningSchemeInput.Ed25519;\n legacy?: false;\n};\n\n/**\n * Unify GenerateAccount type for Legacy and Unified keys\n */\nexport type GenerateAccount = GenerateAccountWithLegacyKey | GenerateAccountWithUnifiedKey;\n"],"mappings":"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","names":["MimeType","TypeTagVariants","ScriptTransactionArgumentVariants","TransactionPayloadVariants","TransactionVariants","TransactionAuthenticatorVariant","AccountAuthenticatorVariant","AnyPublicKeyVariant","AnySignatureVariant","TransactionResponseType","MoveFunctionVisibility","MoveAbility","RoleType","SigningScheme","SigningSchemeInput","DeriveScheme"]}
1
+ {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Network } from \"../utils/apiEndpoints\";\n\nexport * from \"./indexer\";\n\nexport enum MimeType {\n /**\n * JSON representation, used for transaction submission and accept type JSON output\n */\n JSON = \"application/json\",\n /**\n * BCS representation, used for accept type BCS output\n */\n BCS = \"application/x-bcs\",\n /**\n * BCS representation, used for transaction submission in BCS input\n */\n BCS_SIGNED_TRANSACTION = \"application/x.aptos.signed_transaction+bcs\",\n}\n\n/**\n * Hex data as input to a function\n */\nexport type HexInput = string | Uint8Array;\n\n/**\n * TypeTag enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/language_storage.rs#L27}\n */\nexport enum TypeTagVariants {\n Bool = 0,\n U8 = 1,\n U64 = 2,\n U128 = 3,\n Address = 4,\n Signer = 5,\n Vector = 6,\n Struct = 7,\n U16 = 8,\n U32 = 9,\n U256 = 10,\n Reference = 254, // This is specifically a placeholder and does not represent a real type\n Generic = 255, // This is specifically a placeholder and does not represent a real type\n}\n\n/**\n * Script transaction arguments enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/transaction_argument.rs#L11}\n */\nexport enum ScriptTransactionArgumentVariants {\n U8 = 0,\n U64 = 1,\n U128 = 2,\n Address = 3,\n U8Vector = 4,\n Bool = 5,\n U16 = 6,\n U32 = 7,\n U256 = 8,\n}\n\n/**\n * Transaction payload enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L478}\n */\nexport enum TransactionPayloadVariants {\n Script = 0,\n EntryFunction = 2,\n Multisig = 3,\n}\n\n/**\n * Transaction variants enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L440}\n */\nexport enum TransactionVariants {\n MultiAgentTransaction = 0,\n FeePayerTransaction = 1,\n}\n\n/**\n * Transaction Authenticator enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L44}\n */\nexport enum TransactionAuthenticatorVariant {\n Ed25519 = 0,\n MultiEd25519 = 1,\n MultiAgent = 2,\n FeePayer = 3,\n SingleSender = 4,\n}\n\n/**\n * Transaction Authenticator enum as they are represented in Rust\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L414}\n */\nexport enum AccountAuthenticatorVariant {\n Ed25519 = 0,\n MultiEd25519 = 1,\n SingleKey = 2,\n MultiKey = 3,\n}\n\nexport enum AnyPublicKeyVariant {\n Ed25519 = 0,\n Secp256k1 = 1,\n}\n\nexport enum AnySignatureVariant {\n Ed25519 = 0,\n Secp256k1 = 1,\n}\n\n/**\n * BCS types\n */\nexport type Uint8 = number;\nexport type Uint16 = number;\nexport type Uint32 = number;\nexport type Uint64 = bigint;\nexport type Uint128 = bigint;\nexport type Uint256 = bigint;\nexport type AnyNumber = number | bigint;\n\n/**\n * Set of configuration options that can be provided when initializing the SDK.\n * The purpose of these options is to configure various aspects of the SDK's\n * behavior and interaction with the Aptos network\n */\nexport type AptosSettings = {\n readonly network?: Network;\n\n readonly fullnode?: string;\n\n readonly faucet?: string;\n\n readonly indexer?: string;\n\n readonly clientConfig?: ClientConfig;\n\n readonly client?: Client;\n};\n\n/**\n *\n * Controls the number of results that are returned and the starting position of those results.\n * @param offset parameter specifies the starting position of the query result within the set of data. Default is 0.\n * @param limit specifies the maximum number of items or records to return in a query result. Default is 25.\n */\nexport interface PaginationArgs {\n offset?: AnyNumber;\n limit?: number;\n}\n\n/**\n * QUERY TYPES\n */\n\n/**\n * A configuration object we can pass with the request to the server.\n *\n * @param TOKEN - an auth token to send with the request\n * @param HEADERS - extra headers we want to send with the request\n * @param WITH_CREDENTIALS - whether to carry cookies. By default, it is set to true and cookies will be sent\n */\nexport type ClientConfig = {\n TOKEN?: string;\n HEADERS?: Record<string, string | number | boolean>;\n WITH_CREDENTIALS?: boolean;\n};\n\nexport interface ClientRequest<Req> {\n url: string;\n method: \"GET\" | \"POST\";\n body?: Req;\n contentType?: string;\n params?: any;\n overrides?: ClientConfig;\n headers?: Record<string, any>;\n}\n\nexport interface ClientResponse<Res> {\n status: number;\n statusText: string;\n data: Res;\n config?: any;\n request?: any;\n response?: any;\n headers?: any;\n}\n\nexport interface Client {\n provider<Req, Res>(requestOptions: ClientRequest<Req>): Promise<ClientResponse<Res>>;\n}\n\n/**\n * The API request type\n *\n * @param url - the url to make the request to, i.e https://fullnode.aptoslabs.devnet.com/v1\n * @param method - the request method \"GET\" | \"POST\"\n * @param endpoint (optional) - the endpoint to make the request to, i.e transactions\n * @param body (optional) - the body of the request\n * @param contentType (optional) - the content type to set the `content-type` header to,\n * by default is set to `application/json`\n * @param params (optional) - query params to add to the request\n * @param originMethod (optional) - the local method the request came from\n * @param overrides (optional) - a `ClientConfig` object type to override request data\n */\nexport type AptosRequest = {\n url: string;\n method: \"GET\" | \"POST\";\n path?: string;\n body?: any;\n contentType?: string;\n acceptType?: string;\n params?: Record<string, string | AnyNumber | boolean | undefined>;\n originMethod?: string;\n overrides?: ClientConfig;\n};\n\n/**\n * Specifies ledger version of transactions. By default latest version will be used\n */\nexport type LedgerVersion = {\n ledgerVersion?: AnyNumber;\n};\n\n/**\n * RESPONSE TYPES\n */\n\n/**\n * Type holding the outputs of the estimate gas API\n */\nexport type GasEstimation = {\n /**\n * The deprioritized estimate for the gas unit price\n */\n deprioritized_gas_estimate?: number;\n /**\n * The current estimate for the gas unit price\n */\n gas_estimate: number;\n /**\n * The prioritized estimate for the gas unit price\n */\n prioritized_gas_estimate?: number;\n};\n\nexport type MoveResource = {\n type: MoveStructType;\n data: {};\n};\n\nexport type AccountData = {\n sequence_number: string;\n authentication_key: string;\n};\n\nexport type MoveModuleBytecode = {\n bytecode: string;\n abi?: MoveModule;\n};\n\n/**\n * TRANSACTION TYPES\n */\n\nexport enum TransactionResponseType {\n Pending = \"pending_transaction\",\n User = \"user_transaction\",\n Genesis = \"genesis_transaction\",\n BlockMetadata = \"block_metadata_transaction\",\n StateCheckpoint = \"state_checkpoint_transaction\",\n}\n\nexport type TransactionResponse =\n | PendingTransactionResponse\n | UserTransactionResponse\n | GenesisTransactionResponse\n | BlockMetadataTransactionResponse\n | StateCheckpointTransactionResponse;\n\nexport type PendingTransactionResponse = {\n type: TransactionResponseType.Pending;\n hash: string;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: TransactionPayloadResponse;\n signature?: TransactionSignature;\n};\n\nexport type UserTransactionResponse = {\n type: TransactionResponseType.User;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: TransactionPayloadResponse;\n signature?: TransactionSignature;\n /**\n * Events generated by the transaction\n */\n events: Array<Event>;\n timestamp: string;\n};\n\nexport type GenesisTransactionResponse = {\n type: TransactionResponseType.Genesis;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n payload: GenesisPayload;\n /**\n * Events emitted during genesis\n */\n events: Array<Event>;\n};\n\nexport type BlockMetadataTransactionResponse = {\n type: TransactionResponseType.BlockMetadata;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n id: string;\n epoch: string;\n round: string;\n /**\n * The events emitted at the block creation\n */\n events: Array<Event>;\n /**\n * Previous block votes\n */\n previous_block_votes_bitvec: Array<number>;\n proposer: string;\n /**\n * The indices of the proposers who failed to propose\n */\n failed_proposer_indices: Array<number>;\n timestamp: string;\n};\n\nexport type StateCheckpointTransactionResponse = {\n type: TransactionResponseType.StateCheckpoint;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n timestamp: string;\n};\n\n/**\n * WRITESET CHANGE TYPES\n */\n\nexport type WriteSetChange =\n | WriteSetChangeDeleteModule\n | WriteSetChangeDeleteResource\n | WriteSetChangeDeleteTableItem\n | WriteSetChangeWriteModule\n | WriteSetChangeWriteResource\n | WriteSetChangeWriteTableItem;\n\nexport type WriteSetChangeDeleteModule = {\n type: string;\n address: string;\n /**\n * State key hash\n */\n state_key_hash: string;\n module: MoveModuleId;\n};\n\nexport type WriteSetChangeDeleteResource = {\n type: string;\n address: string;\n state_key_hash: string;\n resource: string;\n};\n\nexport type WriteSetChangeDeleteTableItem = {\n type: string;\n state_key_hash: string;\n handle: string;\n key: string;\n data?: DeletedTableData;\n};\n\nexport type WriteSetChangeWriteModule = {\n type: string;\n address: string;\n state_key_hash: string;\n data: MoveModuleBytecode;\n};\n\nexport type WriteSetChangeWriteResource = {\n type: string;\n address: string;\n state_key_hash: string;\n data: MoveResource;\n};\n\nexport type WriteSetChangeWriteTableItem = {\n type: string;\n state_key_hash: string;\n handle: string;\n key: string;\n value: string;\n data?: DecodedTableData;\n};\n\nexport type DecodedTableData = {\n /**\n * Key of table in JSON\n */\n key: any;\n /**\n * Type of key\n */\n key_type: string;\n /**\n * Value of table in JSON\n */\n value: any;\n /**\n * Type of value\n */\n value_type: string;\n};\n\n/**\n * Deleted table data\n */\nexport type DeletedTableData = {\n /**\n * Deleted key\n */\n key: any;\n /**\n * Deleted key type\n */\n key_type: string;\n};\n\nexport type TransactionPayloadResponse = EntryFunctionPayloadResponse | ScriptPayloadResponse | MultisigPayloadResponse;\n\nexport type EntryFunctionPayloadResponse = {\n type: string;\n function: MoveStructType;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<string>;\n /**\n * Arguments of the function\n */\n arguments: Array<any>;\n};\n\nexport type ScriptPayloadResponse = {\n type: string;\n code: MoveScriptBytecode;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<string>;\n /**\n * Arguments of the function\n */\n arguments: Array<any>;\n};\n\nexport type MultisigPayloadResponse = {\n type: string;\n multisig_address: string;\n transaction_payload?: EntryFunctionPayloadResponse;\n};\n\nexport type GenesisPayload = {\n type: string;\n write_set: WriteSet;\n};\n\n/**\n * Move script bytecode\n */\nexport type MoveScriptBytecode = {\n bytecode: string;\n abi?: MoveFunction;\n};\n\n/**\n * These are the JSON representations of transaction signatures returned from the node API.\n */\nexport type TransactionSignature =\n | TransactionEd25519Signature\n | TransactionSecp256k1Signature\n | TransactionMultiEd25519Signature\n | TransactionMultiAgentSignature\n | TransactionFeePayerSignature;\n\nexport type TransactionEd25519Signature = {\n type: string;\n public_key: string;\n signature: \"ed25519_signature\";\n};\n\nexport type TransactionSecp256k1Signature = {\n type: string;\n public_key: string;\n signature: \"secp256k1_ecdsa_signature\";\n};\n\nexport type TransactionMultiEd25519Signature = {\n type: \"multi_ed25519_signature\";\n /**\n * The public keys for the Ed25519 signature\n */\n public_keys: Array<string>;\n /**\n * Signature associated with the public keys in the same order\n */\n signatures: Array<string>;\n /**\n * The number of signatures required for a successful transaction\n */\n threshold: number;\n bitmap: string;\n};\n\nexport type TransactionMultiAgentSignature = {\n type: \"multi_agent_signature\";\n sender: AccountSignature;\n /**\n * The other involved parties' addresses\n */\n secondary_signer_addresses: Array<string>;\n /**\n * The associated signatures, in the same order as the secondary addresses\n */\n secondary_signers: Array<AccountSignature>;\n};\n\nexport type TransactionFeePayerSignature = {\n type: \"fee_payer_signature\";\n sender: AccountSignature;\n /**\n * The other involved parties' addresses\n */\n secondary_signer_addresses: Array<string>;\n /**\n * The associated signatures, in the same order as the secondary addresses\n */\n secondary_signers: Array<AccountSignature>;\n fee_payer_address: string;\n fee_payer_signer: AccountSignature;\n};\n\n/**\n * The union of all single account signatures.\n */\nexport type AccountSignature = AccountEd25519Signature | AccountSecp256k1Signature | AccountMultiEd25519Signature;\n\nexport type AccountEd25519Signature = TransactionEd25519Signature;\n\nexport type AccountSecp256k1Signature = TransactionSecp256k1Signature;\n\nexport type AccountMultiEd25519Signature = TransactionMultiEd25519Signature;\n\nexport type WriteSet = ScriptWriteSet | DirectWriteSet;\n\nexport type ScriptWriteSet = {\n type: string;\n execute_as: string;\n script: ScriptPayloadResponse;\n};\n\nexport type DirectWriteSet = {\n type: string;\n changes: Array<WriteSetChange>;\n events: Array<Event>;\n};\n\nexport type EventGuid = {\n creation_number: string;\n account_address: string;\n};\n\nexport type Event = {\n guid: EventGuid;\n sequence_number: string;\n type: string;\n /**\n * The JSON representation of the event\n */\n data: any;\n};\n\n/**\n * Map of Move types to local TypeScript types\n */\nexport type MoveUint8Type = number;\nexport type MoveUint16Type = number;\nexport type MoveUint32Type = number;\nexport type MoveUint64Type = string;\nexport type MoveUint128Type = string;\nexport type MoveUint256Type = string;\nexport type MoveAddressType = string;\nexport type MoveObjectType = string;\nexport type MoveOptionType = MoveType | null | undefined;\n/**\n * This is the format for a fully qualified struct, resource, or entry function in Move.\n */\nexport type MoveStructType = `${string}::${string}::${string}`;\n\nexport type MoveType =\n | boolean\n | string\n | MoveUint8Type\n | MoveUint16Type\n | MoveUint32Type\n | MoveUint64Type\n | MoveUint128Type\n | MoveUint256Type\n | MoveAddressType\n | MoveObjectType\n | MoveStructType\n | Array<MoveType>;\n\n/**\n * Possible Move values acceptable by move functions (entry, view)\n *\n * Map of a Move value to the corresponding TypeScript value\n *\n * `Bool -> boolean`\n *\n * `u8, u16, u32 -> number`\n *\n * `u64, u128, u256 -> string`\n *\n * `String -> string`\n *\n * `Address -> 0x${string}`\n *\n * `Struct - 0x${string}::${string}::${string}`\n *\n * `Object -> 0x${string}`\n *\n * `Vector -> Array<MoveValue>`\n *\n * `Option -> MoveValue | null | undefined`\n */\nexport type MoveValue =\n | boolean\n | string\n | MoveUint8Type\n | MoveUint16Type\n | MoveUint32Type\n | MoveUint64Type\n | MoveUint128Type\n | MoveUint256Type\n | MoveAddressType\n | MoveObjectType\n | MoveStructType\n | MoveOptionType\n | Array<MoveValue>;\n\n/**\n * Move module id is a string representation of Move module.\n * Module name is case-sensitive.\n */\nexport type MoveModuleId = `${string}::${string}`;\n\n/**\n * Move function visibility\n */\nexport enum MoveFunctionVisibility {\n PRIVATE = \"private\",\n PUBLIC = \"public\",\n FRIEND = \"friend\",\n}\n\n/**\n * Move function ability\n */\nexport enum MoveAbility {\n STORE = \"store\",\n DROP = \"drop\",\n KEY = \"key\",\n COPY = \"copy\",\n}\n\n/**\n * Move abilities tied to the generic type param and associated with the function that uses it\n */\nexport type MoveFunctionGenericTypeParam = {\n constraints: Array<MoveAbility>;\n};\n\n/**\n * Move struct field\n */\nexport type MoveStructField = {\n name: string;\n type: string;\n};\n\n/**\n * A Move module\n */\nexport type MoveModule = {\n address: string;\n name: string;\n /**\n * Friends of the module\n */\n friends: Array<MoveModuleId>;\n /**\n * Public functions of the module\n */\n exposed_functions: Array<MoveFunction>;\n /**\n * Structs of the module\n */\n structs: Array<MoveStruct>;\n};\n\n/**\n * A move struct\n */\nexport type MoveStruct = {\n name: string;\n /**\n * Whether the struct is a native struct of Move\n */\n is_native: boolean;\n /**\n * Abilities associated with the struct\n */\n abilities: Array<MoveAbility>;\n /**\n * Generic types associated with the struct\n */\n generic_type_params: Array<MoveFunctionGenericTypeParam>;\n /**\n * Fields associated with the struct\n */\n fields: Array<MoveStructField>;\n};\n\n/**\n * Move function\n */\nexport type MoveFunction = {\n name: string;\n visibility: MoveFunctionVisibility;\n /**\n * Whether the function can be called as an entry function directly in a transaction\n */\n is_entry: boolean;\n /**\n * Whether the function is a view function or not\n */\n is_view: boolean;\n /**\n * Generic type params associated with the Move function\n */\n generic_type_params: Array<MoveFunctionGenericTypeParam>;\n /**\n * Parameters associated with the move function\n */\n params: Array<string>;\n /**\n * Return type of the function\n */\n return: Array<string>;\n};\n\nexport enum RoleType {\n VALIDATOR = \"validator\",\n FULL_NODE = \"full_node\",\n}\n\nexport type LedgerInfo = {\n /**\n * Chain ID of the current chain\n */\n chain_id: number;\n epoch: string;\n ledger_version: string;\n oldest_ledger_version: string;\n ledger_timestamp: string;\n node_role: RoleType;\n oldest_block_height: string;\n block_height: string;\n /**\n * Git hash of the build of the API endpoint. Can be used to determine the exact\n * software version used by the API endpoint.\n */\n git_hash?: string;\n};\n\n/**\n * A Block type\n */\nexport type Block = {\n block_height: string;\n block_hash: string;\n block_timestamp: string;\n first_version: string;\n last_version: string;\n /**\n * The transactions in the block in sequential order\n */\n transactions?: Array<TransactionResponse>;\n};\n\n/**\n * The data needed to generate a View Request payload\n */\nexport type ViewRequestData = {\n function: MoveStructType;\n typeArguments?: Array<MoveStructType>;\n functionArguments?: Array<MoveValue>;\n};\n\n// REQUEST TYPES\n\n/**\n * View request for the Move view function API\n *\n * `type MoveStructType = ${string}::${string}::${string}`;\n */\nexport type ViewRequest = {\n function: MoveStructType;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<MoveStructType>;\n /**\n * Arguments of the function\n */\n functionArguments: Array<MoveValue>;\n};\n\n/**\n * Table Item request for the GetTableItem API\n */\nexport type TableItemRequest = {\n key_type: MoveValue;\n value_type: MoveValue;\n /**\n * The value of the table item's key\n */\n key: any;\n};\n\n/**\n * A list of Authentication Key schemes that are supported by Aptos.\n *\n * They are combinations of signing schemes and derive schemes.\n */\nexport type AuthenticationKeyScheme = SigningScheme | DeriveScheme;\n\nexport enum SigningScheme {\n /**\n * For Ed25519PublicKey\n */\n Ed25519 = 0,\n /**\n * For MultiEd25519PublicKey\n */\n MultiEd25519 = 1,\n /**\n * For SingleKey ecdsa\n */\n SingleKey = 2,\n\n MultiKey = 3,\n}\n\nexport enum SigningSchemeInput {\n /**\n * For Ed25519PublicKey\n */\n Ed25519 = 0,\n /**\n * For Secp256k1Ecdsa\n */\n Secp256k1Ecdsa = 2,\n}\n\n/**\n * Scheme used for deriving account addresses from other data\n */\nexport enum DeriveScheme {\n /**\n * Derives an address using an AUID, used for objects\n */\n DeriveAuid = 251,\n /**\n * Derives an address from another object address\n */\n DeriveObjectAddressFromObject = 252,\n /**\n * Derives an address from a GUID, used for objects\n */\n DeriveObjectAddressFromGuid = 253,\n /**\n * Derives an address from seed bytes, used for named objects\n */\n DeriveObjectAddressFromSeed = 254,\n /**\n * Derives an address from seed bytes, used for resource accounts\n */\n DeriveResourceAccountAddress = 255,\n}\n\n/**\n * Option properties to pass for waitForTransaction() function\n */\nexport type WaitForTransactionOptions = {\n timeoutSecs?: number;\n checkSuccess?: boolean;\n indexerVersionCheck?: boolean;\n};\n/**\n * Account input type to generate an account using Legacy\n * Ed25519 or MultiEd25519 keys or without a specified `scheme`.\n * If `scheme` is not specified, we default to ED25519\n * In this case `legacy` is always true\n */\nexport type GenerateAccountWithLegacyKey = {\n scheme?: SigningSchemeInput.Ed25519;\n legacy: true;\n};\n\n/**\n * Account input type to generate an account using Unified\n * Secp256k1Ecdsa key\n * In this case `legacy` is always false\n */\nexport type GenerateAccountWithUnifiedKey = {\n scheme: SigningSchemeInput.Secp256k1Ecdsa | SigningSchemeInput.Ed25519;\n legacy?: false;\n};\n\n/**\n * Unify GenerateAccount type for Legacy and Unified keys\n */\nexport type GenerateAccount = GenerateAccountWithLegacyKey | GenerateAccountWithUnifiedKey;\n"],"mappings":"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","names":["MimeType","TypeTagVariants","ScriptTransactionArgumentVariants","TransactionPayloadVariants","TransactionVariants","TransactionAuthenticatorVariant","AccountAuthenticatorVariant","AnyPublicKeyVariant","AnySignatureVariant","TransactionResponseType","MoveFunctionVisibility","MoveAbility","RoleType","SigningScheme","SigningSchemeInput","DeriveScheme"]}
package/package.json CHANGED
@@ -75,5 +75,5 @@
75
75
  "typedoc": "^0.23.20",
76
76
  "typescript": "4.8.2"
77
77
  },
78
- "version": "0.0.2"
78
+ "version": "0.0.3"
79
79
  }
@@ -14,7 +14,7 @@ import {
14
14
  LedgerVersion,
15
15
  MoveModuleBytecode,
16
16
  MoveResource,
17
- MoveResourceType,
17
+ MoveStructType,
18
18
  OrderBy,
19
19
  PaginationArgs,
20
20
  TokenStandard,
@@ -175,7 +175,7 @@ export class Account {
175
175
  */
176
176
  async getAccountResource<T extends {} = any>(args: {
177
177
  accountAddress: HexInput;
178
- resourceType: MoveResourceType;
178
+ resourceType: MoveStructType;
179
179
  options?: LedgerVersion;
180
180
  }): Promise<T> {
181
181
  return getResource<T>({ aptosConfig: this.config, ...args });
package/src/api/coin.ts CHANGED
@@ -4,8 +4,8 @@
4
4
  import { AptosConfig } from "./aptosConfig";
5
5
  import { Account } from "../core";
6
6
  import { transferCoinTransaction } from "../internal/coin";
7
- import { SingleSignerTransaction, GenerateTransactionOptions } from "../transactions/types";
8
- import { AnyNumber, HexInput, MoveResourceType } from "../types";
7
+ import { InputSingleSignerTransaction, InputGenerateTransactionOptions } from "../transactions/types";
8
+ import { AnyNumber, HexInput, MoveStructType } from "../types";
9
9
 
10
10
  /**
11
11
  * A class to handle all `Coin` operations
@@ -31,9 +31,9 @@ export class Coin {
31
31
  sender: Account;
32
32
  recipient: HexInput;
33
33
  amount: AnyNumber;
34
- coinType?: MoveResourceType;
35
- options?: GenerateTransactionOptions;
36
- }): Promise<SingleSignerTransaction> {
34
+ coinType?: MoveStructType;
35
+ options?: InputGenerateTransactionOptions;
36
+ }): Promise<InputSingleSignerTransaction> {
37
37
  return transferCoinTransaction({ aptosConfig: this.config, ...args });
38
38
  }
39
39
  }
@@ -14,7 +14,7 @@ import {
14
14
  } from "../types";
15
15
  import { AptosConfig } from "./aptosConfig";
16
16
  import { Account } from "../core";
17
- import { GenerateTransactionOptions, SingleSignerTransaction } from "../transactions/types";
17
+ import { InputGenerateTransactionOptions, InputSingleSignerTransaction } from "../transactions/types";
18
18
  import {
19
19
  CreateCollectionOptions,
20
20
  createCollectionTransaction,
@@ -68,9 +68,9 @@ export class DigitalAsset {
68
68
  description: string;
69
69
  name: string;
70
70
  uri: string;
71
- options?: GenerateTransactionOptions;
71
+ options?: InputGenerateTransactionOptions;
72
72
  } & CreateCollectionOptions,
73
- ): Promise<SingleSignerTransaction> {
73
+ ): Promise<InputSingleSignerTransaction> {
74
74
  return createCollectionTransaction({ aptosConfig: this.config, ...args });
75
75
  }
76
76
 
@@ -133,8 +133,8 @@ export class DigitalAsset {
133
133
  description: string;
134
134
  name: string;
135
135
  uri: string;
136
- options?: GenerateTransactionOptions;
137
- }): Promise<SingleSignerTransaction> {
136
+ options?: InputGenerateTransactionOptions;
137
+ }): Promise<InputSingleSignerTransaction> {
138
138
  return mintTokenTransaction({ aptosConfig: this.config, ...args });
139
139
  }
140
140
 
package/src/api/event.ts CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  import { AptosConfig } from "./aptosConfig";
5
5
  import { getAccountEventsByCreationNumber, getAccountEventsByEventType, getEvents } from "../internal/event";
6
- import { AnyNumber, GetEventsResponse, HexInput, MoveResourceType, OrderBy, PaginationArgs } from "../types";
6
+ import { AnyNumber, GetEventsResponse, HexInput, MoveStructType, OrderBy, PaginationArgs } from "../types";
7
7
  import { EventsBoolExp } from "../types/generated/types";
8
8
 
9
9
  /**
@@ -41,7 +41,7 @@ export class Event {
41
41
  */
42
42
  async getAccountEventsByEventType(args: {
43
43
  accountAddress: HexInput;
44
- eventType: MoveResourceType;
44
+ eventType: MoveStructType;
45
45
  options?: {
46
46
  pagination?: PaginationArgs;
47
47
  orderBy?: OrderBy<GetEventsResponse[0]>;
package/src/api/faucet.ts CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  import { AptosConfig } from "./aptosConfig";
5
5
  import { fundAccount } from "../internal/faucet";
6
- import { HexInput } from "../types";
6
+ import { HexInput, WaitForTransactionOptions } from "../types";
7
7
 
8
8
  /**
9
9
  * A class to query all `Faucet` related queries on Aptos.
@@ -21,10 +21,14 @@ export class Faucet {
21
21
  *
22
22
  * @param args.accountAddress Address of the account to fund
23
23
  * @param args.amount Amount of tokens to fund the account with
24
- * @param args.timeoutSecs Timeout in seconds. Defaults to 20 seconds.
24
+ * @param args.options Configuration options for waitForTransaction
25
25
  * @returns Transaction hash of the transaction that funded the account
26
26
  */
27
- async fundAccount(args: { accountAddress: HexInput; amount: number; timeoutSecs?: number }): Promise<string> {
27
+ async fundAccount(args: {
28
+ accountAddress: HexInput;
29
+ amount: number;
30
+ options?: WaitForTransactionOptions;
31
+ }): Promise<string> {
28
32
  return fundAccount({ aptosConfig: this.config, ...args });
29
33
  }
30
34
  }
@@ -6,20 +6,20 @@ import { Account } from "../core";
6
6
  import { AccountAuthenticator } from "../transactions/authenticator/account";
7
7
  import {
8
8
  AnyRawTransaction,
9
- FeePayerTransaction,
10
- GenerateMultiAgentRawTransactionInput,
11
- GenerateTransactionInput,
12
- GenerateFeePayerRawTransactionInput,
13
- GenerateSingleSignerRawTransactionInput,
14
- MultiAgentTransaction,
15
- SingleSignerTransaction,
16
- SimulateTransactionData,
17
- GenerateTransactionOptions,
9
+ InputFeePayerTransaction,
10
+ InputGenerateMultiAgentRawTransactionData,
11
+ InputGenerateTransactionData,
12
+ InputGenerateFeePayerRawTransactionData,
13
+ InputGenerateSingleSignerRawTransactionData,
14
+ InputMultiAgentTransaction,
15
+ InputSingleSignerTransaction,
16
+ InputSimulateTransactionData,
17
+ InputGenerateTransactionOptions,
18
18
  } from "../transactions/types";
19
19
  import { UserTransactionResponse, PendingTransactionResponse, HexInput } from "../types";
20
20
  import {
21
21
  generateTransaction,
22
- publishModuleTransaction,
22
+ publicPackageTransaction,
23
23
  signAndSubmitTransaction,
24
24
  signTransaction,
25
25
  simulateTransaction,
@@ -39,10 +39,10 @@ export class TransactionSubmission {
39
39
  * When we call `generateTransaction` function with the relevant type properties,
40
40
  * Typescript can infer the return type based on the appropriate function overload.
41
41
  */
42
- async generateTransaction(args: GenerateSingleSignerRawTransactionInput): Promise<SingleSignerTransaction>;
43
- async generateTransaction(args: GenerateFeePayerRawTransactionInput): Promise<FeePayerTransaction>;
44
- async generateTransaction(args: GenerateMultiAgentRawTransactionInput): Promise<MultiAgentTransaction>;
45
- async generateTransaction(args: GenerateTransactionInput): Promise<AnyRawTransaction>;
42
+ async generateTransaction(args: InputGenerateSingleSignerRawTransactionData): Promise<InputSingleSignerTransaction>;
43
+ async generateTransaction(args: InputGenerateFeePayerRawTransactionData): Promise<InputFeePayerTransaction>;
44
+ async generateTransaction(args: InputGenerateMultiAgentRawTransactionData): Promise<InputMultiAgentTransaction>;
45
+ async generateTransaction(args: InputGenerateTransactionData): Promise<AnyRawTransaction>;
46
46
 
47
47
  /**
48
48
  * Generates any transaction by passing in the required arguments
@@ -84,7 +84,7 @@ export class TransactionSubmission {
84
84
  * }
85
85
  * ```
86
86
  */
87
- async generateTransaction(args: GenerateTransactionInput): Promise<AnyRawTransaction> {
87
+ async generateTransaction(args: InputGenerateTransactionData): Promise<AnyRawTransaction> {
88
88
  return generateTransaction({ aptosConfig: this.config, ...args });
89
89
  }
90
90
 
@@ -117,7 +117,7 @@ export class TransactionSubmission {
117
117
  * @param args.feePayerPublicKey optional. For when the transaction is a fee payer (aka sponsored) transaction
118
118
  * @param args.options optional. A config to simulate the transaction with
119
119
  */
120
- async simulateTransaction(args: SimulateTransactionData): Promise<Array<UserTransactionResponse>> {
120
+ async simulateTransaction(args: InputSimulateTransactionData): Promise<Array<UserTransactionResponse>> {
121
121
  return simulateTransaction({ aptosConfig: this.config, ...args });
122
122
  }
123
123
 
@@ -175,18 +175,18 @@ export class TransactionSubmission {
175
175
  * `aptos move compile --save-metadata ...`,
176
176
  * For more info {@link https://aptos.dev/tutorials/your-first-dapp/#step-4-publish-a-move-module}
177
177
  *
178
- * @param account The publisher account
179
- * @param metadataBytes The package metadata bytes
180
- * @param byteCode The bytecodes of modules
178
+ * @param args.account The publisher account
179
+ * @param args.metadataBytes The package metadata bytes
180
+ * @param args.moduleBytecode An array of the bytecode of each module in the package in compiler output order
181
181
  *
182
182
  * @returns A SingleSignerTransaction that can be simulated or submitted to chain
183
183
  */
184
- async publishModuleTransaction(args: {
184
+ async publishPackageTransaction(args: {
185
185
  account: HexInput;
186
186
  metadataBytes: HexInput;
187
- byteCode: HexInput;
188
- options?: GenerateTransactionOptions;
189
- }): Promise<SingleSignerTransaction> {
190
- return publishModuleTransaction({ aptosConfig: this.config, ...args });
187
+ moduleBytecode: Array<HexInput>;
188
+ options?: InputGenerateTransactionOptions;
189
+ }): Promise<InputSingleSignerTransaction> {
190
+ return publicPackageTransaction({ aptosConfig: this.config, ...args });
191
191
  }
192
192
  }
@@ -24,7 +24,7 @@ import { TransactionArgument } from "../../transactions/instances/transactionArg
24
24
  * @example
25
25
  * const yourCustomSerializedBytes = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]);
26
26
  * const fixedBytes = new FixedBytes(yourCustomSerializedBytes);
27
- * const payload = generateTransactionPayload({
27
+ * const payload = await generateTransactionPayload({
28
28
  * function: "0xbeefcafe::your_module::your_function_that_requires_custom_serialization",
29
29
  * functionArguments: [yourCustomBytes],
30
30
  * });
@@ -6,7 +6,6 @@ import { Serializable, Serializer } from "../serializer";
6
6
  import { Deserializable, Deserializer } from "../deserializer";
7
7
  import { AnyNumber, HexInput, ScriptTransactionArgumentVariants } from "../../types";
8
8
  import { Hex } from "../../core/hex";
9
- import { AccountAddress } from "../../core/accountAddress";
10
9
  import { EntryFunctionArgument, TransactionArgument } from "../../transactions/instances/transactionArgument";
11
10
 
12
11
  /**
@@ -52,7 +51,10 @@ import { EntryFunctionArgument, TransactionArgument } from "../../transactions/i
52
51
  * values: an Array<T> of values where T is a class that implements Serializable
53
52
  * @returns a `MoveVector<T>` with the values `values`
54
53
  */
55
- export class MoveVector<T extends Serializable> extends Serializable implements TransactionArgument {
54
+ export class MoveVector<T extends Serializable & EntryFunctionArgument>
55
+ extends Serializable
56
+ implements TransactionArgument
57
+ {
56
58
  public values: Array<T>;
57
59
 
58
60
  constructor(values: Array<T>) {
@@ -209,7 +211,10 @@ export class MoveVector<T extends Serializable> extends Serializable implements
209
211
  * @returns a MoveVector of the corresponding class T
210
212
  * *
211
213
  */
212
- static deserialize<T extends Serializable>(deserializer: Deserializer, cls: Deserializable<T>): MoveVector<T> {
214
+ static deserialize<T extends Serializable & EntryFunctionArgument>(
215
+ deserializer: Deserializer,
216
+ cls: Deserializable<T>,
217
+ ): MoveVector<T> {
213
218
  const length = deserializer.deserializeUleb128AsU32();
214
219
  const values = new Array<T>();
215
220
  for (let i = 0; i < length; i += 1) {
@@ -247,7 +252,10 @@ export class MoveString extends Serializable implements TransactionArgument {
247
252
  }
248
253
  }
249
254
 
250
- export class MoveOption<T extends Serializable> extends Serializable implements EntryFunctionArgument {
255
+ export class MoveOption<T extends Serializable & EntryFunctionArgument>
256
+ extends Serializable
257
+ implements EntryFunctionArgument
258
+ {
251
259
  private vec: MoveVector<T>;
252
260
 
253
261
  public readonly value?: T;
@@ -424,39 +432,11 @@ export class MoveOption<T extends Serializable> extends Serializable implements
424
432
  return new MoveOption<MoveString>(value !== null && value !== undefined ? new MoveString(value) : undefined);
425
433
  }
426
434
 
427
- static deserialize<U extends Serializable>(deserializer: Deserializer, cls: Deserializable<U>): MoveOption<U> {
435
+ static deserialize<U extends Serializable & EntryFunctionArgument>(
436
+ deserializer: Deserializer,
437
+ cls: Deserializable<U>,
438
+ ): MoveOption<U> {
428
439
  const vector = MoveVector.deserialize(deserializer, cls);
429
440
  return new MoveOption(vector.values[0]);
430
441
  }
431
442
  }
432
-
433
- export class MoveObject extends Serializable implements TransactionArgument {
434
- public value: AccountAddress;
435
-
436
- constructor(value: HexInput | AccountAddress) {
437
- super();
438
-
439
- if (value instanceof AccountAddress) {
440
- this.value = value;
441
- } else {
442
- this.value = AccountAddress.fromHexInputRelaxed(value);
443
- }
444
- }
445
-
446
- serialize(serializer: Serializer): void {
447
- serializer.serialize(this.value);
448
- }
449
-
450
- serializeForEntryFunction(serializer: Serializer): void {
451
- this.value.serializeForEntryFunction(serializer);
452
- }
453
-
454
- serializeForScriptFunction(serializer: Serializer): void {
455
- this.value.serializeForScriptFunction(serializer);
456
- }
457
-
458
- static deserialize(deserializer: Deserializer): MoveObject {
459
- const address = deserializer.deserialize(AccountAddress);
460
- return new MoveObject(address);
461
- }
462
- }