@algorandfoundation/algokit-utils 1.0.0-beta.9 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/account.d.ts +41 -36
- package/account.d.ts.map +1 -1
- package/account.js +59 -44
- package/account.js.map +1 -1
- package/amount.d.ts +20 -0
- package/amount.d.ts.map +1 -0
- package/amount.js +36 -0
- package/amount.js.map +1 -0
- package/app-client.d.ts +14 -0
- package/app-client.d.ts.map +1 -0
- package/app-client.js +19 -0
- package/app-client.js.map +1 -0
- package/app-deploy.d.ts +95 -0
- package/app-deploy.d.ts.map +1 -0
- package/{deploy-app.js → app-deploy.js} +129 -119
- package/app-deploy.js.map +1 -0
- package/app.d.ts +112 -148
- package/app.d.ts.map +1 -1
- package/app.js +460 -143
- package/app.js.map +1 -1
- package/index.d.ts +6 -4
- package/index.d.ts.map +1 -1
- package/index.js +7 -4
- package/index.js.map +1 -1
- package/indexer-lookup.d.ts +11 -4
- package/indexer-lookup.d.ts.map +1 -1
- package/indexer-lookup.js +19 -9
- package/indexer-lookup.js.map +1 -1
- package/localnet.d.ts +10 -10
- package/localnet.d.ts.map +1 -1
- package/localnet.js +16 -16
- package/localnet.js.map +1 -1
- package/network-client.d.ts +15 -24
- package/network-client.d.ts.map +1 -1
- package/network-client.js +16 -16
- package/network-client.js.map +1 -1
- package/package.json +2 -2
- package/testing/account.d.ts +14 -0
- package/testing/account.d.ts.map +1 -0
- package/testing/account.js +31 -0
- package/testing/account.js.map +1 -0
- package/testing/fixtures/algokit-log-capture-fixture.d.ts +19 -0
- package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +1 -0
- package/testing/fixtures/algokit-log-capture-fixture.js +43 -0
- package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -0
- package/testing/fixtures/algorand-fixture.d.ts +24 -0
- package/testing/fixtures/algorand-fixture.d.ts.map +1 -0
- package/testing/fixtures/algorand-fixture.js +60 -0
- package/testing/fixtures/algorand-fixture.js.map +1 -0
- package/testing/fixtures/index.d.ts +3 -0
- package/testing/fixtures/index.d.ts.map +1 -0
- package/testing/fixtures/index.js +19 -0
- package/testing/fixtures/index.js.map +1 -0
- package/testing/index.d.ts +6 -0
- package/testing/index.d.ts.map +1 -0
- package/testing/index.js +22 -0
- package/testing/index.js.map +1 -0
- package/testing/indexer.d.ts +12 -0
- package/testing/indexer.d.ts.map +1 -0
- package/testing/indexer.js +40 -0
- package/testing/indexer.js.map +1 -0
- package/testing/test-logger.d.ts +41 -0
- package/testing/test-logger.d.ts.map +1 -0
- package/testing/test-logger.js +71 -0
- package/testing/test-logger.js.map +1 -0
- package/testing/transaction-logger.d.ts +29 -0
- package/testing/transaction-logger.d.ts.map +1 -0
- package/testing/transaction-logger.js +71 -0
- package/testing/transaction-logger.js.map +1 -0
- package/transaction.d.ts +55 -91
- package/transaction.d.ts.map +1 -1
- package/transaction.js +213 -155
- package/transaction.js.map +1 -1
- package/transfer.d.ts +14 -16
- package/transfer.d.ts.map +1 -1
- package/transfer.js +38 -4
- package/transfer.js.map +1 -1
- package/types/account.d.ts +55 -0
- package/types/account.d.ts.map +1 -0
- package/types/account.js +91 -0
- package/types/account.js.map +1 -0
- package/types/algo-http-client-with-retry.d.ts.map +1 -0
- package/{algo-http-client-with-retry.js → types/algo-http-client-with-retry.js} +3 -3
- package/types/algo-http-client-with-retry.js.map +1 -0
- package/types/algod.d.ts +28 -15
- package/types/algod.d.ts.map +1 -1
- package/{algo-amount.d.ts → types/amount.d.ts} +9 -3
- package/types/amount.d.ts.map +1 -0
- package/{algo-amount.js → types/amount.js} +13 -3
- package/types/amount.js.map +1 -0
- package/types/app-client.d.ts +282 -0
- package/types/app-client.d.ts.map +1 -0
- package/types/app-client.js +529 -0
- package/types/app-client.js.map +1 -0
- package/types/app-spec.d.ts +141 -0
- package/types/app-spec.d.ts.map +1 -0
- package/types/{appspec.js → app-spec.js} +5 -7
- package/types/app-spec.js.map +1 -0
- package/types/app.d.ts +285 -0
- package/types/app.d.ts.map +1 -0
- package/types/app.js +32 -0
- package/types/app.js.map +1 -0
- package/types/config.d.ts +32 -0
- package/types/config.d.ts.map +1 -0
- package/types/config.js +53 -0
- package/types/config.js.map +1 -0
- package/types/indexer.d.ts +368 -58
- package/types/indexer.d.ts.map +1 -1
- package/types/indexer.js +9 -0
- package/types/indexer.js.map +1 -1
- package/{config.d.ts → types/logging.d.ts} +2 -16
- package/types/logging.d.ts.map +1 -0
- package/{config.js → types/logging.js} +5 -24
- package/types/logging.js.map +1 -0
- package/types/logic-error.d.ts +37 -0
- package/types/logic-error.d.ts.map +1 -0
- package/types/logic-error.js +50 -0
- package/types/logic-error.js.map +1 -0
- package/types/network-client.d.ts +11 -0
- package/types/network-client.d.ts.map +1 -0
- package/types/network-client.js +3 -0
- package/types/network-client.js.map +1 -0
- package/types/testing.d.ts +89 -0
- package/types/testing.d.ts.map +1 -0
- package/types/testing.js +3 -0
- package/types/testing.js.map +1 -0
- package/types/transaction.d.ts +112 -0
- package/types/transaction.d.ts.map +1 -0
- package/types/transaction.js +3 -0
- package/types/transaction.js.map +1 -0
- package/types/transfer.d.ts +32 -0
- package/types/transfer.d.ts.map +1 -0
- package/types/transfer.js +3 -0
- package/types/transfer.js.map +1 -0
- package/types/urlTokenBaseHTTPClient.d.ts.map +1 -0
- package/types/urlTokenBaseHTTPClient.js.map +1 -0
- package/algo-amount.d.ts.map +0 -1
- package/algo-amount.js.map +0 -1
- package/algo-http-client-with-retry.d.ts.map +0 -1
- package/algo-http-client-with-retry.js.map +0 -1
- package/application-client.d.ts +0 -113
- package/application-client.d.ts.map +0 -1
- package/application-client.js +0 -258
- package/application-client.js.map +0 -1
- package/config.d.ts.map +0 -1
- package/config.js.map +0 -1
- package/deploy-app.d.ts +0 -164
- package/deploy-app.d.ts.map +0 -1
- package/deploy-app.js.map +0 -1
- package/types/appspec.d.ts +0 -78
- package/types/appspec.d.ts.map +0 -1
- package/types/appspec.js.map +0 -1
- package/urlTokenBaseHTTPClient.d.ts.map +0 -1
- package/urlTokenBaseHTTPClient.js.map +0 -1
- /package/{algo-http-client-with-retry.d.ts → types/algo-http-client-with-retry.d.ts} +0 -0
- /package/{urlTokenBaseHTTPClient.d.ts → types/urlTokenBaseHTTPClient.d.ts} +0 -0
- /package/{urlTokenBaseHTTPClient.js → types/urlTokenBaseHTTPClient.js} +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { ABIContractParams } from 'algosdk';
|
|
2
|
+
/** An ARC-0032 Application Specification see https://github.com/algorandfoundation/ARCs/pull/150 */
|
|
3
|
+
export interface AppSpec {
|
|
4
|
+
/** Method call hints */
|
|
5
|
+
hints: HintSpec;
|
|
6
|
+
/** The TEAL source */
|
|
7
|
+
source: AppSources;
|
|
8
|
+
/** The ABI-0004 contract definition see https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0004.md */
|
|
9
|
+
contract: ABIContractParams;
|
|
10
|
+
/** The values that make up the local and global state */
|
|
11
|
+
schema: SchemaSpec;
|
|
12
|
+
/** The rolled-up schema allocation values for local and global state */
|
|
13
|
+
state: StateSchemaSpec;
|
|
14
|
+
/** The config of all BARE calls (i.e. non ABI calls with no args) */
|
|
15
|
+
bare_call_config: {
|
|
16
|
+
/** NoOp bare call config */
|
|
17
|
+
no_op?: CallConfigValue;
|
|
18
|
+
/** Opt-in bare call config */
|
|
19
|
+
opt_in?: CallConfigValue;
|
|
20
|
+
/** Close out bare call config */
|
|
21
|
+
close_out?: CallConfigValue;
|
|
22
|
+
/** Clear state bare call config */
|
|
23
|
+
clear_state?: CallConfigValue;
|
|
24
|
+
/** Update bare call config */
|
|
25
|
+
update_application?: CallConfigValue;
|
|
26
|
+
/** Delete bare call config */
|
|
27
|
+
delete_application?: CallConfigValue;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/** A lookup of encoded method call spec to hint */
|
|
31
|
+
export type HintSpec = Record<string, Hint>;
|
|
32
|
+
/** The TEAL source of a contract */
|
|
33
|
+
export interface AppSources {
|
|
34
|
+
/** The TEAL source of the approval program */
|
|
35
|
+
approval: string;
|
|
36
|
+
/** The TEAL source of the clear program */
|
|
37
|
+
clear: string;
|
|
38
|
+
}
|
|
39
|
+
/** The various call configs:
|
|
40
|
+
* * `NEVER`: Will not be called
|
|
41
|
+
* * `CALL`: Can be called during a non-create call i.e. app id != 0
|
|
42
|
+
* * `CREATE`: Can be called during a create call i.e. app id = 0
|
|
43
|
+
* * `ALL`: Can be during a create OR non-create call
|
|
44
|
+
**/
|
|
45
|
+
export type CallConfigValue = 'NEVER' | 'CALL' | 'CREATE' | 'ALL';
|
|
46
|
+
/** Hint information for a given method call to allow client generation */
|
|
47
|
+
export interface Hint {
|
|
48
|
+
/** Any user-defined struct/tuple types used in the method call, keyed by parameter name or `output` for return type */
|
|
49
|
+
structs: Record<string, Struct>;
|
|
50
|
+
readonly: boolean;
|
|
51
|
+
default_arguments: Record<string, DefaultArgument>;
|
|
52
|
+
call_config: {
|
|
53
|
+
no_op?: CallConfigValue;
|
|
54
|
+
opt_in?: CallConfigValue;
|
|
55
|
+
close_out?: CallConfigValue;
|
|
56
|
+
clear_state?: CallConfigValue;
|
|
57
|
+
update_application?: CallConfigValue;
|
|
58
|
+
delete_application?: CallConfigValue;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** The name of a field */
|
|
62
|
+
export type FieldName = string;
|
|
63
|
+
/** The string name of an ABI type */
|
|
64
|
+
export type ABIType = string;
|
|
65
|
+
/** The elements of the struct/tuple: `FieldName`, `ABIType` */
|
|
66
|
+
export type StructElement = [FieldName, ABIType];
|
|
67
|
+
/** A user-defined struct/tuple type */
|
|
68
|
+
export interface Struct {
|
|
69
|
+
/** The name of the type */
|
|
70
|
+
name: string;
|
|
71
|
+
/** The elements (in order) that make up the struct/tuple */
|
|
72
|
+
elements: StructElement[];
|
|
73
|
+
}
|
|
74
|
+
/** Any default argument specifications for the given parameter */
|
|
75
|
+
export interface DefaultArgument {
|
|
76
|
+
/** The source of the default argument value:
|
|
77
|
+
* * `global-state`: Global state; `data` is the name of the global state variable
|
|
78
|
+
* * `local-state`: Local state; `data` is the name of the local state variable
|
|
79
|
+
* * `abi-method`: ABI method call; `data` is the method spec of the ABI method to call
|
|
80
|
+
* * `constant`: A constant value; `data` is the value to use
|
|
81
|
+
*/
|
|
82
|
+
source: 'global-state' | 'local-state' | 'abi-method' | 'constant';
|
|
83
|
+
/** The name or value corresponding to the source */
|
|
84
|
+
data: string | bigint | number;
|
|
85
|
+
}
|
|
86
|
+
/** AVM data type */
|
|
87
|
+
export declare enum AVMType {
|
|
88
|
+
uint64 = 0,
|
|
89
|
+
bytes = 1
|
|
90
|
+
}
|
|
91
|
+
/** Declared schema value specification */
|
|
92
|
+
export interface DeclaredSchemaValueSpec {
|
|
93
|
+
/** The type of value */
|
|
94
|
+
type: AVMType;
|
|
95
|
+
/** The name of the key */
|
|
96
|
+
key: string;
|
|
97
|
+
/** A description of the variable */
|
|
98
|
+
desc?: string;
|
|
99
|
+
/** Whether or not the value is set statically (at create time only) or dynamically */
|
|
100
|
+
static: boolean;
|
|
101
|
+
}
|
|
102
|
+
/** Reserved schema value specification */
|
|
103
|
+
export interface ReservedSchemaValueSpec {
|
|
104
|
+
/** The type of value */
|
|
105
|
+
type: AVMType;
|
|
106
|
+
/** The description of the reserved storage space */
|
|
107
|
+
desc: string;
|
|
108
|
+
/** The maximum number of slots to reserve */
|
|
109
|
+
max_keys: number;
|
|
110
|
+
}
|
|
111
|
+
/** The schema for global and local storage */
|
|
112
|
+
export interface SchemaSpec {
|
|
113
|
+
/** The local storage schema */
|
|
114
|
+
local: Schema;
|
|
115
|
+
/** The global storage schema */
|
|
116
|
+
global: Schema;
|
|
117
|
+
}
|
|
118
|
+
/** The storage schema definition */
|
|
119
|
+
export interface Schema {
|
|
120
|
+
/** Declared storage schema */
|
|
121
|
+
declared: Record<string, DeclaredSchemaValueSpec>;
|
|
122
|
+
/** Reserved storage schema */
|
|
123
|
+
reserved: Record<string, ReservedSchemaValueSpec>;
|
|
124
|
+
}
|
|
125
|
+
/** The rolled-up schema allocation specification for local and global state */
|
|
126
|
+
export interface StateSchemaSpec {
|
|
127
|
+
/** Global storage spec */
|
|
128
|
+
global: StateSchema;
|
|
129
|
+
/** Local storage spec */
|
|
130
|
+
local: StateSchema;
|
|
131
|
+
}
|
|
132
|
+
/** Schema spec summary for global or local storage */
|
|
133
|
+
export type StateSchema = {
|
|
134
|
+
/** Number of uint slots */
|
|
135
|
+
num_uints: number;
|
|
136
|
+
/** Number of byte slots */
|
|
137
|
+
num_byte_slices: number;
|
|
138
|
+
};
|
|
139
|
+
/** @deprecated Use `algokit.getABIMethodSignature` instead */
|
|
140
|
+
export declare const getABISignature: (method: import("algosdk").ABIMethodParams | import("algosdk").ABIMethod) => string;
|
|
141
|
+
//# sourceMappingURL=app-spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-spec.d.ts","sourceRoot":"","sources":["../../src/types/app-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAG3C,oGAAoG;AACpG,MAAM,WAAW,OAAO;IACtB,wBAAwB;IACxB,KAAK,EAAE,QAAQ,CAAA;IACf,sBAAsB;IACtB,MAAM,EAAE,UAAU,CAAA;IAClB,iHAAiH;IACjH,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,yDAAyD;IACzD,MAAM,EAAE,UAAU,CAAA;IAClB,wEAAwE;IACxE,KAAK,EAAE,eAAe,CAAA;IACtB,qEAAqE;IACrE,gBAAgB,EAAE;QAChB,4BAA4B;QAC5B,KAAK,CAAC,EAAE,eAAe,CAAA;QACvB,8BAA8B;QAC9B,MAAM,CAAC,EAAE,eAAe,CAAA;QACxB,iCAAiC;QACjC,SAAS,CAAC,EAAE,eAAe,CAAA;QAC3B,mCAAmC;QACnC,WAAW,CAAC,EAAE,eAAe,CAAA;QAC7B,8BAA8B;QAC9B,kBA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AA;IACjB,2BAA2B;IAC3B,eAAe,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,8DAA8D;AAC9D,eAAO,MAAM,eAAe,qFAAwB,CAAA"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getABISignature = exports.AVMType = void 0;
|
|
4
|
+
const app_1 = require("../app");
|
|
5
|
+
/** AVM data type */
|
|
4
6
|
var AVMType;
|
|
5
7
|
(function (AVMType) {
|
|
6
8
|
AVMType[AVMType["uint64"] = 0] = "uint64";
|
|
7
9
|
AVMType[AVMType["bytes"] = 1] = "bytes";
|
|
8
10
|
})(AVMType = exports.AVMType || (exports.AVMType = {}));
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return `{${method.name}}(${argSignature})${returnSignature}`;
|
|
13
|
-
};
|
|
14
|
-
exports.getABISignature = getABISignature;
|
|
15
|
-
//# sourceMappingURL=appspec.js.map
|
|
11
|
+
/** @deprecated Use `algokit.getABIMethodSignature` instead */
|
|
12
|
+
exports.getABISignature = app_1.getABIMethodSignature;
|
|
13
|
+
//# sourceMappingURL=app-spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-spec.js","sourceRoot":"","sources":["../../src/types/app-spec.ts"],"names":[],"mappings":";;;AACA,gCAA8C;AAgG9C,oBAAoB;AACpB,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,yCAAM,CAAA;IACN,uCAAK,CAAA;AACP,CAAC,EAHW,OAAO,GAAP,eAAO,KAAP,eAAO,QAGlB;AAwDD,8DAA8D;AACjD,QAAA,eAAe,GAAG,2BAAqB,CAAA"}
|
package/types/app.d.ts
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import algosdk, { ABIArgument, ABIMethod, ABIMethodParams, ABIType, ABIValue, Address, SourceMap, SuggestedParams, Transaction } from 'algosdk';
|
|
2
|
+
import { SendTransactionFrom, SendTransactionParams, SendTransactionResult, SendTransactionResults, TransactionNote, TransactionToSign } from './transaction';
|
|
3
|
+
/** The name of the TEAL template variable for deploy-time immutability control */
|
|
4
|
+
export declare const UPDATABLE_TEMPLATE_NAME = "TMPL_UPDATABLE";
|
|
5
|
+
/** The name of the TEAL template variable for deploy-time permanence control */
|
|
6
|
+
export declare const DELETABLE_TEMPLATE_NAME = "TMPL_DELETABLE";
|
|
7
|
+
/** The app create/update ARC-2 transaction note prefix */
|
|
8
|
+
export declare const APP_DEPLOY_NOTE_DAPP = "ALGOKIT_DEPLOYER";
|
|
9
|
+
/** The maximum number of bytes in a single app code page */
|
|
10
|
+
export declare const APP_PAGE_MAX_SIZE = 2048;
|
|
11
|
+
/** First 4 bytes of SHA-512/256 hash of "return" for retrieving ABI return values */
|
|
12
|
+
export declare const ABI_RETURN_PREFIX: Uint8Array;
|
|
13
|
+
/** Information about an Algorand app */
|
|
14
|
+
export interface AppReference {
|
|
15
|
+
/** The id of the app */
|
|
16
|
+
appId: number;
|
|
17
|
+
/** The Algorand address of the account associated with the app */
|
|
18
|
+
appAddress: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A grouping of the app ID and name of the box in an Uint8Array
|
|
22
|
+
*/
|
|
23
|
+
export interface BoxReference {
|
|
24
|
+
/**
|
|
25
|
+
* A unique application id
|
|
26
|
+
*/
|
|
27
|
+
appId: number;
|
|
28
|
+
/**
|
|
29
|
+
* Name of box to reference
|
|
30
|
+
*/
|
|
31
|
+
name: BoxIdentifier;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Something that identifies a box name - either a:
|
|
35
|
+
* * `Uint8Array`
|
|
36
|
+
* * `string` (that will be encoded to a Uint8Array)
|
|
37
|
+
* * `SendTransactionFrom` (encoded into the public key address of the corresponding account)
|
|
38
|
+
*/
|
|
39
|
+
export type BoxIdentifier = string | Uint8Array | SendTransactionFrom;
|
|
40
|
+
/**
|
|
41
|
+
* App call args with raw values (minus some processing like encoding strings as binary)
|
|
42
|
+
*/
|
|
43
|
+
export interface RawAppCallArgs {
|
|
44
|
+
/** The address of any accounts to load in */
|
|
45
|
+
accounts?: (string | Address)[];
|
|
46
|
+
/** Any application arguments to pass through */
|
|
47
|
+
appArgs?: (Uint8Array | string)[];
|
|
48
|
+
/** Any box references to load */
|
|
49
|
+
boxes?: (algosdk.BoxReference | BoxReference | BoxIdentifier)[];
|
|
50
|
+
/** IDs of any apps to load into the foreignApps array */
|
|
51
|
+
apps?: number[];
|
|
52
|
+
/** IDs of any assets to load into the foreignAssets array */
|
|
53
|
+
assets?: number[];
|
|
54
|
+
/** The optional lease for the transaction */
|
|
55
|
+
lease?: string | Uint8Array;
|
|
56
|
+
}
|
|
57
|
+
/** An argument for an ABI method, either a primitive value, or a transaction with or without signer, or the unawaited async return value of an algokit method that returns a `SendTransactionResult` */
|
|
58
|
+
export type ABIAppCallArg = ABIArgument | TransactionToSign | Transaction | Promise<SendTransactionResult>;
|
|
59
|
+
/**
|
|
60
|
+
* App call args for an ABI call
|
|
61
|
+
*/
|
|
62
|
+
export interface ABIAppCallArgs {
|
|
63
|
+
/** The ABI method to call */
|
|
64
|
+
method: ABIMethodParams | ABIMethod;
|
|
65
|
+
/** The ABI args to pass in */
|
|
66
|
+
args: ABIAppCallArg[];
|
|
67
|
+
/** The optional lease for the transaction */
|
|
68
|
+
lease?: string | Uint8Array;
|
|
69
|
+
/** Any box references to load either as the box name (if for the current app) or the reference with app id */
|
|
70
|
+
boxes?: (algosdk.BoxReference | BoxReference | BoxIdentifier)[];
|
|
71
|
+
}
|
|
72
|
+
/** Arguments to pass to an app call either:
|
|
73
|
+
* * The raw app call values to pass through into the transaction (after processing); or
|
|
74
|
+
* * An ABI method definition (method and args)
|
|
75
|
+
**/
|
|
76
|
+
export type AppCallArgs = RawAppCallArgs | ABIAppCallArgs;
|
|
77
|
+
/** Base interface for common data passed to an app create or update. */
|
|
78
|
+
interface CreateOrUpdateAppParams extends SendTransactionParams {
|
|
79
|
+
/** The account (with private key loaded) that will send the transaction */
|
|
80
|
+
from: SendTransactionFrom;
|
|
81
|
+
/** The approval program as raw teal (string) or compiled teal, base 64 encoded as a byte array (Uint8Array) */
|
|
82
|
+
approvalProgram: Uint8Array | string;
|
|
83
|
+
/** The clear state program as raw teal (string) or compiled teal, base 64 encoded as a byte array (Uint8Array) */
|
|
84
|
+
clearStateProgram: Uint8Array | string;
|
|
85
|
+
/** Optional transaction parameters */
|
|
86
|
+
transactionParams?: SuggestedParams;
|
|
87
|
+
/** The (optional) transaction note */
|
|
88
|
+
note?: TransactionNote;
|
|
89
|
+
/** The arguments passed in to the app call */
|
|
90
|
+
args?: AppCallArgs;
|
|
91
|
+
}
|
|
92
|
+
/** Parameters that are passed in when creating an app. */
|
|
93
|
+
export interface CreateAppParams extends CreateOrUpdateAppParams {
|
|
94
|
+
/** The storage schema to request for the created app */
|
|
95
|
+
schema: AppStorageSchema;
|
|
96
|
+
}
|
|
97
|
+
/** Parameters that are passed in when updating an app. */
|
|
98
|
+
export interface UpdateAppParams extends CreateOrUpdateAppParams {
|
|
99
|
+
/** The id of the app to update */
|
|
100
|
+
appId: number;
|
|
101
|
+
}
|
|
102
|
+
/** Parameters representing a call to an app. */
|
|
103
|
+
export interface AppCallParams extends SendTransactionParams {
|
|
104
|
+
/** The id of the app to call */
|
|
105
|
+
appId: number;
|
|
106
|
+
/** The type of call, everything except create (`createApp`) and update (`updateApp`) */
|
|
107
|
+
callType: 'optin' | 'closeout' | 'clearstate' | 'delete' | 'normal';
|
|
108
|
+
/** The account to make the call from */
|
|
109
|
+
from: SendTransactionFrom;
|
|
110
|
+
/** Optional transaction parameters */
|
|
111
|
+
transactionParams?: SuggestedParams;
|
|
112
|
+
/** The (optional) transaction note */
|
|
113
|
+
note?: TransactionNote;
|
|
114
|
+
/** The arguments passed in to the app call */
|
|
115
|
+
args?: AppCallArgs;
|
|
116
|
+
}
|
|
117
|
+
/** Parameters representing the storage schema of an app. */
|
|
118
|
+
export interface AppStorageSchema {
|
|
119
|
+
/** Restricts number of ints in per-user local state */
|
|
120
|
+
localInts: number;
|
|
121
|
+
/** Restricts number of byte slices in per-user local state */
|
|
122
|
+
localByteSlices: number;
|
|
123
|
+
/** Restricts number of ints in global state */
|
|
124
|
+
globalInts: number;
|
|
125
|
+
/** Restricts number of byte slices in global state */
|
|
126
|
+
globalByteSlices: number;
|
|
127
|
+
/** Any extra pages that are needed for the smart contract; if left blank then the right number of pages will be calculated based on the teal code size */
|
|
128
|
+
extraPages?: number;
|
|
129
|
+
}
|
|
130
|
+
/** Information about a compiled teal program */
|
|
131
|
+
export interface CompiledTeal {
|
|
132
|
+
/** Original TEAL code */
|
|
133
|
+
teal: string;
|
|
134
|
+
/** The compiled code */
|
|
135
|
+
compiled: string;
|
|
136
|
+
/** The has returned by the compiler */
|
|
137
|
+
compiledHash: string;
|
|
138
|
+
/** The base64 encoded code as a byte array */
|
|
139
|
+
compiledBase64ToBytes: Uint8Array;
|
|
140
|
+
/** Source map from the compilation */
|
|
141
|
+
sourceMap: SourceMap;
|
|
142
|
+
}
|
|
143
|
+
/** Result from calling an app */
|
|
144
|
+
export interface AppCallTransactionResult extends SendTransactionResults, SendTransactionResult {
|
|
145
|
+
/** If an ABI method was called the processed return value */
|
|
146
|
+
return?: ABIReturn;
|
|
147
|
+
}
|
|
148
|
+
/** The return value of an ABI method call */
|
|
149
|
+
export type ABIReturn = {
|
|
150
|
+
rawReturnValue: Uint8Array;
|
|
151
|
+
returnValue: ABIValue;
|
|
152
|
+
decodeError: undefined;
|
|
153
|
+
} | {
|
|
154
|
+
rawReturnValue: undefined;
|
|
155
|
+
returnValue: undefined;
|
|
156
|
+
decodeError: Error;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* The payload of the metadata to add to the transaction note when deploying an app, noting it will be prefixed with `APP_DEPLOY_NOTE_PREFIX`.
|
|
160
|
+
*/
|
|
161
|
+
export interface AppDeployMetadata {
|
|
162
|
+
/** The unique name identifier of the app within the creator account */
|
|
163
|
+
name: string;
|
|
164
|
+
/** The version of app that is / will be deployed */
|
|
165
|
+
version: string;
|
|
166
|
+
/** Whether or not the app is deletable / permanent / unspecified */
|
|
167
|
+
deletable?: boolean;
|
|
168
|
+
/** Whether or not the app is updatable / immutable / unspecified */
|
|
169
|
+
updatable?: boolean;
|
|
170
|
+
}
|
|
171
|
+
/** The metadata that can be collected about a deployed app */
|
|
172
|
+
export interface AppMetadata extends AppReference, AppDeployMetadata {
|
|
173
|
+
/** The round the app was created */
|
|
174
|
+
createdRound: number;
|
|
175
|
+
/** The last round that the app was updated */
|
|
176
|
+
updatedRound: number;
|
|
177
|
+
/** The metadata when the app was created */
|
|
178
|
+
createdMetadata: AppDeployMetadata;
|
|
179
|
+
/** Whether or not the app is deleted */
|
|
180
|
+
deleted: boolean;
|
|
181
|
+
}
|
|
182
|
+
/** A lookup of name -> Algorand app for a creator */
|
|
183
|
+
export interface AppLookup {
|
|
184
|
+
creator: Readonly<string>;
|
|
185
|
+
apps: Readonly<{
|
|
186
|
+
[name: string]: AppMetadata;
|
|
187
|
+
}>;
|
|
188
|
+
}
|
|
189
|
+
/** Dictionary of deploy-time parameters to replace in a teal template.
|
|
190
|
+
*
|
|
191
|
+
* Note: Looks for `TMPL_{parameter}` for template replacements i.e. you can leave out the `TMPL_`.
|
|
192
|
+
*
|
|
193
|
+
*/
|
|
194
|
+
export interface TealTemplateParams {
|
|
195
|
+
[key: string]: string | bigint | number | Uint8Array;
|
|
196
|
+
}
|
|
197
|
+
/** What action to perform when deploying an app and an update is detected in the TEAL code */
|
|
198
|
+
export declare enum OnUpdate {
|
|
199
|
+
/** Fail the deployment */
|
|
200
|
+
Fail = 0,
|
|
201
|
+
/** Update the app */
|
|
202
|
+
UpdateApp = 1,
|
|
203
|
+
/** Delete the app and create a new one in its place */
|
|
204
|
+
ReplaceApp = 2
|
|
205
|
+
}
|
|
206
|
+
/** What action to perform when deploying an app and a breaking schema change is detected */
|
|
207
|
+
export declare enum OnSchemaBreak {
|
|
208
|
+
/** Fail the deployment */
|
|
209
|
+
Fail = 0,
|
|
210
|
+
/** Delete the app and create a new one in its place */
|
|
211
|
+
ReplaceApp = 1
|
|
212
|
+
}
|
|
213
|
+
/** The parameters to deploy an app */
|
|
214
|
+
export interface AppDeploymentParams extends Omit<CreateAppParams, 'args' | 'note' | 'skipSending' | 'skipWaiting' | 'atc'> {
|
|
215
|
+
/** The deployment metadata */
|
|
216
|
+
metadata: AppDeployMetadata;
|
|
217
|
+
/** Any deploy-time parameters to replace in the TEAL code */
|
|
218
|
+
deployTimeParams?: TealTemplateParams;
|
|
219
|
+
/** What action to perform if a schema break is detected */
|
|
220
|
+
onSchemaBreak?: 'replace' | 'fail' | OnSchemaBreak;
|
|
221
|
+
/** What action to perform if a TEAL update is detected */
|
|
222
|
+
onUpdate?: 'update' | 'replace' | 'fail' | OnUpdate;
|
|
223
|
+
/** Optional cached value of the existing apps for the given creator */
|
|
224
|
+
existingDeployments?: AppLookup;
|
|
225
|
+
/** Any args to pass to any create transaction that is issued as part of deployment */
|
|
226
|
+
createArgs?: AppCallArgs;
|
|
227
|
+
/** Any args to pass to any update transaction that is issued as part of deployment */
|
|
228
|
+
updateArgs?: AppCallArgs;
|
|
229
|
+
/** Any args to pass to any delete transaction that is issued as part of deployment */
|
|
230
|
+
deleteArgs?: AppCallArgs;
|
|
231
|
+
}
|
|
232
|
+
/** The result of compiling the approval and clear TEAL for an app */
|
|
233
|
+
export interface AppCompilationResult {
|
|
234
|
+
/** The compilation result of approval */
|
|
235
|
+
compiledApproval: CompiledTeal;
|
|
236
|
+
/** The compilation result of clear */
|
|
237
|
+
compiledClear: CompiledTeal;
|
|
238
|
+
}
|
|
239
|
+
/** Object holding app state values */
|
|
240
|
+
export interface AppState {
|
|
241
|
+
[key: string]: {
|
|
242
|
+
value: number | bigint;
|
|
243
|
+
keyRaw: Uint8Array;
|
|
244
|
+
keyBase64: string;
|
|
245
|
+
} | {
|
|
246
|
+
value: string;
|
|
247
|
+
valueRaw: Uint8Array;
|
|
248
|
+
valueBase64: string;
|
|
249
|
+
keyRaw: Uint8Array;
|
|
250
|
+
keyBase64: string;
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
/** The name of a box storage box */
|
|
254
|
+
export interface BoxName {
|
|
255
|
+
/** Name in UTF-8 */
|
|
256
|
+
name: string;
|
|
257
|
+
/** Name in binary bytes */
|
|
258
|
+
nameRaw: Uint8Array;
|
|
259
|
+
/** Name in Base64 */
|
|
260
|
+
nameBase64: string;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Parameters to get and decode a box value as an ABI type.
|
|
264
|
+
*/
|
|
265
|
+
export interface BoxValueRequestParams {
|
|
266
|
+
/** The ID of the app return box names for */
|
|
267
|
+
appId: number;
|
|
268
|
+
/** The name of the box to return either as a string, binary array or `BoxName` */
|
|
269
|
+
boxName: string | Uint8Array | BoxName;
|
|
270
|
+
/** The ABI type to decode the value using */
|
|
271
|
+
type: ABIType;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Parameters to get and decode a box value as an ABI type.
|
|
275
|
+
*/
|
|
276
|
+
export interface BoxValuesRequestParams {
|
|
277
|
+
/** The ID of the app return box names for */
|
|
278
|
+
appId: number;
|
|
279
|
+
/** The names of the boxes to return either as a string, binary array or BoxName` */
|
|
280
|
+
boxNames: (string | Uint8Array | BoxName)[];
|
|
281
|
+
/** The ABI type to decode the value using */
|
|
282
|
+
type: ABIType;
|
|
283
|
+
}
|
|
284
|
+
export {};
|
|
285
|
+
//# sourceMappingURL=app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/types/app.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EACd,WAAW,EACX,SAAS,EACT,eAAe,EACf,OAAO,EACP,QAAQ,EACR,OAAO,EACP,SAAS,EACT,eAAe,EACf,WAAW,EACZ,MAAM,SAAS,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;IACtC,6CAA6C;IAC7C,IAAI,EAAE,OAAO,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAA;IACb,oFAAoF;IACpF,QAAQ,EAAE,CAAC,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,EAAE,CAAA;IAC3C,6CAA6C;IAC7C,IAAI,EAAE,OAAO,CAAA;CACd"}
|
package/types/app.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OnSchemaBreak = exports.OnUpdate = exports.ABI_RETURN_PREFIX = exports.APP_PAGE_MAX_SIZE = exports.APP_DEPLOY_NOTE_DAPP = exports.DELETABLE_TEMPLATE_NAME = exports.UPDATABLE_TEMPLATE_NAME = void 0;
|
|
4
|
+
/** The name of the TEAL template variable for deploy-time immutability control */
|
|
5
|
+
exports.UPDATABLE_TEMPLATE_NAME = 'TMPL_UPDATABLE';
|
|
6
|
+
/** The name of the TEAL template variable for deploy-time permanence control */
|
|
7
|
+
exports.DELETABLE_TEMPLATE_NAME = 'TMPL_DELETABLE';
|
|
8
|
+
/** The app create/update ARC-2 transaction note prefix */
|
|
9
|
+
exports.APP_DEPLOY_NOTE_DAPP = 'ALGOKIT_DEPLOYER';
|
|
10
|
+
/** The maximum number of bytes in a single app code page */
|
|
11
|
+
exports.APP_PAGE_MAX_SIZE = 2048;
|
|
12
|
+
/** First 4 bytes of SHA-512/256 hash of "return" for retrieving ABI return values */
|
|
13
|
+
exports.ABI_RETURN_PREFIX = new Uint8Array([21, 31, 124, 117]);
|
|
14
|
+
/** What action to perform when deploying an app and an update is detected in the TEAL code */
|
|
15
|
+
var OnUpdate;
|
|
16
|
+
(function (OnUpdate) {
|
|
17
|
+
/** Fail the deployment */
|
|
18
|
+
OnUpdate[OnUpdate["Fail"] = 0] = "Fail";
|
|
19
|
+
/** Update the app */
|
|
20
|
+
OnUpdate[OnUpdate["UpdateApp"] = 1] = "UpdateApp";
|
|
21
|
+
/** Delete the app and create a new one in its place */
|
|
22
|
+
OnUpdate[OnUpdate["ReplaceApp"] = 2] = "ReplaceApp";
|
|
23
|
+
})(OnUpdate = exports.OnUpdate || (exports.OnUpdate = {}));
|
|
24
|
+
/** What action to perform when deploying an app and a breaking schema change is detected */
|
|
25
|
+
var OnSchemaBreak;
|
|
26
|
+
(function (OnSchemaBreak) {
|
|
27
|
+
/** Fail the deployment */
|
|
28
|
+
OnSchemaBreak[OnSchemaBreak["Fail"] = 0] = "Fail";
|
|
29
|
+
/** Delete the app and create a new one in its place */
|
|
30
|
+
OnSchemaBreak[OnSchemaBreak["ReplaceApp"] = 1] = "ReplaceApp";
|
|
31
|
+
})(OnSchemaBreak = exports.OnSchemaBreak || (exports.OnSchemaBreak = {}));
|
|
32
|
+
//# sourceMappingURL=app.js.map
|
package/types/app.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/types/app.ts"],"names":[],"mappings":";;;AAoBA,kFAAkF;AACrE,QAAA,uBAAuB,GAAG,gBAAgB,CAAA;AAEvD,gFAAgF;AACnE,QAAA,uBAAuB,GAAG,gBAAgB,CAAA;AAEvD,0DAA0D;AAC7C,QAAA,oBAAoB,GAAG,kBAAkB,CAAA;AAEtD,4DAA4D;AAC/C,QAAA,iBAAiB,GAAG,IAAI,CAAA;AAErC,qFAAqF;AACxE,QAAA,iBAAiB,GAAG,IAAI,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;AA2MnE,8FAA8F;AAC9F,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,0BAA0B;IAC1B,uCAAI,CAAA;IACJ,qBAAqB;IACrB,iDAAS,CAAA;IACT,uDAAuD;IACvD,mDAAU,CAAA;AACZ,CAAC,EAPW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAOnB;AAED,4FAA4F;AAC5F,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,0BAA0B;IAC1B,iDAAI,CAAA;IACJ,uDAAuD;IACvD,6DAAU,CAAA;AACZ,CAAC,EALW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAKxB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Logger } from './logging';
|
|
2
|
+
/** The AlgoKit configuration type */
|
|
3
|
+
export interface Config {
|
|
4
|
+
/** Logger */
|
|
5
|
+
logger: Logger;
|
|
6
|
+
/** Whether or not debug mode is enabled */
|
|
7
|
+
debug: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** Updatable AlgoKit config */
|
|
10
|
+
export declare class UpdatableConfig implements Readonly<Config> {
|
|
11
|
+
private config;
|
|
12
|
+
get logger(): Logger;
|
|
13
|
+
get debug(): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the current logger, or the null logger if true is passed in to `returnNullLogger`
|
|
16
|
+
* @param returnNullLogger Whether or not to return the null logger
|
|
17
|
+
* @returns The requested logger
|
|
18
|
+
*/
|
|
19
|
+
getLogger(returnNullLogger?: boolean): Logger;
|
|
20
|
+
/**
|
|
21
|
+
* Temporarily run with debug set to true.
|
|
22
|
+
* @param lambda A lambda expression with code to run with debug config set to true
|
|
23
|
+
*/
|
|
24
|
+
withDebug(lambda: () => unknown): void;
|
|
25
|
+
constructor();
|
|
26
|
+
/**
|
|
27
|
+
* Update the AlgoKit configuration with your own configuration settings
|
|
28
|
+
* @param newConfig Partial or complete config to replace
|
|
29
|
+
*/
|
|
30
|
+
configure(newConfig: Partial<Config>): void;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,EAAc,MAAM,WAAW,CAAA;AAE7D,qCAAqC;AACrC,MAAM,WAAW,MAAM;IACrB,aAAa;IACb,MAAM,EAAE,MAAM,CAAA;IACd,2CAA2C;IAC3C,KAAK,EAAE,OAAO,CAAA;CACf;AAED,+BAA+B;AAC/B,qBAAa,eAAgB,YAAW,QAAQ,CAAC,MAAM,CAAC;IACtD,OAAO,CAAC,MAAM,CAAQ;IAEtB,IAAI,MAAM,WAET;IAED,IAAI,KAAK,YAER;IAED;;;;OAIG;IACH,SAAS,CAAC,gBAAgB,CAAC,EAAE,OAAO;IAQpC;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,OAAO;;IAiB/B;;;OAGG;IACH,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC;CAGrC"}
|
package/types/config.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdatableConfig = void 0;
|
|
4
|
+
const logging_1 = require("./logging");
|
|
5
|
+
/** Updatable AlgoKit config */
|
|
6
|
+
class UpdatableConfig {
|
|
7
|
+
get logger() {
|
|
8
|
+
return this.config.logger;
|
|
9
|
+
}
|
|
10
|
+
get debug() {
|
|
11
|
+
return this.config.debug;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Returns the current logger, or the null logger if true is passed in to `returnNullLogger`
|
|
15
|
+
* @param returnNullLogger Whether or not to return the null logger
|
|
16
|
+
* @returns The requested logger
|
|
17
|
+
*/
|
|
18
|
+
getLogger(returnNullLogger) {
|
|
19
|
+
if (returnNullLogger) {
|
|
20
|
+
return logging_1.nullLogger;
|
|
21
|
+
}
|
|
22
|
+
return this.logger;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Temporarily run with debug set to true.
|
|
26
|
+
* @param lambda A lambda expression with code to run with debug config set to true
|
|
27
|
+
*/
|
|
28
|
+
withDebug(lambda) {
|
|
29
|
+
const original = this.config.debug;
|
|
30
|
+
try {
|
|
31
|
+
this.config.debug = true;
|
|
32
|
+
lambda();
|
|
33
|
+
}
|
|
34
|
+
finally {
|
|
35
|
+
this.config.debug = original;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
constructor() {
|
|
39
|
+
this.config = {
|
|
40
|
+
logger: logging_1.consoleLogger,
|
|
41
|
+
debug: false,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Update the AlgoKit configuration with your own configuration settings
|
|
46
|
+
* @param newConfig Partial or complete config to replace
|
|
47
|
+
*/
|
|
48
|
+
configure(newConfig) {
|
|
49
|
+
this.config = { ...this.config, ...newConfig };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.UpdatableConfig = UpdatableConfig;
|
|
53
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":";;;AAAA,uCAA6D;AAU7D,+BAA+B;AAC/B,MAAa,eAAe;IAG1B,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAA;IAC3B,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAA;IAC1B,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,gBAA0B;QAClC,IAAI,gBAAgB,EAAE;YACpB,OAAO,oBAAU,CAAA;SAClB;QAED,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,MAAqB;QAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAA;QAClC,IAAI;YACF,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAA;YACxB,MAAM,EAAE,CAAA;SACT;gBAAS;YACR,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAA;SAC7B;IACH,CAAC;IAED;QACE,IAAI,CAAC,MAAM,GAAG;YACZ,MAAM,EAAE,uBAAa;YACrB,KAAK,EAAE,KAAK;SACb,CAAA;IACH,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,SAA0B;QAClC,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,SAAS,EAAE,CAAA;IAChD,CAAC;CACF;AApDD,0CAoDC"}
|