@algorandfoundation/algokit-utils 1.0.0 → 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 +11 -10
- package/account.d.ts.map +1 -1
- package/account.js +13 -12
- package/account.js.map +1 -1
- package/amount.d.ts +15 -3
- package/amount.d.ts.map +1 -1
- package/amount.js +15 -3
- package/amount.js.map +1 -1
- 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/{deploy-app.d.ts → app-deploy.d.ts} +16 -14
- package/app-deploy.d.ts.map +1 -0
- package/{deploy-app.js → app-deploy.js} +47 -28
- package/app-deploy.js.map +1 -0
- package/app.d.ts +53 -8
- package/app.d.ts.map +1 -1
- package/app.js +305 -146
- package/app.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.d.ts.map +1 -1
- package/index.js +2 -2
- 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 +7 -7
- package/localnet.js +7 -7
- package/network-client.d.ts +4 -4
- package/network-client.js +5 -5
- package/network-client.js.map +1 -1
- package/package.json +1 -1
- package/testing/account.d.ts +2 -2
- package/testing/account.js +2 -2
- package/testing/fixtures/algorand-fixture.d.ts +6 -2
- package/testing/fixtures/algorand-fixture.d.ts.map +1 -1
- package/testing/fixtures/algorand-fixture.js +19 -8
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/indexer.d.ts.map +1 -1
- package/testing/indexer.js +1 -0
- package/testing/indexer.js.map +1 -1
- package/testing/test-logger.d.ts +3 -1
- package/testing/test-logger.d.ts.map +1 -1
- package/testing/test-logger.js +4 -2
- package/testing/test-logger.js.map +1 -1
- package/testing/transaction-logger.d.ts +4 -4
- package/testing/transaction-logger.d.ts.map +1 -1
- package/testing/transaction-logger.js +4 -4
- package/testing/transaction-logger.js.map +1 -1
- package/transaction.d.ts +54 -13
- package/transaction.d.ts.map +1 -1
- package/transaction.js +201 -93
- package/transaction.js.map +1 -1
- package/transfer.d.ts +4 -3
- package/transfer.d.ts.map +1 -1
- package/transfer.js +10 -8
- package/transfer.js.map +1 -1
- package/types/account.d.ts +6 -3
- package/types/account.d.ts.map +1 -1
- package/types/account.js +7 -2
- package/types/account.js.map +1 -1
- package/types/algo-http-client-with-retry.js +1 -1
- package/types/algo-http-client-with-retry.js.map +1 -1
- package/types/algod.d.ts +6 -6
- package/types/algod.d.ts.map +1 -1
- package/types/amount.d.ts +6 -2
- package/types/amount.d.ts.map +1 -1
- package/types/amount.js +6 -2
- package/types/amount.js.map +1 -1
- package/types/{application-client.d.ts → app-client.d.ts} +75 -22
- package/types/app-client.d.ts.map +1 -0
- package/types/{application-client.js → app-client.js} +115 -56
- 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 +23 -17
- package/types/app.d.ts.map +1 -1
- package/types/app.js.map +1 -1
- package/types/config.d.ts +19 -2
- package/types/config.d.ts.map +1 -1
- package/types/config.js +28 -2
- package/types/config.js.map +1 -1
- package/types/indexer.d.ts +360 -49
- package/types/indexer.d.ts.map +1 -1
- package/types/indexer.js +9 -0
- package/types/indexer.js.map +1 -1
- package/types/logic-error.d.ts +5 -1
- package/types/logic-error.d.ts.map +1 -1
- package/types/logic-error.js +6 -2
- package/types/logic-error.js.map +1 -1
- package/types/testing.d.ts +9 -9
- package/types/testing.d.ts.map +1 -1
- package/types/transaction.d.ts +54 -9
- package/types/transaction.d.ts.map +1 -1
- package/types/transfer.d.ts +7 -7
- package/types/transfer.d.ts.map +1 -1
- package/application-client.d.ts +0 -10
- package/application-client.d.ts.map +0 -1
- package/application-client.js +0 -15
- package/application-client.js.map +0 -1
- package/deploy-app.d.ts.map +0 -1
- package/deploy-app.js.map +0 -1
- package/types/application-client.d.ts.map +0 -1
- package/types/application-client.js.map +0 -1
- package/types/appspec.d.ts +0 -77
- package/types/appspec.d.ts.map +0 -1
- package/types/appspec.js.map +0 -1
package/app.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import algosdk, { ABIValue, Algodv2 } from 'algosdk';
|
|
1
|
+
import algosdk, { ABIMethod, ABIMethodParams, ABIValue, Algodv2 } from 'algosdk';
|
|
2
2
|
import { ApplicationResponse, EvalDelta, PendingTransactionResponse, TealValue } from './types/algod';
|
|
3
|
-
import { ABIReturn, AppCallArgs, AppCallParams, AppCallTransactionResult, AppCompilationResult, AppReference, AppState, BoxName, BoxValueRequestParams, BoxValuesRequestParams, CompiledTeal, CreateAppParams, UpdateAppParams } from './types/app';
|
|
3
|
+
import { ABIAppCallArgs, ABIReturn, AppCallArgs, AppCallParams, AppCallTransactionResult, AppCompilationResult, AppReference, AppState, BoxIdentifier, BoxName, BoxReference, BoxValueRequestParams, BoxValuesRequestParams, CompiledTeal, CreateAppParams, RawAppCallArgs, UpdateAppParams } from './types/app';
|
|
4
4
|
import { SendTransactionFrom } from './types/transaction';
|
|
5
5
|
/**
|
|
6
6
|
* Creates a smart contract app, returns the details of the created app.
|
|
@@ -23,6 +23,12 @@ export declare function updateApp(update: UpdateAppParams, algod: Algodv2): Prom
|
|
|
23
23
|
* @returns The result of the call
|
|
24
24
|
*/
|
|
25
25
|
export declare function callApp(call: AppCallParams, algod: Algodv2): Promise<AppCallTransactionResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Returns any ABI return values for the given app call arguments and transaction confirmation.
|
|
28
|
+
* @param args The arguments that were used for the call
|
|
29
|
+
* @param confirmation The transaction confirmation from algod
|
|
30
|
+
* @returns The return value for the method call
|
|
31
|
+
*/
|
|
26
32
|
export declare function getABIReturn(args?: AppCallArgs, confirmation?: PendingTransactionResponse): ABIReturn | undefined;
|
|
27
33
|
/**
|
|
28
34
|
* Returns the current global state values for the given app ID
|
|
@@ -49,7 +55,7 @@ export declare function getAppBoxNames(appId: number, algod: Algodv2): Promise<B
|
|
|
49
55
|
/**
|
|
50
56
|
* Returns the value of the given box name for the given app.
|
|
51
57
|
* @param appId The ID of the app return box names for
|
|
52
|
-
* @param boxName The name of the box to return either as a string, binary array or
|
|
58
|
+
* @param boxName The name of the box to return either as a string, binary array or `BoxName`
|
|
53
59
|
* @param algod An algod client instance
|
|
54
60
|
* @returns The current box value as a byte array
|
|
55
61
|
*/
|
|
@@ -57,7 +63,7 @@ export declare function getAppBoxValue(appId: number, boxName: string | Uint8Arr
|
|
|
57
63
|
/**
|
|
58
64
|
* Returns the value of the given box names for the given app.
|
|
59
65
|
* @param appId The ID of the app return box names for
|
|
60
|
-
* @param boxNames The names of the boxes to return either as a string, binary array or
|
|
66
|
+
* @param boxNames The names of the boxes to return either as a string, binary array or `BoxName`
|
|
61
67
|
* @param algod An algod client instance
|
|
62
68
|
* @returns The current box values as a byte array in the same order as the passed in box names
|
|
63
69
|
*/
|
|
@@ -76,12 +82,22 @@ export declare function getAppBoxValueFromABIType(request: BoxValueRequestParams
|
|
|
76
82
|
* @returns The current box values as an ABI value in the same order as the passed in box names
|
|
77
83
|
*/
|
|
78
84
|
export declare function getAppBoxValuesFromABIType(request: BoxValuesRequestParams, algod: Algodv2): Promise<ABIValue[]>;
|
|
85
|
+
/**
|
|
86
|
+
* Converts an array of global/local state values from the algod api to a more friendly
|
|
87
|
+
* generic object keyed by the UTF-8 value of the key.
|
|
88
|
+
* @param state A `global-state`, `local-state`, `global-state-deltas` or `local-state-deltas`
|
|
89
|
+
* @returns An object keyeed by the UTF-8 representation of the key with various parsings of the values
|
|
90
|
+
*/
|
|
79
91
|
export declare function decodeAppState(state: {
|
|
80
92
|
key: string;
|
|
81
93
|
value: TealValue | EvalDelta;
|
|
82
94
|
}[]): AppState;
|
|
83
|
-
/**
|
|
84
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Returns the app args ready to load onto an app `Transaction` object
|
|
97
|
+
* @param args The app call args
|
|
98
|
+
* @returns The args ready to load into a `Transaction`
|
|
99
|
+
*/
|
|
100
|
+
export declare function getAppArgsForTransaction(args?: RawAppCallArgs): {
|
|
85
101
|
accounts: string[] | undefined;
|
|
86
102
|
appArgs: Uint8Array[] | undefined;
|
|
87
103
|
boxes: algosdk.BoxReference[] | undefined;
|
|
@@ -89,6 +105,27 @@ export declare function getAppArgsForTransaction(args?: AppCallArgs): {
|
|
|
89
105
|
foreignAssets: number[] | undefined;
|
|
90
106
|
lease: Uint8Array | undefined;
|
|
91
107
|
} | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Returns the app args ready to load onto an ABI method call in `AtomicTransactionComposer`
|
|
110
|
+
* @param args The ABI app call args
|
|
111
|
+
* @param from The transaction signer
|
|
112
|
+
* @returns The parameters ready to pass into `addMethodCall` within AtomicTransactionComposer
|
|
113
|
+
*/
|
|
114
|
+
export declare function getAppArgsForABICall(args: ABIAppCallArgs, from: SendTransactionFrom): Promise<{
|
|
115
|
+
method: algosdk.ABIMethod;
|
|
116
|
+
sender: string;
|
|
117
|
+
signer: algosdk.TransactionSigner;
|
|
118
|
+
boxes: algosdk.BoxReference[] | undefined;
|
|
119
|
+
lease: Uint8Array | undefined;
|
|
120
|
+
methodArgs: (string | number | bigint | boolean | Uint8Array | algosdk.ABIValue[] | algosdk.TransactionWithSigner)[];
|
|
121
|
+
rekeyTo: undefined;
|
|
122
|
+
}>;
|
|
123
|
+
/**
|
|
124
|
+
* Returns a `algosdk.BoxReference` given a `BoxIdentifier` or `BoxReference`.
|
|
125
|
+
* @param box The box to return a reference for
|
|
126
|
+
* @returns The box reference ready to pass into a `Transaction`
|
|
127
|
+
*/
|
|
128
|
+
export declare function getBoxReference(box: BoxIdentifier | BoxReference | algosdk.BoxReference): algosdk.BoxReference;
|
|
92
129
|
/**
|
|
93
130
|
* Gets the current data for the given app from algod.
|
|
94
131
|
*
|
|
@@ -96,13 +133,21 @@ export declare function getAppArgsForTransaction(args?: AppCallArgs): {
|
|
|
96
133
|
* @param algod An algod client
|
|
97
134
|
* @returns The data about the app
|
|
98
135
|
*/
|
|
99
|
-
export declare function
|
|
136
|
+
export declare function getAppById(appId: number, algod: Algodv2): Promise<ApplicationResponse>;
|
|
137
|
+
/** @deprecated Use `algokit.getAppById` instead. */
|
|
138
|
+
export declare const getAppByIndex: typeof getAppById;
|
|
100
139
|
/**
|
|
101
|
-
* Compiles the given TEAL using algod and returns the result.
|
|
140
|
+
* Compiles the given TEAL using algod and returns the result, including source map.
|
|
102
141
|
*
|
|
103
142
|
* @param algod An algod client
|
|
104
143
|
* @param tealCode The TEAL code
|
|
105
144
|
* @returns The information about the compiled file
|
|
106
145
|
*/
|
|
107
146
|
export declare function compileTeal(tealCode: string, algod: Algodv2): Promise<CompiledTeal>;
|
|
147
|
+
/**
|
|
148
|
+
* Returns the encoded ABI spec for a given ABI Method
|
|
149
|
+
* @param method The method to return a signature for
|
|
150
|
+
* @returns The encoded ABI method spec e.g. `method_name(uint64,string)string`
|
|
151
|
+
*/
|
|
152
|
+
export declare const getABIMethodSignature: (method: ABIMethodParams | ABIMethod) => string;
|
|
108
153
|
//# sourceMappingURL=app.d.ts.map
|
package/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EACd,SAAS,EACT,eAAe,EAEf,QAAQ,EACR,OAAO,EAKR,MAAM,SAAS,CAAA;AAahB,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,0BAA0B,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACrG,OAAO,EACL,cAAc,EACd,SAAS,EACT,WAAW,EACX,aAAa,EACb,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