@aptos-labs/ts-sdk 1.4.0 → 1.5.0
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 +1 -1
- package/dist/browser/index.d.ts +306 -226
- package/dist/browser/index.global.js +30 -30
- package/dist/browser/index.global.js.map +1 -1
- package/dist/common/index.d.ts +306 -226
- package/dist/common/index.js +24 -24
- package/dist/common/index.js.map +1 -1
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +6 -1
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +5 -0
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +8 -0
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +89 -0
- package/dist/esm/api/transactionSubmission/management.mjs +2 -0
- package/dist/esm/api/transactionSubmission/management.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/chunk-27YNIEGN.mjs +2 -0
- package/dist/esm/chunk-27YNIEGN.mjs.map +1 -0
- package/dist/esm/{chunk-CBMEWHLK.mjs → chunk-2L25JUOZ.mjs} +2 -2
- package/dist/esm/chunk-3ZXA5RXM.mjs +2 -0
- package/dist/esm/{chunk-NXPN5XLB.mjs.map → chunk-3ZXA5RXM.mjs.map} +1 -1
- package/dist/esm/{chunk-V6J34VOD.mjs → chunk-4RCHQ5OG.mjs} +2 -2
- package/dist/esm/{chunk-GGCQNE7J.mjs → chunk-4YLVLXBU.mjs} +2 -2
- package/dist/esm/{chunk-CHK4FLX4.mjs → chunk-5LVAL5L5.mjs} +2 -2
- package/dist/esm/{chunk-KYI7YRRQ.mjs → chunk-5YEWYQYB.mjs} +2 -2
- package/dist/esm/{chunk-PXNW26UO.mjs → chunk-6DJNNRXC.mjs} +2 -2
- package/dist/esm/{chunk-FXXTTZOI.mjs → chunk-7FQQLRCP.mjs} +2 -2
- package/dist/esm/chunk-7G6Q5OZU.mjs +2 -0
- package/dist/esm/chunk-7G6Q5OZU.mjs.map +1 -0
- package/dist/esm/{chunk-LLONKHWW.mjs → chunk-7OEIQQ6R.mjs} +2 -2
- package/dist/esm/{chunk-F362Q4BJ.mjs → chunk-A4FV3LLX.mjs} +2 -2
- package/dist/esm/{chunk-RKWCYC3Y.mjs → chunk-AEM3D7EJ.mjs} +2 -2
- package/dist/esm/{chunk-QQMEPYJ3.mjs → chunk-AKKHTLMY.mjs} +2 -2
- package/dist/esm/{chunk-XSM3SOZY.mjs → chunk-BYMM43DU.mjs} +2 -2
- package/dist/esm/chunk-C65GKQ3P.mjs +2 -0
- package/dist/esm/chunk-C65GKQ3P.mjs.map +1 -0
- package/dist/esm/{chunk-O74RSNEJ.mjs → chunk-DGHZH65W.mjs} +2 -2
- package/dist/esm/{chunk-4BGNLZ5Y.mjs → chunk-FDHCHIQ7.mjs} +2 -2
- package/dist/esm/{chunk-MJW4JGUR.mjs → chunk-IHBKJDF3.mjs} +2 -2
- package/dist/esm/chunk-JZTWL2U4.mjs +2 -0
- package/dist/esm/chunk-JZTWL2U4.mjs.map +1 -0
- package/dist/esm/{chunk-BBJ3YXGC.mjs → chunk-LQO2NP7Q.mjs} +2 -2
- package/dist/esm/{chunk-LGC5FYCC.mjs → chunk-LT3YQOAJ.mjs} +2 -2
- package/dist/esm/{chunk-XGM33CR7.mjs → chunk-NI7GRYCP.mjs} +2 -2
- package/dist/esm/{chunk-4RFWMHWT.mjs → chunk-NIGVPRZ6.mjs} +2 -2
- package/dist/esm/chunk-NTCYNTCE.mjs +2 -0
- package/dist/esm/chunk-NTCYNTCE.mjs.map +1 -0
- package/dist/esm/{chunk-FW7B46XZ.mjs → chunk-OZWFV4NN.mjs} +2 -2
- package/dist/esm/{chunk-4OI7MPFH.mjs → chunk-RNO5ZG3C.mjs} +2 -2
- package/dist/esm/{chunk-I4EKXYTB.mjs → chunk-RR2M6HEQ.mjs} +2 -2
- package/dist/esm/{chunk-YJQQF4GI.mjs → chunk-SNPLEVUU.mjs} +2 -2
- package/dist/esm/{chunk-457LDQ3A.mjs → chunk-TXZRELMU.mjs} +2 -2
- package/dist/esm/{chunk-3PPUHF6D.mjs → chunk-UFNOMNAH.mjs} +2 -2
- package/dist/esm/{chunk-Q7B4KMTR.mjs → chunk-UUDSB4PL.mjs} +2 -2
- package/dist/esm/{chunk-7Z4DTVZN.mjs → chunk-VEH3IYGS.mjs} +2 -2
- package/dist/esm/{chunk-TJJSQSO3.mjs → chunk-VO2CATMP.mjs} +2 -2
- package/dist/esm/{chunk-TN4RHL6A.mjs → chunk-VVSHMXN7.mjs} +2 -2
- package/dist/esm/{chunk-DHR4YEUH.mjs → chunk-WYHDRLPQ.mjs} +2 -2
- package/dist/esm/{chunk-3DM36HLF.mjs → chunk-YVSIS6BA.mjs} +2 -2
- package/dist/esm/{chunk-JHKU4VAL.mjs → chunk-YWXYB7J2.mjs} +2 -2
- package/dist/esm/{chunk-4DEYLX4E.mjs → chunk-ZDDVIMPX.mjs} +2 -2
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account.mjs +1 -1
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/anyPublicKey.mjs +1 -1
- package/dist/esm/core/crypto/anySignature.mjs +1 -1
- package/dist/esm/core/crypto/asymmetricCrypto.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +3 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +2 -1
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +29 -3
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -1
- package/src/api/aptos.ts +1 -1
- package/src/api/transaction.ts +7 -9
- package/src/api/transactionSubmission/management.ts +106 -0
- package/src/client/core.ts +1 -1
- package/src/transactions/management/transactionWorker.ts +74 -14
- package/src/version.ts +1 -1
- package/dist/esm/chunk-2EQNGCPL.mjs +0 -2
- package/dist/esm/chunk-2EQNGCPL.mjs.map +0 -1
- package/dist/esm/chunk-ATV7SH7J.mjs +0 -2
- package/dist/esm/chunk-ATV7SH7J.mjs.map +0 -1
- package/dist/esm/chunk-NXPN5XLB.mjs +0 -2
- package/dist/esm/chunk-QLAW63UU.mjs +0 -2
- package/dist/esm/chunk-QLAW63UU.mjs.map +0 -1
- package/dist/esm/chunk-RVQGLEBY.mjs +0 -2
- package/dist/esm/chunk-RVQGLEBY.mjs.map +0 -1
- /package/dist/esm/{chunk-CBMEWHLK.mjs.map → chunk-2L25JUOZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-V6J34VOD.mjs.map → chunk-4RCHQ5OG.mjs.map} +0 -0
- /package/dist/esm/{chunk-GGCQNE7J.mjs.map → chunk-4YLVLXBU.mjs.map} +0 -0
- /package/dist/esm/{chunk-CHK4FLX4.mjs.map → chunk-5LVAL5L5.mjs.map} +0 -0
- /package/dist/esm/{chunk-KYI7YRRQ.mjs.map → chunk-5YEWYQYB.mjs.map} +0 -0
- /package/dist/esm/{chunk-PXNW26UO.mjs.map → chunk-6DJNNRXC.mjs.map} +0 -0
- /package/dist/esm/{chunk-FXXTTZOI.mjs.map → chunk-7FQQLRCP.mjs.map} +0 -0
- /package/dist/esm/{chunk-LLONKHWW.mjs.map → chunk-7OEIQQ6R.mjs.map} +0 -0
- /package/dist/esm/{chunk-F362Q4BJ.mjs.map → chunk-A4FV3LLX.mjs.map} +0 -0
- /package/dist/esm/{chunk-RKWCYC3Y.mjs.map → chunk-AEM3D7EJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-QQMEPYJ3.mjs.map → chunk-AKKHTLMY.mjs.map} +0 -0
- /package/dist/esm/{chunk-XSM3SOZY.mjs.map → chunk-BYMM43DU.mjs.map} +0 -0
- /package/dist/esm/{chunk-O74RSNEJ.mjs.map → chunk-DGHZH65W.mjs.map} +0 -0
- /package/dist/esm/{chunk-4BGNLZ5Y.mjs.map → chunk-FDHCHIQ7.mjs.map} +0 -0
- /package/dist/esm/{chunk-MJW4JGUR.mjs.map → chunk-IHBKJDF3.mjs.map} +0 -0
- /package/dist/esm/{chunk-BBJ3YXGC.mjs.map → chunk-LQO2NP7Q.mjs.map} +0 -0
- /package/dist/esm/{chunk-LGC5FYCC.mjs.map → chunk-LT3YQOAJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-XGM33CR7.mjs.map → chunk-NI7GRYCP.mjs.map} +0 -0
- /package/dist/esm/{chunk-4RFWMHWT.mjs.map → chunk-NIGVPRZ6.mjs.map} +0 -0
- /package/dist/esm/{chunk-FW7B46XZ.mjs.map → chunk-OZWFV4NN.mjs.map} +0 -0
- /package/dist/esm/{chunk-4OI7MPFH.mjs.map → chunk-RNO5ZG3C.mjs.map} +0 -0
- /package/dist/esm/{chunk-I4EKXYTB.mjs.map → chunk-RR2M6HEQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-YJQQF4GI.mjs.map → chunk-SNPLEVUU.mjs.map} +0 -0
- /package/dist/esm/{chunk-457LDQ3A.mjs.map → chunk-TXZRELMU.mjs.map} +0 -0
- /package/dist/esm/{chunk-3PPUHF6D.mjs.map → chunk-UFNOMNAH.mjs.map} +0 -0
- /package/dist/esm/{chunk-Q7B4KMTR.mjs.map → chunk-UUDSB4PL.mjs.map} +0 -0
- /package/dist/esm/{chunk-7Z4DTVZN.mjs.map → chunk-VEH3IYGS.mjs.map} +0 -0
- /package/dist/esm/{chunk-TJJSQSO3.mjs.map → chunk-VO2CATMP.mjs.map} +0 -0
- /package/dist/esm/{chunk-TN4RHL6A.mjs.map → chunk-VVSHMXN7.mjs.map} +0 -0
- /package/dist/esm/{chunk-DHR4YEUH.mjs.map → chunk-WYHDRLPQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-3DM36HLF.mjs.map → chunk-YVSIS6BA.mjs.map} +0 -0
- /package/dist/esm/{chunk-JHKU4VAL.mjs.map → chunk-YWXYB7J2.mjs.map} +0 -0
- /package/dist/esm/{chunk-4DEYLX4E.mjs.map → chunk-ZDDVIMPX.mjs.map} +0 -0
package/README.md
CHANGED
|
@@ -171,7 +171,7 @@ const pendingTransaction = await aptos.signAndSubmitTransaction({ signer: alice,
|
|
|
171
171
|
|
|
172
172
|
## Documentation and examples
|
|
173
173
|
|
|
174
|
-
- For full SDK documentation, check out the [TypeScript SDK documentation](https://aptos.dev/sdks/ts-sdk
|
|
174
|
+
- For full SDK documentation, check out the [TypeScript SDK documentation](https://aptos.dev/sdks/new-ts-sdk/)
|
|
175
175
|
- For reference documenation, check out the [API reference documentation](https://aptos-labs.github.io/aptos-ts-sdk/) for the associated version.
|
|
176
176
|
- For in-depth examples, check out the [examples](./examples) folder with ready-made `package.json` files to get you going quickly!
|
|
177
177
|
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import EventEmitter from 'eventemitter3';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* This error is used to explain why parsing failed.
|
|
3
5
|
*/
|
|
@@ -6178,11 +6180,311 @@ declare class Submit {
|
|
|
6178
6180
|
}): Promise<PendingTransactionResponse>;
|
|
6179
6181
|
}
|
|
6180
6182
|
|
|
6183
|
+
/**
|
|
6184
|
+
* A wrapper that handles and manages an account sequence number.
|
|
6185
|
+
*
|
|
6186
|
+
* Submit up to `maximumInFlight` transactions per account in parallel with a timeout of `sleepTime`
|
|
6187
|
+
* If local assumes `maximumInFlight` are in flight, determine the actual committed state from the network
|
|
6188
|
+
* If there are less than `maximumInFlight` due to some being committed, adjust the window
|
|
6189
|
+
* If `maximumInFlight` are in flight, wait `sleepTime` seconds before re-evaluating
|
|
6190
|
+
* If ever waiting more than `maxWaitTime` restart the sequence number to the current on-chain state
|
|
6191
|
+
*
|
|
6192
|
+
* Assumptions:
|
|
6193
|
+
* Accounts are expected to be managed by a single AccountSequenceNumber and not used otherwise.
|
|
6194
|
+
* They are initialized to the current on-chain state, so if there are already transactions in
|
|
6195
|
+
* flight, they may take some time to reset.
|
|
6196
|
+
* Accounts are automatically initialized if not explicitly
|
|
6197
|
+
*
|
|
6198
|
+
* Notes:
|
|
6199
|
+
* This is co-routine safe, that is many async tasks can be reading from this concurrently.
|
|
6200
|
+
* The state of an account cannot be used across multiple AccountSequenceNumber services.
|
|
6201
|
+
* The synchronize method will create a barrier that prevents additional nextSequenceNumber
|
|
6202
|
+
* calls until it is complete.
|
|
6203
|
+
* This only manages the distribution of sequence numbers it does not help handle transaction
|
|
6204
|
+
* failures.
|
|
6205
|
+
* If a transaction fails, you should call synchronize and wait for timeouts.
|
|
6206
|
+
*/
|
|
6207
|
+
|
|
6208
|
+
declare class AccountSequenceNumber {
|
|
6209
|
+
readonly aptosConfig: AptosConfig;
|
|
6210
|
+
readonly account: Account$1;
|
|
6211
|
+
lastUncommintedNumber: bigint | null;
|
|
6212
|
+
currentNumber: bigint | null;
|
|
6213
|
+
/**
|
|
6214
|
+
* We want to guarantee that we preserve ordering of workers to requests.
|
|
6215
|
+
*
|
|
6216
|
+
* `lock` is used to try to prevent multiple coroutines from accessing a shared resource at the same time,
|
|
6217
|
+
* which can result in race conditions and data inconsistency.
|
|
6218
|
+
* This code actually doesn't do it though, since we aren't giving out a slot, it is still somewhat a race condition.
|
|
6219
|
+
*
|
|
6220
|
+
* The ideal solution is likely that each thread grabs the next number from a incremental integer.
|
|
6221
|
+
* When they complete, they increment that number and that entity is able to enter the `lock`.
|
|
6222
|
+
* That would guarantee ordering.
|
|
6223
|
+
*/
|
|
6224
|
+
lock: boolean;
|
|
6225
|
+
maxWaitTime: number;
|
|
6226
|
+
maximumInFlight: number;
|
|
6227
|
+
sleepTime: number;
|
|
6228
|
+
constructor(aptosConfig: AptosConfig, account: Account$1, maxWaitTime: number, maximumInFlight: number, sleepTime: number);
|
|
6229
|
+
/**
|
|
6230
|
+
* Returns the next available sequence number for this account
|
|
6231
|
+
*
|
|
6232
|
+
* @returns next available sequence number
|
|
6233
|
+
*/
|
|
6234
|
+
nextSequenceNumber(): Promise<bigint | null>;
|
|
6235
|
+
/**
|
|
6236
|
+
* Initializes this account with the sequence number on chain
|
|
6237
|
+
*/
|
|
6238
|
+
initialize(): Promise<void>;
|
|
6239
|
+
/**
|
|
6240
|
+
* Updates this account sequence number with the one on-chain
|
|
6241
|
+
*
|
|
6242
|
+
* @returns on-chain sequence number for this account
|
|
6243
|
+
*/
|
|
6244
|
+
update(): Promise<bigint>;
|
|
6245
|
+
/**
|
|
6246
|
+
* Synchronizes local sequence number with the seqeunce number on chain for this account.
|
|
6247
|
+
*
|
|
6248
|
+
* Poll the network until all submitted transactions have either been committed or until
|
|
6249
|
+
* the maximum wait time has elapsed
|
|
6250
|
+
*/
|
|
6251
|
+
synchronize(): Promise<void>;
|
|
6252
|
+
}
|
|
6253
|
+
|
|
6254
|
+
/**
|
|
6255
|
+
* The AsyncQueue class is an async-aware data structure that provides a queue-like
|
|
6256
|
+
* behavior for managing asynchronous tasks or operations.
|
|
6257
|
+
* It allows to enqueue items and dequeue them asynchronously.
|
|
6258
|
+
* This is not thread-safe but it is async concurrency safe and
|
|
6259
|
+
* it does not guarantee ordering for those that call into and await on enqueue.
|
|
6260
|
+
*/
|
|
6261
|
+
declare class AsyncQueue<T> {
|
|
6262
|
+
readonly queue: T[];
|
|
6263
|
+
private pendingDequeue;
|
|
6264
|
+
private cancelled;
|
|
6265
|
+
/**
|
|
6266
|
+
* The enqueue method adds an item to the queue. If there are pending dequeued promises,
|
|
6267
|
+
* in the pendingDequeue, it resolves the oldest promise with the enqueued item immediately.
|
|
6268
|
+
* Otherwise, it adds the item to the queue.
|
|
6269
|
+
*
|
|
6270
|
+
* @param item T
|
|
6271
|
+
*/
|
|
6272
|
+
enqueue(item: T): void;
|
|
6273
|
+
/**
|
|
6274
|
+
* The dequeue method returns a promise that resolves to the next item in the queue.
|
|
6275
|
+
* If the queue is not empty, it resolves the promise immediately with the next item.
|
|
6276
|
+
* Otherwise, it creates a new promise. The promise's resolve function is stored
|
|
6277
|
+
* in the pendingDequeue with a unique counter value as the key.
|
|
6278
|
+
* The newly created promise is then returned, and it will be resolved later when an item is enqueued.
|
|
6279
|
+
*
|
|
6280
|
+
* @returns Promise<T>
|
|
6281
|
+
*/
|
|
6282
|
+
dequeue(): Promise<T>;
|
|
6283
|
+
/**
|
|
6284
|
+
* The isEmpty method returns whether the queue is empty or not.
|
|
6285
|
+
*
|
|
6286
|
+
* @returns boolean
|
|
6287
|
+
*/
|
|
6288
|
+
isEmpty(): boolean;
|
|
6289
|
+
/**
|
|
6290
|
+
* The cancel method cancels all pending promises in the queue.
|
|
6291
|
+
* It rejects the promises with a AsyncQueueCancelledError error,
|
|
6292
|
+
* ensuring that any awaiting code can handle the cancellation appropriately.
|
|
6293
|
+
*/
|
|
6294
|
+
cancel(): void;
|
|
6295
|
+
/**
|
|
6296
|
+
* The isCancelled method returns whether the queue is cancelled or not.
|
|
6297
|
+
*
|
|
6298
|
+
* @returns boolean
|
|
6299
|
+
*/
|
|
6300
|
+
isCancelled(): boolean;
|
|
6301
|
+
/**
|
|
6302
|
+
* The pendingDequeueLength method returns the length of the pendingDequeue.
|
|
6303
|
+
*
|
|
6304
|
+
* @returns number
|
|
6305
|
+
*/
|
|
6306
|
+
pendingDequeueLength(): number;
|
|
6307
|
+
}
|
|
6308
|
+
|
|
6309
|
+
declare const promiseFulfilledStatus = "fulfilled";
|
|
6310
|
+
declare enum TransactionWorkerEventsEnum {
|
|
6311
|
+
TransactionSent = "transactionSent",
|
|
6312
|
+
TransactionSendFailed = "transactionSendFailed",
|
|
6313
|
+
TransactionExecuted = "transactionExecuted",
|
|
6314
|
+
TransactionExecutionFailed = "transactionExecutionFailed",
|
|
6315
|
+
ExecutionFinish = "executionFinish"
|
|
6316
|
+
}
|
|
6317
|
+
interface TransactionWorkerEvents {
|
|
6318
|
+
transactionSent: (data: SuccessEventData) => void;
|
|
6319
|
+
transactionSendFailed: (data: FailureEventData) => void;
|
|
6320
|
+
transactionExecuted: (data: SuccessEventData) => void;
|
|
6321
|
+
transactionExecutionFailed: (data: FailureEventData) => void;
|
|
6322
|
+
executionFinish: (data: ExecutionFinishEventData) => void;
|
|
6323
|
+
}
|
|
6324
|
+
type ExecutionFinishEventData = {
|
|
6325
|
+
message: string;
|
|
6326
|
+
};
|
|
6327
|
+
type SuccessEventData = {
|
|
6328
|
+
message: string;
|
|
6329
|
+
transactionHash: string;
|
|
6330
|
+
};
|
|
6331
|
+
type FailureEventData = {
|
|
6332
|
+
message: string;
|
|
6333
|
+
error: string;
|
|
6334
|
+
};
|
|
6335
|
+
/**
|
|
6336
|
+
* TransactionWorker provides a simple framework for receiving payloads to be processed.
|
|
6337
|
+
*
|
|
6338
|
+
* Once one `start()` the process and pushes a new transaction, the worker acquires
|
|
6339
|
+
* the current account's next sequence number (by using the AccountSequenceNumber class),
|
|
6340
|
+
* generates a signed transaction and pushes an async submission process into the `outstandingTransactions` queue.
|
|
6341
|
+
* At the same time, the worker processes transactions by reading the `outstandingTransactions` queue
|
|
6342
|
+
* and submits the next transaction to chain, it
|
|
6343
|
+
* 1) waits for resolution of the submission process or get pre-execution validation error
|
|
6344
|
+
* and 2) waits for the resolution of the execution process or get an execution error.
|
|
6345
|
+
* The worker fires events for any submission and/or execution success and/or failure.
|
|
6346
|
+
*/
|
|
6347
|
+
declare class TransactionWorker extends EventEmitter<TransactionWorkerEvents> {
|
|
6348
|
+
readonly aptosConfig: AptosConfig;
|
|
6349
|
+
readonly account: Account$1;
|
|
6350
|
+
readonly accountSequnceNumber: AccountSequenceNumber;
|
|
6351
|
+
readonly taskQueue: AsyncQueue<() => Promise<void>>;
|
|
6352
|
+
started: boolean;
|
|
6353
|
+
/**
|
|
6354
|
+
* transactions payloads waiting to be generated and signed
|
|
6355
|
+
*
|
|
6356
|
+
* TODO support entry function payload from ABI builder
|
|
6357
|
+
*/
|
|
6358
|
+
transactionsQueue: AsyncQueue<[InputGenerateTransactionPayloadData, InputGenerateTransactionOptions | undefined]>;
|
|
6359
|
+
/**
|
|
6360
|
+
* signed transactions waiting to be submitted
|
|
6361
|
+
*/
|
|
6362
|
+
outstandingTransactions: AsyncQueue<[Promise<PendingTransactionResponse>, bigint]>;
|
|
6363
|
+
/**
|
|
6364
|
+
* transactions that have been submitted to chain
|
|
6365
|
+
*/
|
|
6366
|
+
sentTransactions: Array<[string, bigint, any]>;
|
|
6367
|
+
/**
|
|
6368
|
+
* transactions that have been committed to chain
|
|
6369
|
+
*/
|
|
6370
|
+
executedTransactions: Array<[string, bigint, any]>;
|
|
6371
|
+
/**
|
|
6372
|
+
* Provides a simple framework for receiving payloads to be processed.
|
|
6373
|
+
*
|
|
6374
|
+
* @param aptosConfig - a config object
|
|
6375
|
+
* @param sender - a sender as Account
|
|
6376
|
+
* @param maxWaitTime - the max wait time to wait before resyncing the sequence number
|
|
6377
|
+
* to the current on-chain state, default to 30
|
|
6378
|
+
* @param maximumInFlight - submit up to `maximumInFlight` transactions per account.
|
|
6379
|
+
* Mempool limits the number of transactions per account to 100, hence why we default to 100.
|
|
6380
|
+
* @param sleepTime - If `maximumInFlight` are in flight, wait `sleepTime` seconds before re-evaluating, default to 10
|
|
6381
|
+
*/
|
|
6382
|
+
constructor(aptosConfig: AptosConfig, account: Account$1, maxWaitTime?: number, maximumInFlight?: number, sleepTime?: number);
|
|
6383
|
+
/**
|
|
6384
|
+
* Gets the current account sequence number,
|
|
6385
|
+
* generates the transaction with the account sequence number,
|
|
6386
|
+
* adds the transaction to the outstanding transaction queue
|
|
6387
|
+
* to be processed later.
|
|
6388
|
+
*/
|
|
6389
|
+
submitNextTransaction(): Promise<void>;
|
|
6390
|
+
/**
|
|
6391
|
+
* Reads the outstanding transaction queue and submits the transaction to chain.
|
|
6392
|
+
*
|
|
6393
|
+
* If the transaction has fulfilled, it pushes the transaction to the processed
|
|
6394
|
+
* transactions queue and fires a transactionsFulfilled event.
|
|
6395
|
+
*
|
|
6396
|
+
* If the transaction has failed, it pushes the transaction to the processed
|
|
6397
|
+
* transactions queue with the failure reason and fires a transactionsFailed event.
|
|
6398
|
+
*/
|
|
6399
|
+
processTransactions(): Promise<void>;
|
|
6400
|
+
/**
|
|
6401
|
+
* Once transaction has been sent to chain, we check for its execution status.
|
|
6402
|
+
* @param sentTransaction transactions that were sent to chain and are now waiting to be executed
|
|
6403
|
+
* @param sequenceNumber the account's sequence number that was sent with the transaction
|
|
6404
|
+
*/
|
|
6405
|
+
checkTransaction(sentTransaction: PromiseFulfilledResult<PendingTransactionResponse>, sequenceNumber: bigint): Promise<void>;
|
|
6406
|
+
/**
|
|
6407
|
+
* Push transaction to the transactions queue
|
|
6408
|
+
* @param payload Transaction payload
|
|
6409
|
+
*/
|
|
6410
|
+
push(transactionData: InputGenerateTransactionPayloadData, options?: InputGenerateTransactionOptions): Promise<void>;
|
|
6411
|
+
/**
|
|
6412
|
+
* Generates a signed transaction that can be submitted to chain
|
|
6413
|
+
* @param account an Aptos account
|
|
6414
|
+
* @param sequenceNumber a sequence number the transaction will be generated with
|
|
6415
|
+
* @returns
|
|
6416
|
+
*/
|
|
6417
|
+
generateNextTransaction(account: Account$1, sequenceNumber: bigint): Promise<SimpleTransaction | undefined>;
|
|
6418
|
+
/**
|
|
6419
|
+
* Starts transaction submission and transaction processing.
|
|
6420
|
+
*/
|
|
6421
|
+
run(): Promise<void>;
|
|
6422
|
+
/**
|
|
6423
|
+
* Starts the transaction management process.
|
|
6424
|
+
*/
|
|
6425
|
+
start(): void;
|
|
6426
|
+
/**
|
|
6427
|
+
* Stops the the transaction management process.
|
|
6428
|
+
*/
|
|
6429
|
+
stop(): void;
|
|
6430
|
+
}
|
|
6431
|
+
|
|
6432
|
+
declare class TransactionManagement extends EventEmitter<TransactionWorkerEvents> {
|
|
6433
|
+
account: Account$1;
|
|
6434
|
+
transactionWorker: TransactionWorker;
|
|
6435
|
+
readonly config: AptosConfig;
|
|
6436
|
+
constructor(config: AptosConfig);
|
|
6437
|
+
/**
|
|
6438
|
+
* Internal function to start the transaction worker and
|
|
6439
|
+
* listen to worker events
|
|
6440
|
+
*
|
|
6441
|
+
* @param args.sender The sender account to sign and submit the transaction
|
|
6442
|
+
*/
|
|
6443
|
+
private start;
|
|
6444
|
+
/**
|
|
6445
|
+
* Internal function to push transaction data to the transaction worker.
|
|
6446
|
+
*
|
|
6447
|
+
* @param args.data An array of transaction payloads
|
|
6448
|
+
* @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)
|
|
6449
|
+
*
|
|
6450
|
+
* TODO - make this public once worker supports adding transactions to existing queue
|
|
6451
|
+
*/
|
|
6452
|
+
private push;
|
|
6453
|
+
/**
|
|
6454
|
+
* Internal function to start listening to transaction worker events
|
|
6455
|
+
*
|
|
6456
|
+
* TODO - should we ask events to listen to as an input?
|
|
6457
|
+
*/
|
|
6458
|
+
private registerToEvents;
|
|
6459
|
+
/**
|
|
6460
|
+
* Send batch transactions for a single account.
|
|
6461
|
+
*
|
|
6462
|
+
* This function uses a transaction worker that receives payloads to be processed
|
|
6463
|
+
* and submitted to chain.
|
|
6464
|
+
* Note that this process is best for submitting multiple transactions that
|
|
6465
|
+
* dont rely on each other, i.e batch funds, batch token mints, etc.
|
|
6466
|
+
*
|
|
6467
|
+
* If any worker failure, the functions throws an error.
|
|
6468
|
+
*
|
|
6469
|
+
* @param args.sender The sender account to sign and submit the transaction
|
|
6470
|
+
* @param args.data An array of transaction payloads
|
|
6471
|
+
* @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)
|
|
6472
|
+
*
|
|
6473
|
+
* @return void. Throws if any error
|
|
6474
|
+
*/
|
|
6475
|
+
forSingleAccount(args: {
|
|
6476
|
+
sender: Account$1;
|
|
6477
|
+
data: InputGenerateTransactionPayloadData[];
|
|
6478
|
+
options?: Omit<InputGenerateTransactionOptions, "accountSequenceNumber">;
|
|
6479
|
+
}): void;
|
|
6480
|
+
}
|
|
6481
|
+
|
|
6181
6482
|
declare class Transaction {
|
|
6182
6483
|
readonly config: AptosConfig;
|
|
6183
6484
|
readonly build: Build;
|
|
6184
6485
|
readonly simulate: Simulate;
|
|
6185
6486
|
readonly submit: Submit;
|
|
6487
|
+
readonly batch: TransactionManagement;
|
|
6186
6488
|
constructor(config: AptosConfig);
|
|
6187
6489
|
/**
|
|
6188
6490
|
* Queries on-chain transactions. This function will not return pending
|
|
@@ -6339,6 +6641,8 @@ declare class Transaction {
|
|
|
6339
6641
|
transaction: AnyRawTransaction;
|
|
6340
6642
|
}): AccountAuthenticator;
|
|
6341
6643
|
/**
|
|
6644
|
+
* @deprecated Prefer to use `aptos.transaction.batch.forSingleAccount()`
|
|
6645
|
+
*
|
|
6342
6646
|
* Batch transactions for a single account.
|
|
6343
6647
|
*
|
|
6344
6648
|
* This function uses a transaction worker that receives payloads to be processed
|
|
@@ -6401,7 +6705,7 @@ declare class Aptos {
|
|
|
6401
6705
|
readonly transaction: Transaction;
|
|
6402
6706
|
constructor(settings?: AptosConfig);
|
|
6403
6707
|
}
|
|
6404
|
-
interface Aptos extends Account, ANS, Coin, DigitalAsset, Event, Faucet, FungibleAsset, General, Staking, Omit<Transaction, "build" | "simulate" | "submit"> {
|
|
6708
|
+
interface Aptos extends Account, ANS, Coin, DigitalAsset, Event, Faucet, FungibleAsset, General, Staking, Omit<Transaction, "build" | "simulate" | "submit" | "batch"> {
|
|
6405
6709
|
}
|
|
6406
6710
|
|
|
6407
6711
|
/**
|
|
@@ -6552,228 +6856,4 @@ declare function postAptosFullNode<Req extends {}, Res extends {}>(options: Post
|
|
|
6552
6856
|
declare function postAptosIndexer<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
|
|
6553
6857
|
declare function postAptosFaucet<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
|
|
6554
6858
|
|
|
6555
|
-
|
|
6556
|
-
* A wrapper that handles and manages an account sequence number.
|
|
6557
|
-
*
|
|
6558
|
-
* Submit up to `maximumInFlight` transactions per account in parallel with a timeout of `sleepTime`
|
|
6559
|
-
* If local assumes `maximumInFlight` are in flight, determine the actual committed state from the network
|
|
6560
|
-
* If there are less than `maximumInFlight` due to some being committed, adjust the window
|
|
6561
|
-
* If `maximumInFlight` are in flight, wait `sleepTime` seconds before re-evaluating
|
|
6562
|
-
* If ever waiting more than `maxWaitTime` restart the sequence number to the current on-chain state
|
|
6563
|
-
*
|
|
6564
|
-
* Assumptions:
|
|
6565
|
-
* Accounts are expected to be managed by a single AccountSequenceNumber and not used otherwise.
|
|
6566
|
-
* They are initialized to the current on-chain state, so if there are already transactions in
|
|
6567
|
-
* flight, they may take some time to reset.
|
|
6568
|
-
* Accounts are automatically initialized if not explicitly
|
|
6569
|
-
*
|
|
6570
|
-
* Notes:
|
|
6571
|
-
* This is co-routine safe, that is many async tasks can be reading from this concurrently.
|
|
6572
|
-
* The state of an account cannot be used across multiple AccountSequenceNumber services.
|
|
6573
|
-
* The synchronize method will create a barrier that prevents additional nextSequenceNumber
|
|
6574
|
-
* calls until it is complete.
|
|
6575
|
-
* This only manages the distribution of sequence numbers it does not help handle transaction
|
|
6576
|
-
* failures.
|
|
6577
|
-
* If a transaction fails, you should call synchronize and wait for timeouts.
|
|
6578
|
-
*/
|
|
6579
|
-
|
|
6580
|
-
declare class AccountSequenceNumber {
|
|
6581
|
-
readonly aptosConfig: AptosConfig;
|
|
6582
|
-
readonly account: Account$1;
|
|
6583
|
-
lastUncommintedNumber: bigint | null;
|
|
6584
|
-
currentNumber: bigint | null;
|
|
6585
|
-
/**
|
|
6586
|
-
* We want to guarantee that we preserve ordering of workers to requests.
|
|
6587
|
-
*
|
|
6588
|
-
* `lock` is used to try to prevent multiple coroutines from accessing a shared resource at the same time,
|
|
6589
|
-
* which can result in race conditions and data inconsistency.
|
|
6590
|
-
* This code actually doesn't do it though, since we aren't giving out a slot, it is still somewhat a race condition.
|
|
6591
|
-
*
|
|
6592
|
-
* The ideal solution is likely that each thread grabs the next number from a incremental integer.
|
|
6593
|
-
* When they complete, they increment that number and that entity is able to enter the `lock`.
|
|
6594
|
-
* That would guarantee ordering.
|
|
6595
|
-
*/
|
|
6596
|
-
lock: boolean;
|
|
6597
|
-
maxWaitTime: number;
|
|
6598
|
-
maximumInFlight: number;
|
|
6599
|
-
sleepTime: number;
|
|
6600
|
-
constructor(aptosConfig: AptosConfig, account: Account$1, maxWaitTime: number, maximumInFlight: number, sleepTime: number);
|
|
6601
|
-
/**
|
|
6602
|
-
* Returns the next available sequence number for this account
|
|
6603
|
-
*
|
|
6604
|
-
* @returns next available sequence number
|
|
6605
|
-
*/
|
|
6606
|
-
nextSequenceNumber(): Promise<bigint | null>;
|
|
6607
|
-
/**
|
|
6608
|
-
* Initializes this account with the sequence number on chain
|
|
6609
|
-
*/
|
|
6610
|
-
initialize(): Promise<void>;
|
|
6611
|
-
/**
|
|
6612
|
-
* Updates this account sequence number with the one on-chain
|
|
6613
|
-
*
|
|
6614
|
-
* @returns on-chain sequence number for this account
|
|
6615
|
-
*/
|
|
6616
|
-
update(): Promise<bigint>;
|
|
6617
|
-
/**
|
|
6618
|
-
* Synchronizes local sequence number with the seqeunce number on chain for this account.
|
|
6619
|
-
*
|
|
6620
|
-
* Poll the network until all submitted transactions have either been committed or until
|
|
6621
|
-
* the maximum wait time has elapsed
|
|
6622
|
-
*/
|
|
6623
|
-
synchronize(): Promise<void>;
|
|
6624
|
-
}
|
|
6625
|
-
|
|
6626
|
-
/**
|
|
6627
|
-
* The AsyncQueue class is an async-aware data structure that provides a queue-like
|
|
6628
|
-
* behavior for managing asynchronous tasks or operations.
|
|
6629
|
-
* It allows to enqueue items and dequeue them asynchronously.
|
|
6630
|
-
* This is not thread-safe but it is async concurrency safe and
|
|
6631
|
-
* it does not guarantee ordering for those that call into and await on enqueue.
|
|
6632
|
-
*/
|
|
6633
|
-
declare class AsyncQueue<T> {
|
|
6634
|
-
readonly queue: T[];
|
|
6635
|
-
private pendingDequeue;
|
|
6636
|
-
private cancelled;
|
|
6637
|
-
/**
|
|
6638
|
-
* The enqueue method adds an item to the queue. If there are pending dequeued promises,
|
|
6639
|
-
* in the pendingDequeue, it resolves the oldest promise with the enqueued item immediately.
|
|
6640
|
-
* Otherwise, it adds the item to the queue.
|
|
6641
|
-
*
|
|
6642
|
-
* @param item T
|
|
6643
|
-
*/
|
|
6644
|
-
enqueue(item: T): void;
|
|
6645
|
-
/**
|
|
6646
|
-
* The dequeue method returns a promise that resolves to the next item in the queue.
|
|
6647
|
-
* If the queue is not empty, it resolves the promise immediately with the next item.
|
|
6648
|
-
* Otherwise, it creates a new promise. The promise's resolve function is stored
|
|
6649
|
-
* in the pendingDequeue with a unique counter value as the key.
|
|
6650
|
-
* The newly created promise is then returned, and it will be resolved later when an item is enqueued.
|
|
6651
|
-
*
|
|
6652
|
-
* @returns Promise<T>
|
|
6653
|
-
*/
|
|
6654
|
-
dequeue(): Promise<T>;
|
|
6655
|
-
/**
|
|
6656
|
-
* The isEmpty method returns whether the queue is empty or not.
|
|
6657
|
-
*
|
|
6658
|
-
* @returns boolean
|
|
6659
|
-
*/
|
|
6660
|
-
isEmpty(): boolean;
|
|
6661
|
-
/**
|
|
6662
|
-
* The cancel method cancels all pending promises in the queue.
|
|
6663
|
-
* It rejects the promises with a AsyncQueueCancelledError error,
|
|
6664
|
-
* ensuring that any awaiting code can handle the cancellation appropriately.
|
|
6665
|
-
*/
|
|
6666
|
-
cancel(): void;
|
|
6667
|
-
/**
|
|
6668
|
-
* The isCancelled method returns whether the queue is cancelled or not.
|
|
6669
|
-
*
|
|
6670
|
-
* @returns boolean
|
|
6671
|
-
*/
|
|
6672
|
-
isCancelled(): boolean;
|
|
6673
|
-
/**
|
|
6674
|
-
* The pendingDequeueLength method returns the length of the pendingDequeue.
|
|
6675
|
-
*
|
|
6676
|
-
* @returns number
|
|
6677
|
-
*/
|
|
6678
|
-
pendingDequeueLength(): number;
|
|
6679
|
-
}
|
|
6680
|
-
|
|
6681
|
-
/**
|
|
6682
|
-
* TransactionWorker provides a simple framework for receiving payloads to be processed.
|
|
6683
|
-
*
|
|
6684
|
-
* Once one `start()` the process and pushes a new transaction, the worker acquires
|
|
6685
|
-
* the current account's next sequence number (by using the AccountSequenceNumber class),
|
|
6686
|
-
* generates a signed transaction and pushes an async submission process into the `outstandingTransactions` queue.
|
|
6687
|
-
* At the same time, the worker processes transactions by reading the `outstandingTransactions` queue
|
|
6688
|
-
* and submits the next transaction to chain, it
|
|
6689
|
-
* 1) waits for resolution of the submission process or get pre-execution validation error
|
|
6690
|
-
* and 2) waits for the resolution of the execution process or get an execution error.
|
|
6691
|
-
* The worker fires events for any submission and/or execution success and/or failure.
|
|
6692
|
-
*/
|
|
6693
|
-
|
|
6694
|
-
declare class TransactionWorker {
|
|
6695
|
-
readonly aptosConfig: AptosConfig;
|
|
6696
|
-
readonly account: Account$1;
|
|
6697
|
-
readonly accountSequnceNumber: AccountSequenceNumber;
|
|
6698
|
-
readonly taskQueue: AsyncQueue<() => Promise<void>>;
|
|
6699
|
-
started: boolean;
|
|
6700
|
-
/**
|
|
6701
|
-
* transactions payloads waiting to be generated and signed
|
|
6702
|
-
*
|
|
6703
|
-
* TODO support entry function payload from ABI builder
|
|
6704
|
-
*/
|
|
6705
|
-
transactionsQueue: AsyncQueue<[InputGenerateTransactionPayloadData, InputGenerateTransactionOptions | undefined]>;
|
|
6706
|
-
/**
|
|
6707
|
-
* signed transactions waiting to be submitted
|
|
6708
|
-
*/
|
|
6709
|
-
outstandingTransactions: AsyncQueue<[Promise<PendingTransactionResponse>, bigint]>;
|
|
6710
|
-
/**
|
|
6711
|
-
* transactions that have been submitted to chain
|
|
6712
|
-
*/
|
|
6713
|
-
sentTransactions: Array<[string, bigint, any]>;
|
|
6714
|
-
/**
|
|
6715
|
-
* transactions that have been committed to chain
|
|
6716
|
-
*/
|
|
6717
|
-
executedTransactions: Array<[string, bigint, any]>;
|
|
6718
|
-
/**
|
|
6719
|
-
* Provides a simple framework for receiving payloads to be processed.
|
|
6720
|
-
*
|
|
6721
|
-
* @param aptosConfig - a config object
|
|
6722
|
-
* @param sender - a sender as Account
|
|
6723
|
-
* @param maxWaitTime - the max wait time to wait before resyncing the sequence number
|
|
6724
|
-
* to the current on-chain state, default to 30
|
|
6725
|
-
* @param maximumInFlight - submit up to `maximumInFlight` transactions per account.
|
|
6726
|
-
* Mempool limits the number of transactions per account to 100, hence why we default to 100.
|
|
6727
|
-
* @param sleepTime - If `maximumInFlight` are in flight, wait `sleepTime` seconds before re-evaluating, default to 10
|
|
6728
|
-
*/
|
|
6729
|
-
constructor(aptosConfig: AptosConfig, account: Account$1, maxWaitTime?: number, maximumInFlight?: number, sleepTime?: number);
|
|
6730
|
-
/**
|
|
6731
|
-
* Gets the current account sequence number,
|
|
6732
|
-
* generates the transaction with the account sequence number,
|
|
6733
|
-
* adds the transaction to the outstanding transaction queue
|
|
6734
|
-
* to be processed later.
|
|
6735
|
-
*/
|
|
6736
|
-
submitNextTransaction(): Promise<void>;
|
|
6737
|
-
/**
|
|
6738
|
-
* Reads the outstanding transaction queue and submits the transaction to chain.
|
|
6739
|
-
*
|
|
6740
|
-
* If the transaction has fulfilled, it pushes the transaction to the processed
|
|
6741
|
-
* transactions queue and fires a transactionsFulfilled event.
|
|
6742
|
-
*
|
|
6743
|
-
* If the transaction has failed, it pushes the transaction to the processed
|
|
6744
|
-
* transactions queue with the failure reason and fires a transactionsFailed event.
|
|
6745
|
-
*/
|
|
6746
|
-
processTransactions(): Promise<void>;
|
|
6747
|
-
/**
|
|
6748
|
-
* Once transaction has been sent to chain, we check for its execution status.
|
|
6749
|
-
* @param sentTransaction transactions that were sent to chain and are now waiting to be executed
|
|
6750
|
-
* @param sequenceNumber the account's sequence number that was sent with the transaction
|
|
6751
|
-
*/
|
|
6752
|
-
checkTransaction(sentTransaction: PromiseFulfilledResult<PendingTransactionResponse>, sequenceNumber: bigint): Promise<void>;
|
|
6753
|
-
/**
|
|
6754
|
-
* Push transaction to the transactions queue
|
|
6755
|
-
* @param payload Transaction payload
|
|
6756
|
-
*/
|
|
6757
|
-
push(transactionData: InputGenerateTransactionPayloadData, options?: InputGenerateTransactionOptions): Promise<void>;
|
|
6758
|
-
/**
|
|
6759
|
-
* Generates a signed transaction that can be submitted to chain
|
|
6760
|
-
* @param account an Aptos account
|
|
6761
|
-
* @param sequenceNumber a sequence number the transaction will be generated with
|
|
6762
|
-
* @returns
|
|
6763
|
-
*/
|
|
6764
|
-
generateNextTransaction(account: Account$1, sequenceNumber: bigint): Promise<SimpleTransaction | undefined>;
|
|
6765
|
-
/**
|
|
6766
|
-
* Starts transaction submission and transaction processing.
|
|
6767
|
-
*/
|
|
6768
|
-
run(): Promise<void>;
|
|
6769
|
-
/**
|
|
6770
|
-
* Starts the transaction management process.
|
|
6771
|
-
*/
|
|
6772
|
-
start(): void;
|
|
6773
|
-
/**
|
|
6774
|
-
* Stops the the transaction management process.
|
|
6775
|
-
*/
|
|
6776
|
-
stop(): void;
|
|
6777
|
-
}
|
|
6778
|
-
|
|
6779
|
-
export { APTOS_BIP44_REGEX, APTOS_COIN, APTOS_HARDENED_REGEX, Account$1 as Account, AccountAddress, type AccountAddressInput, AccountAuthenticator, AccountAuthenticatorEd25519, AccountAuthenticatorMultiEd25519, AccountAuthenticatorMultiKey, AccountAuthenticatorSingleKey, AccountAuthenticatorVariant, type AccountData, AccountSequenceNumber, type AccountSignature, AddressInvalidReason, type AnyNumber, AnyPublicKey, AnyPublicKeyVariant, type AnyRawTransaction, type AnyRawTransactionInstance, AnySignature, AnySignatureVariant, type AnyTransactionPayloadInstance, Aptos, AptosApiError, AptosApiType, AptosConfig, type AptosRequest, type AptosResponse, type AptosSettings, AuthenticationKey, type AuthenticationKeyScheme, type Block, type BlockMetadataTransactionResponse, Bool, CKDPriv, ChainId, type Client, type ClientConfig, type ClientRequest, type ClientResponse, type CommittedTransactionResponse, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_NETWORK, DEFAULT_TXN_EXP_SEC_FROM_NOW, DEFAULT_TXN_TIMEOUT_SEC, type DecodedTableData, type DeletedTableData, DeriveScheme, type DerivedKeys, type Deserializable, Deserializer, type DirectWriteSet, Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature, EntryFunction, type EntryFunctionABI, type EntryFunctionArgument, type EntryFunctionArgumentTypes, EntryFunctionBytes, type EntryFunctionPayloadResponse, type Event$1 as Event, type EventGuid, FeePayerRawTransaction, FixedBytes, type GasEstimation, type GenerateAccount, type GenerateAccountWithEd25519, type GenerateAccountWithSingleSignerSecp256k1Key, type GenesisPayload, type GenesisTransactionResponse, type GetANSNameResponse, type GetAccountCoinsDataResponse, type GetAccountCollectionsWithOwnedTokenResponse, type GetAccountOwnedObjectsResponse, type GetAccountOwnedTokensFromCollectionResponse, type GetAccountOwnedTokensQueryResponse, type GetAptosRequestOptions, type GetChainTopUserTransactionsResponse, type GetCollectionDataResponse, type GetCurrentFungibleAssetBalancesResponse, type GetCurrentTokenOwnershipResponse, type GetDelegatedStakingActivitiesResponse, type GetEventsResponse, type GetFungibleAssetActivitiesResponse, type GetFungibleAssetMetadataResponse, type GetNumberOfDelegatorsResponse, type GetOwnedTokensResponse, type GetProcessorStatusResponse, type GetRequestOptions, type GetTokenActivityResponse, type GetTokenDataResponse, type GraphqlQuery, HARDENED_OFFSET, Hex, type HexInput, HexInvalidReason, Identifier, type InputEntryFunctionData, type InputEntryFunctionDataWithRemoteABI, type InputGenerateMultiAgentRawTransactionArgs, type InputGenerateMultiAgentRawTransactionData, type InputGenerateRawTransactionArgs, type InputGenerateSingleSignerRawTransactionArgs, type InputGenerateSingleSignerRawTransactionData, type InputGenerateTransactionData, type InputGenerateTransactionOptions, type InputGenerateTransactionPayloadData, type InputGenerateTransactionPayloadDataWithRemoteABI, type InputMultiSigData, type InputMultiSigDataWithRemoteABI, type InputScriptData, type InputSimulateTransactionData, type InputSimulateTransactionOptions, type InputSubmitTransactionData, type InputViewRequestData, KeyType, type LedgerInfo, type LedgerVersionArg, MimeType, ModuleId, MoveAbility, type MoveAddressType, type MoveFunction, type MoveFunctionGenericTypeParam, type MoveFunctionId, MoveFunctionVisibility, type MoveModule, type MoveModuleBytecode, type MoveModuleId, type MoveObjectType, MoveOption, type MoveOptionType, type MoveResource, type MoveScriptBytecode, MoveString, type MoveStruct, type MoveStructField, type MoveStructId, type MoveStructType, type MoveType, type MoveUint128Type, type MoveUint16Type, type MoveUint256Type, type MoveUint32Type, type MoveUint64Type, type MoveUint8Type, type MoveValue, MoveVector, MultiAgentRawTransaction, type MultiAgentTransaction, MultiEd25519PublicKey, MultiEd25519Signature, MultiKey, MultiSig, MultiSigTransactionPayload, type MultisigPayloadResponse, Network, NetworkToChainId, NetworkToFaucetAPI, NetworkToIndexerAPI, NetworkToNetworkName, NetworkToNodeAPI, type OrderBy, type OrderByArg, type OrderByValue, type PaginationArgs, ParsingError, type ParsingResult, type PendingTransactionResponse, type PostAptosRequestOptions, type PostRequestOptions, PrivateKey, ProcessorType, PublicKey, RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT, RawTransaction, RawTransactionWithData, RoleType, RotationProofChallenge, Script, type ScriptFunctionArgument, type ScriptFunctionArgumentTypes, type ScriptPayloadResponse, ScriptTransactionArgumentVariants, type ScriptWriteSet, Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1Signature, Serializable, Serializer, Signature, SignedTransaction, SigningScheme, SigningSchemeInput, type SimpleEntryFunctionArgumentTypes, type SimpleTransaction, type StateCheckpointTransactionResponse, StructTag, type TableItemRequest, type TokenStandard, type TokenStandardArg, type TransactionArgument, TransactionAuthenticator, TransactionAuthenticatorEd25519, TransactionAuthenticatorFeePayer, TransactionAuthenticatorMultiAgent, TransactionAuthenticatorMultiEd25519, TransactionAuthenticatorSingleSender, TransactionAuthenticatorVariant, type TransactionEd25519Signature, type TransactionFeePayerSignature, type TransactionMultiAgentSignature, type TransactionMultiEd25519Signature, TransactionPayload, TransactionPayloadEntryFunction, TransactionPayloadMultiSig, type TransactionPayloadResponse, TransactionPayloadScript, TransactionPayloadVariants, type TransactionResponse, TransactionResponseType, type TransactionSecp256k1Signature, type TransactionSignature, TransactionVariants, TransactionWorker, TypeTag, TypeTagAddress, TypeTagBool, TypeTagGeneric, TypeTagParserError, TypeTagParserErrorType, TypeTagReference, TypeTagSigner, TypeTagStruct, TypeTagU128, TypeTagU16, TypeTagU256, TypeTagU32, TypeTagU64, TypeTagU8, TypeTagVariants, TypeTagVector, U128, U16, U256, U32, U64, U8, type Uint128, type Uint16, type Uint256, type Uint32, type Uint64, type Uint8, type UserTransactionResponse, type ViewRequest, type WaitForTransactionOptions, type WhereArg, type WriteSet, type WriteSetChange, type WriteSetChangeDeleteModule, type WriteSetChangeDeleteResource, type WriteSetChangeDeleteTableItem, type WriteSetChangeWriteModule, type WriteSetChangeWriteResource, type WriteSetChangeWriteTableItem, aptosCoinStructTag, aptosRequest, buildTransaction, checkOrConvertArgument, convertArgument, deriveKey, deriveTransactionType, deserializeFromScriptArgument, ensureBoolean, fetchEntryFunctionAbi, findFirstNonSignerArg, generateMultiSignersSignedTransaction, generateRawTransaction, generateSignedTransaction, generateSignedTransactionForSimulation, generateSigningMessage, generateTransactionPayload, generateTransactionPayloadWithABI, get, getAptosFullNode, getAuthenticatorForSimulation, getFunctionParts, isBcsAddress, isBcsBool, isBcsFixedBytes, isBcsString, isBcsU128, isBcsU16, isBcsU256, isBcsU32, isBcsU64, isBcsU8, isBlockMetadataTransactionResponse, isBool, isEd25519Signature, isEncodedEntryFunctionArgument, isFeePayerSignature, isGenesisTransactionResponse, isLargeNumber, isMultiAgentSignature, isMultiEd25519Signature, isNull, isNumber, isPendingTransactionResponse, isScriptDataInput, isSecp256k1Signature, isStateCheckpointTransactionResponse, isString, isUserTransactionResponse, isValidBIP44Path, isValidHardenedPath, mnemonicToSeed, objectStructTag, optionStructTag, outOfRangeErrorMessage, paginateWithCursor, parseTypeTag, post, postAptosFaucet, postAptosFullNode, postAptosIndexer, request, sign, splitPath, standardizeTypeTags, stringStructTag, throwTypeMismatch, validateNumberInRange };
|
|
6859
|
+
export { APTOS_BIP44_REGEX, APTOS_COIN, APTOS_HARDENED_REGEX, Account$1 as Account, AccountAddress, type AccountAddressInput, AccountAuthenticator, AccountAuthenticatorEd25519, AccountAuthenticatorMultiEd25519, AccountAuthenticatorMultiKey, AccountAuthenticatorSingleKey, AccountAuthenticatorVariant, type AccountData, AccountSequenceNumber, type AccountSignature, AddressInvalidReason, type AnyNumber, AnyPublicKey, AnyPublicKeyVariant, type AnyRawTransaction, type AnyRawTransactionInstance, AnySignature, AnySignatureVariant, type AnyTransactionPayloadInstance, Aptos, AptosApiError, AptosApiType, AptosConfig, type AptosRequest, type AptosResponse, type AptosSettings, AuthenticationKey, type AuthenticationKeyScheme, type Block, type BlockMetadataTransactionResponse, Bool, CKDPriv, ChainId, type Client, type ClientConfig, type ClientRequest, type ClientResponse, type CommittedTransactionResponse, DEFAULT_MAX_GAS_AMOUNT, DEFAULT_NETWORK, DEFAULT_TXN_EXP_SEC_FROM_NOW, DEFAULT_TXN_TIMEOUT_SEC, type DecodedTableData, type DeletedTableData, DeriveScheme, type DerivedKeys, type Deserializable, Deserializer, type DirectWriteSet, Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature, EntryFunction, type EntryFunctionABI, type EntryFunctionArgument, type EntryFunctionArgumentTypes, EntryFunctionBytes, type EntryFunctionPayloadResponse, type Event$1 as Event, type EventGuid, type ExecutionFinishEventData, type FailureEventData, FeePayerRawTransaction, FixedBytes, type GasEstimation, type GenerateAccount, type GenerateAccountWithEd25519, type GenerateAccountWithSingleSignerSecp256k1Key, type GenesisPayload, type GenesisTransactionResponse, type GetANSNameResponse, type GetAccountCoinsDataResponse, type GetAccountCollectionsWithOwnedTokenResponse, type GetAccountOwnedObjectsResponse, type GetAccountOwnedTokensFromCollectionResponse, type GetAccountOwnedTokensQueryResponse, type GetAptosRequestOptions, type GetChainTopUserTransactionsResponse, type GetCollectionDataResponse, type GetCurrentFungibleAssetBalancesResponse, type GetCurrentTokenOwnershipResponse, type GetDelegatedStakingActivitiesResponse, type GetEventsResponse, type GetFungibleAssetActivitiesResponse, type GetFungibleAssetMetadataResponse, type GetNumberOfDelegatorsResponse, type GetOwnedTokensResponse, type GetProcessorStatusResponse, type GetRequestOptions, type GetTokenActivityResponse, type GetTokenDataResponse, type GraphqlQuery, HARDENED_OFFSET, Hex, type HexInput, HexInvalidReason, Identifier, type InputEntryFunctionData, type InputEntryFunctionDataWithRemoteABI, type InputGenerateMultiAgentRawTransactionArgs, type InputGenerateMultiAgentRawTransactionData, type InputGenerateRawTransactionArgs, type InputGenerateSingleSignerRawTransactionArgs, type InputGenerateSingleSignerRawTransactionData, type InputGenerateTransactionData, type InputGenerateTransactionOptions, type InputGenerateTransactionPayloadData, type InputGenerateTransactionPayloadDataWithRemoteABI, type InputMultiSigData, type InputMultiSigDataWithRemoteABI, type InputScriptData, type InputSimulateTransactionData, type InputSimulateTransactionOptions, type InputSubmitTransactionData, type InputViewRequestData, KeyType, type LedgerInfo, type LedgerVersionArg, MimeType, ModuleId, MoveAbility, type MoveAddressType, type MoveFunction, type MoveFunctionGenericTypeParam, type MoveFunctionId, MoveFunctionVisibility, type MoveModule, type MoveModuleBytecode, type MoveModuleId, type MoveObjectType, MoveOption, type MoveOptionType, type MoveResource, type MoveScriptBytecode, MoveString, type MoveStruct, type MoveStructField, type MoveStructId, type MoveStructType, type MoveType, type MoveUint128Type, type MoveUint16Type, type MoveUint256Type, type MoveUint32Type, type MoveUint64Type, type MoveUint8Type, type MoveValue, MoveVector, MultiAgentRawTransaction, type MultiAgentTransaction, MultiEd25519PublicKey, MultiEd25519Signature, MultiKey, MultiSig, MultiSigTransactionPayload, type MultisigPayloadResponse, Network, NetworkToChainId, NetworkToFaucetAPI, NetworkToIndexerAPI, NetworkToNetworkName, NetworkToNodeAPI, type OrderBy, type OrderByArg, type OrderByValue, type PaginationArgs, ParsingError, type ParsingResult, type PendingTransactionResponse, type PostAptosRequestOptions, type PostRequestOptions, PrivateKey, ProcessorType, PublicKey, RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT, RawTransaction, RawTransactionWithData, RoleType, RotationProofChallenge, Script, type ScriptFunctionArgument, type ScriptFunctionArgumentTypes, type ScriptPayloadResponse, ScriptTransactionArgumentVariants, type ScriptWriteSet, Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1Signature, Serializable, Serializer, Signature, SignedTransaction, SigningScheme, SigningSchemeInput, type SimpleEntryFunctionArgumentTypes, type SimpleTransaction, type StateCheckpointTransactionResponse, StructTag, type SuccessEventData, type TableItemRequest, type TokenStandard, type TokenStandardArg, type TransactionArgument, TransactionAuthenticator, TransactionAuthenticatorEd25519, TransactionAuthenticatorFeePayer, TransactionAuthenticatorMultiAgent, TransactionAuthenticatorMultiEd25519, TransactionAuthenticatorSingleSender, TransactionAuthenticatorVariant, type TransactionEd25519Signature, type TransactionFeePayerSignature, type TransactionMultiAgentSignature, type TransactionMultiEd25519Signature, TransactionPayload, TransactionPayloadEntryFunction, TransactionPayloadMultiSig, type TransactionPayloadResponse, TransactionPayloadScript, TransactionPayloadVariants, type TransactionResponse, TransactionResponseType, type TransactionSecp256k1Signature, type TransactionSignature, TransactionVariants, TransactionWorker, type TransactionWorkerEvents, TransactionWorkerEventsEnum, TypeTag, TypeTagAddress, TypeTagBool, TypeTagGeneric, TypeTagParserError, TypeTagParserErrorType, TypeTagReference, TypeTagSigner, TypeTagStruct, TypeTagU128, TypeTagU16, TypeTagU256, TypeTagU32, TypeTagU64, TypeTagU8, TypeTagVariants, TypeTagVector, U128, U16, U256, U32, U64, U8, type Uint128, type Uint16, type Uint256, type Uint32, type Uint64, type Uint8, type UserTransactionResponse, type ViewRequest, type WaitForTransactionOptions, type WhereArg, type WriteSet, type WriteSetChange, type WriteSetChangeDeleteModule, type WriteSetChangeDeleteResource, type WriteSetChangeDeleteTableItem, type WriteSetChangeWriteModule, type WriteSetChangeWriteResource, type WriteSetChangeWriteTableItem, aptosCoinStructTag, aptosRequest, buildTransaction, checkOrConvertArgument, convertArgument, deriveKey, deriveTransactionType, deserializeFromScriptArgument, ensureBoolean, fetchEntryFunctionAbi, findFirstNonSignerArg, generateMultiSignersSignedTransaction, generateRawTransaction, generateSignedTransaction, generateSignedTransactionForSimulation, generateSigningMessage, generateTransactionPayload, generateTransactionPayloadWithABI, get, getAptosFullNode, getAuthenticatorForSimulation, getFunctionParts, isBcsAddress, isBcsBool, isBcsFixedBytes, isBcsString, isBcsU128, isBcsU16, isBcsU256, isBcsU32, isBcsU64, isBcsU8, isBlockMetadataTransactionResponse, isBool, isEd25519Signature, isEncodedEntryFunctionArgument, isFeePayerSignature, isGenesisTransactionResponse, isLargeNumber, isMultiAgentSignature, isMultiEd25519Signature, isNull, isNumber, isPendingTransactionResponse, isScriptDataInput, isSecp256k1Signature, isStateCheckpointTransactionResponse, isString, isUserTransactionResponse, isValidBIP44Path, isValidHardenedPath, mnemonicToSeed, objectStructTag, optionStructTag, outOfRangeErrorMessage, paginateWithCursor, parseTypeTag, post, postAptosFaucet, postAptosFullNode, postAptosIndexer, promiseFulfilledStatus, request, sign, splitPath, standardizeTypeTags, stringStructTag, throwTypeMismatch, validateNumberInRange };
|