@aptos-labs/ts-sdk 0.0.0 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/dist/browser/index.global.js +25 -25
- package/dist/browser/index.global.js.map +1 -1
- package/dist/cjs/index.d.ts +209 -45
- package/dist/cjs/index.js +338 -108
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.d.ts +209 -45
- package/dist/esm/index.mjs +334 -108
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/index.d.ts +84 -16
- package/dist/types/index.js +26 -3
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/account.ts +26 -6
- package/src/api/aptosConfig.ts +8 -1
- package/src/api/fungibleAsset.ts +25 -0
- package/src/api/general.ts +2 -2
- package/src/api/transaction.ts +9 -2
- package/src/api/transactionSubmission.ts +34 -10
- package/src/bcs/serializable/fixedBytes.ts +1 -1
- package/src/client/core.ts +15 -17
- package/src/client/get.ts +1 -1
- package/src/client/post.ts +2 -2
- package/src/core/account.ts +74 -33
- package/src/core/authenticationKey.ts +29 -13
- package/src/core/crypto/anyPublicKey.ts +84 -0
- package/src/core/crypto/anySignature.ts +56 -0
- package/src/core/crypto/ed25519.ts +10 -0
- package/src/core/crypto/secp256k1.ts +11 -1
- package/src/internal/account.ts +78 -6
- package/src/internal/coin.ts +1 -1
- package/src/internal/digitalAsset.ts +2 -6
- package/src/internal/faucet.ts +5 -1
- package/src/internal/general.ts +1 -1
- package/src/internal/transaction.ts +2 -1
- package/src/internal/transactionSubmission.ts +47 -6
- package/src/transactions/authenticator/account.ts +16 -15
- package/src/transactions/authenticator/transaction.ts +15 -22
- package/src/transactions/transaction_builder/transaction_builder.ts +27 -28
- package/src/transactions/typeTag/parser.ts +285 -0
- package/src/transactions/types.ts +2 -2
- package/src/types/index.ts +93 -15
- package/src/version.ts +1 -1
package/dist/esm/index.d.ts
CHANGED
|
@@ -735,7 +735,7 @@ declare enum TransactionAuthenticatorVariant {
|
|
|
735
735
|
MultiEd25519 = 1,
|
|
736
736
|
MultiAgent = 2,
|
|
737
737
|
FeePayer = 3,
|
|
738
|
-
|
|
738
|
+
SingleSenderTransactionAuthenticator = 4
|
|
739
739
|
}
|
|
740
740
|
/**
|
|
741
741
|
* Transaction Authenticator enum as they are represented in Rust
|
|
@@ -744,7 +744,16 @@ declare enum TransactionAuthenticatorVariant {
|
|
|
744
744
|
declare enum AccountAuthenticatorVariant {
|
|
745
745
|
Ed25519 = 0,
|
|
746
746
|
MultiEd25519 = 1,
|
|
747
|
-
|
|
747
|
+
SingleKey = 2,
|
|
748
|
+
MultiKey = 3
|
|
749
|
+
}
|
|
750
|
+
declare enum AnyPublicKeyVariant {
|
|
751
|
+
Ed25519 = 0,
|
|
752
|
+
Secp256k1 = 1
|
|
753
|
+
}
|
|
754
|
+
declare enum AnySignatureVariant {
|
|
755
|
+
Ed25519 = 0,
|
|
756
|
+
Secp256k1 = 1
|
|
748
757
|
}
|
|
749
758
|
/**
|
|
750
759
|
* BCS types
|
|
@@ -762,11 +771,12 @@ declare type AnyNumber = number | bigint;
|
|
|
762
771
|
* behavior and interaction with the Aptos network
|
|
763
772
|
*/
|
|
764
773
|
declare type AptosSettings = {
|
|
765
|
-
readonly network
|
|
774
|
+
readonly network?: Network;
|
|
766
775
|
readonly fullnode?: string;
|
|
767
776
|
readonly faucet?: string;
|
|
768
777
|
readonly indexer?: string;
|
|
769
778
|
readonly clientConfig?: ClientConfig;
|
|
779
|
+
readonly client?: Client;
|
|
770
780
|
};
|
|
771
781
|
/**
|
|
772
782
|
*
|
|
@@ -793,6 +803,27 @@ declare type ClientConfig = {
|
|
|
793
803
|
HEADERS?: Record<string, string | number | boolean>;
|
|
794
804
|
WITH_CREDENTIALS?: boolean;
|
|
795
805
|
};
|
|
806
|
+
interface ClientRequest<Req> {
|
|
807
|
+
url: string;
|
|
808
|
+
method: "GET" | "POST";
|
|
809
|
+
body?: Req;
|
|
810
|
+
contentType?: string;
|
|
811
|
+
params?: any;
|
|
812
|
+
overrides?: ClientConfig;
|
|
813
|
+
headers?: Record<string, any>;
|
|
814
|
+
}
|
|
815
|
+
interface ClientResponse<Res> {
|
|
816
|
+
status: number;
|
|
817
|
+
statusText: string;
|
|
818
|
+
data: Res;
|
|
819
|
+
config?: any;
|
|
820
|
+
request?: any;
|
|
821
|
+
response?: any;
|
|
822
|
+
headers?: any;
|
|
823
|
+
}
|
|
824
|
+
interface Client {
|
|
825
|
+
provider<Req, Res>(requestOptions: ClientRequest<Req>): Promise<ClientResponse<Res>>;
|
|
826
|
+
}
|
|
796
827
|
/**
|
|
797
828
|
* The API request type
|
|
798
829
|
*
|
|
@@ -1214,9 +1245,9 @@ declare type MoveUint32Type = number;
|
|
|
1214
1245
|
declare type MoveUint64Type = string;
|
|
1215
1246
|
declare type MoveUint128Type = string;
|
|
1216
1247
|
declare type MoveUint256Type = string;
|
|
1217
|
-
declare type MoveAddressType =
|
|
1218
|
-
declare type MoveObjectType =
|
|
1219
|
-
declare type MoveStructType =
|
|
1248
|
+
declare type MoveAddressType = string;
|
|
1249
|
+
declare type MoveObjectType = string;
|
|
1250
|
+
declare type MoveStructType = `${string}::${string}::${string}`;
|
|
1220
1251
|
declare type MoveOptionType = MoveType | null | undefined;
|
|
1221
1252
|
/**
|
|
1222
1253
|
* String representation of a on-chain Move struct type.
|
|
@@ -1377,7 +1408,7 @@ declare type LedgerInfo = {
|
|
|
1377
1408
|
*/
|
|
1378
1409
|
declare type Block = {
|
|
1379
1410
|
block_height: string;
|
|
1380
|
-
block_hash:
|
|
1411
|
+
block_hash: string;
|
|
1381
1412
|
block_timestamp: string;
|
|
1382
1413
|
first_version: string;
|
|
1383
1414
|
last_version: string;
|
|
@@ -1392,7 +1423,7 @@ declare type Block = {
|
|
|
1392
1423
|
declare type ViewRequestData = {
|
|
1393
1424
|
function: MoveStructType;
|
|
1394
1425
|
typeArguments?: Array<MoveResourceType>;
|
|
1395
|
-
|
|
1426
|
+
functionArguments?: Array<MoveValue>;
|
|
1396
1427
|
};
|
|
1397
1428
|
/**
|
|
1398
1429
|
* View request for the Move view function API
|
|
@@ -1408,7 +1439,7 @@ declare type ViewRequest = {
|
|
|
1408
1439
|
/**
|
|
1409
1440
|
* Arguments of the function
|
|
1410
1441
|
*/
|
|
1411
|
-
|
|
1442
|
+
functionArguments: Array<MoveValue>;
|
|
1412
1443
|
};
|
|
1413
1444
|
/**
|
|
1414
1445
|
* Table Item request for the GetTableItem API
|
|
@@ -1427,11 +1458,6 @@ declare type TableItemRequest = {
|
|
|
1427
1458
|
* They are combinations of signing schemes and derive schemes.
|
|
1428
1459
|
*/
|
|
1429
1460
|
declare type AuthenticationKeyScheme = SigningScheme | DeriveScheme;
|
|
1430
|
-
/**
|
|
1431
|
-
* A list of signing schemes that are supported by Aptos.
|
|
1432
|
-
*
|
|
1433
|
-
* https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L375-L378
|
|
1434
|
-
*/
|
|
1435
1461
|
declare enum SigningScheme {
|
|
1436
1462
|
/**
|
|
1437
1463
|
* For Ed25519PublicKey
|
|
@@ -1442,7 +1468,21 @@ declare enum SigningScheme {
|
|
|
1442
1468
|
*/
|
|
1443
1469
|
MultiEd25519 = 1,
|
|
1444
1470
|
/**
|
|
1445
|
-
* For
|
|
1471
|
+
* For SingleKey ecdsa
|
|
1472
|
+
*/
|
|
1473
|
+
SingleKey = 2
|
|
1474
|
+
}
|
|
1475
|
+
declare enum SigningSchemeInput {
|
|
1476
|
+
/**
|
|
1477
|
+
* For Ed25519PublicKey
|
|
1478
|
+
*/
|
|
1479
|
+
Ed25519 = 0,
|
|
1480
|
+
/**
|
|
1481
|
+
* For MultiEd25519PublicKey
|
|
1482
|
+
*/
|
|
1483
|
+
MultiEd25519 = 1,
|
|
1484
|
+
/**
|
|
1485
|
+
* For Secp256k1Ecdsa
|
|
1446
1486
|
*/
|
|
1447
1487
|
Secp256k1Ecdsa = 2
|
|
1448
1488
|
}
|
|
@@ -1471,6 +1511,34 @@ declare enum DeriveScheme {
|
|
|
1471
1511
|
*/
|
|
1472
1512
|
DeriveResourceAccountAddress = 255
|
|
1473
1513
|
}
|
|
1514
|
+
declare type WaitForTransactionOptions = {
|
|
1515
|
+
timeoutSecs?: number;
|
|
1516
|
+
checkSuccess?: boolean;
|
|
1517
|
+
indexerVersionCheck?: boolean;
|
|
1518
|
+
};
|
|
1519
|
+
/**
|
|
1520
|
+
* Account input type to generate an account using Legacy
|
|
1521
|
+
* Ed25519 or MultiEd25519 keys or without a specified `scheme`.
|
|
1522
|
+
* If `scheme` is not specified, we default to ED25519
|
|
1523
|
+
* In this case `legacy` is always true
|
|
1524
|
+
*/
|
|
1525
|
+
declare type GenerateAccountWithLegacyKey = {
|
|
1526
|
+
scheme?: SigningSchemeInput.Ed25519 | SigningSchemeInput.MultiEd25519;
|
|
1527
|
+
legacy: true;
|
|
1528
|
+
};
|
|
1529
|
+
/**
|
|
1530
|
+
* Account input type to generate an account using Unified
|
|
1531
|
+
* Secp256k1Ecdsa key
|
|
1532
|
+
* In this case `legacy` is always false
|
|
1533
|
+
*/
|
|
1534
|
+
declare type GenerateAccountWithUnifiedKey = {
|
|
1535
|
+
scheme: SigningSchemeInput.Secp256k1Ecdsa | SigningSchemeInput.Ed25519;
|
|
1536
|
+
legacy?: false;
|
|
1537
|
+
};
|
|
1538
|
+
/**
|
|
1539
|
+
* Unify GenerateAccount type for Legacy and Unified keys
|
|
1540
|
+
*/
|
|
1541
|
+
declare type GenerateAccount = GenerateAccountWithLegacyKey | GenerateAccountWithUnifiedKey;
|
|
1474
1542
|
|
|
1475
1543
|
/**
|
|
1476
1544
|
* Type of API endpoint for request routing
|
|
@@ -1487,6 +1555,10 @@ declare enum AptosApiType {
|
|
|
1487
1555
|
declare class AptosConfig {
|
|
1488
1556
|
/** The Network that this SDK is associated with. */
|
|
1489
1557
|
readonly network: Network;
|
|
1558
|
+
/**
|
|
1559
|
+
* The client instance the SDK uses
|
|
1560
|
+
*/
|
|
1561
|
+
readonly client: Client;
|
|
1490
1562
|
/**
|
|
1491
1563
|
* The optional hardcoded fullnode URL to send requests to instead of using the network
|
|
1492
1564
|
*/
|
|
@@ -2259,7 +2331,7 @@ declare class AccountAddress extends Serializable implements TransactionArgument
|
|
|
2259
2331
|
* const fixedBytes = new FixedBytes(yourCustomSerializedBytes);
|
|
2260
2332
|
* const payload = generateTransactionPayload({
|
|
2261
2333
|
* function: "0xbeefcafe::your_module::your_function_that_requires_custom_serialization",
|
|
2262
|
-
*
|
|
2334
|
+
* functionArguments: [yourCustomBytes],
|
|
2263
2335
|
* });
|
|
2264
2336
|
*
|
|
2265
2337
|
* For example, if you store each of the 32 bytes for an address as a U8 in a MoveVector<U8>, when you
|
|
@@ -2716,6 +2788,22 @@ declare abstract class Signature extends Serializable {
|
|
|
2716
2788
|
*
|
|
2717
2789
|
* Use this class to create accounts, sign transactions, and more.
|
|
2718
2790
|
* Note: Creating an account instance does not create the account on-chain.
|
|
2791
|
+
*
|
|
2792
|
+
* Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports
|
|
2793
|
+
* `Legacy` and `Unified` authentications.
|
|
2794
|
+
*
|
|
2795
|
+
* @Legacy includes `ED25519` and `MultiED25519`
|
|
2796
|
+
* @Unified includes `SingleSender` and `MultiSender`, where currently
|
|
2797
|
+
* `SingleSender` supports `ED25519` and `Secp256k1`, and `MultiSender` supports
|
|
2798
|
+
* `MultiED25519`.
|
|
2799
|
+
*
|
|
2800
|
+
* In TypeScript SDK, we support all of these options
|
|
2801
|
+
* @generate default to generate Unified keys, with an optional `legacy` boolean argument
|
|
2802
|
+
* that lets you generate new keys conforming to the Legacy authentication.
|
|
2803
|
+
* @fromPrivateKey derives an account by a provided private key and address, with an optional
|
|
2804
|
+
* `legacy` boolean argument that lets you generate new keys conforming to the Legacy authentication.
|
|
2805
|
+
* @fromDerivationPath derives an account with bip44 path and mnemonics,
|
|
2806
|
+
*
|
|
2719
2807
|
*/
|
|
2720
2808
|
declare class Account$1 {
|
|
2721
2809
|
/**
|
|
@@ -2741,38 +2829,55 @@ declare class Account$1 {
|
|
|
2741
2829
|
*
|
|
2742
2830
|
* @param args.privateKey PrivateKey - private key of the account
|
|
2743
2831
|
* @param args.address AccountAddress - address of the account
|
|
2832
|
+
* @param args.legacy optional. If set to true, the keypair generated is a Legacy keypair. Defaults
|
|
2833
|
+
* to generating a Unified keypair
|
|
2744
2834
|
*
|
|
2745
2835
|
* This method is private because it should only be called by the factory static methods.
|
|
2746
2836
|
* @returns Account
|
|
2747
2837
|
*/
|
|
2748
2838
|
private constructor();
|
|
2749
2839
|
/**
|
|
2750
|
-
* Derives an account with random private key and address
|
|
2840
|
+
* Derives an account with random private key and address.
|
|
2841
|
+
* Default generation is using the Unified flow with ED25519 key
|
|
2751
2842
|
*
|
|
2752
|
-
* @param
|
|
2753
|
-
*
|
|
2843
|
+
* @param args optional. Unify GenerateAccount type for Legacy and Unified keys
|
|
2844
|
+
*
|
|
2845
|
+
* Account input type to generate an account using Legacy
|
|
2846
|
+
* Ed25519 or MultiEd25519 keys or without a specified `scheme`.
|
|
2847
|
+
* ```
|
|
2848
|
+
* GenerateAccountWithLegacyKey = {
|
|
2849
|
+
* scheme?: SigningSchemeInput.Ed25519 | SigningSchemeInput.MultiEd25519;
|
|
2850
|
+
* legacy: true;
|
|
2851
|
+
* };
|
|
2852
|
+
* ```
|
|
2853
|
+
*
|
|
2854
|
+
* Account input type to generate an account using Unified
|
|
2855
|
+
* Secp256k1Ecdsa key
|
|
2856
|
+
* In this case `legacy` is always false
|
|
2857
|
+
* ```
|
|
2858
|
+
* GenerateAccountWithUnifiedKey = {
|
|
2859
|
+
* scheme: SigningSchemeInput.Secp256k1Ecdsa;
|
|
2860
|
+
* legacy?: false;
|
|
2861
|
+
* };
|
|
2862
|
+
* ```
|
|
2754
2863
|
*
|
|
2755
2864
|
* @returns Account with the given signing scheme
|
|
2756
2865
|
*/
|
|
2757
|
-
static generate(
|
|
2866
|
+
static generate(args?: GenerateAccount): Account$1;
|
|
2758
2867
|
/**
|
|
2759
2868
|
* Derives an account with provided private key
|
|
2760
2869
|
*
|
|
2761
|
-
* @param privateKey
|
|
2762
|
-
* @
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
/**
|
|
2766
|
-
* Derives an account with provided private key and address
|
|
2767
|
-
* This is intended to be used for account that has it's key rotated
|
|
2870
|
+
* @param privateKey PrivateKey - private key of the account
|
|
2871
|
+
* @param address The account address
|
|
2872
|
+
* @param args.legacy optional. If set to true, the keypair generated is a Legacy keypair. Defaults
|
|
2873
|
+
* to generating a Unified keypair
|
|
2768
2874
|
*
|
|
2769
|
-
* @param args.privateKey Hex - private key of the account
|
|
2770
|
-
* @param args.address AccountAddress - address of the account
|
|
2771
2875
|
* @returns Account
|
|
2772
2876
|
*/
|
|
2773
|
-
static
|
|
2877
|
+
static fromPrivateKey(args: {
|
|
2774
2878
|
privateKey: PrivateKey;
|
|
2775
2879
|
address: AccountAddress;
|
|
2880
|
+
legacy?: boolean;
|
|
2776
2881
|
}): Account$1;
|
|
2777
2882
|
/**
|
|
2778
2883
|
* Derives an account with bip44 path and mnemonics,
|
|
@@ -2848,7 +2953,10 @@ declare class AuthenticationKey {
|
|
|
2848
2953
|
* This allows for the creation of AuthenticationKeys that are not derived from Public Keys directly
|
|
2849
2954
|
* @param args
|
|
2850
2955
|
*/
|
|
2851
|
-
|
|
2956
|
+
static fromPublicKeyAndScheme(args: {
|
|
2957
|
+
publicKey: PublicKey;
|
|
2958
|
+
scheme: AuthenticationKeyScheme;
|
|
2959
|
+
}): AuthenticationKey;
|
|
2852
2960
|
/**
|
|
2853
2961
|
* Converts a PublicKey(s) to AuthenticationKey
|
|
2854
2962
|
*
|
|
@@ -2909,6 +3017,7 @@ declare class Ed25519PublicKey extends PublicKey {
|
|
|
2909
3017
|
}): boolean;
|
|
2910
3018
|
serialize(serializer: Serializer): void;
|
|
2911
3019
|
static deserialize(deserializer: Deserializer): Ed25519PublicKey;
|
|
3020
|
+
static load(deserializer: Deserializer): Ed25519PublicKey;
|
|
2912
3021
|
}
|
|
2913
3022
|
/**
|
|
2914
3023
|
* Represents the private key of an Ed25519 key pair.
|
|
@@ -2991,6 +3100,7 @@ declare class Ed25519Signature extends Signature {
|
|
|
2991
3100
|
toString(): string;
|
|
2992
3101
|
serialize(serializer: Serializer): void;
|
|
2993
3102
|
static deserialize(deserializer: Deserializer): Ed25519Signature;
|
|
3103
|
+
static load(deserializer: Deserializer): Ed25519Signature;
|
|
2994
3104
|
}
|
|
2995
3105
|
|
|
2996
3106
|
/**
|
|
@@ -3143,6 +3253,7 @@ declare class Secp256k1PublicKey extends PublicKey {
|
|
|
3143
3253
|
}): boolean;
|
|
3144
3254
|
serialize(serializer: Serializer): void;
|
|
3145
3255
|
static deserialize(deserializer: Deserializer): Secp256k1PublicKey;
|
|
3256
|
+
static load(deserializer: Deserializer): Secp256k1PublicKey;
|
|
3146
3257
|
}
|
|
3147
3258
|
/**
|
|
3148
3259
|
* A Secp256k1 ecdsa private key
|
|
@@ -3230,6 +3341,7 @@ declare class Secp256k1Signature extends Signature {
|
|
|
3230
3341
|
toString(): string;
|
|
3231
3342
|
serialize(serializer: Serializer): void;
|
|
3232
3343
|
static deserialize(deserializer: Deserializer): Secp256k1Signature;
|
|
3344
|
+
static load(deserializer: Deserializer): Secp256k1Signature;
|
|
3233
3345
|
}
|
|
3234
3346
|
|
|
3235
3347
|
/**
|
|
@@ -3328,8 +3440,10 @@ declare class Account {
|
|
|
3328
3440
|
options?: PaginationArgs & LedgerVersion;
|
|
3329
3441
|
}): Promise<MoveResource[]>;
|
|
3330
3442
|
/**
|
|
3331
|
-
* Queries a specific account resource given account address and resource type
|
|
3443
|
+
* Queries a specific account resource given account address and resource type. Note that the default is `any` in order
|
|
3444
|
+
* to allow for ease of accessing properties of the object.
|
|
3332
3445
|
*
|
|
3446
|
+
* @type The typed output of the resource
|
|
3333
3447
|
* @param args.accountAddress Aptos account address
|
|
3334
3448
|
* @param args.resourceType String representation of an on-chain Move struct type, i.e "0x1::aptos_coin::AptosCoin"
|
|
3335
3449
|
* @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version
|
|
@@ -3339,16 +3453,15 @@ declare class Account {
|
|
|
3339
3453
|
* @example An example of an account resource
|
|
3340
3454
|
* ```
|
|
3341
3455
|
* {
|
|
3342
|
-
* type: "0x1::aptos_coin::AptosCoin",
|
|
3343
3456
|
* data: { value: 6 }
|
|
3344
3457
|
* }
|
|
3345
3458
|
* ```
|
|
3346
3459
|
*/
|
|
3347
|
-
getAccountResource(args: {
|
|
3460
|
+
getAccountResource<T extends {} = any>(args: {
|
|
3348
3461
|
accountAddress: HexInput;
|
|
3349
3462
|
resourceType: MoveResourceType;
|
|
3350
3463
|
options?: LedgerVersion;
|
|
3351
|
-
}): Promise<
|
|
3464
|
+
}): Promise<T>;
|
|
3352
3465
|
/**
|
|
3353
3466
|
* Looks up the account address for a given authentication key
|
|
3354
3467
|
*
|
|
@@ -3486,6 +3599,23 @@ declare class Account {
|
|
|
3486
3599
|
orderBy?: OrderBy<GetAccountOwnedObjectsResponse[0]>;
|
|
3487
3600
|
};
|
|
3488
3601
|
}): Promise<GetAccountOwnedObjectsResponse>;
|
|
3602
|
+
/**
|
|
3603
|
+
* Derives an account by providing a private key.
|
|
3604
|
+
* This functions resolves the provided private key type and derives the public key from it.
|
|
3605
|
+
*
|
|
3606
|
+
* If the privateKey is a Secp256k1 type, it derives the account using the derived public key and
|
|
3607
|
+
* auth key using the SingleKey scheme locally.
|
|
3608
|
+
*
|
|
3609
|
+
* If the privateKey is a ED25519 type, it looks up the authentication key on chain, and uses it to resolve
|
|
3610
|
+
* whether it is a Legacy ED25519 key or a Unified ED25519 key. It then derives the account based
|
|
3611
|
+
* on that.
|
|
3612
|
+
*
|
|
3613
|
+
* @param args.privateKey An account private key
|
|
3614
|
+
* @returns Account type
|
|
3615
|
+
*/
|
|
3616
|
+
deriveAccountFromPrivateKey(args: {
|
|
3617
|
+
privateKey: PrivateKey;
|
|
3618
|
+
}): Promise<Account$1>;
|
|
3489
3619
|
}
|
|
3490
3620
|
|
|
3491
3621
|
/**
|
|
@@ -3933,7 +4063,7 @@ declare type GenerateTransactionPayloadData = EntryFunctionData | ScriptData | M
|
|
|
3933
4063
|
declare type EntryFunctionData = {
|
|
3934
4064
|
function: MoveStructType;
|
|
3935
4065
|
typeArguments?: Array<TypeTag>;
|
|
3936
|
-
|
|
4066
|
+
functionArguments: Array<EntryFunctionArgumentTypes>;
|
|
3937
4067
|
};
|
|
3938
4068
|
/**
|
|
3939
4069
|
* The data needed to generate a Multi Sig payload
|
|
@@ -3947,7 +4077,7 @@ declare type MultiSigData = {
|
|
|
3947
4077
|
declare type ScriptData = {
|
|
3948
4078
|
bytecode: HexInput;
|
|
3949
4079
|
typeArguments?: Array<TypeTag>;
|
|
3950
|
-
|
|
4080
|
+
functionArguments: Array<ScriptFunctionArgumentTypes>;
|
|
3951
4081
|
};
|
|
3952
4082
|
/**
|
|
3953
4083
|
* Interface of the arguments to generate a single signer transaction.
|
|
@@ -4372,6 +4502,19 @@ declare class FungibleAsset {
|
|
|
4372
4502
|
where?: FungibleAssetMetadataBoolExp;
|
|
4373
4503
|
};
|
|
4374
4504
|
}): Promise<GetFungibleAssetMetadataResponse>;
|
|
4505
|
+
/**
|
|
4506
|
+
* Queries the current specific fungible asset metadata
|
|
4507
|
+
*
|
|
4508
|
+
* This query returns the fungible asset metadata for a specific fungible asset.
|
|
4509
|
+
*
|
|
4510
|
+
* @param assetType The asset type of the fungible asset.
|
|
4511
|
+
* e.g
|
|
4512
|
+
* "0x1::aptos_coin::AptosCoin" for Aptos Coin
|
|
4513
|
+
* "0xc2948283c2ce03aafbb294821de7ee684b06116bb378ab614fa2de07a99355a8" - address format if this is fungible asset
|
|
4514
|
+
*
|
|
4515
|
+
* @returns getFungibleAssetMetadata A fungible asset metadata item
|
|
4516
|
+
*/
|
|
4517
|
+
getFungibleAssetMetadataByAssetType(assetType: string): Promise<GetFungibleAssetMetadataResponse[0]>;
|
|
4375
4518
|
/**
|
|
4376
4519
|
* Queries the fungible asset activities
|
|
4377
4520
|
*
|
|
@@ -4492,8 +4635,8 @@ declare class General {
|
|
|
4492
4635
|
* `
|
|
4493
4636
|
* const payload: ViewRequest = {
|
|
4494
4637
|
* function: "0x1::coin::balance",
|
|
4495
|
-
*
|
|
4496
|
-
*
|
|
4638
|
+
* typeArguments: ["0x1::aptos_coin::AptosCoin"],
|
|
4639
|
+
* functionArguments: [accountAddress],
|
|
4497
4640
|
* };
|
|
4498
4641
|
* `
|
|
4499
4642
|
*
|
|
@@ -4653,10 +4796,7 @@ declare class Transaction {
|
|
|
4653
4796
|
*/
|
|
4654
4797
|
waitForTransaction(args: {
|
|
4655
4798
|
transactionHash: HexInput;
|
|
4656
|
-
options?:
|
|
4657
|
-
timeoutSecs?: number;
|
|
4658
|
-
checkSuccess?: boolean;
|
|
4659
|
-
};
|
|
4799
|
+
options?: WaitForTransactionOptions;
|
|
4660
4800
|
}): Promise<TransactionResponse>;
|
|
4661
4801
|
/**
|
|
4662
4802
|
* Gives an estimate of the gas unit price required to get a
|
|
@@ -4759,6 +4899,25 @@ declare class TransactionSubmission {
|
|
|
4759
4899
|
signer: Account$1;
|
|
4760
4900
|
transaction: AnyRawTransaction;
|
|
4761
4901
|
}): Promise<PendingTransactionResponse>;
|
|
4902
|
+
/**
|
|
4903
|
+
* Generates a transaction to publish a move package to chain.
|
|
4904
|
+
*
|
|
4905
|
+
* To get the `metadataBytes` and `byteCode`, can compile using Aptos CLI with command
|
|
4906
|
+
* `aptos move compile --save-metadata ...`,
|
|
4907
|
+
* For more info {@link https://aptos.dev/tutorials/your-first-dapp/#step-4-publish-a-move-module}
|
|
4908
|
+
*
|
|
4909
|
+
* @param account The publisher account
|
|
4910
|
+
* @param metadataBytes The package metadata bytes
|
|
4911
|
+
* @param byteCode The bytecodes of modules
|
|
4912
|
+
*
|
|
4913
|
+
* @returns A SingleSignerTransaction that can be simulated or submitted to chain
|
|
4914
|
+
*/
|
|
4915
|
+
publishModuleTransaction(args: {
|
|
4916
|
+
account: HexInput;
|
|
4917
|
+
metadataBytes: HexInput;
|
|
4918
|
+
byteCode: HexInput;
|
|
4919
|
+
options?: GenerateTransactionOptions;
|
|
4920
|
+
}): Promise<SingleSignerTransaction>;
|
|
4762
4921
|
}
|
|
4763
4922
|
|
|
4764
4923
|
/**
|
|
@@ -4824,6 +4983,11 @@ declare class AptosApiError extends Error {
|
|
|
4824
4983
|
constructor(request: AptosRequest, response: AptosResponse<any, any>, message: string);
|
|
4825
4984
|
}
|
|
4826
4985
|
|
|
4986
|
+
/**
|
|
4987
|
+
* Given a url and method, sends the request with axios and
|
|
4988
|
+
* returns the response.
|
|
4989
|
+
*/
|
|
4990
|
+
declare function request<Req, Res>(options: ClientRequest<Req>, client: Client): Promise<ClientResponse<Res>>;
|
|
4827
4991
|
/**
|
|
4828
4992
|
* The main function to use when doing an API request.
|
|
4829
4993
|
*
|
|
@@ -4908,7 +5072,7 @@ declare type PostRequestOptions = {
|
|
|
4908
5072
|
*/
|
|
4909
5073
|
params?: Record<string, string | AnyNumber | boolean | undefined>;
|
|
4910
5074
|
/**
|
|
4911
|
-
* The body of the request, should match
|
|
5075
|
+
* The body of the request, should match the content type of the request
|
|
4912
5076
|
*/
|
|
4913
5077
|
body?: any;
|
|
4914
5078
|
/**
|
|
@@ -4962,4 +5126,4 @@ declare const isValidPath: (path: string) => boolean;
|
|
|
4962
5126
|
*/
|
|
4963
5127
|
declare const derivePrivateKeyFromMnemonic: (keyType: KeyType, path: string, seedPhrase: string, offset?: number) => DerivedKeys;
|
|
4964
5128
|
|
|
4965
|
-
export { APTOS_PATH_REGEX, Account$1 as Account, AccountAddress, AccountAuthenticatorVariant, AccountData, AccountEd25519Signature, AccountMultiEd25519Signature, AccountSecp256k1Signature, AccountSignature, AddressInvalidReason, AnyNumber, AnyRawTransaction, AnyRawTransactionInstance, Aptos, AptosApiError, AptosConfig, AptosRequest, AptosResponse, AptosSettings, AuthenticationKey, AuthenticationKeyScheme, Block, BlockMetadataTransactionResponse, Bool, ClientConfig, DecodedTableData, DeletedTableData, DeriveScheme, DerivedKeys, Deserializable, Deserializer, DirectWriteSet, Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature, EntryFunctionArgumentTypes, EntryFunctionBytes, EntryFunctionData, EntryFunctionPayloadResponse, Event$1 as Event, EventGuid, FeePayerTransaction, FixedBytes, GasEstimation, GenerateFeePayerRawTransactionArgs, GenerateFeePayerRawTransactionInput, GenerateMultiAgentRawTransactionArgs, GenerateMultiAgentRawTransactionInput, GenerateRawTransactionArgs, GenerateSingleSignerRawTransactionArgs, GenerateSingleSignerRawTransactionInput, GenerateTransactionInput, GenerateTransactionOptions, GenerateTransactionPayloadData, GenesisPayload, GenesisTransactionResponse, GetAccountCoinsDataResponse, GetAccountCollectionsWithOwnedTokenResponse, GetAccountOwnedObjectsResponse, GetAccountOwnedTokensFromCollectionResponse, GetAccountOwnedTokensQueryResponse, GetAptosRequestOptions, GetChainTopUserTransactionsResponse, GetCollectionDataResponse, GetCurrentFungibleAssetBalancesResponse, GetCurrentTokenOwnershipResponse, GetDelegatedStakingActivitiesResponse, GetEventsResponse, GetFungibleAssetActivitiesResponse, GetFungibleAssetMetadataResponse, GetNumberOfDelegatorsResponse, GetOwnedTokensResponse, GetProcessorStatusResponse, GetRequestOptions, GetTokenActivityResponse, GetTokenDataResponse, GraphqlQuery, Hex, HexInput, HexInvalidReason, KeyType, LedgerInfo, LedgerVersion, MimeType, MoveAbility, MoveAddressType, MoveFunction, MoveFunctionGenericTypeParam, MoveFunctionVisibility, MoveModule, MoveModuleBytecode, MoveModuleId, MoveObject, MoveObjectType, MoveOption, MoveOptionType, MoveResource, MoveResourceType, MoveScriptBytecode, MoveString, MoveStruct, MoveStructField, MoveStructType, MoveType, MoveUint128Type, MoveUint16Type, MoveUint256Type, MoveUint32Type, MoveUint64Type, MoveUint8Type, MoveValue, MoveVector, MultiAgentTransaction, MultiEd25519PublicKey, MultiEd25519Signature, MultiSigData, MultisigPayloadResponse, Network, NetworkToChainId, NetworkToFaucetAPI, NetworkToIndexerAPI, NetworkToNodeAPI, OrderBy, OrderByValue, PaginationArgs, ParsingError, ParsingResult, PendingTransactionResponse, PostAptosRequestOptions, PostRequestOptions, PrivateKey, PublicKey, RoleType, ScriptData, ScriptFunctionArgumentTypes, ScriptPayloadResponse, ScriptTransactionArgumentVariants, ScriptWriteSet, Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1Signature, Serializable, Serializer, Signature, SigningScheme, SimulateTransactionData, SimulateTransactionOptions, SingleSignerTransaction, StateCheckpointTransactionResponse, StructTag, TableItemRequest, TokenStandard, TransactionAuthenticatorVariant, TransactionEd25519Signature, TransactionFeePayerSignature, TransactionMultiAgentSignature, TransactionMultiEd25519Signature, TransactionPayload, TransactionPayloadResponse, TransactionPayloadVariants, TransactionResponse, TransactionResponseType, TransactionSecp256k1Signature, TransactionSignature, TransactionVariants, TypeTag, TypeTagAddress, TypeTagBool, TypeTagParser, TypeTagParserError, TypeTagSigner, TypeTagStruct, TypeTagU128, TypeTagU16, TypeTagU256, TypeTagU32, TypeTagU64, TypeTagU8, TypeTagVariants, TypeTagVector, U128, U16, U256, U32, U64, U8, Uint128, Uint16, Uint256, Uint32, Uint64, Uint8, UserTransactionResponse, ViewRequest, ViewRequestData, WriteSet, WriteSetChange, WriteSetChangeDeleteModule, WriteSetChangeDeleteResource, WriteSetChangeDeleteTableItem, WriteSetChangeWriteModule, WriteSetChangeWriteResource, WriteSetChangeWriteTableItem, aptosRequest, derivePrivateKeyFromMnemonic, ensureBoolean, get, getAptosFullNode, isValidPath, objectStructTag, optionStructTag, outOfRangeErrorMessage, paginateWithCursor, post, postAptosFaucet, postAptosFullNode, postAptosIndexer, stringStructTag, validateNumberInRange };
|
|
5129
|
+
export { APTOS_PATH_REGEX, Account$1 as Account, AccountAddress, AccountAuthenticatorVariant, AccountData, AccountEd25519Signature, AccountMultiEd25519Signature, AccountSecp256k1Signature, AccountSignature, AddressInvalidReason, AnyNumber, AnyPublicKeyVariant, AnyRawTransaction, AnyRawTransactionInstance, AnySignatureVariant, Aptos, AptosApiError, AptosConfig, AptosRequest, AptosResponse, AptosSettings, AuthenticationKey, AuthenticationKeyScheme, Block, BlockMetadataTransactionResponse, Bool, Client, ClientConfig, ClientRequest, ClientResponse, DecodedTableData, DeletedTableData, DeriveScheme, DerivedKeys, Deserializable, Deserializer, DirectWriteSet, Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature, EntryFunctionArgumentTypes, EntryFunctionBytes, EntryFunctionData, EntryFunctionPayloadResponse, Event$1 as Event, EventGuid, FeePayerTransaction, FixedBytes, GasEstimation, GenerateAccount, GenerateAccountWithLegacyKey, GenerateAccountWithUnifiedKey, GenerateFeePayerRawTransactionArgs, GenerateFeePayerRawTransactionInput, GenerateMultiAgentRawTransactionArgs, GenerateMultiAgentRawTransactionInput, GenerateRawTransactionArgs, GenerateSingleSignerRawTransactionArgs, GenerateSingleSignerRawTransactionInput, GenerateTransactionInput, GenerateTransactionOptions, GenerateTransactionPayloadData, GenesisPayload, GenesisTransactionResponse, GetAccountCoinsDataResponse, GetAccountCollectionsWithOwnedTokenResponse, GetAccountOwnedObjectsResponse, GetAccountOwnedTokensFromCollectionResponse, GetAccountOwnedTokensQueryResponse, GetAptosRequestOptions, GetChainTopUserTransactionsResponse, GetCollectionDataResponse, GetCurrentFungibleAssetBalancesResponse, GetCurrentTokenOwnershipResponse, GetDelegatedStakingActivitiesResponse, GetEventsResponse, GetFungibleAssetActivitiesResponse, GetFungibleAssetMetadataResponse, GetNumberOfDelegatorsResponse, GetOwnedTokensResponse, GetProcessorStatusResponse, GetRequestOptions, GetTokenActivityResponse, GetTokenDataResponse, GraphqlQuery, Hex, HexInput, HexInvalidReason, KeyType, LedgerInfo, LedgerVersion, MimeType, MoveAbility, MoveAddressType, MoveFunction, MoveFunctionGenericTypeParam, MoveFunctionVisibility, MoveModule, MoveModuleBytecode, MoveModuleId, MoveObject, MoveObjectType, MoveOption, MoveOptionType, MoveResource, MoveResourceType, MoveScriptBytecode, MoveString, MoveStruct, MoveStructField, MoveStructType, MoveType, MoveUint128Type, MoveUint16Type, MoveUint256Type, MoveUint32Type, MoveUint64Type, MoveUint8Type, MoveValue, MoveVector, MultiAgentTransaction, MultiEd25519PublicKey, MultiEd25519Signature, MultiSigData, MultisigPayloadResponse, Network, NetworkToChainId, NetworkToFaucetAPI, NetworkToIndexerAPI, NetworkToNodeAPI, OrderBy, OrderByValue, PaginationArgs, ParsingError, ParsingResult, PendingTransactionResponse, PostAptosRequestOptions, PostRequestOptions, PrivateKey, PublicKey, RoleType, ScriptData, ScriptFunctionArgumentTypes, ScriptPayloadResponse, ScriptTransactionArgumentVariants, ScriptWriteSet, Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1Signature, Serializable, Serializer, Signature, SigningScheme, SigningSchemeInput, SimulateTransactionData, SimulateTransactionOptions, SingleSignerTransaction, StateCheckpointTransactionResponse, StructTag, TableItemRequest, TokenStandard, TransactionAuthenticatorVariant, TransactionEd25519Signature, TransactionFeePayerSignature, TransactionMultiAgentSignature, TransactionMultiEd25519Signature, TransactionPayload, TransactionPayloadResponse, TransactionPayloadVariants, TransactionResponse, TransactionResponseType, TransactionSecp256k1Signature, TransactionSignature, TransactionVariants, TypeTag, TypeTagAddress, TypeTagBool, TypeTagParser, TypeTagParserError, TypeTagSigner, TypeTagStruct, TypeTagU128, TypeTagU16, TypeTagU256, TypeTagU32, TypeTagU64, TypeTagU8, TypeTagVariants, TypeTagVector, U128, U16, U256, U32, U64, U8, Uint128, Uint16, Uint256, Uint32, Uint64, Uint8, UserTransactionResponse, ViewRequest, ViewRequestData, WaitForTransactionOptions, WriteSet, WriteSetChange, WriteSetChangeDeleteModule, WriteSetChangeDeleteResource, WriteSetChangeDeleteTableItem, WriteSetChangeWriteModule, WriteSetChangeWriteResource, WriteSetChangeWriteTableItem, aptosRequest, derivePrivateKeyFromMnemonic, ensureBoolean, get, getAptosFullNode, isValidPath, objectStructTag, optionStructTag, outOfRangeErrorMessage, paginateWithCursor, post, postAptosFaucet, postAptosFullNode, postAptosIndexer, request, stringStructTag, validateNumberInRange };
|