@algorandfoundation/algokit-utils 9.2.1-beta.3 → 9.2.2-beta.1
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/account/account.d.ts +28 -23
- package/account/get-account-config-from-environment.d.ts +2 -7
- package/account/get-account.d.ts +12 -14
- package/account/get-dispenser-account.d.ts +5 -9
- package/account/index.d.ts +5 -0
- package/account/mnemonic-account.d.ts +3 -7
- package/amount.d.ts +35 -40
- package/app-client.d.ts +6 -10
- package/app-deploy.d.ts +23 -25
- package/app.d.ts +46 -45
- package/asset.d.ts +12 -16
- package/config.d.ts +2 -7
- package/debugging/debugging.d.ts +1 -5
- package/debugging/index.d.ts +1 -0
- package/dispenser-client.d.ts +2 -7
- package/index.d.ts +18 -27
- package/indexer-lookup.d.ts +11 -18
- package/localnet/get-kmd-wallet-account.d.ts +7 -9
- package/localnet/get-localnet-dispenser-account.d.ts +5 -7
- package/localnet/get-or-create-kmd-wallet-account.d.ts +8 -10
- package/localnet/index.d.ts +4 -0
- package/localnet/is-localnet.d.ts +3 -7
- package/network-client.d.ts +15 -17
- package/package.json +1 -1
- package/testing/_asset.d.ts +3 -0
- package/testing/account.d.ts +9 -11
- package/testing/fixtures/algokit-log-capture-fixture.d.ts +2 -7
- package/testing/fixtures/algorand-fixture.d.ts +4 -9
- package/testing/fixtures/index.d.ts +2 -0
- package/testing/index.d.ts +5 -7
- package/testing/indexer.d.ts +1 -5
- package/testing/test-logger.d.ts +36 -41
- package/testing/transaction-logger.d.ts +27 -30
- package/transaction/index.d.ts +2 -0
- package/transaction/legacy-bridge.d.ts +35 -0
- package/transaction/perform-atomic-transaction-composer-simulate.d.ts +5 -7
- package/transaction/resolve-signed-transactions.d.ts +16 -0
- package/transaction/transaction.d.ts +35 -34
- package/transfer/index.d.ts +2 -0
- package/transfer/transfer-algos.d.ts +5 -9
- package/transfer/transfer.d.ts +8 -11
- package/types/account-manager.d.ts +429 -432
- package/types/account.d.ts +202 -192
- package/types/algo-http-client-with-retry.d.ts +10 -15
- package/types/algorand-client-transaction-creator.d.ts +771 -778
- package/types/algorand-client-transaction-sender.d.ts +1085 -1090
- package/types/algorand-client.d.ts +236 -239
- package/types/amount.d.ts +43 -47
- package/types/app-arc56.d.ts +272 -235
- package/types/app-client.d.ts +1151 -1128
- package/types/app-deployer.d.ts +141 -139
- package/types/app-factory.d.ts +783 -762
- package/types/app-manager.d.ts +310 -304
- package/types/app-spec.d.ts +117 -118
- package/types/app.d.ts +241 -229
- package/types/asset-manager.d.ts +199 -204
- package/types/asset.d.ts +91 -95
- package/types/async-event-emitter.d.ts +13 -18
- package/types/client-manager.d.ts +451 -453
- package/types/composer.d.ts +1257 -1210
- package/types/config.d.ts +48 -53
- package/types/debugging.d.ts +23 -25
- package/types/dispenser-client.d.ts +52 -57
- package/types/expand.d.ts +3 -5
- package/types/indexer.d.ts +66 -70
- package/types/instance-of.d.ts +3 -5
- package/types/kmd-account-manager.d.ts +70 -75
- package/types/lifecycle-events.d.ts +8 -13
- package/types/logging.d.ts +11 -15
- package/types/logic-error.d.ts +29 -33
- package/types/network-client.d.ts +27 -32
- package/types/testing.d.ts +132 -131
- package/types/transaction.d.ts +110 -110
- package/types/transfer.d.ts +66 -70
- package/util.d.ts +48 -0
package/types/transaction.d.ts
CHANGED
|
@@ -1,84 +1,87 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { MultisigAccount, SigningAccount, TransactionSignerAccount } from
|
|
3
|
-
import {
|
|
4
|
-
import { ABIReturn } from
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import algosdk from 'algosdk';
|
|
2
|
+
import { MultisigAccount, SigningAccount, TransactionSignerAccount } from './account';
|
|
3
|
+
import { AlgoAmount } from './amount';
|
|
4
|
+
import { ABIReturn } from './app';
|
|
5
|
+
import { Expand } from './expand';
|
|
6
|
+
import Account = algosdk.Account;
|
|
7
|
+
import AtomicTransactionComposer = algosdk.AtomicTransactionComposer;
|
|
8
|
+
import LogicSigAccount = algosdk.LogicSigAccount;
|
|
9
|
+
import Transaction = algosdk.Transaction;
|
|
10
|
+
import modelsv2 = algosdk.modelsv2;
|
|
11
|
+
export type TransactionNote = Uint8Array | TransactionNoteData | Arc2TransactionNote;
|
|
12
|
+
export type TransactionNoteData = string | null | undefined | number | any[] | Record<string, any>;
|
|
10
13
|
/** ARC-0002 compatible transaction note components https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md */
|
|
11
|
-
type Arc2TransactionNote = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
export type Arc2TransactionNote = {
|
|
15
|
+
dAppName: string;
|
|
16
|
+
format: 'm' | 'b' | 'u';
|
|
17
|
+
data: string;
|
|
15
18
|
} | {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
dAppName: string;
|
|
20
|
+
format: 'j';
|
|
21
|
+
data: TransactionNoteData;
|
|
19
22
|
};
|
|
20
23
|
/** The sending configuration for a transaction */
|
|
21
|
-
interface SendTransactionParams {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
export interface SendTransactionParams {
|
|
25
|
+
/** Whether to skip signing and sending the transaction to the chain (default: transaction signed and sent to chain, unless `atc` specified)
|
|
26
|
+
* and instead just return the raw transaction, e.g. so you can add it to a group of transactions */
|
|
27
|
+
skipSending?: boolean;
|
|
28
|
+
/** Whether to skip waiting for the submitted transaction (only relevant if `skipSending` is `false` or unset) */
|
|
29
|
+
skipWaiting?: boolean;
|
|
30
|
+
/** An optional `AtomicTransactionComposer` to add the transaction to, if specified then `skipSending: undefined` has the same effect as `skipSending: true` */
|
|
31
|
+
atc?: AtomicTransactionComposer;
|
|
32
|
+
/** Whether to suppress log messages from transaction send, default: do not suppress */
|
|
33
|
+
suppressLog?: boolean;
|
|
34
|
+
/** The flat fee you want to pay, useful for covering extra fees in a transaction group or app call */
|
|
35
|
+
fee?: AlgoAmount;
|
|
36
|
+
/** The maximum fee that you are happy to pay (default: unbounded) - if this is set it's possible the transaction could get rejected during network congestion */
|
|
37
|
+
maxFee?: AlgoAmount;
|
|
38
|
+
/** The maximum number of rounds to wait for confirmation, only applies if `skipWaiting` is `undefined` or `false`, default: wait up to 5 rounds */
|
|
39
|
+
maxRoundsToWaitForConfirmation?: number;
|
|
40
|
+
/** Whether to use simulate to automatically populate app call resources in the txn objects. Defaults to true when there are app calls in the group. */
|
|
41
|
+
populateAppCallResources?: boolean;
|
|
39
42
|
}
|
|
40
43
|
/** Result from sending a single transaction. */
|
|
41
|
-
type SendSingleTransactionResult = Expand<SendAtomicTransactionComposerResults & ConfirmedTransactionResult>;
|
|
44
|
+
export type SendSingleTransactionResult = Expand<SendAtomicTransactionComposerResults & ConfirmedTransactionResult>;
|
|
42
45
|
/** The result of sending a transaction */
|
|
43
|
-
interface SendTransactionResult {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
export interface SendTransactionResult {
|
|
47
|
+
/** The transaction */
|
|
48
|
+
transaction: Transaction;
|
|
49
|
+
/** The response if the transaction was sent and waited for */
|
|
50
|
+
confirmation?: modelsv2.PendingTransactionResponse;
|
|
48
51
|
}
|
|
49
52
|
/** The result of preparing and/or sending multiple transactions */
|
|
50
|
-
interface SendTransactionResults {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
export interface SendTransactionResults {
|
|
54
|
+
/** The transactions that have been prepared and/or sent */
|
|
55
|
+
transactions: Transaction[];
|
|
56
|
+
/** The responses if the transactions were sent and waited for,
|
|
57
|
+
* the index of the confirmation will match the index of the underlying transaction
|
|
58
|
+
*/
|
|
59
|
+
confirmations?: modelsv2.PendingTransactionResponse[];
|
|
57
60
|
}
|
|
58
61
|
/** The result of preparing and/or sending multiple transactions using an `AtomicTransactionComposer` */
|
|
59
|
-
interface SendAtomicTransactionComposerResults extends SendTransactionResults {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
export interface SendAtomicTransactionComposerResults extends SendTransactionResults {
|
|
63
|
+
/** base64 encoded representation of the group ID of the atomic group */
|
|
64
|
+
groupId: string;
|
|
65
|
+
/** The transaction IDs that have been prepared and/or sent */
|
|
66
|
+
txIds: string[];
|
|
67
|
+
/** If ABI method(s) were called the processed return values */
|
|
68
|
+
returns?: ABIReturn[];
|
|
69
|
+
/** The responses if the transactions were sent and waited for,
|
|
70
|
+
* the index of the confirmation will match the index of the underlying transaction
|
|
71
|
+
*/
|
|
72
|
+
confirmations: modelsv2.PendingTransactionResponse[];
|
|
70
73
|
}
|
|
71
74
|
/** The result of sending and confirming a transaction */
|
|
72
|
-
interface ConfirmedTransactionResult extends SendTransactionResult {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
export interface ConfirmedTransactionResult extends SendTransactionResult {
|
|
76
|
+
/** The response from sending and waiting for the transaction */
|
|
77
|
+
confirmation: modelsv2.PendingTransactionResponse;
|
|
75
78
|
}
|
|
76
79
|
/** The result of sending and confirming one or more transactions, but where there is a primary transaction of interest */
|
|
77
|
-
interface ConfirmedTransactionResults extends SendTransactionResult, SendTransactionResults {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
export interface ConfirmedTransactionResults extends SendTransactionResult, SendTransactionResults {
|
|
81
|
+
/** The response from sending and waiting for the primary transaction */
|
|
82
|
+
confirmation: modelsv2.PendingTransactionResponse;
|
|
83
|
+
/** The response from sending and waiting for the transactions */
|
|
84
|
+
confirmations: modelsv2.PendingTransactionResponse[];
|
|
82
85
|
}
|
|
83
86
|
/** Core account abstraction when signing/sending transactions
|
|
84
87
|
*
|
|
@@ -90,59 +93,56 @@ interface ConfirmedTransactionResults extends SendTransactionResult, SendTransac
|
|
|
90
93
|
* * `MultisigAccount` - An AlgoKit Utils class that wraps a multisig account and provides mechanisms to get a multisig account
|
|
91
94
|
* * `TransactionSignerAccount` - An AlgoKit Utils class that wraps the in-built `algosdk.TransactionSigner` along with the sender address
|
|
92
95
|
*/
|
|
93
|
-
type SendTransactionFrom = Account | SigningAccount | LogicSigAccount | MultisigAccount | TransactionSignerAccount;
|
|
96
|
+
export type SendTransactionFrom = Account | SigningAccount | LogicSigAccount | MultisigAccount | TransactionSignerAccount;
|
|
94
97
|
/** Defines an unsigned transaction that will appear in a group of transactions along with its signing information */
|
|
95
|
-
interface TransactionToSign {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
export interface TransactionToSign {
|
|
99
|
+
/** The unsigned transaction to sign and send */
|
|
100
|
+
transaction: Transaction;
|
|
101
|
+
/** The account to use to sign the transaction, either an account (with private key loaded) or a logic signature account */
|
|
102
|
+
signer: SendTransactionFrom;
|
|
100
103
|
}
|
|
101
104
|
/** A group of transactions to send together as an atomic group
|
|
102
105
|
* https://dev.algorand.co/concepts/transactions/atomic-txn-groups/
|
|
103
106
|
*/
|
|
104
|
-
interface TransactionGroupToSend {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
107
|
+
export interface TransactionGroupToSend {
|
|
108
|
+
/** Any parameters to control the semantics of the send to the network */
|
|
109
|
+
sendParams?: Omit<SendTransactionParams, 'fee' | 'maxFee' | 'skipSending' | 'atc'>;
|
|
110
|
+
/** The list of transactions to send, which can either be a raw transaction (in which case `signer` is required),
|
|
111
|
+
* the async result of an AlgoKit utils method that returns a `SendTransactionResult` (saves unwrapping the promise, be sure to pass `skipSending: true`, `signer` is also required)
|
|
112
|
+
* or the transaction with its signer (`signer` is ignored)
|
|
113
|
+
**/
|
|
114
|
+
transactions: (TransactionToSign | Transaction | Promise<SendTransactionResult>)[];
|
|
115
|
+
/** Optional signer to pass in, required if at least one transaction provided is just the transaction, ignored otherwise */
|
|
116
|
+
signer?: SendTransactionFrom;
|
|
114
117
|
}
|
|
115
118
|
/** Parameters to configure transaction sending. */
|
|
116
|
-
interface SendParams {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
119
|
+
export interface SendParams {
|
|
120
|
+
/** The number of rounds to wait for confirmation. By default until the latest lastValid has past. */
|
|
121
|
+
maxRoundsToWaitForConfirmation?: number;
|
|
122
|
+
/** Whether to suppress log messages from transaction send, default: do not suppress. */
|
|
123
|
+
suppressLog?: boolean;
|
|
124
|
+
/** Whether to use simulate to automatically populate app call resources in the txn objects. Defaults to `Config.populateAppCallResources`. */
|
|
125
|
+
populateAppCallResources?: boolean;
|
|
126
|
+
/** Whether to use simulate to automatically calculate required app call inner transaction fees and cover them in the parent app call transaction fee */
|
|
127
|
+
coverAppCallInnerTransactionFees?: boolean;
|
|
125
128
|
}
|
|
126
129
|
/** Additional context about the `AtomicTransactionComposer`. */
|
|
127
|
-
interface AdditionalAtomicTransactionComposerContext {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
export interface AdditionalAtomicTransactionComposerContext {
|
|
131
|
+
/** A map of transaction index in the `AtomicTransactionComposer` to the max fee that can be calculated for a transaction in the group */
|
|
132
|
+
maxFees: Map<number, AlgoAmount>;
|
|
133
|
+
suggestedParams: Pick<algosdk.SuggestedParams, 'fee' | 'minFee'>;
|
|
131
134
|
}
|
|
132
135
|
/** An `AtomicTransactionComposer` with transactions to send. */
|
|
133
|
-
interface AtomicTransactionComposerToSend extends SendParams {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
136
|
+
export interface AtomicTransactionComposerToSend extends SendParams {
|
|
137
|
+
/** The `AtomicTransactionComposer` with transactions loaded to send */
|
|
138
|
+
atc: AtomicTransactionComposer;
|
|
139
|
+
/**
|
|
140
|
+
* @deprecated - set the parameters at the top level instead
|
|
141
|
+
* Any parameters to control the semantics of the send to the network */
|
|
142
|
+
sendParams?: Omit<SendTransactionParams, 'fee' | 'maxFee' | 'skipSending' | 'atc'>;
|
|
143
|
+
/**
|
|
144
|
+
* Additional `AtomicTransactionComposer` context used when building the transaction group that is sent.
|
|
145
|
+
* This additional context is used and must be supplied when coverAppCallInnerTransactionFees is set to true.
|
|
146
|
+
**/
|
|
147
|
+
additionalAtcContext?: AdditionalAtomicTransactionComposerContext;
|
|
145
148
|
}
|
|
146
|
-
//#endregion
|
|
147
|
-
export { AdditionalAtomicTransactionComposerContext, Arc2TransactionNote, AtomicTransactionComposerToSend, ConfirmedTransactionResult, ConfirmedTransactionResults, SendAtomicTransactionComposerResults, SendParams, SendSingleTransactionResult, SendTransactionFrom, SendTransactionParams, SendTransactionResult, SendTransactionResults, TransactionGroupToSend, TransactionNote, TransactionNoteData, TransactionToSign };
|
|
148
|
-
//# sourceMappingURL=transaction.d.ts.map
|
package/types/transfer.d.ts
CHANGED
|
@@ -1,80 +1,76 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { TestNetDispenserApiClient } from
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
//#region src/types/transfer.d.ts
|
|
1
|
+
import algosdk from 'algosdk';
|
|
2
|
+
import { AlgoAmount } from './amount';
|
|
3
|
+
import { TestNetDispenserApiClient } from './dispenser-client';
|
|
4
|
+
import { SendTransactionFrom, SendTransactionParams, TransactionNote } from './transaction';
|
|
5
|
+
import SuggestedParams = algosdk.SuggestedParams;
|
|
7
6
|
/** @deprecated Parameters for `transferAlgos` call. */
|
|
8
|
-
interface AlgoTransferParams extends SendTransactionParams {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
export interface AlgoTransferParams extends SendTransactionParams {
|
|
8
|
+
/** The account that will send the Algo */
|
|
9
|
+
from: SendTransactionFrom;
|
|
10
|
+
/** The account / account address that will receive the Algo */
|
|
11
|
+
to: SendTransactionFrom | string;
|
|
12
|
+
/** The amount to send */
|
|
13
|
+
amount: AlgoAmount;
|
|
14
|
+
/** Optional transaction parameters */
|
|
15
|
+
transactionParams?: SuggestedParams;
|
|
16
|
+
/** The (optional) transaction note */
|
|
17
|
+
note?: TransactionNote;
|
|
18
|
+
/** An (optional) [transaction lease](https://dev.algorand.co/concepts/transactions/leases) to apply */
|
|
19
|
+
lease?: string | Uint8Array;
|
|
21
20
|
}
|
|
22
21
|
/** @deprecated Parameters for `rekeyAccount` call. */
|
|
23
|
-
interface AlgoRekeyParams extends SendTransactionParams {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
export interface AlgoRekeyParams extends SendTransactionParams {
|
|
23
|
+
/** The account that will be rekeyed */
|
|
24
|
+
from: SendTransactionFrom;
|
|
25
|
+
/** The account / account address that will have the private key that is authorised to transact on behalf of the from account from now on */
|
|
26
|
+
rekeyTo: SendTransactionFrom | string;
|
|
27
|
+
/** Optional transaction parameters */
|
|
28
|
+
transactionParams?: SuggestedParams;
|
|
29
|
+
/** The (optional) transaction note */
|
|
30
|
+
note?: TransactionNote;
|
|
31
|
+
/** An (optional) [transaction lease](https://dev.algorand.co/concepts/transactions/leases) to apply */
|
|
32
|
+
lease?: string | Uint8Array;
|
|
34
33
|
}
|
|
35
34
|
/** @deprecated Parameters for `ensureFunded` call. */
|
|
36
|
-
interface EnsureFundedParams extends SendTransactionParams {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
export interface EnsureFundedParams extends SendTransactionParams {
|
|
36
|
+
/** The account to fund */
|
|
37
|
+
accountToFund: SendTransactionFrom | string;
|
|
38
|
+
/** The account to use as a funding source, will default to using the dispenser account returned by `algokit.getDispenserAccount` */
|
|
39
|
+
fundingSource?: SendTransactionFrom | TestNetDispenserApiClient;
|
|
40
|
+
/** The minimum balance of Algo that the account should have available to spend (i.e. on top of minimum balance requirement) */
|
|
41
|
+
minSpendingBalance: AlgoAmount;
|
|
42
|
+
/** When issuing a funding amount, the minimum amount to transfer (avoids many small transfers if this gets called often on an active account) */
|
|
43
|
+
minFundingIncrement?: AlgoAmount;
|
|
44
|
+
/** Optional transaction parameters */
|
|
45
|
+
transactionParams?: SuggestedParams;
|
|
46
|
+
/** The (optional) transaction note, default: "Funding account to meet minimum requirement" */
|
|
47
|
+
note?: TransactionNote;
|
|
48
|
+
/** An (optional) [transaction lease](https://dev.algorand.co/concepts/transactions/leases) to apply */
|
|
49
|
+
lease?: string | Uint8Array;
|
|
51
50
|
}
|
|
52
51
|
/** @deprecated Parameters for `transferAsset` call. */
|
|
53
|
-
interface TransferAssetParams extends SendTransactionParams {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
52
|
+
export interface TransferAssetParams extends SendTransactionParams {
|
|
53
|
+
/** The account that will send the asset */
|
|
54
|
+
from: SendTransactionFrom;
|
|
55
|
+
/** The account / account address that will receive the asset */
|
|
56
|
+
to: SendTransactionFrom | string;
|
|
57
|
+
/** The asset id that will be transfered */
|
|
58
|
+
assetId: number;
|
|
59
|
+
/** The amount to send as the smallest divisible unit value */
|
|
60
|
+
amount: number | bigint;
|
|
61
|
+
/** Optional transaction parameters */
|
|
62
|
+
transactionParams?: SuggestedParams;
|
|
63
|
+
/** An address of a target account from which to perform a clawback operation. Please note, in such cases senderAccount must be equal to clawback field on ASA metadata. */
|
|
64
|
+
clawbackFrom?: SendTransactionFrom | string;
|
|
65
|
+
/** The (optional) transaction note */
|
|
66
|
+
note?: TransactionNote;
|
|
67
|
+
/** An (optional) [transaction lease](https://dev.algorand.co/concepts/transactions/leases) to apply */
|
|
68
|
+
lease?: string | Uint8Array;
|
|
70
69
|
}
|
|
71
70
|
/** @deprecated */
|
|
72
|
-
interface EnsureFundedReturnType {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
export interface EnsureFundedReturnType {
|
|
72
|
+
/** The transaction */
|
|
73
|
+
transactionId: string;
|
|
74
|
+
/** The response if the transaction was sent and waited for */
|
|
75
|
+
amount: number;
|
|
77
76
|
}
|
|
78
|
-
//#endregion
|
|
79
|
-
export { AlgoRekeyParams, AlgoTransferParams, EnsureFundedParams, EnsureFundedReturnType, TransferAssetParams };
|
|
80
|
-
//# sourceMappingURL=transfer.d.ts.map
|
package/util.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ABIReturnType, ABIType, ABIValue } from 'algosdk';
|
|
2
|
+
/**
|
|
3
|
+
* Converts a value which might be a number or a bigint into a number to be used with apis that don't support bigint.
|
|
4
|
+
*
|
|
5
|
+
* Throws an UnsafeConversionError if the conversion would result in an unsafe integer for the Number type
|
|
6
|
+
* @param value
|
|
7
|
+
*/
|
|
8
|
+
export declare const toNumber: (value: number | bigint) => number;
|
|
9
|
+
export declare class UnsafeConversionError extends Error {
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Calculates the amount of funds to add to a wallet to bring it up to the minimum spending balance.
|
|
13
|
+
* @param minSpendingBalance The minimum spending balance for the wallet
|
|
14
|
+
* @param currentSpendingBalance The current spending balance for the wallet
|
|
15
|
+
* @param minFundingIncrement The minimum amount of funds that can be added to the wallet
|
|
16
|
+
* @returns The amount of funds to add to the wallet or null if the wallet is already above the minimum spending balance
|
|
17
|
+
*/
|
|
18
|
+
export declare const calculateFundAmount: (minSpendingBalance: bigint, currentSpendingBalance: bigint, minFundingIncrement: bigint) => bigint | null;
|
|
19
|
+
/**
|
|
20
|
+
* Checks if the current environment is Node.js
|
|
21
|
+
*
|
|
22
|
+
* @returns A boolean indicating whether the current environment is Node.js
|
|
23
|
+
*/
|
|
24
|
+
export declare const isNode: () => boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the given array split into chunks of `batchSize` batches.
|
|
27
|
+
* @param array The array to chunk
|
|
28
|
+
* @param batchSize The size of batches to split the array into
|
|
29
|
+
* @returns A generator that yields the array split into chunks of `batchSize` batches
|
|
30
|
+
*/
|
|
31
|
+
export declare function chunkArray<T>(array: T[], batchSize: number): Generator<T[], void>;
|
|
32
|
+
/**
|
|
33
|
+
* Memoize calls to the given function in an in-memory map.
|
|
34
|
+
* @param fn The function to memoize
|
|
35
|
+
* @returns The memoized function
|
|
36
|
+
*/
|
|
37
|
+
export declare const memoize: <T = unknown, R = unknown>(fn: (val: T) => R) => (val: T) => R;
|
|
38
|
+
export declare const binaryStartsWith: (base: Uint8Array, startsWith: Uint8Array) => boolean;
|
|
39
|
+
export declare const defaultJsonValueReplacer: (key: string, value: unknown) => unknown;
|
|
40
|
+
export declare const asJson: (value: unknown, replacer?: (key: string, value: unknown) => unknown, space?: string | number) => string;
|
|
41
|
+
/** Calculate minimum number of extra program pages required for provided approval and clear state programs */
|
|
42
|
+
export declare const calculateExtraProgramPages: (approvalProgram: Uint8Array, clearStateProgram?: Uint8Array) => number;
|
|
43
|
+
/** Take a decoded ABI value and convert all byte arrays (including nested ones) from number[] to Uint8Arrays */
|
|
44
|
+
export declare function convertAbiByteArrays(value: ABIValue, type: ABIReturnType): ABIValue;
|
|
45
|
+
/**
|
|
46
|
+
* Convert bigint values to numbers for uint types with bit size < 53
|
|
47
|
+
*/
|
|
48
|
+
export declare const convertABIDecodedBigIntToNumber: (value: ABIValue, type: ABIType) => ABIValue;
|