@algorandfoundation/algokit-utils 9.2.0 → 9.2.1-beta.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/_virtual/_rolldown/runtime.js +33 -0
- package/_virtual/_rolldown/runtime.mjs +13 -0
- package/account/account.d.ts +25 -30
- package/account/account.js +151 -146
- package/account/account.js.map +1 -1
- package/account/account.mjs +149 -144
- package/account/account.mjs.map +1 -1
- package/account/get-account-config-from-environment.d.ts +7 -2
- package/account/get-account-config-from-environment.js +19 -21
- package/account/get-account-config-from-environment.js.map +1 -1
- package/account/get-account-config-from-environment.mjs +19 -19
- package/account/get-account-config-from-environment.mjs.map +1 -1
- package/account/get-account.d.ts +14 -12
- package/account/get-account.js +56 -59
- package/account/get-account.js.map +1 -1
- package/account/get-account.mjs +56 -57
- package/account/get-account.mjs.map +1 -1
- package/account/get-dispenser-account.d.ts +9 -5
- package/account/get-dispenser-account.js +20 -18
- package/account/get-dispenser-account.js.map +1 -1
- package/account/get-dispenser-account.mjs +20 -16
- package/account/get-dispenser-account.mjs.map +1 -1
- package/account/mnemonic-account.d.ts +7 -3
- package/account/mnemonic-account.js +17 -17
- package/account/mnemonic-account.js.map +1 -1
- package/account/mnemonic-account.mjs +15 -15
- package/account/mnemonic-account.mjs.map +1 -1
- package/amount.d.ts +40 -35
- package/amount.js +33 -34
- package/amount.js.map +1 -1
- package/amount.mjs +33 -32
- package/amount.mjs.map +1 -1
- package/app-client.d.ts +10 -6
- package/app-client.js +91 -86
- package/app-client.js.map +1 -1
- package/app-client.mjs +91 -84
- package/app-client.mjs.map +1 -1
- package/app-deploy.d.ts +26 -24
- package/app-deploy.js +235 -253
- package/app-deploy.js.map +1 -1
- package/app-deploy.mjs +233 -251
- package/app-deploy.mjs.map +1 -1
- package/app.d.ts +45 -46
- package/app.js +253 -271
- package/app.js.map +1 -1
- package/app.mjs +249 -267
- package/app.mjs.map +1 -1
- package/asset.d.ts +16 -12
- package/asset.js +116 -122
- package/asset.js.map +1 -1
- package/asset.mjs +116 -120
- package/asset.mjs.map +1 -1
- package/config.d.ts +7 -2
- package/config.js +5 -7
- package/config.js.map +1 -1
- package/config.mjs +5 -4
- package/config.mjs.map +1 -1
- package/debugging/debugging.d.ts +5 -1
- package/debugging/debugging.js +11 -11
- package/debugging/debugging.js.map +1 -1
- package/debugging/debugging.mjs +11 -9
- package/debugging/debugging.mjs.map +1 -1
- package/dispenser-client.d.ts +7 -2
- package/dispenser-client.js +23 -24
- package/dispenser-client.js.map +1 -1
- package/dispenser-client.mjs +23 -22
- package/dispenser-client.mjs.map +1 -1
- package/index.d.ts +27 -18
- package/index.js +140 -143
- package/index.mjs +27 -29
- package/indexer-lookup.d.ts +18 -11
- package/indexer-lookup.js +112 -120
- package/indexer-lookup.js.map +1 -1
- package/indexer-lookup.mjs +105 -118
- package/indexer-lookup.mjs.map +1 -1
- package/localnet/get-kmd-wallet-account.d.ts +9 -7
- package/localnet/get-kmd-wallet-account.js +28 -26
- package/localnet/get-kmd-wallet-account.js.map +1 -1
- package/localnet/get-kmd-wallet-account.mjs +28 -24
- package/localnet/get-kmd-wallet-account.mjs.map +1 -1
- package/localnet/get-localnet-dispenser-account.d.ts +7 -5
- package/localnet/get-localnet-dispenser-account.js +17 -15
- package/localnet/get-localnet-dispenser-account.js.map +1 -1
- package/localnet/get-localnet-dispenser-account.mjs +17 -13
- package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.d.ts +10 -8
- package/localnet/get-or-create-kmd-wallet-account.js +28 -26
- package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.mjs +28 -24
- package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
- package/localnet/is-localnet.d.ts +7 -3
- package/localnet/is-localnet.js +9 -10
- package/localnet/is-localnet.js.map +1 -1
- package/localnet/is-localnet.mjs +9 -8
- package/localnet/is-localnet.mjs.map +1 -1
- package/network-client.d.ts +17 -15
- package/network-client.js +115 -116
- package/network-client.js.map +1 -1
- package/network-client.mjs +115 -114
- package/network-client.mjs.map +1 -1
- package/package.json +12 -3
- package/testing/account.d.ts +11 -9
- package/testing/account.js +31 -33
- package/testing/account.js.map +1 -1
- package/testing/account.mjs +29 -31
- package/testing/account.mjs.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.d.ts +7 -2
- package/testing/fixtures/algokit-log-capture-fixture.js +36 -41
- package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.mjs +36 -39
- package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
- package/testing/fixtures/algorand-fixture.d.ts +9 -4
- package/testing/fixtures/algorand-fixture.js +67 -62
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs +66 -59
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/testing/index.d.ts +7 -5
- package/testing/index.js +13 -18
- package/testing/index.mjs +7 -7
- package/testing/indexer.d.ts +5 -1
- package/testing/indexer.js +28 -37
- package/testing/indexer.js.map +1 -1
- package/testing/indexer.mjs +28 -35
- package/testing/indexer.mjs.map +1 -1
- package/testing/test-logger.d.ts +41 -36
- package/testing/test-logger.js +71 -76
- package/testing/test-logger.js.map +1 -1
- package/testing/test-logger.mjs +71 -74
- package/testing/test-logger.mjs.map +1 -1
- package/testing/transaction-logger.d.ts +30 -27
- package/testing/transaction-logger.js +77 -93
- package/testing/transaction-logger.js.map +1 -1
- package/testing/transaction-logger.mjs +74 -90
- package/testing/transaction-logger.mjs.map +1 -1
- package/transaction/legacy-bridge.js +100 -111
- package/transaction/legacy-bridge.js.map +1 -1
- package/transaction/legacy-bridge.mjs +97 -108
- package/transaction/legacy-bridge.mjs.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.d.ts +7 -5
- package/transaction/perform-atomic-transaction-composer-simulate.js +31 -36
- package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.mjs +28 -33
- package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
- package/transaction/transaction.d.ts +34 -35
- package/transaction/transaction.js +716 -914
- package/transaction/transaction.js.map +1 -1
- package/transaction/transaction.mjs +713 -911
- package/transaction/transaction.mjs.map +1 -1
- package/transfer/transfer-algos.d.ts +9 -5
- package/transfer/transfer-algos.js +26 -27
- package/transfer/transfer-algos.js.map +1 -1
- package/transfer/transfer-algos.mjs +26 -25
- package/transfer/transfer-algos.mjs.map +1 -1
- package/transfer/transfer.d.ts +11 -8
- package/transfer/transfer.js +94 -100
- package/transfer/transfer.js.map +1 -1
- package/transfer/transfer.mjs +94 -98
- package/transfer/transfer.mjs.map +1 -1
- package/types/account-manager.d.ts +432 -429
- package/types/account-manager.js +591 -602
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +587 -599
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +192 -202
- package/types/account.js +91 -88
- package/types/account.js.map +1 -1
- package/types/account.mjs +88 -86
- package/types/account.mjs.map +1 -1
- package/types/algo-http-client-with-retry.d.ts +15 -10
- package/types/algo-http-client-with-retry.js +70 -92
- package/types/algo-http-client-with-retry.js.map +1 -1
- package/types/algo-http-client-with-retry.mjs +69 -90
- package/types/algo-http-client-with-retry.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +778 -771
- package/types/algorand-client-transaction-creator.js +733 -732
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +732 -730
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +1090 -1360
- package/types/algorand-client-transaction-sender.js +930 -961
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +927 -959
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/algorand-client.d.ts +239 -236
- package/types/algorand-client.js +322 -320
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +321 -318
- package/types/algorand-client.mjs.map +1 -1
- package/types/amount.d.ts +47 -43
- package/types/amount.js +66 -70
- package/types/amount.js.map +1 -1
- package/types/amount.mjs +63 -68
- package/types/amount.mjs.map +1 -1
- package/types/app-arc56.d.ts +235 -272
- package/types/app-arc56.js +124 -170
- package/types/app-arc56.js.map +1 -1
- package/types/app-arc56.mjs +121 -168
- package/types/app-arc56.mjs.map +1 -1
- package/types/app-client.d.ts +1128 -2009
- package/types/app-client.js +1633 -1791
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +1624 -1783
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +139 -141
- package/types/app-deployer.js +344 -384
- package/types/app-deployer.js.map +1 -1
- package/types/app-deployer.mjs +341 -382
- package/types/app-deployer.mjs.map +1 -1
- package/types/app-factory.d.ts +762 -932
- package/types/app-factory.js +496 -488
- package/types/app-factory.js.map +1 -1
- package/types/app-factory.mjs +491 -484
- package/types/app-factory.mjs.map +1 -1
- package/types/app-manager.d.ts +304 -310
- package/types/app-manager.js +422 -475
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +419 -473
- package/types/app-manager.mjs.map +1 -1
- package/types/app-spec.d.ts +118 -117
- package/types/app-spec.js +125 -135
- package/types/app-spec.js.map +1 -1
- package/types/app-spec.mjs +121 -132
- package/types/app-spec.mjs.map +1 -1
- package/types/app.d.ts +229 -241
- package/types/app.js +36 -28
- package/types/app.js.map +1 -1
- package/types/app.mjs +33 -26
- package/types/app.mjs.map +1 -1
- package/types/asset-manager.d.ts +204 -199
- package/types/asset-manager.js +165 -174
- package/types/asset-manager.js.map +1 -1
- package/types/asset-manager.mjs +164 -172
- package/types/asset-manager.mjs.map +1 -1
- package/types/asset.d.ts +95 -91
- package/types/asset.js +0 -3
- package/types/asset.mjs +0 -2
- package/types/async-event-emitter.d.ts +18 -13
- package/types/async-event-emitter.js +37 -49
- package/types/async-event-emitter.js.map +1 -1
- package/types/async-event-emitter.mjs +36 -47
- package/types/async-event-emitter.mjs.map +1 -1
- package/types/client-manager.d.ts +453 -451
- package/types/client-manager.js +602 -598
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +597 -594
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +1211 -1258
- package/types/composer.js +1436 -1498
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +1430 -1493
- package/types/composer.mjs.map +1 -1
- package/types/config.d.ts +53 -48
- package/types/config.js +78 -77
- package/types/config.js.map +1 -1
- package/types/config.mjs +77 -75
- package/types/config.mjs.map +1 -1
- package/types/debugging.d.ts +25 -23
- package/types/debugging.js +9 -11
- package/types/debugging.js.map +1 -1
- package/types/debugging.mjs +8 -9
- package/types/debugging.mjs.map +1 -1
- package/types/dispenser-client.d.ts +57 -52
- package/types/dispenser-client.js +120 -141
- package/types/dispenser-client.js.map +1 -1
- package/types/dispenser-client.mjs +119 -139
- package/types/dispenser-client.mjs.map +1 -1
- package/types/expand.d.ts +5 -3
- package/types/expand.js +0 -3
- package/types/expand.mjs +0 -2
- package/types/indexer.d.ts +104 -100
- package/types/indexer.js +36 -31
- package/types/indexer.js.map +1 -1
- package/types/indexer.mjs +32 -30
- package/types/indexer.mjs.map +1 -1
- package/types/instance-of.d.ts +5 -3
- package/types/instance-of.js +0 -3
- package/types/instance-of.mjs +0 -2
- package/types/kmd-account-manager.d.ts +75 -70
- package/types/kmd-account-manager.js +150 -184
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +147 -182
- package/types/kmd-account-manager.mjs.map +1 -1
- package/types/lifecycle-events.d.ts +13 -8
- package/types/lifecycle-events.js +10 -7
- package/types/lifecycle-events.js.map +1 -1
- package/types/lifecycle-events.mjs +9 -7
- package/types/lifecycle-events.mjs.map +1 -1
- package/types/logging.d.ts +15 -11
- package/types/logging.js +30 -31
- package/types/logging.js.map +1 -1
- package/types/logging.mjs +29 -29
- package/types/logging.mjs.map +1 -1
- package/types/logic-error.d.ts +33 -29
- package/types/logic-error.js +50 -49
- package/types/logic-error.js.map +1 -1
- package/types/logic-error.mjs +49 -47
- package/types/logic-error.mjs.map +1 -1
- package/types/network-client.d.ts +32 -27
- package/types/network-client.js +10 -9
- package/types/network-client.js.map +1 -1
- package/types/network-client.mjs +9 -7
- package/types/network-client.mjs.map +1 -1
- package/types/testing.d.ts +131 -132
- package/types/testing.js +0 -3
- package/types/testing.mjs +0 -2
- package/types/transaction.d.ts +110 -110
- package/types/transaction.js +0 -3
- package/types/transaction.mjs +0 -2
- package/types/transfer.d.ts +70 -66
- package/types/transfer.js +0 -3
- package/types/transfer.mjs +0 -2
- package/util.js +73 -118
- package/util.js.map +1 -1
- package/util.mjs +73 -116
- package/util.mjs.map +1 -1
- package/account/index.d.ts +0 -5
- package/debugging/index.d.ts +0 -1
- package/index.js.map +0 -1
- package/index.mjs.map +0 -1
- package/localnet/index.d.ts +0 -4
- package/testing/_asset.d.ts +0 -3
- package/testing/fixtures/index.d.ts +0 -2
- package/testing/index.js.map +0 -1
- package/testing/index.mjs.map +0 -1
- package/transaction/index.d.ts +0 -2
- package/transaction/legacy-bridge.d.ts +0 -35
- package/transfer/index.d.ts +0 -2
- package/types/asset.js.map +0 -1
- package/types/asset.mjs.map +0 -1
- package/types/expand.js.map +0 -1
- package/types/expand.mjs.map +0 -1
- package/types/instance-of.js.map +0 -1
- package/types/instance-of.mjs.map +0 -1
- package/types/testing.js.map +0 -1
- package/types/testing.mjs.map +0 -1
- package/types/transaction.js.map +0 -1
- package/types/transaction.mjs.map +0 -1
- package/types/transfer.js.map +0 -1
- package/types/transfer.mjs.map +0 -1
- package/util.d.ts +0 -48
package/types/app-arc56.d.ts
CHANGED
|
@@ -1,47 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ABIReturn } from
|
|
3
|
-
import
|
|
1
|
+
import { Expand } from "./expand.js";
|
|
2
|
+
import { ABIReturn } from "./app.js";
|
|
3
|
+
import algosdk from "algosdk";
|
|
4
|
+
|
|
5
|
+
//#region src/types/app-arc56.d.ts
|
|
4
6
|
/** Type to describe an argument within an `Arc56Method`. */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
type Arc56MethodArg = Expand<Omit<Method['args'][number], 'type'> & {
|
|
8
|
+
type: algosdk.ABIArgumentType;
|
|
7
9
|
}>;
|
|
8
10
|
/** Type to describe a return type within an `Arc56Method`. */
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
type Arc56MethodReturnType = Expand<Omit<Method['returns'], 'type'> & {
|
|
12
|
+
type: algosdk.ABIReturnType;
|
|
11
13
|
}>;
|
|
12
14
|
/**
|
|
13
15
|
* Wrapper around `algosdk.ABIMethod` that represents an ARC-56 ABI method.
|
|
14
16
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
declare class Arc56Method extends algosdk.ABIMethod {
|
|
18
|
+
method: Method;
|
|
19
|
+
readonly args: Array<Arc56MethodArg>;
|
|
20
|
+
readonly returns: Arc56MethodReturnType;
|
|
21
|
+
constructor(method: Method);
|
|
22
|
+
toJSON(): Method;
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
25
|
* Returns the `ABITupleType` for the given ARC-56 struct definition
|
|
24
26
|
* @param struct The ARC-56 struct definition
|
|
25
27
|
* @returns The `ABITupleType`
|
|
26
28
|
*/
|
|
27
|
-
|
|
29
|
+
declare function getABITupleTypeFromABIStructDefinition(struct: StructField[], structs: Record<string, StructField[]>): algosdk.ABITupleType;
|
|
28
30
|
/**
|
|
29
31
|
* Converts a decoded ABI tuple as a struct.
|
|
30
32
|
* @param decodedABITuple The decoded ABI tuple value
|
|
31
33
|
* @param structFields The struct fields from an ARC-56 app spec
|
|
32
34
|
* @returns The struct as a Record<string, any>
|
|
33
35
|
*/
|
|
34
|
-
|
|
36
|
+
declare function getABIStructFromABITuple<TReturn extends ABIStruct = Record<string, any>>(decodedABITuple: algosdk.ABIValue[], structFields: StructField[], structs: Record<string, StructField[]>): TReturn;
|
|
35
37
|
/**
|
|
36
38
|
* Converts an ARC-56 struct as an ABI tuple.
|
|
37
39
|
* @param struct The struct to convert
|
|
38
40
|
* @param structFields The struct fields from an ARC-56 app spec
|
|
39
41
|
* @returns The struct as a decoded ABI tuple
|
|
40
42
|
*/
|
|
41
|
-
|
|
43
|
+
declare function getABITupleFromABIStruct(struct: ABIStruct, structFields: StructField[], structs: Record<string, StructField[]>): algosdk.ABIValue[];
|
|
42
44
|
/** Decoded ARC-56 struct as a struct rather than a tuple. */
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
type ABIStruct = {
|
|
46
|
+
[key: string]: ABIStruct | algosdk.ABIValue;
|
|
45
47
|
};
|
|
46
48
|
/**
|
|
47
49
|
* Returns the decoded ABI value (or struct for a struct type)
|
|
@@ -51,7 +53,7 @@ export type ABIStruct = {
|
|
|
51
53
|
* @param structs The defined ARC-56 structs
|
|
52
54
|
* @returns The decoded ABI value or struct
|
|
53
55
|
*/
|
|
54
|
-
|
|
56
|
+
declare function getABIDecodedValue(value: Uint8Array | number | bigint, type: string, structs: Record<string, StructField[]>): algosdk.ABIValue | ABIStruct;
|
|
55
57
|
/**
|
|
56
58
|
* Returns the ABI-encoded value for the given value.
|
|
57
59
|
* @param value The value to encode either already in encoded binary form (`Uint8Array`), a decoded ABI value or an ARC-56 struct
|
|
@@ -59,7 +61,7 @@ export declare function getABIDecodedValue(value: Uint8Array | number | bigint,
|
|
|
59
61
|
* @param structs The defined ARC-56 structs
|
|
60
62
|
* @returns The binary ABI-encoded value
|
|
61
63
|
*/
|
|
62
|
-
|
|
64
|
+
declare function getABIEncodedValue(value: Uint8Array | algosdk.ABIValue | ABIStruct, type: string, structs: Record<string, StructField[]>): Uint8Array;
|
|
63
65
|
/**
|
|
64
66
|
* Returns the ARC-56 ABI method object for a given method name or signature and ARC-56 app spec.
|
|
65
67
|
* @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.
|
|
@@ -67,7 +69,7 @@ export declare function getABIEncodedValue(value: Uint8Array | algosdk.ABIValue
|
|
|
67
69
|
* @param appSpec The app spec for the app
|
|
68
70
|
* @returns The `Arc56Method`
|
|
69
71
|
*/
|
|
70
|
-
|
|
72
|
+
declare function getArc56Method(methodNameOrSignature: string, appSpec: Arc56Contract): Arc56Method;
|
|
71
73
|
/**
|
|
72
74
|
* Checks for decode errors on the AppCallTransactionResult and maps the return value to the specified generic type
|
|
73
75
|
*
|
|
@@ -76,284 +78,245 @@ export declare function getArc56Method(methodNameOrSignature: string, appSpec: A
|
|
|
76
78
|
* @param structs The struct fields from the app spec
|
|
77
79
|
* @returns The smart contract response with an updated return value
|
|
78
80
|
*/
|
|
79
|
-
|
|
81
|
+
declare function getArc56ReturnValue<TReturn extends Uint8Array | algosdk.ABIValue | ABIStruct | undefined>(returnValue: ABIReturn | undefined, method: Method | Arc56Method, structs: Record<string, StructField[]>): TReturn;
|
|
80
82
|
/****************/
|
|
81
83
|
/** ARC-56 spec */
|
|
82
84
|
/****************/
|
|
83
85
|
/** Describes the entire contract. This interface is an extension of the interface described in ARC-4 */
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
appID: number;
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
/** Named structs used by the application. Each struct field appears in the same order as ABI encoding. */
|
|
105
|
-
structs: {
|
|
106
|
-
[structName: StructName]: StructField[];
|
|
107
|
-
};
|
|
108
|
-
/** All of the methods that the contract implements */
|
|
109
|
-
methods: Method[];
|
|
110
|
-
state: {
|
|
111
|
-
/** Defines the values that should be used for GlobalNumUint, GlobalNumByteSlice, LocalNumUint, and LocalNumByteSlice when creating the application */
|
|
112
|
-
schema: {
|
|
113
|
-
global: {
|
|
114
|
-
ints: number;
|
|
115
|
-
bytes: number;
|
|
116
|
-
};
|
|
117
|
-
local: {
|
|
118
|
-
ints: number;
|
|
119
|
-
bytes: number;
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
/** Mapping of human-readable names to StorageKey objects */
|
|
123
|
-
keys: {
|
|
124
|
-
global: {
|
|
125
|
-
[name: string]: StorageKey;
|
|
126
|
-
};
|
|
127
|
-
local: {
|
|
128
|
-
[name: string]: StorageKey;
|
|
129
|
-
};
|
|
130
|
-
box: {
|
|
131
|
-
[name: string]: StorageKey;
|
|
132
|
-
};
|
|
133
|
-
};
|
|
134
|
-
/** Mapping of human-readable names to StorageMap objects */
|
|
135
|
-
maps: {
|
|
136
|
-
global: {
|
|
137
|
-
[name: string]: StorageMap;
|
|
138
|
-
};
|
|
139
|
-
local: {
|
|
140
|
-
[name: string]: StorageMap;
|
|
141
|
-
};
|
|
142
|
-
box: {
|
|
143
|
-
[name: string]: StorageMap;
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
/** Supported bare actions for the contract. An action is a combination of call/create and an OnComplete */
|
|
148
|
-
bareActions: {
|
|
149
|
-
/** OnCompletes this method allows when appID === 0 */
|
|
150
|
-
create: ('NoOp' | 'OptIn' | 'DeleteApplication')[];
|
|
151
|
-
/** OnCompletes this method allows when appID !== 0 */
|
|
152
|
-
call: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[];
|
|
86
|
+
interface Arc56Contract {
|
|
87
|
+
/** The ARCs used and/or supported by this contract. All contracts implicitly support ARC4 and ARC56 */
|
|
88
|
+
arcs: number[];
|
|
89
|
+
/** A user-friendly name for the contract */
|
|
90
|
+
name: string;
|
|
91
|
+
/** Optional, user-friendly description for the interface */
|
|
92
|
+
desc?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Optional object listing the contract instances across different networks.
|
|
95
|
+
* The key is the base64 genesis hash of the network, and the value contains
|
|
96
|
+
* information about the deployed contract in the network indicated by the
|
|
97
|
+
* key. A key containing the human-readable name of the network MAY be
|
|
98
|
+
* included, but the corresponding genesis hash key MUST also be defined
|
|
99
|
+
*/
|
|
100
|
+
networks?: {
|
|
101
|
+
[network: string]: {
|
|
102
|
+
/** The app ID of the deployed contract in this network */appID: number;
|
|
153
103
|
};
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
104
|
+
};
|
|
105
|
+
/** Named structs used by the application. Each struct field appears in the same order as ABI encoding. */
|
|
106
|
+
structs: {
|
|
107
|
+
[structName: StructName]: StructField[];
|
|
108
|
+
};
|
|
109
|
+
/** All of the methods that the contract implements */
|
|
110
|
+
methods: Method[];
|
|
111
|
+
state: {
|
|
112
|
+
/** Defines the values that should be used for GlobalNumUint, GlobalNumByteSlice, LocalNumUint, and LocalNumByteSlice when creating the application */schema: {
|
|
113
|
+
global: {
|
|
114
|
+
ints: number;
|
|
115
|
+
bytes: number;
|
|
116
|
+
};
|
|
117
|
+
local: {
|
|
118
|
+
ints: number;
|
|
119
|
+
bytes: number;
|
|
120
|
+
};
|
|
121
|
+
}; /** Mapping of human-readable names to StorageKey objects */
|
|
122
|
+
keys: {
|
|
123
|
+
global: {
|
|
124
|
+
[name: string]: StorageKey;
|
|
125
|
+
};
|
|
126
|
+
local: {
|
|
127
|
+
[name: string]: StorageKey;
|
|
128
|
+
};
|
|
129
|
+
box: {
|
|
130
|
+
[name: string]: StorageKey;
|
|
131
|
+
};
|
|
132
|
+
}; /** Mapping of human-readable names to StorageMap objects */
|
|
133
|
+
maps: {
|
|
134
|
+
global: {
|
|
135
|
+
[name: string]: StorageMap;
|
|
136
|
+
};
|
|
137
|
+
local: {
|
|
138
|
+
[name: string]: StorageMap;
|
|
139
|
+
};
|
|
140
|
+
box: {
|
|
141
|
+
[name: string]: StorageMap;
|
|
142
|
+
};
|
|
160
143
|
};
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
144
|
+
};
|
|
145
|
+
/** Supported bare actions for the contract. An action is a combination of call/create and an OnComplete */
|
|
146
|
+
bareActions: {
|
|
147
|
+
/** OnCompletes this method allows when appID === 0 */create: ('NoOp' | 'OptIn' | 'DeleteApplication')[]; /** OnCompletes this method allows when appID !== 0 */
|
|
148
|
+
call: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[];
|
|
149
|
+
};
|
|
150
|
+
/** Information about the TEAL programs */
|
|
151
|
+
sourceInfo?: {
|
|
152
|
+
/** Approval program information */approval: ProgramSourceInfo; /** Clear program information */
|
|
153
|
+
clear: ProgramSourceInfo;
|
|
154
|
+
};
|
|
155
|
+
/** The pre-compiled TEAL that may contain template variables. MUST be omitted if included as part of ARC23 */
|
|
156
|
+
source?: {
|
|
157
|
+
/** The approval program */approval: string; /** The clear program */
|
|
158
|
+
clear: string;
|
|
159
|
+
};
|
|
160
|
+
/** The compiled bytecode for the application. MUST be omitted if included as part of ARC23 */
|
|
161
|
+
byteCode?: {
|
|
162
|
+
/** The approval program */approval: string; /** The clear program */
|
|
163
|
+
clear: string;
|
|
164
|
+
};
|
|
165
|
+
/** Information used to get the given byteCode and/or PC values in sourceInfo. MUST be given if byteCode or PC values are present */
|
|
166
|
+
compilerInfo?: {
|
|
167
|
+
/** The name of the compiler */compiler: 'algod' | 'puya'; /** Compiler version information */
|
|
168
|
+
compilerVersion: {
|
|
169
|
+
major: number;
|
|
170
|
+
minor: number;
|
|
171
|
+
patch: number;
|
|
172
|
+
commitHash?: string;
|
|
167
173
|
};
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
+
};
|
|
175
|
+
/** ARC-28 events that MAY be emitted by this contract */
|
|
176
|
+
events?: Array<Event>;
|
|
177
|
+
/** A mapping of template variable names as they appear in the TEAL (not including TMPL_ prefix) to their respective types and values (if applicable) */
|
|
178
|
+
templateVariables?: {
|
|
179
|
+
[name: string]: {
|
|
180
|
+
/** The type of the template variable */type: ABIType | AVMType | StructName; /** If given, the base64 encoded value used for the given app/program */
|
|
181
|
+
value?: string;
|
|
174
182
|
};
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
major: number;
|
|
182
|
-
minor: number;
|
|
183
|
-
patch: number;
|
|
184
|
-
commitHash?: string;
|
|
185
|
-
};
|
|
186
|
-
};
|
|
187
|
-
/** ARC-28 events that MAY be emitted by this contract */
|
|
188
|
-
events?: Array<Event>;
|
|
189
|
-
/** A mapping of template variable names as they appear in the TEAL (not including TMPL_ prefix) to their respective types and values (if applicable) */
|
|
190
|
-
templateVariables?: {
|
|
191
|
-
[name: string]: {
|
|
192
|
-
/** The type of the template variable */
|
|
193
|
-
type: ABIType | AVMType | StructName;
|
|
194
|
-
/** If given, the base64 encoded value used for the given app/program */
|
|
195
|
-
value?: string;
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
|
-
/** The scratch variables used during runtime */
|
|
199
|
-
scratchVariables?: {
|
|
200
|
-
[name: string]: {
|
|
201
|
-
slot: number;
|
|
202
|
-
type: ABIType | AVMType | StructName;
|
|
203
|
-
};
|
|
183
|
+
};
|
|
184
|
+
/** The scratch variables used during runtime */
|
|
185
|
+
scratchVariables?: {
|
|
186
|
+
[name: string]: {
|
|
187
|
+
slot: number;
|
|
188
|
+
type: ABIType | AVMType | StructName;
|
|
204
189
|
};
|
|
190
|
+
};
|
|
205
191
|
}
|
|
206
192
|
/** Describes a method in the contract. This interface is an extension of the interface described in ARC-4 */
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
* - box: The data key signifies the box key to read the value from
|
|
230
|
-
* - global: The data key signifies the global state key to read the value from
|
|
231
|
-
* - local: The data key signifies the local state key to read the value from (for the sender)
|
|
232
|
-
* - literal: the value is a literal and should be passed directly as the argument
|
|
233
|
-
* - method: The utf8 signature of the method in this contract to call to get the default value. If the method has arguments, they all must have default values. The method **MUST** be readonly so simulate can be used to get the default value
|
|
234
|
-
*/
|
|
235
|
-
source: 'box' | 'global' | 'local' | 'literal' | 'method';
|
|
236
|
-
};
|
|
237
|
-
}>;
|
|
238
|
-
/** Information about the method's return value */
|
|
239
|
-
returns: {
|
|
240
|
-
/** The type of the return value, or "void" to indicate no return value. The `struct` field should also be checked to determine if this return value is a struct. */
|
|
241
|
-
type: ABIType;
|
|
242
|
-
/** If the type is a struct, the name of the struct */
|
|
243
|
-
struct?: StructName;
|
|
244
|
-
/** Optional, user-friendly description for the return value */
|
|
245
|
-
desc?: string;
|
|
246
|
-
};
|
|
247
|
-
/** an action is a combination of call/create and an OnComplete */
|
|
248
|
-
actions: {
|
|
249
|
-
/** OnCompletes this method allows when appID === 0 */
|
|
250
|
-
create: ('NoOp' | 'OptIn' | 'DeleteApplication')[];
|
|
251
|
-
/** OnCompletes this method allows when appID !== 0 */
|
|
252
|
-
call: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[];
|
|
253
|
-
};
|
|
254
|
-
/** If this method does not write anything to the ledger (ARC-22) */
|
|
255
|
-
readonly?: boolean;
|
|
256
|
-
/** ARC-28 events that MAY be emitted by this method */
|
|
257
|
-
events?: Array<Event>;
|
|
258
|
-
/** Information that clients can use when calling the method */
|
|
259
|
-
recommendations?: {
|
|
260
|
-
/** The number of inner transactions the caller should cover the fees for */
|
|
261
|
-
innerTransactionCount?: number;
|
|
262
|
-
/** Recommended box references to include */
|
|
263
|
-
boxes?: {
|
|
264
|
-
/** The app ID for the box */
|
|
265
|
-
app?: number;
|
|
266
|
-
/** The base64 encoded box key */
|
|
267
|
-
key: string;
|
|
268
|
-
/** The number of bytes being read from the box */
|
|
269
|
-
readBytes: number;
|
|
270
|
-
/** The number of bytes being written to the box */
|
|
271
|
-
writeBytes: number;
|
|
272
|
-
};
|
|
273
|
-
/** Recommended foreign accounts */
|
|
274
|
-
accounts?: string[];
|
|
275
|
-
/** Recommended foreign apps */
|
|
276
|
-
apps?: number[];
|
|
277
|
-
/** Recommended foreign assets */
|
|
278
|
-
assets?: number[];
|
|
193
|
+
interface Method {
|
|
194
|
+
/** The name of the method */
|
|
195
|
+
name: string;
|
|
196
|
+
/** Optional, user-friendly description for the method */
|
|
197
|
+
desc?: string;
|
|
198
|
+
/** The arguments of the method, in order */
|
|
199
|
+
args: Array<{
|
|
200
|
+
/** The type of the argument. The `struct` field should also be checked to determine if this arg is a struct. */type: ABIType; /** If the type is a struct, the name of the struct */
|
|
201
|
+
struct?: StructName; /** Optional, user-friendly name for the argument */
|
|
202
|
+
name?: string; /** Optional, user-friendly description for the argument */
|
|
203
|
+
desc?: string; /** The default value that clients should use. */
|
|
204
|
+
defaultValue?: {
|
|
205
|
+
/** Base64 encoded bytes, base64 ARC4 encoded uint64, or UTF-8 method selector */data: string; /** How the data is encoded. This is the encoding for the data provided here, not the arg type */
|
|
206
|
+
type?: ABIType | AVMType;
|
|
207
|
+
/** Where the default value is coming from
|
|
208
|
+
* - box: The data key signifies the box key to read the value from
|
|
209
|
+
* - global: The data key signifies the global state key to read the value from
|
|
210
|
+
* - local: The data key signifies the local state key to read the value from (for the sender)
|
|
211
|
+
* - literal: the value is a literal and should be passed directly as the argument
|
|
212
|
+
* - method: The utf8 signature of the method in this contract to call to get the default value. If the method has arguments, they all must have default values. The method **MUST** be readonly so simulate can be used to get the default value
|
|
213
|
+
*/
|
|
214
|
+
source: 'box' | 'global' | 'local' | 'literal' | 'method';
|
|
279
215
|
};
|
|
216
|
+
}>;
|
|
217
|
+
/** Information about the method's return value */
|
|
218
|
+
returns: {
|
|
219
|
+
/** The type of the return value, or "void" to indicate no return value. The `struct` field should also be checked to determine if this return value is a struct. */type: ABIType; /** If the type is a struct, the name of the struct */
|
|
220
|
+
struct?: StructName; /** Optional, user-friendly description for the return value */
|
|
221
|
+
desc?: string;
|
|
222
|
+
};
|
|
223
|
+
/** an action is a combination of call/create and an OnComplete */
|
|
224
|
+
actions: {
|
|
225
|
+
/** OnCompletes this method allows when appID === 0 */create: ('NoOp' | 'OptIn' | 'DeleteApplication')[]; /** OnCompletes this method allows when appID !== 0 */
|
|
226
|
+
call: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[];
|
|
227
|
+
};
|
|
228
|
+
/** If this method does not write anything to the ledger (ARC-22) */
|
|
229
|
+
readonly?: boolean;
|
|
230
|
+
/** ARC-28 events that MAY be emitted by this method */
|
|
231
|
+
events?: Array<Event>;
|
|
232
|
+
/** Information that clients can use when calling the method */
|
|
233
|
+
recommendations?: {
|
|
234
|
+
/** The number of inner transactions the caller should cover the fees for */innerTransactionCount?: number; /** Recommended box references to include */
|
|
235
|
+
boxes?: {
|
|
236
|
+
/** The app ID for the box */app?: number; /** The base64 encoded box key */
|
|
237
|
+
key: string; /** The number of bytes being read from the box */
|
|
238
|
+
readBytes: number; /** The number of bytes being written to the box */
|
|
239
|
+
writeBytes: number;
|
|
240
|
+
}; /** Recommended foreign accounts */
|
|
241
|
+
accounts?: string[]; /** Recommended foreign apps */
|
|
242
|
+
apps?: number[]; /** Recommended foreign assets */
|
|
243
|
+
assets?: number[];
|
|
244
|
+
};
|
|
280
245
|
}
|
|
281
246
|
/** ARC-28 event */
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
desc?: string;
|
|
295
|
-
/** If the type is a struct, the name of the struct */
|
|
296
|
-
struct?: StructName;
|
|
297
|
-
}>;
|
|
247
|
+
interface Event {
|
|
248
|
+
/** The name of the event */
|
|
249
|
+
name: string;
|
|
250
|
+
/** Optional, user-friendly description for the event */
|
|
251
|
+
desc?: string;
|
|
252
|
+
/** The arguments of the event, in order */
|
|
253
|
+
args: Array<{
|
|
254
|
+
/** The type of the argument. The `struct` field should also be checked to determine if this arg is a struct. */type: ABIType; /** Optional, user-friendly name for the argument */
|
|
255
|
+
name?: string; /** Optional, user-friendly description for the argument */
|
|
256
|
+
desc?: string; /** If the type is a struct, the name of the struct */
|
|
257
|
+
struct?: StructName;
|
|
258
|
+
}>;
|
|
298
259
|
}
|
|
299
260
|
/** An ABI-encoded type */
|
|
300
|
-
|
|
261
|
+
type ABIType = string;
|
|
301
262
|
/** The name of a defined struct */
|
|
302
|
-
|
|
263
|
+
type StructName = string;
|
|
303
264
|
/** Raw byteslice without the length prefixed that is specified in ARC-4 */
|
|
304
|
-
|
|
265
|
+
type AVMBytes = 'AVMBytes';
|
|
305
266
|
/** A utf-8 string without the length prefix that is specified in ARC-4 */
|
|
306
|
-
|
|
267
|
+
type AVMString = 'AVMString';
|
|
307
268
|
/** A 64-bit unsigned integer */
|
|
308
|
-
|
|
269
|
+
type AVMUint64 = 'AVMUint64';
|
|
309
270
|
/** A native AVM type */
|
|
310
|
-
|
|
271
|
+
type AVMType = AVMBytes | AVMString | AVMUint64;
|
|
311
272
|
/** Information about a single field in a struct */
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
273
|
+
interface StructField {
|
|
274
|
+
/** The name of the struct field */
|
|
275
|
+
name: string;
|
|
276
|
+
/** The type of the struct field's value */
|
|
277
|
+
type: ABIType | StructName | StructField[];
|
|
317
278
|
}
|
|
318
279
|
/** Describes a single key in app storage */
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
280
|
+
interface StorageKey {
|
|
281
|
+
/** Description of what this storage key holds */
|
|
282
|
+
desc?: string;
|
|
283
|
+
/** The type of the key */
|
|
284
|
+
keyType: ABIType | AVMType | StructName;
|
|
285
|
+
/** The type of the value */
|
|
286
|
+
valueType: ABIType | AVMType | StructName;
|
|
287
|
+
/** The bytes of the key encoded as base64 */
|
|
288
|
+
key: string;
|
|
328
289
|
}
|
|
329
290
|
/** Describes a mapping of key-value pairs in storage */
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
291
|
+
interface StorageMap {
|
|
292
|
+
/** Description of what the key-value pairs in this mapping hold */
|
|
293
|
+
desc?: string;
|
|
294
|
+
/** The type of the keys in the map */
|
|
295
|
+
keyType: ABIType | AVMType | StructName;
|
|
296
|
+
/** The type of the values in the map */
|
|
297
|
+
valueType: ABIType | AVMType | StructName;
|
|
298
|
+
/** The base64-encoded prefix of the map keys*/
|
|
299
|
+
prefix?: string;
|
|
339
300
|
}
|
|
340
301
|
interface SourceInfo {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
302
|
+
/** The program counter value(s). Could be offset if pcOffsetMethod is not "none" */
|
|
303
|
+
pc: Array<number>;
|
|
304
|
+
/** A human-readable string that describes the error when the program fails at the given PC */
|
|
305
|
+
errorMessage?: string;
|
|
306
|
+
/** The TEAL line number that corresponds to the given PC. RECOMMENDED to be used for development purposes, but not required for clients */
|
|
307
|
+
teal?: number;
|
|
308
|
+
/** The original source file and line number that corresponds to the given PC. RECOMMENDED to be used for development purposes, but not required for clients */
|
|
309
|
+
source?: string;
|
|
349
310
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
311
|
+
interface ProgramSourceInfo {
|
|
312
|
+
/** The source information for the program */
|
|
313
|
+
sourceInfo: SourceInfo[];
|
|
314
|
+
/** How the program counter offset is calculated
|
|
315
|
+
* - none: The pc values in sourceInfo are not offset
|
|
316
|
+
* - cblocks: The pc values in sourceInfo are offset by the PC of the first op following the last cblock at the top of the program
|
|
317
|
+
*/
|
|
318
|
+
pcOffsetMethod: 'none' | 'cblocks';
|
|
358
319
|
}
|
|
359
|
-
|
|
320
|
+
//#endregion
|
|
321
|
+
export { ABIStruct, ABIType, AVMBytes, AVMString, AVMType, AVMUint64, Arc56Contract, Arc56Method, Arc56MethodArg, Arc56MethodReturnType, Event, Method, ProgramSourceInfo, StorageKey, StorageMap, StructField, StructName, getABIDecodedValue, getABIEncodedValue, getABIStructFromABITuple, getABITupleFromABIStruct, getABITupleTypeFromABIStructDefinition, getArc56Method, getArc56ReturnValue };
|
|
322
|
+
//# sourceMappingURL=app-arc56.d.ts.map
|