arc200-client 1.0.0 → 1.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 +14 -17
- package/dist/index.d.mts +1141 -423
- package/dist/index.d.ts +1141 -423
- package/dist/index.js +1145 -481
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1147 -468
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -13
package/dist/index.d.mts
CHANGED
|
@@ -1,66 +1,58 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
1
|
+
import * as _algorandfoundation_algokit_utils_types_composer from '@algorandfoundation/algokit-utils/types/composer';
|
|
2
|
+
import { AppCallMethodCall, TransactionComposer, SkipSignaturesSimulateOptions, RawSimulateOptions } from '@algorandfoundation/algokit-utils/types/composer';
|
|
3
|
+
import * as _algorandfoundation_algokit_utils_types_app_manager from '@algorandfoundation/algokit-utils/types/app-manager';
|
|
4
|
+
import * as _algorandfoundation_algokit_utils_types_account from '@algorandfoundation/algokit-utils/types/account';
|
|
5
|
+
import * as _algorandfoundation_algokit_utils_types_amount from '@algorandfoundation/algokit-utils/types/amount';
|
|
3
6
|
import * as _algorandfoundation_algokit_utils_types_transaction from '@algorandfoundation/algokit-utils/types/transaction';
|
|
4
|
-
import {
|
|
7
|
+
import { SendParams, SendAtomicTransactionComposerResults } from '@algorandfoundation/algokit-utils/types/transaction';
|
|
5
8
|
import * as _algorandfoundation_algokit_utils_types_app from '@algorandfoundation/algokit-utils/types/app';
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
9
|
+
import { ABIReturn } from '@algorandfoundation/algokit-utils/types/app';
|
|
10
|
+
import * as _algorandfoundation_algokit_utils_types_app_arc56 from '@algorandfoundation/algokit-utils/types/app-arc56';
|
|
11
|
+
import { Arc56Contract } from '@algorandfoundation/algokit-utils/types/app-arc56';
|
|
12
|
+
import * as algosdk from 'algosdk';
|
|
13
|
+
import { Address, OnApplicationComplete, Transaction, TransactionSigner, modelsv2, ProgramSourceMap } from 'algosdk';
|
|
14
|
+
import { AlgorandClient } from '@algorandfoundation/algokit-utils/types/algorand-client';
|
|
15
|
+
import { AppClient, AppClientParams, ResolveAppClientByCreatorAndName, ResolveAppClientByNetwork, AppClientBareCallParams, AppClientMethodCallParams, CloneAppClientParams, AppClientCompilationParams } from '@algorandfoundation/algokit-utils/types/app-client';
|
|
16
|
+
import { AppFactory, AppFactoryParams, AppFactoryAppClientParams, AppFactoryResolveAppClientByCreatorAndNameParams, AppFactoryDeployParams, CreateSchema } from '@algorandfoundation/algokit-utils/types/app-factory';
|
|
17
|
+
import { AlgorandClient as AlgorandClient$1 } from '@algorandfoundation/algokit-utils';
|
|
8
18
|
|
|
9
19
|
/**
|
|
10
|
-
*
|
|
20
|
+
* Expands types for IntelliSense so they are more human readable
|
|
21
|
+
* See https://stackoverflow.com/a/69288824
|
|
11
22
|
*/
|
|
12
|
-
type
|
|
13
|
-
|
|
23
|
+
type Expand<T> = T extends (...args: infer A) => infer R ? (...args: Expand<A>) => Expand<R> : T extends infer O ? {
|
|
24
|
+
[K in keyof O]: O[K];
|
|
25
|
+
} : never;
|
|
26
|
+
type ApprovalStruct = {
|
|
27
|
+
approvalAmount: bigint;
|
|
28
|
+
owner: string;
|
|
29
|
+
spender: string;
|
|
14
30
|
};
|
|
15
31
|
/**
|
|
16
|
-
*
|
|
32
|
+
* The argument types for the Arc200 contract
|
|
17
33
|
*/
|
|
18
|
-
type
|
|
34
|
+
type Arc200Args = {
|
|
19
35
|
/**
|
|
20
|
-
*
|
|
36
|
+
* The object representation of the arguments for each method
|
|
21
37
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*/
|
|
35
|
-
returns: string;
|
|
36
|
-
}> & Record<'arc200_decimals()uint8' | 'arc200_decimals', {
|
|
37
|
-
argsObj: {};
|
|
38
|
-
argsTuple: [];
|
|
39
|
-
/**
|
|
40
|
-
* The decimals of the token
|
|
41
|
-
*/
|
|
42
|
-
returns: number;
|
|
43
|
-
}> & Record<'arc200_totalSupply()uint256' | 'arc200_totalSupply', {
|
|
44
|
-
argsObj: {};
|
|
45
|
-
argsTuple: [];
|
|
46
|
-
/**
|
|
47
|
-
* The total supply of the token
|
|
48
|
-
*/
|
|
49
|
-
returns: bigint;
|
|
50
|
-
}> & Record<'arc200_balanceOf(address)uint256' | 'arc200_balanceOf', {
|
|
51
|
-
argsObj: {
|
|
38
|
+
obj: {
|
|
39
|
+
'bootstrap(byte[],byte[],uint8,uint256)bool': {
|
|
40
|
+
name: Uint8Array;
|
|
41
|
+
symbol: Uint8Array;
|
|
42
|
+
decimals: bigint | number;
|
|
43
|
+
totalSupply: bigint | number;
|
|
44
|
+
};
|
|
45
|
+
'arc200_name()byte[32]': Record<string, never>;
|
|
46
|
+
'arc200_symbol()byte[8]': Record<string, never>;
|
|
47
|
+
'arc200_decimals()uint8': Record<string, never>;
|
|
48
|
+
'arc200_totalSupply()uint256': Record<string, never>;
|
|
49
|
+
'arc200_balanceOf(address)uint256': {
|
|
52
50
|
/**
|
|
53
51
|
* The address of the owner of the token
|
|
54
52
|
*/
|
|
55
53
|
owner: string;
|
|
56
54
|
};
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* The current balance of the holder of the token
|
|
60
|
-
*/
|
|
61
|
-
returns: bigint;
|
|
62
|
-
}> & Record<'arc200_transfer(address,uint256)bool' | 'arc200_transfer', {
|
|
63
|
-
argsObj: {
|
|
55
|
+
'arc200_transfer(address,uint256)bool': {
|
|
64
56
|
/**
|
|
65
57
|
* The destination of the transfer
|
|
66
58
|
*/
|
|
@@ -70,13 +62,7 @@ type Arc200 = {
|
|
|
70
62
|
*/
|
|
71
63
|
value: bigint | number;
|
|
72
64
|
};
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Success
|
|
76
|
-
*/
|
|
77
|
-
returns: boolean;
|
|
78
|
-
}> & Record<'arc200_transferFrom(address,address,uint256)bool' | 'arc200_transferFrom', {
|
|
79
|
-
argsObj: {
|
|
65
|
+
'arc200_transferFrom(address,address,uint256)bool': {
|
|
80
66
|
/**
|
|
81
67
|
* The source of the transfer
|
|
82
68
|
*/
|
|
@@ -90,13 +76,7 @@ type Arc200 = {
|
|
|
90
76
|
*/
|
|
91
77
|
value: bigint | number;
|
|
92
78
|
};
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Success
|
|
96
|
-
*/
|
|
97
|
-
returns: boolean;
|
|
98
|
-
}> & Record<'arc200_approve(address,uint256)bool' | 'arc200_approve', {
|
|
99
|
-
argsObj: {
|
|
79
|
+
'arc200_approve(address,uint256)bool': {
|
|
100
80
|
/**
|
|
101
81
|
* Who is allowed to take tokens on owner's behalf
|
|
102
82
|
*/
|
|
@@ -106,13 +86,7 @@ type Arc200 = {
|
|
|
106
86
|
*/
|
|
107
87
|
value: bigint | number;
|
|
108
88
|
};
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Success
|
|
112
|
-
*/
|
|
113
|
-
returns: boolean;
|
|
114
|
-
}> & Record<'arc200_allowance(address,address)uint256' | 'arc200_allowance', {
|
|
115
|
-
argsObj: {
|
|
89
|
+
'arc200_allowance(address,address)uint256': {
|
|
116
90
|
/**
|
|
117
91
|
* Owner's account
|
|
118
92
|
*/
|
|
@@ -122,435 +96,1176 @@ type Arc200 = {
|
|
|
122
96
|
*/
|
|
123
97
|
spender: string;
|
|
124
98
|
};
|
|
125
|
-
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* The tuple representation of the arguments for each method
|
|
102
|
+
*/
|
|
103
|
+
tuple: {
|
|
104
|
+
'bootstrap(byte[],byte[],uint8,uint256)bool': [
|
|
105
|
+
name: Uint8Array,
|
|
106
|
+
symbol: Uint8Array,
|
|
107
|
+
decimals: bigint | number,
|
|
108
|
+
totalSupply: bigint | number
|
|
109
|
+
];
|
|
110
|
+
'arc200_name()byte[32]': [];
|
|
111
|
+
'arc200_symbol()byte[8]': [];
|
|
112
|
+
'arc200_decimals()uint8': [];
|
|
113
|
+
'arc200_totalSupply()uint256': [];
|
|
114
|
+
'arc200_balanceOf(address)uint256': [owner: string];
|
|
115
|
+
'arc200_transfer(address,uint256)bool': [to: string, value: bigint | number];
|
|
116
|
+
'arc200_transferFrom(address,address,uint256)bool': [from: string, to: string, value: bigint | number];
|
|
117
|
+
'arc200_approve(address,uint256)bool': [spender: string, value: bigint | number];
|
|
118
|
+
'arc200_allowance(address,address)uint256': [owner: string, spender: string];
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* The return type for each method
|
|
123
|
+
*/
|
|
124
|
+
type Arc200Returns = {
|
|
125
|
+
'bootstrap(byte[],byte[],uint8,uint256)bool': boolean;
|
|
126
|
+
'arc200_name()byte[32]': Uint8Array;
|
|
127
|
+
'arc200_symbol()byte[8]': Uint8Array;
|
|
128
|
+
'arc200_decimals()uint8': number;
|
|
129
|
+
'arc200_totalSupply()uint256': bigint;
|
|
130
|
+
'arc200_balanceOf(address)uint256': bigint;
|
|
131
|
+
'arc200_transfer(address,uint256)bool': boolean;
|
|
132
|
+
'arc200_transferFrom(address,address,uint256)bool': boolean;
|
|
133
|
+
'arc200_approve(address,uint256)bool': boolean;
|
|
134
|
+
'arc200_allowance(address,address)uint256': bigint;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Defines the types of available calls and state of the Arc200 smart contract.
|
|
138
|
+
*/
|
|
139
|
+
type Arc200Types = {
|
|
140
|
+
/**
|
|
141
|
+
* Maps method signatures / names to their argument and return types.
|
|
142
|
+
*/
|
|
143
|
+
methods: Record<'bootstrap(byte[],byte[],uint8,uint256)bool' | 'bootstrap', {
|
|
144
|
+
argsObj: Arc200Args['obj']['bootstrap(byte[],byte[],uint8,uint256)bool'];
|
|
145
|
+
argsTuple: Arc200Args['tuple']['bootstrap(byte[],byte[],uint8,uint256)bool'];
|
|
146
|
+
returns: Arc200Returns['bootstrap(byte[],byte[],uint8,uint256)bool'];
|
|
147
|
+
}> & Record<'arc200_name()byte[32]' | 'arc200_name', {
|
|
148
|
+
argsObj: Arc200Args['obj']['arc200_name()byte[32]'];
|
|
149
|
+
argsTuple: Arc200Args['tuple']['arc200_name()byte[32]'];
|
|
150
|
+
/**
|
|
151
|
+
* The name of the token
|
|
152
|
+
*/
|
|
153
|
+
returns: Arc200Returns['arc200_name()byte[32]'];
|
|
154
|
+
}> & Record<'arc200_symbol()byte[8]' | 'arc200_symbol', {
|
|
155
|
+
argsObj: Arc200Args['obj']['arc200_symbol()byte[8]'];
|
|
156
|
+
argsTuple: Arc200Args['tuple']['arc200_symbol()byte[8]'];
|
|
157
|
+
/**
|
|
158
|
+
* The symbol of the token
|
|
159
|
+
*/
|
|
160
|
+
returns: Arc200Returns['arc200_symbol()byte[8]'];
|
|
161
|
+
}> & Record<'arc200_decimals()uint8' | 'arc200_decimals', {
|
|
162
|
+
argsObj: Arc200Args['obj']['arc200_decimals()uint8'];
|
|
163
|
+
argsTuple: Arc200Args['tuple']['arc200_decimals()uint8'];
|
|
164
|
+
/**
|
|
165
|
+
* The decimals of the token
|
|
166
|
+
*/
|
|
167
|
+
returns: Arc200Returns['arc200_decimals()uint8'];
|
|
168
|
+
}> & Record<'arc200_totalSupply()uint256' | 'arc200_totalSupply', {
|
|
169
|
+
argsObj: Arc200Args['obj']['arc200_totalSupply()uint256'];
|
|
170
|
+
argsTuple: Arc200Args['tuple']['arc200_totalSupply()uint256'];
|
|
171
|
+
/**
|
|
172
|
+
* The total supply of the token
|
|
173
|
+
*/
|
|
174
|
+
returns: Arc200Returns['arc200_totalSupply()uint256'];
|
|
175
|
+
}> & Record<'arc200_balanceOf(address)uint256' | 'arc200_balanceOf', {
|
|
176
|
+
argsObj: Arc200Args['obj']['arc200_balanceOf(address)uint256'];
|
|
177
|
+
argsTuple: Arc200Args['tuple']['arc200_balanceOf(address)uint256'];
|
|
178
|
+
/**
|
|
179
|
+
* The current balance of the holder of the token
|
|
180
|
+
*/
|
|
181
|
+
returns: Arc200Returns['arc200_balanceOf(address)uint256'];
|
|
182
|
+
}> & Record<'arc200_transfer(address,uint256)bool' | 'arc200_transfer', {
|
|
183
|
+
argsObj: Arc200Args['obj']['arc200_transfer(address,uint256)bool'];
|
|
184
|
+
argsTuple: Arc200Args['tuple']['arc200_transfer(address,uint256)bool'];
|
|
185
|
+
/**
|
|
186
|
+
* Success
|
|
187
|
+
*/
|
|
188
|
+
returns: Arc200Returns['arc200_transfer(address,uint256)bool'];
|
|
189
|
+
}> & Record<'arc200_transferFrom(address,address,uint256)bool' | 'arc200_transferFrom', {
|
|
190
|
+
argsObj: Arc200Args['obj']['arc200_transferFrom(address,address,uint256)bool'];
|
|
191
|
+
argsTuple: Arc200Args['tuple']['arc200_transferFrom(address,address,uint256)bool'];
|
|
192
|
+
/**
|
|
193
|
+
* Success
|
|
194
|
+
*/
|
|
195
|
+
returns: Arc200Returns['arc200_transferFrom(address,address,uint256)bool'];
|
|
196
|
+
}> & Record<'arc200_approve(address,uint256)bool' | 'arc200_approve', {
|
|
197
|
+
argsObj: Arc200Args['obj']['arc200_approve(address,uint256)bool'];
|
|
198
|
+
argsTuple: Arc200Args['tuple']['arc200_approve(address,uint256)bool'];
|
|
199
|
+
/**
|
|
200
|
+
* Success
|
|
201
|
+
*/
|
|
202
|
+
returns: Arc200Returns['arc200_approve(address,uint256)bool'];
|
|
203
|
+
}> & Record<'arc200_allowance(address,address)uint256' | 'arc200_allowance', {
|
|
204
|
+
argsObj: Arc200Args['obj']['arc200_allowance(address,address)uint256'];
|
|
205
|
+
argsTuple: Arc200Args['tuple']['arc200_allowance(address,address)uint256'];
|
|
126
206
|
/**
|
|
127
207
|
* The remaining allowance
|
|
128
208
|
*/
|
|
129
|
-
returns:
|
|
130
|
-
}> & Record<'createApplication()void' | 'createApplication', {
|
|
131
|
-
argsObj: {};
|
|
132
|
-
argsTuple: [];
|
|
133
|
-
returns: void;
|
|
209
|
+
returns: Arc200Returns['arc200_allowance(address,address)uint256'];
|
|
134
210
|
}>;
|
|
211
|
+
/**
|
|
212
|
+
* Defines the shape of the state of the application.
|
|
213
|
+
*/
|
|
214
|
+
state: {
|
|
215
|
+
global: {
|
|
216
|
+
keys: {
|
|
217
|
+
/**
|
|
218
|
+
* Name of the asset. Max 32 bytes
|
|
219
|
+
*/
|
|
220
|
+
name: Uint8Array;
|
|
221
|
+
/**
|
|
222
|
+
* Symbol of the asset. Max 8 bytes
|
|
223
|
+
*/
|
|
224
|
+
symbol: Uint8Array;
|
|
225
|
+
/**
|
|
226
|
+
* Decimals of the asset. Recommended is 6 decimal places.
|
|
227
|
+
*/
|
|
228
|
+
decimals: number;
|
|
229
|
+
/**
|
|
230
|
+
* Minted supply
|
|
231
|
+
*/
|
|
232
|
+
totalSupply: bigint;
|
|
233
|
+
};
|
|
234
|
+
maps: {};
|
|
235
|
+
};
|
|
236
|
+
box: {
|
|
237
|
+
keys: {};
|
|
238
|
+
maps: {
|
|
239
|
+
balances: Map<string, bigint>;
|
|
240
|
+
approvals: Map<Uint8Array, ApprovalStruct>;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
};
|
|
135
244
|
};
|
|
136
245
|
/**
|
|
137
|
-
* Defines the possible abi call signatures
|
|
246
|
+
* Defines the possible abi call signatures.
|
|
138
247
|
*/
|
|
139
|
-
type
|
|
248
|
+
type Arc200Signatures = keyof Arc200Types['methods'];
|
|
140
249
|
/**
|
|
141
|
-
* Defines
|
|
250
|
+
* Defines the possible abi call signatures for methods that return a non-void value.
|
|
142
251
|
*/
|
|
143
|
-
type
|
|
144
|
-
method: TSignature;
|
|
145
|
-
methodArgs: TSignature extends undefined ? undefined : Array<ABIAppCallArg | undefined>;
|
|
146
|
-
} & AppClientCallCoreParams & CoreAppCallArgs;
|
|
252
|
+
type Arc200NonVoidMethodSignatures = keyof Arc200Types['methods'] extends infer T ? T extends keyof Arc200Types['methods'] ? MethodReturn<T> extends void ? never : T : never : never;
|
|
147
253
|
/**
|
|
148
|
-
* Defines
|
|
254
|
+
* Defines an object containing all relevant parameters for a single call to the contract.
|
|
149
255
|
*/
|
|
150
|
-
type
|
|
256
|
+
type CallParams<TArgs> = Expand<Omit<AppClientMethodCallParams, 'method' | 'args' | 'onComplete'> & {
|
|
257
|
+
/** The args for the ABI method call, either as an ordered array or an object */
|
|
258
|
+
args: Expand<TArgs>;
|
|
259
|
+
}>;
|
|
151
260
|
/**
|
|
152
|
-
* Maps a method signature from the Arc200 smart contract to the method's
|
|
261
|
+
* Maps a method signature from the Arc200 smart contract to the method's return type
|
|
153
262
|
*/
|
|
154
|
-
type
|
|
263
|
+
type MethodReturn<TSignature extends Arc200Signatures> = Arc200Types['methods'][TSignature]['returns'];
|
|
155
264
|
/**
|
|
156
|
-
*
|
|
265
|
+
* Defines the shape of the keyed global state of the application.
|
|
157
266
|
*/
|
|
158
|
-
type
|
|
267
|
+
type GlobalKeysState = Arc200Types['state']['global']['keys'];
|
|
159
268
|
/**
|
|
160
|
-
*
|
|
269
|
+
* Defines the shape of the keyed box state of the application.
|
|
161
270
|
*/
|
|
162
|
-
type
|
|
271
|
+
type BoxKeysState = Arc200Types['state']['box']['keys'];
|
|
163
272
|
/**
|
|
164
|
-
* Defines supported create
|
|
273
|
+
* Defines supported create method params for this smart contract
|
|
165
274
|
*/
|
|
166
|
-
type Arc200CreateCallParams =
|
|
275
|
+
type Arc200CreateCallParams = Expand<AppClientBareCallParams & {
|
|
276
|
+
method?: never;
|
|
277
|
+
} & {
|
|
278
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
279
|
+
} & CreateSchema>;
|
|
167
280
|
/**
|
|
168
281
|
* Defines arguments required for the deploy method.
|
|
169
282
|
*/
|
|
170
|
-
type
|
|
171
|
-
deployTimeParams?: TealTemplateParams;
|
|
283
|
+
type Arc200DeployParams = Expand<Omit<AppFactoryDeployParams, 'createParams' | 'updateParams' | 'deleteParams'> & {
|
|
172
284
|
/**
|
|
173
|
-
*
|
|
285
|
+
* Create transaction parameters to use if a create needs to be issued as part of deployment; use `method` to define ABI call (if available) or leave out for a bare call (if available)
|
|
174
286
|
*/
|
|
175
|
-
|
|
176
|
-
}
|
|
287
|
+
createParams?: Arc200CreateCallParams;
|
|
288
|
+
}>;
|
|
177
289
|
/**
|
|
178
|
-
*
|
|
290
|
+
* A factory to create and deploy one or more instance of the Arc200 smart contract and to create one or more app clients to interact with those (or other) app instances
|
|
179
291
|
*/
|
|
180
|
-
declare
|
|
292
|
+
declare class Arc200Factory {
|
|
181
293
|
/**
|
|
182
|
-
*
|
|
294
|
+
* The underlying `AppFactory` for when you want to have more flexibility
|
|
183
295
|
*/
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Constructs a create call for the Arc200 smart contract using the createApplication()void ABI method
|
|
187
|
-
*
|
|
188
|
-
* @param args Any args for the contract call
|
|
189
|
-
* @param params Any additional parameters for the call
|
|
190
|
-
* @returns A TypedCallParams object for the call
|
|
191
|
-
*/
|
|
192
|
-
createApplication(args: MethodArgs<'createApplication()void'>, params?: AppClientCallCoreParams & CoreAppCallArgs & AppClientCompilationParams & (OnCompleteNoOp)): {
|
|
193
|
-
sender?: SendTransactionFrom | undefined;
|
|
194
|
-
note?: _algorandfoundation_algokit_utils_types_transaction.TransactionNote;
|
|
195
|
-
sendParams?: _algorandfoundation_algokit_utils_types_transaction.SendTransactionParams | undefined;
|
|
196
|
-
lease?: string | Uint8Array | undefined;
|
|
197
|
-
boxes?: (algosdk.BoxReference | _algorandfoundation_algokit_utils_types_app.BoxReference | _algorandfoundation_algokit_utils_types_app.BoxIdentifier)[] | undefined;
|
|
198
|
-
accounts?: (string | algosdk.Address)[] | undefined;
|
|
199
|
-
apps?: number[] | undefined;
|
|
200
|
-
assets?: number[] | undefined;
|
|
201
|
-
deployTimeParams?: TealTemplateParams | undefined;
|
|
202
|
-
updatable?: boolean | undefined;
|
|
203
|
-
deletable?: boolean | undefined;
|
|
204
|
-
onCompleteAction?: OnApplicationComplete.NoOpOC | "no_op" | undefined;
|
|
205
|
-
method: "createApplication()void";
|
|
206
|
-
methodArgs: any[];
|
|
207
|
-
};
|
|
208
|
-
};
|
|
209
|
-
/**
|
|
210
|
-
* Constructs a no op call for the arc200_name()string ABI method
|
|
211
|
-
*
|
|
212
|
-
* Returns the name of the token
|
|
213
|
-
*
|
|
214
|
-
* @param args Any args for the contract call
|
|
215
|
-
* @param params Any additional parameters for the call
|
|
216
|
-
* @returns A TypedCallParams object for the call
|
|
217
|
-
*/
|
|
218
|
-
static arc200Name(args: MethodArgs<'arc200_name()string'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
|
|
219
|
-
sender?: SendTransactionFrom | undefined;
|
|
220
|
-
note?: _algorandfoundation_algokit_utils_types_transaction.TransactionNote;
|
|
221
|
-
sendParams?: _algorandfoundation_algokit_utils_types_transaction.SendTransactionParams | undefined;
|
|
222
|
-
lease?: string | Uint8Array | undefined;
|
|
223
|
-
boxes?: (algosdk.BoxReference | _algorandfoundation_algokit_utils_types_app.BoxReference | _algorandfoundation_algokit_utils_types_app.BoxIdentifier)[] | undefined;
|
|
224
|
-
accounts?: (string | algosdk.Address)[] | undefined;
|
|
225
|
-
apps?: number[] | undefined;
|
|
226
|
-
assets?: number[] | undefined;
|
|
227
|
-
method: "arc200_name()string";
|
|
228
|
-
methodArgs: any[];
|
|
229
|
-
};
|
|
296
|
+
readonly appFactory: AppFactory;
|
|
230
297
|
/**
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
* Returns the symbol of the token
|
|
298
|
+
* Creates a new instance of `Arc200Factory`
|
|
234
299
|
*
|
|
235
|
-
* @param
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
boxes?: (algosdk.BoxReference | _algorandfoundation_algokit_utils_types_app.BoxReference | _algorandfoundation_algokit_utils_types_app.BoxIdentifier)[] | undefined;
|
|
245
|
-
accounts?: (string | algosdk.Address)[] | undefined;
|
|
246
|
-
apps?: number[] | undefined;
|
|
247
|
-
assets?: number[] | undefined;
|
|
248
|
-
method: "arc200_symbol()string";
|
|
249
|
-
methodArgs: any[];
|
|
250
|
-
};
|
|
251
|
-
/**
|
|
252
|
-
* Constructs a no op call for the arc200_decimals()uint8 ABI method
|
|
253
|
-
*
|
|
254
|
-
* Returns the decimals of the token
|
|
255
|
-
*
|
|
256
|
-
* @param args Any args for the contract call
|
|
257
|
-
* @param params Any additional parameters for the call
|
|
258
|
-
* @returns A TypedCallParams object for the call
|
|
259
|
-
*/
|
|
260
|
-
static arc200Decimals(args: MethodArgs<'arc200_decimals()uint8'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
|
|
261
|
-
sender?: SendTransactionFrom | undefined;
|
|
262
|
-
note?: _algorandfoundation_algokit_utils_types_transaction.TransactionNote;
|
|
263
|
-
sendParams?: _algorandfoundation_algokit_utils_types_transaction.SendTransactionParams | undefined;
|
|
264
|
-
lease?: string | Uint8Array | undefined;
|
|
265
|
-
boxes?: (algosdk.BoxReference | _algorandfoundation_algokit_utils_types_app.BoxReference | _algorandfoundation_algokit_utils_types_app.BoxIdentifier)[] | undefined;
|
|
266
|
-
accounts?: (string | algosdk.Address)[] | undefined;
|
|
267
|
-
apps?: number[] | undefined;
|
|
268
|
-
assets?: number[] | undefined;
|
|
269
|
-
method: "arc200_decimals()uint8";
|
|
270
|
-
methodArgs: any[];
|
|
271
|
-
};
|
|
300
|
+
* @param params The parameters to initialise the app factory with
|
|
301
|
+
*/
|
|
302
|
+
constructor(params: Omit<AppFactoryParams, 'appSpec'>);
|
|
303
|
+
/** The name of the app (from the ARC-32 / ARC-56 app spec or override). */
|
|
304
|
+
get appName(): string;
|
|
305
|
+
/** The ARC-56 app spec being used */
|
|
306
|
+
get appSpec(): Arc56Contract;
|
|
307
|
+
/** A reference to the underlying `AlgorandClient` this app factory is using. */
|
|
308
|
+
get algorand(): AlgorandClient;
|
|
272
309
|
/**
|
|
273
|
-
*
|
|
310
|
+
* Returns a new `AppClient` client for an app instance of the given ID.
|
|
274
311
|
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
* @param
|
|
278
|
-
* @
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
static arc200TotalSupply(args: MethodArgs<'arc200_totalSupply()uint256'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
|
|
282
|
-
sender?: SendTransactionFrom | undefined;
|
|
283
|
-
note?: _algorandfoundation_algokit_utils_types_transaction.TransactionNote;
|
|
284
|
-
sendParams?: _algorandfoundation_algokit_utils_types_transaction.SendTransactionParams | undefined;
|
|
285
|
-
lease?: string | Uint8Array | undefined;
|
|
286
|
-
boxes?: (algosdk.BoxReference | _algorandfoundation_algokit_utils_types_app.BoxReference | _algorandfoundation_algokit_utils_types_app.BoxIdentifier)[] | undefined;
|
|
287
|
-
accounts?: (string | algosdk.Address)[] | undefined;
|
|
288
|
-
apps?: number[] | undefined;
|
|
289
|
-
assets?: number[] | undefined;
|
|
290
|
-
method: "arc200_totalSupply()uint256";
|
|
291
|
-
methodArgs: any[];
|
|
292
|
-
};
|
|
312
|
+
* Automatically populates appName, defaultSender and source maps from the factory
|
|
313
|
+
* if not specified in the params.
|
|
314
|
+
* @param params The parameters to create the app client
|
|
315
|
+
* @returns The `AppClient`
|
|
316
|
+
*/
|
|
317
|
+
getAppClientById(params: AppFactoryAppClientParams): Arc200Client;
|
|
293
318
|
/**
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
* Returns the current balance of the owner of the token
|
|
319
|
+
* Returns a new `AppClient` client, resolving the app by creator address and name
|
|
320
|
+
* using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
|
|
297
321
|
*
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
* @
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
note?: _algorandfoundation_algokit_utils_types_transaction.TransactionNote;
|
|
305
|
-
sendParams?: _algorandfoundation_algokit_utils_types_transaction.SendTransactionParams | undefined;
|
|
306
|
-
lease?: string | Uint8Array | undefined;
|
|
307
|
-
boxes?: (algosdk.BoxReference | _algorandfoundation_algokit_utils_types_app.BoxReference | _algorandfoundation_algokit_utils_types_app.BoxIdentifier)[] | undefined;
|
|
308
|
-
accounts?: (string | algosdk.Address)[] | undefined;
|
|
309
|
-
apps?: number[] | undefined;
|
|
310
|
-
assets?: number[] | undefined;
|
|
311
|
-
method: "arc200_balanceOf(address)uint256";
|
|
312
|
-
methodArgs: string[];
|
|
313
|
-
};
|
|
322
|
+
* Automatically populates appName, defaultSender and source maps from the factory
|
|
323
|
+
* if not specified in the params.
|
|
324
|
+
* @param params The parameters to create the app client
|
|
325
|
+
* @returns The `AppClient`
|
|
326
|
+
*/
|
|
327
|
+
getAppClientByCreatorAndName(params: AppFactoryResolveAppClientByCreatorAndNameParams): Promise<Arc200Client>;
|
|
314
328
|
/**
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
* Transfers tokens
|
|
329
|
+
* Idempotently deploys the Arc200 smart contract.
|
|
318
330
|
*
|
|
319
|
-
* @param
|
|
320
|
-
* @
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
331
|
+
* @param params The arguments for the contract calls and any additional parameters for the call
|
|
332
|
+
* @returns The deployment result
|
|
333
|
+
*/
|
|
334
|
+
deploy(params?: Arc200DeployParams): Promise<{
|
|
335
|
+
result: {
|
|
336
|
+
return: algosdk.ABIValue | _algorandfoundation_algokit_utils_types_app_arc56.ABIStruct | undefined;
|
|
337
|
+
deleteReturn: algosdk.ABIValue | _algorandfoundation_algokit_utils_types_app_arc56.ABIStruct | undefined;
|
|
338
|
+
compiledApproval?: _algorandfoundation_algokit_utils_types_app.CompiledTeal | undefined;
|
|
339
|
+
compiledClear?: _algorandfoundation_algokit_utils_types_app.CompiledTeal | undefined;
|
|
340
|
+
operationPerformed: "create";
|
|
341
|
+
version: string;
|
|
342
|
+
name: string;
|
|
343
|
+
createdRound: bigint;
|
|
344
|
+
updatedRound: bigint;
|
|
345
|
+
createdMetadata: _algorandfoundation_algokit_utils_types_app.AppDeployMetadata;
|
|
346
|
+
deleted: boolean;
|
|
347
|
+
deletable?: boolean | undefined;
|
|
348
|
+
updatable?: boolean | undefined;
|
|
349
|
+
groupId: string;
|
|
350
|
+
txIds: string[];
|
|
351
|
+
returns?: _algorandfoundation_algokit_utils_types_app.ABIReturn[] | undefined;
|
|
352
|
+
confirmations: modelsv2.PendingTransactionResponse[];
|
|
353
|
+
transactions: Transaction[];
|
|
354
|
+
confirmation: modelsv2.PendingTransactionResponse;
|
|
355
|
+
transaction: Transaction;
|
|
356
|
+
appId: bigint;
|
|
357
|
+
appAddress: Address;
|
|
358
|
+
} | {
|
|
359
|
+
return: algosdk.ABIValue | _algorandfoundation_algokit_utils_types_app_arc56.ABIStruct | undefined;
|
|
360
|
+
deleteReturn: algosdk.ABIValue | _algorandfoundation_algokit_utils_types_app_arc56.ABIStruct | undefined;
|
|
361
|
+
compiledApproval?: _algorandfoundation_algokit_utils_types_app.CompiledTeal | undefined;
|
|
362
|
+
compiledClear?: _algorandfoundation_algokit_utils_types_app.CompiledTeal | undefined;
|
|
363
|
+
operationPerformed: "update";
|
|
364
|
+
appId: bigint;
|
|
365
|
+
appAddress: Address;
|
|
366
|
+
createdRound: bigint;
|
|
367
|
+
updatedRound: bigint;
|
|
368
|
+
createdMetadata: _algorandfoundation_algokit_utils_types_app.AppDeployMetadata;
|
|
369
|
+
deleted: boolean;
|
|
370
|
+
name: string;
|
|
371
|
+
version: string;
|
|
372
|
+
deletable?: boolean | undefined;
|
|
373
|
+
updatable?: boolean | undefined;
|
|
374
|
+
groupId: string;
|
|
375
|
+
txIds: string[];
|
|
376
|
+
returns?: _algorandfoundation_algokit_utils_types_app.ABIReturn[] | undefined;
|
|
377
|
+
confirmations: modelsv2.PendingTransactionResponse[];
|
|
378
|
+
transactions: Transaction[];
|
|
379
|
+
confirmation: modelsv2.PendingTransactionResponse;
|
|
380
|
+
transaction: Transaction;
|
|
381
|
+
} | {
|
|
382
|
+
return: algosdk.ABIValue | _algorandfoundation_algokit_utils_types_app_arc56.ABIStruct | undefined;
|
|
383
|
+
deleteReturn: algosdk.ABIValue | _algorandfoundation_algokit_utils_types_app_arc56.ABIStruct | undefined;
|
|
384
|
+
compiledApproval?: _algorandfoundation_algokit_utils_types_app.CompiledTeal | undefined;
|
|
385
|
+
compiledClear?: _algorandfoundation_algokit_utils_types_app.CompiledTeal | undefined;
|
|
386
|
+
operationPerformed: "replace";
|
|
387
|
+
version: string;
|
|
388
|
+
name: string;
|
|
389
|
+
createdRound: bigint;
|
|
390
|
+
updatedRound: bigint;
|
|
391
|
+
createdMetadata: _algorandfoundation_algokit_utils_types_app.AppDeployMetadata;
|
|
392
|
+
deleted: boolean;
|
|
393
|
+
deletable?: boolean | undefined;
|
|
394
|
+
updatable?: boolean | undefined;
|
|
395
|
+
groupId: string;
|
|
396
|
+
txIds: string[];
|
|
397
|
+
returns?: _algorandfoundation_algokit_utils_types_app.ABIReturn[] | undefined;
|
|
398
|
+
confirmations: modelsv2.PendingTransactionResponse[];
|
|
399
|
+
transactions: Transaction[];
|
|
400
|
+
confirmation: modelsv2.PendingTransactionResponse;
|
|
401
|
+
transaction: Transaction;
|
|
402
|
+
appId: bigint;
|
|
403
|
+
appAddress: Address;
|
|
404
|
+
deleteResult: _algorandfoundation_algokit_utils_types_transaction.ConfirmedTransactionResult;
|
|
405
|
+
} | {
|
|
406
|
+
return: algosdk.ABIValue | _algorandfoundation_algokit_utils_types_app_arc56.ABIStruct | undefined;
|
|
407
|
+
deleteReturn: algosdk.ABIValue | _algorandfoundation_algokit_utils_types_app_arc56.ABIStruct | undefined;
|
|
408
|
+
compiledApproval?: _algorandfoundation_algokit_utils_types_app.CompiledTeal | undefined;
|
|
409
|
+
compiledClear?: _algorandfoundation_algokit_utils_types_app.CompiledTeal | undefined;
|
|
410
|
+
operationPerformed: "nothing";
|
|
411
|
+
appId: bigint;
|
|
412
|
+
appAddress: Address;
|
|
413
|
+
createdRound: bigint;
|
|
414
|
+
updatedRound: bigint;
|
|
415
|
+
createdMetadata: _algorandfoundation_algokit_utils_types_app.AppDeployMetadata;
|
|
416
|
+
deleted: boolean;
|
|
417
|
+
name: string;
|
|
418
|
+
version: string;
|
|
419
|
+
deletable?: boolean | undefined;
|
|
420
|
+
updatable?: boolean | undefined;
|
|
421
|
+
};
|
|
422
|
+
appClient: Arc200Client;
|
|
423
|
+
}>;
|
|
335
424
|
/**
|
|
336
|
-
*
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
425
|
+
* Get parameters to create transactions (create and deploy related calls) for the current app. A good mental model for this is that these parameters represent a deferred transaction creation.
|
|
426
|
+
*/
|
|
427
|
+
readonly params: {
|
|
428
|
+
/**
|
|
429
|
+
* Gets available create methods
|
|
430
|
+
*/
|
|
431
|
+
create: {
|
|
432
|
+
/**
|
|
433
|
+
* Creates a new instance of the Arc200 smart contract using a bare call.
|
|
434
|
+
*
|
|
435
|
+
* @param params The params for the bare (raw) call
|
|
436
|
+
* @returns The params for a create call
|
|
437
|
+
*/
|
|
438
|
+
bare: (params?: Expand<AppClientBareCallParams & AppClientCompilationParams & CreateSchema & {
|
|
439
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
440
|
+
}>) => Promise<{
|
|
441
|
+
approvalProgram: Uint8Array;
|
|
442
|
+
clearStateProgram: Uint8Array;
|
|
443
|
+
compiledApproval?: _algorandfoundation_algokit_utils_types_app.CompiledTeal | undefined;
|
|
444
|
+
compiledClear?: _algorandfoundation_algokit_utils_types_app.CompiledTeal | undefined;
|
|
445
|
+
deployTimeParams: _algorandfoundation_algokit_utils_types_app.TealTemplateParams | undefined;
|
|
446
|
+
schema: {
|
|
447
|
+
globalInts: number;
|
|
448
|
+
globalByteSlices: number;
|
|
449
|
+
localInts: number;
|
|
450
|
+
localByteSlices: number;
|
|
451
|
+
};
|
|
452
|
+
maxFee?: _algorandfoundation_algokit_utils_types_amount.AlgoAmount | undefined;
|
|
453
|
+
note?: string | Uint8Array | undefined;
|
|
454
|
+
args?: Uint8Array[] | undefined;
|
|
455
|
+
signer?: TransactionSigner | _algorandfoundation_algokit_utils_types_account.TransactionSignerAccount | undefined;
|
|
456
|
+
lease?: string | Uint8Array | undefined;
|
|
457
|
+
rekeyTo?: string | Address | undefined;
|
|
458
|
+
staticFee?: _algorandfoundation_algokit_utils_types_amount.AlgoAmount | undefined;
|
|
459
|
+
extraFee?: _algorandfoundation_algokit_utils_types_amount.AlgoAmount | undefined;
|
|
460
|
+
validityWindow?: number | bigint | undefined;
|
|
461
|
+
firstValidRound?: bigint | undefined;
|
|
462
|
+
lastValidRound?: bigint | undefined;
|
|
463
|
+
accountReferences?: (string | Address)[] | undefined;
|
|
464
|
+
appReferences?: bigint[] | undefined;
|
|
465
|
+
assetReferences?: bigint[] | undefined;
|
|
466
|
+
boxReferences?: (_algorandfoundation_algokit_utils_types_app_manager.BoxIdentifier | _algorandfoundation_algokit_utils_types_app_manager.BoxReference)[] | undefined;
|
|
467
|
+
sender?: string | Address | undefined;
|
|
468
|
+
updatable?: boolean | undefined;
|
|
469
|
+
deletable?: boolean | undefined;
|
|
470
|
+
onComplete?: OnApplicationComplete.NoOpOC | OnApplicationComplete.OptInOC | OnApplicationComplete.CloseOutOC | OnApplicationComplete.UpdateApplicationOC | OnApplicationComplete.DeleteApplicationOC | undefined;
|
|
471
|
+
extraProgramPages?: number | undefined;
|
|
472
|
+
} & {
|
|
473
|
+
sender: Address;
|
|
474
|
+
signer: TransactionSigner | _algorandfoundation_algokit_utils_types_account.TransactionSignerAccount | undefined;
|
|
475
|
+
onComplete: OnApplicationComplete.NoOpOC | OnApplicationComplete.OptInOC | OnApplicationComplete.CloseOutOC | OnApplicationComplete.UpdateApplicationOC | OnApplicationComplete.DeleteApplicationOC;
|
|
476
|
+
}>;
|
|
477
|
+
};
|
|
355
478
|
};
|
|
356
479
|
/**
|
|
357
|
-
*
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
method: "arc200_approve(address,uint256)bool";
|
|
375
|
-
methodArgs: (string | number | bigint)[];
|
|
480
|
+
* Create transactions for the current app
|
|
481
|
+
*/
|
|
482
|
+
readonly createTransaction: {
|
|
483
|
+
/**
|
|
484
|
+
* Gets available create methods
|
|
485
|
+
*/
|
|
486
|
+
create: {
|
|
487
|
+
/**
|
|
488
|
+
* Creates a new instance of the Arc200 smart contract using a bare call.
|
|
489
|
+
*
|
|
490
|
+
* @param params The params for the bare (raw) call
|
|
491
|
+
* @returns The transaction for a create call
|
|
492
|
+
*/
|
|
493
|
+
bare: (params?: Expand<AppClientBareCallParams & AppClientCompilationParams & CreateSchema & {
|
|
494
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
495
|
+
}>) => Promise<Transaction>;
|
|
496
|
+
};
|
|
376
497
|
};
|
|
377
498
|
/**
|
|
378
|
-
*
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
499
|
+
* Send calls to the current app
|
|
500
|
+
*/
|
|
501
|
+
readonly send: {
|
|
502
|
+
/**
|
|
503
|
+
* Gets available create methods
|
|
504
|
+
*/
|
|
505
|
+
create: {
|
|
506
|
+
/**
|
|
507
|
+
* Creates a new instance of the Arc200 smart contract using a bare call.
|
|
508
|
+
*
|
|
509
|
+
* @param params The params for the bare (raw) call
|
|
510
|
+
* @returns The create result
|
|
511
|
+
*/
|
|
512
|
+
bare: (params?: Expand<AppClientBareCallParams & AppClientCompilationParams & CreateSchema & SendParams & {
|
|
513
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
514
|
+
}>) => Promise<{
|
|
515
|
+
result: {
|
|
516
|
+
compiledApproval?: _algorandfoundation_algokit_utils_types_app.CompiledTeal | undefined;
|
|
517
|
+
compiledClear?: _algorandfoundation_algokit_utils_types_app.CompiledTeal | undefined;
|
|
518
|
+
return: undefined;
|
|
519
|
+
groupId: string;
|
|
520
|
+
txIds: string[];
|
|
521
|
+
returns?: _algorandfoundation_algokit_utils_types_app.ABIReturn[] | undefined;
|
|
522
|
+
confirmations: modelsv2.PendingTransactionResponse[];
|
|
523
|
+
transactions: Transaction[];
|
|
524
|
+
confirmation: modelsv2.PendingTransactionResponse;
|
|
525
|
+
transaction: Transaction;
|
|
526
|
+
appId: bigint;
|
|
527
|
+
appAddress: Address;
|
|
528
|
+
};
|
|
529
|
+
appClient: Arc200Client;
|
|
530
|
+
}>;
|
|
531
|
+
};
|
|
397
532
|
};
|
|
398
533
|
}
|
|
399
534
|
/**
|
|
400
535
|
* A client to make calls to the Arc200 smart contract
|
|
401
536
|
*/
|
|
402
537
|
declare class Arc200Client {
|
|
403
|
-
private algod;
|
|
404
538
|
/**
|
|
405
|
-
* The underlying `
|
|
539
|
+
* The underlying `AppClient` for when you want to have more flexibility
|
|
406
540
|
*/
|
|
407
|
-
readonly appClient:
|
|
408
|
-
private readonly sender;
|
|
541
|
+
readonly appClient: AppClient;
|
|
409
542
|
/**
|
|
410
543
|
* Creates a new instance of `Arc200Client`
|
|
411
544
|
*
|
|
412
|
-
* @param
|
|
413
|
-
* @param algod An algod client instance
|
|
545
|
+
* @param appClient An `AppClient` instance which has been created with the Arc200 app spec
|
|
414
546
|
*/
|
|
415
|
-
constructor(
|
|
547
|
+
constructor(appClient: AppClient);
|
|
416
548
|
/**
|
|
417
|
-
*
|
|
549
|
+
* Creates a new instance of `Arc200Client`
|
|
418
550
|
*
|
|
419
|
-
* @param
|
|
420
|
-
* @param returnValueFormatter An optional delegate to format the return value if required
|
|
421
|
-
* @returns The smart contract response with an updated return value
|
|
551
|
+
* @param params The parameters to initialise the app client with
|
|
422
552
|
*/
|
|
423
|
-
|
|
553
|
+
constructor(params: Omit<AppClientParams, 'appSpec'>);
|
|
424
554
|
/**
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
* @param typedCallParams An object containing the method signature, args, and any other relevant parameters
|
|
428
|
-
* @param returnValueFormatter An optional delegate which when provided will be used to map non-undefined return values to the target type
|
|
429
|
-
* @returns The result of the smart contract call
|
|
555
|
+
* Checks for decode errors on the given return value and maps the return value to the return type for the given method
|
|
556
|
+
* @returns The typed return value or undefined if there was no value
|
|
430
557
|
*/
|
|
431
|
-
|
|
558
|
+
decodeReturnValue<TSignature extends Arc200NonVoidMethodSignatures>(method: TSignature, returnValue: ABIReturn | undefined): MethodReturn<TSignature> | undefined;
|
|
432
559
|
/**
|
|
433
|
-
*
|
|
560
|
+
* Returns a new `Arc200Client` client, resolving the app by creator address and name
|
|
561
|
+
* using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
|
|
562
|
+
* @param params The parameters to create the app client
|
|
563
|
+
*/
|
|
564
|
+
static fromCreatorAndName(params: Omit<ResolveAppClientByCreatorAndName, 'appSpec'>): Promise<Arc200Client>;
|
|
565
|
+
/**
|
|
566
|
+
* Returns an `Arc200Client` instance for the current network based on
|
|
567
|
+
* pre-determined network-specific app IDs specified in the ARC-56 app spec.
|
|
434
568
|
*
|
|
435
|
-
*
|
|
436
|
-
* @
|
|
569
|
+
* If no IDs are in the app spec or the network isn't recognised, an error is thrown.
|
|
570
|
+
* @param params The parameters to create the app client
|
|
571
|
+
*/
|
|
572
|
+
static fromNetwork(params: Omit<ResolveAppClientByNetwork, 'appSpec'>): Promise<Arc200Client>;
|
|
573
|
+
/** The ID of the app instance this client is linked to. */
|
|
574
|
+
get appId(): bigint;
|
|
575
|
+
/** The app address of the app instance this client is linked to. */
|
|
576
|
+
get appAddress(): Address;
|
|
577
|
+
/** The name of the app. */
|
|
578
|
+
get appName(): string;
|
|
579
|
+
/** The ARC-56 app spec being used */
|
|
580
|
+
get appSpec(): Arc56Contract;
|
|
581
|
+
/** A reference to the underlying `AlgorandClient` this app client is using. */
|
|
582
|
+
get algorand(): AlgorandClient;
|
|
583
|
+
/**
|
|
584
|
+
* Get parameters to create transactions for the current app. A good mental model for this is that these parameters represent a deferred transaction creation.
|
|
585
|
+
*/
|
|
586
|
+
readonly params: {
|
|
587
|
+
/**
|
|
588
|
+
* Makes a clear_state call to an existing instance of the Arc200 smart contract.
|
|
589
|
+
*
|
|
590
|
+
* @param params The params for the bare (raw) call
|
|
591
|
+
* @returns The clearState result
|
|
592
|
+
*/
|
|
593
|
+
clearState: (params?: Expand<AppClientBareCallParams>) => _algorandfoundation_algokit_utils_types_composer.AppCallParams;
|
|
594
|
+
/**
|
|
595
|
+
* Makes a call to the Arc200 smart contract using the `bootstrap(byte[],byte[],uint8,uint256)bool` ABI method.
|
|
596
|
+
*
|
|
597
|
+
* @param params The params for the smart contract call
|
|
598
|
+
* @returns The call params
|
|
599
|
+
*/
|
|
600
|
+
bootstrap: (params: CallParams<Arc200Args["obj"]["bootstrap(byte[],byte[],uint8,uint256)bool"] | Arc200Args["tuple"]["bootstrap(byte[],byte[],uint8,uint256)bool"]> & {
|
|
601
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
602
|
+
}) => Promise<AppCallMethodCall>;
|
|
603
|
+
/**
|
|
604
|
+
* Makes a call to the Arc200 smart contract using the `arc200_name()byte[32]` ABI method.
|
|
605
|
+
*
|
|
606
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
607
|
+
*
|
|
608
|
+
* Returns the name of the token
|
|
609
|
+
*
|
|
610
|
+
* @param params The params for the smart contract call
|
|
611
|
+
* @returns The call params: The name of the token
|
|
612
|
+
*/
|
|
613
|
+
arc200Name: (params?: CallParams<Arc200Args["obj"]["arc200_name()byte[32]"] | Arc200Args["tuple"]["arc200_name()byte[32]"]> & {
|
|
614
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
615
|
+
}) => Promise<AppCallMethodCall>;
|
|
616
|
+
/**
|
|
617
|
+
* Makes a call to the Arc200 smart contract using the `arc200_symbol()byte[8]` ABI method.
|
|
618
|
+
*
|
|
619
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
620
|
+
*
|
|
621
|
+
* Returns the symbol of the token
|
|
622
|
+
*
|
|
623
|
+
* @param params The params for the smart contract call
|
|
624
|
+
* @returns The call params: The symbol of the token
|
|
625
|
+
*/
|
|
626
|
+
arc200Symbol: (params?: CallParams<Arc200Args["obj"]["arc200_symbol()byte[8]"] | Arc200Args["tuple"]["arc200_symbol()byte[8]"]> & {
|
|
627
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
628
|
+
}) => Promise<AppCallMethodCall>;
|
|
629
|
+
/**
|
|
630
|
+
* Makes a call to the Arc200 smart contract using the `arc200_decimals()uint8` ABI method.
|
|
631
|
+
*
|
|
632
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
633
|
+
*
|
|
634
|
+
* Returns the decimals of the token
|
|
635
|
+
*
|
|
636
|
+
* @param params The params for the smart contract call
|
|
637
|
+
* @returns The call params: The decimals of the token
|
|
638
|
+
*/
|
|
639
|
+
arc200Decimals: (params?: CallParams<Arc200Args["obj"]["arc200_decimals()uint8"] | Arc200Args["tuple"]["arc200_decimals()uint8"]> & {
|
|
640
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
641
|
+
}) => Promise<AppCallMethodCall>;
|
|
642
|
+
/**
|
|
643
|
+
* Makes a call to the Arc200 smart contract using the `arc200_totalSupply()uint256` ABI method.
|
|
644
|
+
*
|
|
645
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
646
|
+
*
|
|
647
|
+
* Returns the total supply of the token
|
|
648
|
+
*
|
|
649
|
+
* @param params The params for the smart contract call
|
|
650
|
+
* @returns The call params: The total supply of the token
|
|
651
|
+
*/
|
|
652
|
+
arc200TotalSupply: (params?: CallParams<Arc200Args["obj"]["arc200_totalSupply()uint256"] | Arc200Args["tuple"]["arc200_totalSupply()uint256"]> & {
|
|
653
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
654
|
+
}) => Promise<AppCallMethodCall>;
|
|
655
|
+
/**
|
|
656
|
+
* Makes a call to the Arc200 smart contract using the `arc200_balanceOf(address)uint256` ABI method.
|
|
657
|
+
*
|
|
658
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
659
|
+
*
|
|
660
|
+
* Returns the current balance of the owner of the token
|
|
661
|
+
*
|
|
662
|
+
* @param params The params for the smart contract call
|
|
663
|
+
* @returns The call params: The current balance of the holder of the token
|
|
664
|
+
*/
|
|
665
|
+
arc200BalanceOf: (params: CallParams<Arc200Args["obj"]["arc200_balanceOf(address)uint256"] | Arc200Args["tuple"]["arc200_balanceOf(address)uint256"]> & {
|
|
666
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
667
|
+
}) => Promise<AppCallMethodCall>;
|
|
668
|
+
/**
|
|
669
|
+
* Makes a call to the Arc200 smart contract using the `arc200_transfer(address,uint256)bool` ABI method.
|
|
670
|
+
*
|
|
671
|
+
* Transfers tokens
|
|
672
|
+
*
|
|
673
|
+
* @param params The params for the smart contract call
|
|
674
|
+
* @returns The call params: Success
|
|
675
|
+
*/
|
|
676
|
+
arc200Transfer: (params: CallParams<Arc200Args["obj"]["arc200_transfer(address,uint256)bool"] | Arc200Args["tuple"]["arc200_transfer(address,uint256)bool"]> & {
|
|
677
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
678
|
+
}) => Promise<AppCallMethodCall>;
|
|
679
|
+
/**
|
|
680
|
+
* Makes a call to the Arc200 smart contract using the `arc200_transferFrom(address,address,uint256)bool` ABI method.
|
|
681
|
+
*
|
|
682
|
+
* Transfers tokens from source to destination as approved spender
|
|
683
|
+
*
|
|
684
|
+
* @param params The params for the smart contract call
|
|
685
|
+
* @returns The call params: Success
|
|
686
|
+
*/
|
|
687
|
+
arc200TransferFrom: (params: CallParams<Arc200Args["obj"]["arc200_transferFrom(address,address,uint256)bool"] | Arc200Args["tuple"]["arc200_transferFrom(address,address,uint256)bool"]> & {
|
|
688
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
689
|
+
}) => Promise<AppCallMethodCall>;
|
|
690
|
+
/**
|
|
691
|
+
* Makes a call to the Arc200 smart contract using the `arc200_approve(address,uint256)bool` ABI method.
|
|
692
|
+
*
|
|
693
|
+
* Approve spender for a token
|
|
694
|
+
*
|
|
695
|
+
* @param params The params for the smart contract call
|
|
696
|
+
* @returns The call params: Success
|
|
697
|
+
*/
|
|
698
|
+
arc200Approve: (params: CallParams<Arc200Args["obj"]["arc200_approve(address,uint256)bool"] | Arc200Args["tuple"]["arc200_approve(address,uint256)bool"]> & {
|
|
699
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
700
|
+
}) => Promise<AppCallMethodCall>;
|
|
701
|
+
/**
|
|
702
|
+
* Makes a call to the Arc200 smart contract using the `arc200_allowance(address,address)uint256` ABI method.
|
|
703
|
+
*
|
|
704
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
705
|
+
*
|
|
706
|
+
* Returns the current allowance of the spender of the tokens of the owner
|
|
707
|
+
*
|
|
708
|
+
* @param params The params for the smart contract call
|
|
709
|
+
* @returns The call params: The remaining allowance
|
|
710
|
+
*/
|
|
711
|
+
arc200Allowance: (params: CallParams<Arc200Args["obj"]["arc200_allowance(address,address)uint256"] | Arc200Args["tuple"]["arc200_allowance(address,address)uint256"]> & {
|
|
712
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
713
|
+
}) => Promise<AppCallMethodCall>;
|
|
714
|
+
};
|
|
715
|
+
/**
|
|
716
|
+
* Create transactions for the current app
|
|
437
717
|
*/
|
|
438
|
-
|
|
718
|
+
readonly createTransaction: {
|
|
719
|
+
/**
|
|
720
|
+
* Makes a clear_state call to an existing instance of the Arc200 smart contract.
|
|
721
|
+
*
|
|
722
|
+
* @param params The params for the bare (raw) call
|
|
723
|
+
* @returns The clearState result
|
|
724
|
+
*/
|
|
725
|
+
clearState: (params?: Expand<AppClientBareCallParams>) => Promise<Transaction>;
|
|
726
|
+
/**
|
|
727
|
+
* Makes a call to the Arc200 smart contract using the `bootstrap(byte[],byte[],uint8,uint256)bool` ABI method.
|
|
728
|
+
*
|
|
729
|
+
* @param params The params for the smart contract call
|
|
730
|
+
* @returns The call transaction
|
|
731
|
+
*/
|
|
732
|
+
bootstrap: (params: CallParams<Arc200Args["obj"]["bootstrap(byte[],byte[],uint8,uint256)bool"] | Arc200Args["tuple"]["bootstrap(byte[],byte[],uint8,uint256)bool"]> & {
|
|
733
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
734
|
+
}) => Promise<{
|
|
735
|
+
transactions: Transaction[];
|
|
736
|
+
methodCalls: Map<number, algosdk.ABIMethod>;
|
|
737
|
+
signers: Map<number, TransactionSigner>;
|
|
738
|
+
}>;
|
|
739
|
+
/**
|
|
740
|
+
* Makes a call to the Arc200 smart contract using the `arc200_name()byte[32]` ABI method.
|
|
741
|
+
*
|
|
742
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
743
|
+
*
|
|
744
|
+
* Returns the name of the token
|
|
745
|
+
*
|
|
746
|
+
* @param params The params for the smart contract call
|
|
747
|
+
* @returns The call transaction: The name of the token
|
|
748
|
+
*/
|
|
749
|
+
arc200Name: (params?: CallParams<Arc200Args["obj"]["arc200_name()byte[32]"] | Arc200Args["tuple"]["arc200_name()byte[32]"]> & {
|
|
750
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
751
|
+
}) => Promise<{
|
|
752
|
+
transactions: Transaction[];
|
|
753
|
+
methodCalls: Map<number, algosdk.ABIMethod>;
|
|
754
|
+
signers: Map<number, TransactionSigner>;
|
|
755
|
+
}>;
|
|
756
|
+
/**
|
|
757
|
+
* Makes a call to the Arc200 smart contract using the `arc200_symbol()byte[8]` ABI method.
|
|
758
|
+
*
|
|
759
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
760
|
+
*
|
|
761
|
+
* Returns the symbol of the token
|
|
762
|
+
*
|
|
763
|
+
* @param params The params for the smart contract call
|
|
764
|
+
* @returns The call transaction: The symbol of the token
|
|
765
|
+
*/
|
|
766
|
+
arc200Symbol: (params?: CallParams<Arc200Args["obj"]["arc200_symbol()byte[8]"] | Arc200Args["tuple"]["arc200_symbol()byte[8]"]> & {
|
|
767
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
768
|
+
}) => Promise<{
|
|
769
|
+
transactions: Transaction[];
|
|
770
|
+
methodCalls: Map<number, algosdk.ABIMethod>;
|
|
771
|
+
signers: Map<number, TransactionSigner>;
|
|
772
|
+
}>;
|
|
773
|
+
/**
|
|
774
|
+
* Makes a call to the Arc200 smart contract using the `arc200_decimals()uint8` ABI method.
|
|
775
|
+
*
|
|
776
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
777
|
+
*
|
|
778
|
+
* Returns the decimals of the token
|
|
779
|
+
*
|
|
780
|
+
* @param params The params for the smart contract call
|
|
781
|
+
* @returns The call transaction: The decimals of the token
|
|
782
|
+
*/
|
|
783
|
+
arc200Decimals: (params?: CallParams<Arc200Args["obj"]["arc200_decimals()uint8"] | Arc200Args["tuple"]["arc200_decimals()uint8"]> & {
|
|
784
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
785
|
+
}) => Promise<{
|
|
786
|
+
transactions: Transaction[];
|
|
787
|
+
methodCalls: Map<number, algosdk.ABIMethod>;
|
|
788
|
+
signers: Map<number, TransactionSigner>;
|
|
789
|
+
}>;
|
|
790
|
+
/**
|
|
791
|
+
* Makes a call to the Arc200 smart contract using the `arc200_totalSupply()uint256` ABI method.
|
|
792
|
+
*
|
|
793
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
794
|
+
*
|
|
795
|
+
* Returns the total supply of the token
|
|
796
|
+
*
|
|
797
|
+
* @param params The params for the smart contract call
|
|
798
|
+
* @returns The call transaction: The total supply of the token
|
|
799
|
+
*/
|
|
800
|
+
arc200TotalSupply: (params?: CallParams<Arc200Args["obj"]["arc200_totalSupply()uint256"] | Arc200Args["tuple"]["arc200_totalSupply()uint256"]> & {
|
|
801
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
802
|
+
}) => Promise<{
|
|
803
|
+
transactions: Transaction[];
|
|
804
|
+
methodCalls: Map<number, algosdk.ABIMethod>;
|
|
805
|
+
signers: Map<number, TransactionSigner>;
|
|
806
|
+
}>;
|
|
807
|
+
/**
|
|
808
|
+
* Makes a call to the Arc200 smart contract using the `arc200_balanceOf(address)uint256` ABI method.
|
|
809
|
+
*
|
|
810
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
811
|
+
*
|
|
812
|
+
* Returns the current balance of the owner of the token
|
|
813
|
+
*
|
|
814
|
+
* @param params The params for the smart contract call
|
|
815
|
+
* @returns The call transaction: The current balance of the holder of the token
|
|
816
|
+
*/
|
|
817
|
+
arc200BalanceOf: (params: CallParams<Arc200Args["obj"]["arc200_balanceOf(address)uint256"] | Arc200Args["tuple"]["arc200_balanceOf(address)uint256"]> & {
|
|
818
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
819
|
+
}) => Promise<{
|
|
820
|
+
transactions: Transaction[];
|
|
821
|
+
methodCalls: Map<number, algosdk.ABIMethod>;
|
|
822
|
+
signers: Map<number, TransactionSigner>;
|
|
823
|
+
}>;
|
|
824
|
+
/**
|
|
825
|
+
* Makes a call to the Arc200 smart contract using the `arc200_transfer(address,uint256)bool` ABI method.
|
|
826
|
+
*
|
|
827
|
+
* Transfers tokens
|
|
828
|
+
*
|
|
829
|
+
* @param params The params for the smart contract call
|
|
830
|
+
* @returns The call transaction: Success
|
|
831
|
+
*/
|
|
832
|
+
arc200Transfer: (params: CallParams<Arc200Args["obj"]["arc200_transfer(address,uint256)bool"] | Arc200Args["tuple"]["arc200_transfer(address,uint256)bool"]> & {
|
|
833
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
834
|
+
}) => Promise<{
|
|
835
|
+
transactions: Transaction[];
|
|
836
|
+
methodCalls: Map<number, algosdk.ABIMethod>;
|
|
837
|
+
signers: Map<number, TransactionSigner>;
|
|
838
|
+
}>;
|
|
839
|
+
/**
|
|
840
|
+
* Makes a call to the Arc200 smart contract using the `arc200_transferFrom(address,address,uint256)bool` ABI method.
|
|
841
|
+
*
|
|
842
|
+
* Transfers tokens from source to destination as approved spender
|
|
843
|
+
*
|
|
844
|
+
* @param params The params for the smart contract call
|
|
845
|
+
* @returns The call transaction: Success
|
|
846
|
+
*/
|
|
847
|
+
arc200TransferFrom: (params: CallParams<Arc200Args["obj"]["arc200_transferFrom(address,address,uint256)bool"] | Arc200Args["tuple"]["arc200_transferFrom(address,address,uint256)bool"]> & {
|
|
848
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
849
|
+
}) => Promise<{
|
|
850
|
+
transactions: Transaction[];
|
|
851
|
+
methodCalls: Map<number, algosdk.ABIMethod>;
|
|
852
|
+
signers: Map<number, TransactionSigner>;
|
|
853
|
+
}>;
|
|
854
|
+
/**
|
|
855
|
+
* Makes a call to the Arc200 smart contract using the `arc200_approve(address,uint256)bool` ABI method.
|
|
856
|
+
*
|
|
857
|
+
* Approve spender for a token
|
|
858
|
+
*
|
|
859
|
+
* @param params The params for the smart contract call
|
|
860
|
+
* @returns The call transaction: Success
|
|
861
|
+
*/
|
|
862
|
+
arc200Approve: (params: CallParams<Arc200Args["obj"]["arc200_approve(address,uint256)bool"] | Arc200Args["tuple"]["arc200_approve(address,uint256)bool"]> & {
|
|
863
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
864
|
+
}) => Promise<{
|
|
865
|
+
transactions: Transaction[];
|
|
866
|
+
methodCalls: Map<number, algosdk.ABIMethod>;
|
|
867
|
+
signers: Map<number, TransactionSigner>;
|
|
868
|
+
}>;
|
|
869
|
+
/**
|
|
870
|
+
* Makes a call to the Arc200 smart contract using the `arc200_allowance(address,address)uint256` ABI method.
|
|
871
|
+
*
|
|
872
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
873
|
+
*
|
|
874
|
+
* Returns the current allowance of the spender of the tokens of the owner
|
|
875
|
+
*
|
|
876
|
+
* @param params The params for the smart contract call
|
|
877
|
+
* @returns The call transaction: The remaining allowance
|
|
878
|
+
*/
|
|
879
|
+
arc200Allowance: (params: CallParams<Arc200Args["obj"]["arc200_allowance(address,address)uint256"] | Arc200Args["tuple"]["arc200_allowance(address,address)uint256"]> & {
|
|
880
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
881
|
+
}) => Promise<{
|
|
882
|
+
transactions: Transaction[];
|
|
883
|
+
methodCalls: Map<number, algosdk.ABIMethod>;
|
|
884
|
+
signers: Map<number, TransactionSigner>;
|
|
885
|
+
}>;
|
|
886
|
+
};
|
|
439
887
|
/**
|
|
440
|
-
*
|
|
888
|
+
* Send calls to the current app
|
|
441
889
|
*/
|
|
442
|
-
|
|
890
|
+
readonly send: {
|
|
891
|
+
/**
|
|
892
|
+
* Makes a clear_state call to an existing instance of the Arc200 smart contract.
|
|
893
|
+
*
|
|
894
|
+
* @param params The params for the bare (raw) call
|
|
895
|
+
* @returns The clearState result
|
|
896
|
+
*/
|
|
897
|
+
clearState: (params?: Expand<AppClientBareCallParams & SendParams>) => Promise<{
|
|
898
|
+
groupId: string;
|
|
899
|
+
txIds: string[];
|
|
900
|
+
returns?: ABIReturn[] | undefined;
|
|
901
|
+
confirmations: modelsv2.PendingTransactionResponse[];
|
|
902
|
+
transactions: Transaction[];
|
|
903
|
+
confirmation: modelsv2.PendingTransactionResponse;
|
|
904
|
+
transaction: Transaction;
|
|
905
|
+
return?: ABIReturn | undefined;
|
|
906
|
+
}>;
|
|
907
|
+
/**
|
|
908
|
+
* Makes a call to the Arc200 smart contract using the `bootstrap(byte[],byte[],uint8,uint256)bool` ABI method.
|
|
909
|
+
*
|
|
910
|
+
* @param params The params for the smart contract call
|
|
911
|
+
* @returns The call result
|
|
912
|
+
*/
|
|
913
|
+
bootstrap: (params: CallParams<Arc200Args["obj"]["bootstrap(byte[],byte[],uint8,uint256)bool"] | Arc200Args["tuple"]["bootstrap(byte[],byte[],uint8,uint256)bool"]> & SendParams & {
|
|
914
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
915
|
+
}) => Promise<{
|
|
916
|
+
return: undefined | Arc200Returns["bootstrap(byte[],byte[],uint8,uint256)bool"];
|
|
917
|
+
returns?: ABIReturn[] | undefined | undefined;
|
|
918
|
+
groupId: string;
|
|
919
|
+
txIds: string[];
|
|
920
|
+
confirmations: modelsv2.PendingTransactionResponse[];
|
|
921
|
+
transactions: Transaction[];
|
|
922
|
+
confirmation: modelsv2.PendingTransactionResponse;
|
|
923
|
+
transaction: Transaction;
|
|
924
|
+
}>;
|
|
925
|
+
/**
|
|
926
|
+
* Makes a call to the Arc200 smart contract using the `arc200_name()byte[32]` ABI method.
|
|
927
|
+
*
|
|
928
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
929
|
+
*
|
|
930
|
+
* Returns the name of the token
|
|
931
|
+
*
|
|
932
|
+
* @param params The params for the smart contract call
|
|
933
|
+
* @returns The call result: The name of the token
|
|
934
|
+
*/
|
|
935
|
+
arc200Name: (params?: CallParams<Arc200Args["obj"]["arc200_name()byte[32]"] | Arc200Args["tuple"]["arc200_name()byte[32]"]> & SendParams & {
|
|
936
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
937
|
+
}) => Promise<{
|
|
938
|
+
return: undefined | Arc200Returns["arc200_name()byte[32]"];
|
|
939
|
+
returns?: ABIReturn[] | undefined | undefined;
|
|
940
|
+
groupId: string;
|
|
941
|
+
txIds: string[];
|
|
942
|
+
confirmations: modelsv2.PendingTransactionResponse[];
|
|
943
|
+
transactions: Transaction[];
|
|
944
|
+
confirmation: modelsv2.PendingTransactionResponse;
|
|
945
|
+
transaction: Transaction;
|
|
946
|
+
}>;
|
|
947
|
+
/**
|
|
948
|
+
* Makes a call to the Arc200 smart contract using the `arc200_symbol()byte[8]` ABI method.
|
|
949
|
+
*
|
|
950
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
951
|
+
*
|
|
952
|
+
* Returns the symbol of the token
|
|
953
|
+
*
|
|
954
|
+
* @param params The params for the smart contract call
|
|
955
|
+
* @returns The call result: The symbol of the token
|
|
956
|
+
*/
|
|
957
|
+
arc200Symbol: (params?: CallParams<Arc200Args["obj"]["arc200_symbol()byte[8]"] | Arc200Args["tuple"]["arc200_symbol()byte[8]"]> & SendParams & {
|
|
958
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
959
|
+
}) => Promise<{
|
|
960
|
+
return: undefined | Arc200Returns["arc200_symbol()byte[8]"];
|
|
961
|
+
returns?: ABIReturn[] | undefined | undefined;
|
|
962
|
+
groupId: string;
|
|
963
|
+
txIds: string[];
|
|
964
|
+
confirmations: modelsv2.PendingTransactionResponse[];
|
|
965
|
+
transactions: Transaction[];
|
|
966
|
+
confirmation: modelsv2.PendingTransactionResponse;
|
|
967
|
+
transaction: Transaction;
|
|
968
|
+
}>;
|
|
969
|
+
/**
|
|
970
|
+
* Makes a call to the Arc200 smart contract using the `arc200_decimals()uint8` ABI method.
|
|
971
|
+
*
|
|
972
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
973
|
+
*
|
|
974
|
+
* Returns the decimals of the token
|
|
975
|
+
*
|
|
976
|
+
* @param params The params for the smart contract call
|
|
977
|
+
* @returns The call result: The decimals of the token
|
|
978
|
+
*/
|
|
979
|
+
arc200Decimals: (params?: CallParams<Arc200Args["obj"]["arc200_decimals()uint8"] | Arc200Args["tuple"]["arc200_decimals()uint8"]> & SendParams & {
|
|
980
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
981
|
+
}) => Promise<{
|
|
982
|
+
return: undefined | Arc200Returns["arc200_decimals()uint8"];
|
|
983
|
+
returns?: ABIReturn[] | undefined | undefined;
|
|
984
|
+
groupId: string;
|
|
985
|
+
txIds: string[];
|
|
986
|
+
confirmations: modelsv2.PendingTransactionResponse[];
|
|
987
|
+
transactions: Transaction[];
|
|
988
|
+
confirmation: modelsv2.PendingTransactionResponse;
|
|
989
|
+
transaction: Transaction;
|
|
990
|
+
}>;
|
|
443
991
|
/**
|
|
444
|
-
*
|
|
992
|
+
* Makes a call to the Arc200 smart contract using the `arc200_totalSupply()uint256` ABI method.
|
|
993
|
+
*
|
|
994
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
995
|
+
*
|
|
996
|
+
* Returns the total supply of the token
|
|
997
|
+
*
|
|
998
|
+
* @param params The params for the smart contract call
|
|
999
|
+
* @returns The call result: The total supply of the token
|
|
1000
|
+
*/
|
|
1001
|
+
arc200TotalSupply: (params?: CallParams<Arc200Args["obj"]["arc200_totalSupply()uint256"] | Arc200Args["tuple"]["arc200_totalSupply()uint256"]> & SendParams & {
|
|
1002
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
1003
|
+
}) => Promise<{
|
|
1004
|
+
return: undefined | Arc200Returns["arc200_totalSupply()uint256"];
|
|
1005
|
+
returns?: ABIReturn[] | undefined | undefined;
|
|
1006
|
+
groupId: string;
|
|
1007
|
+
txIds: string[];
|
|
1008
|
+
confirmations: modelsv2.PendingTransactionResponse[];
|
|
1009
|
+
transactions: Transaction[];
|
|
1010
|
+
confirmation: modelsv2.PendingTransactionResponse;
|
|
1011
|
+
transaction: Transaction;
|
|
1012
|
+
}>;
|
|
1013
|
+
/**
|
|
1014
|
+
* Makes a call to the Arc200 smart contract using the `arc200_balanceOf(address)uint256` ABI method.
|
|
1015
|
+
*
|
|
1016
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
1017
|
+
*
|
|
1018
|
+
* Returns the current balance of the owner of the token
|
|
1019
|
+
*
|
|
1020
|
+
* @param params The params for the smart contract call
|
|
1021
|
+
* @returns The call result: The current balance of the holder of the token
|
|
1022
|
+
*/
|
|
1023
|
+
arc200BalanceOf: (params: CallParams<Arc200Args["obj"]["arc200_balanceOf(address)uint256"] | Arc200Args["tuple"]["arc200_balanceOf(address)uint256"]> & SendParams & {
|
|
1024
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
1025
|
+
}) => Promise<{
|
|
1026
|
+
return: undefined | Arc200Returns["arc200_balanceOf(address)uint256"];
|
|
1027
|
+
returns?: ABIReturn[] | undefined | undefined;
|
|
1028
|
+
groupId: string;
|
|
1029
|
+
txIds: string[];
|
|
1030
|
+
confirmations: modelsv2.PendingTransactionResponse[];
|
|
1031
|
+
transactions: Transaction[];
|
|
1032
|
+
confirmation: modelsv2.PendingTransactionResponse;
|
|
1033
|
+
transaction: Transaction;
|
|
1034
|
+
}>;
|
|
1035
|
+
/**
|
|
1036
|
+
* Makes a call to the Arc200 smart contract using the `arc200_transfer(address,uint256)bool` ABI method.
|
|
1037
|
+
*
|
|
1038
|
+
* Transfers tokens
|
|
1039
|
+
*
|
|
1040
|
+
* @param params The params for the smart contract call
|
|
1041
|
+
* @returns The call result: Success
|
|
1042
|
+
*/
|
|
1043
|
+
arc200Transfer: (params: CallParams<Arc200Args["obj"]["arc200_transfer(address,uint256)bool"] | Arc200Args["tuple"]["arc200_transfer(address,uint256)bool"]> & SendParams & {
|
|
1044
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
1045
|
+
}) => Promise<{
|
|
1046
|
+
return: undefined | Arc200Returns["arc200_transfer(address,uint256)bool"];
|
|
1047
|
+
returns?: ABIReturn[] | undefined | undefined;
|
|
1048
|
+
groupId: string;
|
|
1049
|
+
txIds: string[];
|
|
1050
|
+
confirmations: modelsv2.PendingTransactionResponse[];
|
|
1051
|
+
transactions: Transaction[];
|
|
1052
|
+
confirmation: modelsv2.PendingTransactionResponse;
|
|
1053
|
+
transaction: Transaction;
|
|
1054
|
+
}>;
|
|
1055
|
+
/**
|
|
1056
|
+
* Makes a call to the Arc200 smart contract using the `arc200_transferFrom(address,address,uint256)bool` ABI method.
|
|
1057
|
+
*
|
|
1058
|
+
* Transfers tokens from source to destination as approved spender
|
|
1059
|
+
*
|
|
1060
|
+
* @param params The params for the smart contract call
|
|
1061
|
+
* @returns The call result: Success
|
|
1062
|
+
*/
|
|
1063
|
+
arc200TransferFrom: (params: CallParams<Arc200Args["obj"]["arc200_transferFrom(address,address,uint256)bool"] | Arc200Args["tuple"]["arc200_transferFrom(address,address,uint256)bool"]> & SendParams & {
|
|
1064
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
1065
|
+
}) => Promise<{
|
|
1066
|
+
return: undefined | Arc200Returns["arc200_transferFrom(address,address,uint256)bool"];
|
|
1067
|
+
returns?: ABIReturn[] | undefined | undefined;
|
|
1068
|
+
groupId: string;
|
|
1069
|
+
txIds: string[];
|
|
1070
|
+
confirmations: modelsv2.PendingTransactionResponse[];
|
|
1071
|
+
transactions: Transaction[];
|
|
1072
|
+
confirmation: modelsv2.PendingTransactionResponse;
|
|
1073
|
+
transaction: Transaction;
|
|
1074
|
+
}>;
|
|
1075
|
+
/**
|
|
1076
|
+
* Makes a call to the Arc200 smart contract using the `arc200_approve(address,uint256)bool` ABI method.
|
|
1077
|
+
*
|
|
1078
|
+
* Approve spender for a token
|
|
1079
|
+
*
|
|
1080
|
+
* @param params The params for the smart contract call
|
|
1081
|
+
* @returns The call result: Success
|
|
1082
|
+
*/
|
|
1083
|
+
arc200Approve: (params: CallParams<Arc200Args["obj"]["arc200_approve(address,uint256)bool"] | Arc200Args["tuple"]["arc200_approve(address,uint256)bool"]> & SendParams & {
|
|
1084
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
1085
|
+
}) => Promise<{
|
|
1086
|
+
return: undefined | Arc200Returns["arc200_approve(address,uint256)bool"];
|
|
1087
|
+
returns?: ABIReturn[] | undefined | undefined;
|
|
1088
|
+
groupId: string;
|
|
1089
|
+
txIds: string[];
|
|
1090
|
+
confirmations: modelsv2.PendingTransactionResponse[];
|
|
1091
|
+
transactions: Transaction[];
|
|
1092
|
+
confirmation: modelsv2.PendingTransactionResponse;
|
|
1093
|
+
transaction: Transaction;
|
|
1094
|
+
}>;
|
|
1095
|
+
/**
|
|
1096
|
+
* Makes a call to the Arc200 smart contract using the `arc200_allowance(address,address)uint256` ABI method.
|
|
1097
|
+
*
|
|
1098
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
1099
|
+
*
|
|
1100
|
+
* Returns the current allowance of the spender of the tokens of the owner
|
|
445
1101
|
*
|
|
446
|
-
* @param
|
|
447
|
-
* @
|
|
448
|
-
* @returns The create result
|
|
1102
|
+
* @param params The params for the smart contract call
|
|
1103
|
+
* @returns The call result: The remaining allowance
|
|
449
1104
|
*/
|
|
450
|
-
|
|
1105
|
+
arc200Allowance: (params: CallParams<Arc200Args["obj"]["arc200_allowance(address,address)uint256"] | Arc200Args["tuple"]["arc200_allowance(address,address)uint256"]> & SendParams & {
|
|
1106
|
+
onComplete?: OnApplicationComplete.NoOpOC;
|
|
1107
|
+
}) => Promise<{
|
|
1108
|
+
return: undefined | Arc200Returns["arc200_allowance(address,address)uint256"];
|
|
1109
|
+
returns?: ABIReturn[] | undefined | undefined;
|
|
1110
|
+
groupId: string;
|
|
1111
|
+
txIds: string[];
|
|
1112
|
+
confirmations: modelsv2.PendingTransactionResponse[];
|
|
1113
|
+
transactions: Transaction[];
|
|
1114
|
+
confirmation: modelsv2.PendingTransactionResponse;
|
|
1115
|
+
transaction: Transaction;
|
|
1116
|
+
}>;
|
|
451
1117
|
};
|
|
452
1118
|
/**
|
|
453
|
-
*
|
|
1119
|
+
* Clone this app client with different params
|
|
454
1120
|
*
|
|
455
|
-
* @param
|
|
456
|
-
* @returns
|
|
1121
|
+
* @param params The params to use for the the cloned app client. Omit a param to keep the original value. Set a param to override the original value. Setting to undefined will clear the original value.
|
|
1122
|
+
* @returns A new app client with the altered params
|
|
457
1123
|
*/
|
|
458
|
-
|
|
1124
|
+
clone(params: CloneAppClientParams): Arc200Client;
|
|
459
1125
|
/**
|
|
460
|
-
*
|
|
1126
|
+
* Makes a readonly (simulated) call to the Arc200 smart contract using the `arc200_name()byte[32]` ABI method.
|
|
1127
|
+
*
|
|
1128
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
461
1129
|
*
|
|
462
1130
|
* Returns the name of the token
|
|
463
1131
|
*
|
|
464
|
-
* @param
|
|
465
|
-
* @
|
|
466
|
-
* @returns The result of the call: The name of the token
|
|
1132
|
+
* @param params The params for the smart contract call
|
|
1133
|
+
* @returns The call result: The name of the token
|
|
467
1134
|
*/
|
|
468
|
-
arc200Name(
|
|
1135
|
+
arc200Name(params?: CallParams<Arc200Args['obj']['arc200_name()byte[32]'] | Arc200Args['tuple']['arc200_name()byte[32]']>): Promise<Uint8Array<ArrayBufferLike>>;
|
|
469
1136
|
/**
|
|
470
|
-
*
|
|
1137
|
+
* Makes a readonly (simulated) call to the Arc200 smart contract using the `arc200_symbol()byte[8]` ABI method.
|
|
1138
|
+
*
|
|
1139
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
471
1140
|
*
|
|
472
1141
|
* Returns the symbol of the token
|
|
473
1142
|
*
|
|
474
|
-
* @param
|
|
475
|
-
* @
|
|
476
|
-
* @returns The result of the call: The symbol of the token
|
|
1143
|
+
* @param params The params for the smart contract call
|
|
1144
|
+
* @returns The call result: The symbol of the token
|
|
477
1145
|
*/
|
|
478
|
-
arc200Symbol(
|
|
1146
|
+
arc200Symbol(params?: CallParams<Arc200Args['obj']['arc200_symbol()byte[8]'] | Arc200Args['tuple']['arc200_symbol()byte[8]']>): Promise<Uint8Array<ArrayBufferLike>>;
|
|
479
1147
|
/**
|
|
480
|
-
*
|
|
1148
|
+
* Makes a readonly (simulated) call to the Arc200 smart contract using the `arc200_decimals()uint8` ABI method.
|
|
1149
|
+
*
|
|
1150
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
481
1151
|
*
|
|
482
1152
|
* Returns the decimals of the token
|
|
483
1153
|
*
|
|
484
|
-
* @param
|
|
485
|
-
* @
|
|
486
|
-
* @returns The result of the call: The decimals of the token
|
|
1154
|
+
* @param params The params for the smart contract call
|
|
1155
|
+
* @returns The call result: The decimals of the token
|
|
487
1156
|
*/
|
|
488
|
-
arc200Decimals(
|
|
1157
|
+
arc200Decimals(params?: CallParams<Arc200Args['obj']['arc200_decimals()uint8'] | Arc200Args['tuple']['arc200_decimals()uint8']>): Promise<number>;
|
|
489
1158
|
/**
|
|
490
|
-
*
|
|
1159
|
+
* Makes a readonly (simulated) call to the Arc200 smart contract using the `arc200_totalSupply()uint256` ABI method.
|
|
1160
|
+
*
|
|
1161
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
491
1162
|
*
|
|
492
1163
|
* Returns the total supply of the token
|
|
493
1164
|
*
|
|
494
|
-
* @param
|
|
495
|
-
* @
|
|
496
|
-
* @returns The result of the call: The total supply of the token
|
|
1165
|
+
* @param params The params for the smart contract call
|
|
1166
|
+
* @returns The call result: The total supply of the token
|
|
497
1167
|
*/
|
|
498
|
-
arc200TotalSupply(
|
|
1168
|
+
arc200TotalSupply(params?: CallParams<Arc200Args['obj']['arc200_totalSupply()uint256'] | Arc200Args['tuple']['arc200_totalSupply()uint256']>): Promise<bigint>;
|
|
499
1169
|
/**
|
|
500
|
-
*
|
|
1170
|
+
* Makes a readonly (simulated) call to the Arc200 smart contract using the `arc200_balanceOf(address)uint256` ABI method.
|
|
1171
|
+
*
|
|
1172
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
501
1173
|
*
|
|
502
1174
|
* Returns the current balance of the owner of the token
|
|
503
1175
|
*
|
|
504
|
-
* @param
|
|
505
|
-
* @
|
|
506
|
-
* @returns The result of the call: The current balance of the holder of the token
|
|
1176
|
+
* @param params The params for the smart contract call
|
|
1177
|
+
* @returns The call result: The current balance of the holder of the token
|
|
507
1178
|
*/
|
|
508
|
-
arc200BalanceOf(
|
|
1179
|
+
arc200BalanceOf(params: CallParams<Arc200Args['obj']['arc200_balanceOf(address)uint256'] | Arc200Args['tuple']['arc200_balanceOf(address)uint256']>): Promise<bigint>;
|
|
509
1180
|
/**
|
|
510
|
-
*
|
|
511
|
-
*
|
|
512
|
-
* Transfers tokens
|
|
1181
|
+
* Makes a readonly (simulated) call to the Arc200 smart contract using the `arc200_allowance(address,address)uint256` ABI method.
|
|
513
1182
|
*
|
|
514
|
-
*
|
|
515
|
-
* @param params Any additional parameters for the call
|
|
516
|
-
* @returns The result of the call: Success
|
|
517
|
-
*/
|
|
518
|
-
arc200Transfer(args: MethodArgs<'arc200_transfer(address,uint256)bool'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<boolean> & AppCallTransactionResult>;
|
|
519
|
-
/**
|
|
520
|
-
* Calls the arc200_transferFrom(address,address,uint256)bool ABI method.
|
|
1183
|
+
* This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.
|
|
521
1184
|
*
|
|
522
|
-
*
|
|
1185
|
+
* Returns the current allowance of the spender of the tokens of the owner
|
|
523
1186
|
*
|
|
524
|
-
* @param
|
|
525
|
-
* @
|
|
526
|
-
* @returns The result of the call: Success
|
|
1187
|
+
* @param params The params for the smart contract call
|
|
1188
|
+
* @returns The call result: The remaining allowance
|
|
527
1189
|
*/
|
|
528
|
-
|
|
1190
|
+
arc200Allowance(params: CallParams<Arc200Args['obj']['arc200_allowance(address,address)uint256'] | Arc200Args['tuple']['arc200_allowance(address,address)uint256']>): Promise<bigint>;
|
|
529
1191
|
/**
|
|
530
|
-
*
|
|
531
|
-
*
|
|
532
|
-
* Approve spender for a token
|
|
533
|
-
*
|
|
534
|
-
* @param args The arguments for the contract call
|
|
535
|
-
* @param params Any additional parameters for the call
|
|
536
|
-
* @returns The result of the call: Success
|
|
1192
|
+
* Methods to access state for the current Arc200 app
|
|
537
1193
|
*/
|
|
538
|
-
|
|
1194
|
+
state: {
|
|
1195
|
+
/**
|
|
1196
|
+
* Methods to access global state for the current Arc200 app
|
|
1197
|
+
*/
|
|
1198
|
+
global: {
|
|
1199
|
+
/**
|
|
1200
|
+
* Get all current keyed values from global state
|
|
1201
|
+
*/
|
|
1202
|
+
getAll: () => Promise<Partial<Expand<GlobalKeysState>>>;
|
|
1203
|
+
/**
|
|
1204
|
+
* Get the current value of the name key in global state
|
|
1205
|
+
*/
|
|
1206
|
+
name: () => Promise<Uint8Array | undefined>;
|
|
1207
|
+
/**
|
|
1208
|
+
* Get the current value of the symbol key in global state
|
|
1209
|
+
*/
|
|
1210
|
+
symbol: () => Promise<Uint8Array | undefined>;
|
|
1211
|
+
/**
|
|
1212
|
+
* Get the current value of the decimals key in global state
|
|
1213
|
+
*/
|
|
1214
|
+
decimals: () => Promise<number | undefined>;
|
|
1215
|
+
/**
|
|
1216
|
+
* Get the current value of the totalSupply key in global state
|
|
1217
|
+
*/
|
|
1218
|
+
totalSupply: () => Promise<bigint | undefined>;
|
|
1219
|
+
};
|
|
1220
|
+
/**
|
|
1221
|
+
* Methods to access box state for the current Arc200 app
|
|
1222
|
+
*/
|
|
1223
|
+
box: {
|
|
1224
|
+
/**
|
|
1225
|
+
* Get all current keyed values from box state
|
|
1226
|
+
*/
|
|
1227
|
+
getAll: () => Promise<Partial<Expand<BoxKeysState>>>;
|
|
1228
|
+
/**
|
|
1229
|
+
* Get values from the balances map in box state
|
|
1230
|
+
*/
|
|
1231
|
+
balances: {
|
|
1232
|
+
/**
|
|
1233
|
+
* Get all current values of the balances map in box state
|
|
1234
|
+
*/
|
|
1235
|
+
getMap: () => Promise<Map<string, bigint>>;
|
|
1236
|
+
/**
|
|
1237
|
+
* Get a current value of the balances map by key from box state
|
|
1238
|
+
*/
|
|
1239
|
+
value: (key: string) => Promise<bigint | undefined>;
|
|
1240
|
+
};
|
|
1241
|
+
/**
|
|
1242
|
+
* Get values from the approvals map in box state
|
|
1243
|
+
*/
|
|
1244
|
+
approvals: {
|
|
1245
|
+
/**
|
|
1246
|
+
* Get all current values of the approvals map in box state
|
|
1247
|
+
*/
|
|
1248
|
+
getMap: () => Promise<Map<Uint8Array, ApprovalStruct>>;
|
|
1249
|
+
/**
|
|
1250
|
+
* Get a current value of the approvals map by key from box state
|
|
1251
|
+
*/
|
|
1252
|
+
value: (key: Uint8Array) => Promise<ApprovalStruct | undefined>;
|
|
1253
|
+
};
|
|
1254
|
+
};
|
|
1255
|
+
};
|
|
1256
|
+
newGroup(): Arc200Composer;
|
|
1257
|
+
}
|
|
1258
|
+
type Arc200Composer<TReturns extends [...any[]] = []> = {
|
|
539
1259
|
/**
|
|
540
|
-
* Calls the
|
|
541
|
-
*
|
|
542
|
-
* Returns the current allowance of the spender of the tokens of the owner
|
|
1260
|
+
* Calls the bootstrap(byte[],byte[],uint8,uint256)bool ABI method.
|
|
543
1261
|
*
|
|
544
1262
|
* @param args The arguments for the contract call
|
|
545
1263
|
* @param params Any additional parameters for the call
|
|
546
|
-
* @returns The
|
|
1264
|
+
* @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions
|
|
547
1265
|
*/
|
|
548
|
-
|
|
549
|
-
compose(): Arc200Composer;
|
|
550
|
-
}
|
|
551
|
-
type Arc200Composer<TReturns extends [...any[]] = []> = {
|
|
1266
|
+
bootstrap(params?: CallParams<Arc200Args['obj']['bootstrap(byte[],byte[],uint8,uint256)bool'] | Arc200Args['tuple']['bootstrap(byte[],byte[],uint8,uint256)bool']>): Arc200Composer<[...TReturns, Arc200Returns['bootstrap(byte[],byte[],uint8,uint256)bool'] | undefined]>;
|
|
552
1267
|
/**
|
|
553
|
-
* Calls the arc200_name()
|
|
1268
|
+
* Calls the arc200_name()byte[32] ABI method.
|
|
554
1269
|
*
|
|
555
1270
|
* Returns the name of the token
|
|
556
1271
|
*
|
|
@@ -558,9 +1273,9 @@ type Arc200Composer<TReturns extends [...any[]] = []> = {
|
|
|
558
1273
|
* @param params Any additional parameters for the call
|
|
559
1274
|
* @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions
|
|
560
1275
|
*/
|
|
561
|
-
arc200Name(
|
|
1276
|
+
arc200Name(params?: CallParams<Arc200Args['obj']['arc200_name()byte[32]'] | Arc200Args['tuple']['arc200_name()byte[32]']>): Arc200Composer<[...TReturns, Arc200Returns['arc200_name()byte[32]'] | undefined]>;
|
|
562
1277
|
/**
|
|
563
|
-
* Calls the arc200_symbol()
|
|
1278
|
+
* Calls the arc200_symbol()byte[8] ABI method.
|
|
564
1279
|
*
|
|
565
1280
|
* Returns the symbol of the token
|
|
566
1281
|
*
|
|
@@ -568,7 +1283,7 @@ type Arc200Composer<TReturns extends [...any[]] = []> = {
|
|
|
568
1283
|
* @param params Any additional parameters for the call
|
|
569
1284
|
* @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions
|
|
570
1285
|
*/
|
|
571
|
-
arc200Symbol(
|
|
1286
|
+
arc200Symbol(params?: CallParams<Arc200Args['obj']['arc200_symbol()byte[8]'] | Arc200Args['tuple']['arc200_symbol()byte[8]']>): Arc200Composer<[...TReturns, Arc200Returns['arc200_symbol()byte[8]'] | undefined]>;
|
|
572
1287
|
/**
|
|
573
1288
|
* Calls the arc200_decimals()uint8 ABI method.
|
|
574
1289
|
*
|
|
@@ -578,7 +1293,7 @@ type Arc200Composer<TReturns extends [...any[]] = []> = {
|
|
|
578
1293
|
* @param params Any additional parameters for the call
|
|
579
1294
|
* @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions
|
|
580
1295
|
*/
|
|
581
|
-
arc200Decimals(
|
|
1296
|
+
arc200Decimals(params?: CallParams<Arc200Args['obj']['arc200_decimals()uint8'] | Arc200Args['tuple']['arc200_decimals()uint8']>): Arc200Composer<[...TReturns, Arc200Returns['arc200_decimals()uint8'] | undefined]>;
|
|
582
1297
|
/**
|
|
583
1298
|
* Calls the arc200_totalSupply()uint256 ABI method.
|
|
584
1299
|
*
|
|
@@ -588,7 +1303,7 @@ type Arc200Composer<TReturns extends [...any[]] = []> = {
|
|
|
588
1303
|
* @param params Any additional parameters for the call
|
|
589
1304
|
* @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions
|
|
590
1305
|
*/
|
|
591
|
-
arc200TotalSupply(
|
|
1306
|
+
arc200TotalSupply(params?: CallParams<Arc200Args['obj']['arc200_totalSupply()uint256'] | Arc200Args['tuple']['arc200_totalSupply()uint256']>): Arc200Composer<[...TReturns, Arc200Returns['arc200_totalSupply()uint256'] | undefined]>;
|
|
592
1307
|
/**
|
|
593
1308
|
* Calls the arc200_balanceOf(address)uint256 ABI method.
|
|
594
1309
|
*
|
|
@@ -598,7 +1313,7 @@ type Arc200Composer<TReturns extends [...any[]] = []> = {
|
|
|
598
1313
|
* @param params Any additional parameters for the call
|
|
599
1314
|
* @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions
|
|
600
1315
|
*/
|
|
601
|
-
arc200BalanceOf(
|
|
1316
|
+
arc200BalanceOf(params?: CallParams<Arc200Args['obj']['arc200_balanceOf(address)uint256'] | Arc200Args['tuple']['arc200_balanceOf(address)uint256']>): Arc200Composer<[...TReturns, Arc200Returns['arc200_balanceOf(address)uint256'] | undefined]>;
|
|
602
1317
|
/**
|
|
603
1318
|
* Calls the arc200_transfer(address,uint256)bool ABI method.
|
|
604
1319
|
*
|
|
@@ -608,7 +1323,7 @@ type Arc200Composer<TReturns extends [...any[]] = []> = {
|
|
|
608
1323
|
* @param params Any additional parameters for the call
|
|
609
1324
|
* @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions
|
|
610
1325
|
*/
|
|
611
|
-
arc200Transfer(
|
|
1326
|
+
arc200Transfer(params?: CallParams<Arc200Args['obj']['arc200_transfer(address,uint256)bool'] | Arc200Args['tuple']['arc200_transfer(address,uint256)bool']>): Arc200Composer<[...TReturns, Arc200Returns['arc200_transfer(address,uint256)bool'] | undefined]>;
|
|
612
1327
|
/**
|
|
613
1328
|
* Calls the arc200_transferFrom(address,address,uint256)bool ABI method.
|
|
614
1329
|
*
|
|
@@ -618,7 +1333,7 @@ type Arc200Composer<TReturns extends [...any[]] = []> = {
|
|
|
618
1333
|
* @param params Any additional parameters for the call
|
|
619
1334
|
* @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions
|
|
620
1335
|
*/
|
|
621
|
-
arc200TransferFrom(
|
|
1336
|
+
arc200TransferFrom(params?: CallParams<Arc200Args['obj']['arc200_transferFrom(address,address,uint256)bool'] | Arc200Args['tuple']['arc200_transferFrom(address,address,uint256)bool']>): Arc200Composer<[...TReturns, Arc200Returns['arc200_transferFrom(address,address,uint256)bool'] | undefined]>;
|
|
622
1337
|
/**
|
|
623
1338
|
* Calls the arc200_approve(address,uint256)bool ABI method.
|
|
624
1339
|
*
|
|
@@ -628,7 +1343,7 @@ type Arc200Composer<TReturns extends [...any[]] = []> = {
|
|
|
628
1343
|
* @param params Any additional parameters for the call
|
|
629
1344
|
* @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions
|
|
630
1345
|
*/
|
|
631
|
-
arc200Approve(
|
|
1346
|
+
arc200Approve(params?: CallParams<Arc200Args['obj']['arc200_approve(address,uint256)bool'] | Arc200Args['tuple']['arc200_approve(address,uint256)bool']>): Arc200Composer<[...TReturns, Arc200Returns['arc200_approve(address,uint256)bool'] | undefined]>;
|
|
632
1347
|
/**
|
|
633
1348
|
* Calls the arc200_allowance(address,address)uint256 ABI method.
|
|
634
1349
|
*
|
|
@@ -638,52 +1353,55 @@ type Arc200Composer<TReturns extends [...any[]] = []> = {
|
|
|
638
1353
|
* @param params Any additional parameters for the call
|
|
639
1354
|
* @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions
|
|
640
1355
|
*/
|
|
641
|
-
arc200Allowance(
|
|
1356
|
+
arc200Allowance(params?: CallParams<Arc200Args['obj']['arc200_allowance(address,address)uint256'] | Arc200Args['tuple']['arc200_allowance(address,address)uint256']>): Arc200Composer<[...TReturns, Arc200Returns['arc200_allowance(address,address)uint256'] | undefined]>;
|
|
642
1357
|
/**
|
|
643
1358
|
* Makes a clear_state call to an existing instance of the Arc200 smart contract.
|
|
644
1359
|
*
|
|
645
1360
|
* @param args The arguments for the bare call
|
|
646
1361
|
* @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions
|
|
647
1362
|
*/
|
|
648
|
-
clearState(
|
|
1363
|
+
clearState(params?: AppClientBareCallParams): Arc200Composer<[...TReturns, undefined]>;
|
|
649
1364
|
/**
|
|
650
1365
|
* Adds a transaction to the composer
|
|
651
1366
|
*
|
|
652
|
-
* @param txn
|
|
653
|
-
* @param
|
|
1367
|
+
* @param txn A transaction to add to the transaction group
|
|
1368
|
+
* @param signer The optional signer to use when signing this transaction.
|
|
654
1369
|
*/
|
|
655
|
-
addTransaction(txn:
|
|
1370
|
+
addTransaction(txn: Transaction, signer?: TransactionSigner): Arc200Composer<TReturns>;
|
|
656
1371
|
/**
|
|
657
1372
|
* Returns the underlying AtomicTransactionComposer instance
|
|
658
1373
|
*/
|
|
659
|
-
|
|
1374
|
+
composer(): Promise<TransactionComposer>;
|
|
660
1375
|
/**
|
|
661
1376
|
* Simulates the transaction group and returns the result
|
|
662
1377
|
*/
|
|
663
|
-
simulate(
|
|
1378
|
+
simulate(): Promise<Arc200ComposerResults<TReturns> & {
|
|
1379
|
+
simulateResponse: modelsv2.SimulateResponse;
|
|
1380
|
+
}>;
|
|
1381
|
+
simulate(options: SkipSignaturesSimulateOptions): Promise<Arc200ComposerResults<TReturns> & {
|
|
1382
|
+
simulateResponse: modelsv2.SimulateResponse;
|
|
1383
|
+
}>;
|
|
1384
|
+
simulate(options: RawSimulateOptions): Promise<Arc200ComposerResults<TReturns> & {
|
|
1385
|
+
simulateResponse: modelsv2.SimulateResponse;
|
|
1386
|
+
}>;
|
|
664
1387
|
/**
|
|
665
|
-
*
|
|
1388
|
+
* Sends the transaction group to the network and returns the results
|
|
666
1389
|
*/
|
|
667
|
-
|
|
1390
|
+
send(params?: SendParams): Promise<Arc200ComposerResults<TReturns>>;
|
|
668
1391
|
};
|
|
669
|
-
type
|
|
670
|
-
type Arc200ComposerSimulateResult<TReturns extends [...any[]]> = {
|
|
1392
|
+
type Arc200ComposerResults<TReturns extends [...any[]]> = Expand<SendAtomicTransactionComposerResults & {
|
|
671
1393
|
returns: TReturns;
|
|
672
|
-
|
|
673
|
-
simulateResponse: modelsv2.SimulateResponse;
|
|
674
|
-
};
|
|
675
|
-
type Arc200ComposerResults<TReturns extends [...any[]]> = {
|
|
676
|
-
returns: TReturns;
|
|
677
|
-
groupId: string;
|
|
678
|
-
txIds: string[];
|
|
679
|
-
transactions: Transaction[];
|
|
680
|
-
};
|
|
1394
|
+
}>;
|
|
681
1395
|
|
|
682
1396
|
interface IGetClientInput {
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
1397
|
+
algorand: AlgorandClient$1;
|
|
1398
|
+
appId: bigint;
|
|
1399
|
+
appName: string | undefined;
|
|
1400
|
+
approvalSourceMap: ProgramSourceMap | undefined;
|
|
1401
|
+
clearSourceMap: ProgramSourceMap | undefined;
|
|
1402
|
+
defaultSender: string | Address | undefined;
|
|
1403
|
+
defaultSigner: TransactionSigner | undefined;
|
|
686
1404
|
}
|
|
687
1405
|
declare const getArc200Client: (input: IGetClientInput) => Arc200Client;
|
|
688
1406
|
|
|
689
|
-
export { getArc200Client };
|
|
1407
|
+
export { type ApprovalStruct, Arc200Client, Arc200Factory, getArc200Client };
|