algosdk 1.10.1 → 1.13.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -6
- package/dist/browser/algosdk.min.js +1 -1
- package/dist/browser/algosdk.min.js.map +1 -1
- package/dist/cjs/src/abi/abi_type.js +665 -0
- package/dist/cjs/src/abi/abi_type.js.map +1 -0
- package/dist/cjs/src/abi/contract.js +25 -0
- package/dist/cjs/src/abi/contract.js.map +1 -0
- package/dist/cjs/src/abi/index.js +17 -0
- package/dist/cjs/src/abi/index.js.map +1 -0
- package/dist/cjs/src/abi/interface.js +21 -0
- package/dist/cjs/src/abi/interface.js.map +1 -0
- package/dist/cjs/src/abi/method.js +117 -0
- package/dist/cjs/src/abi/method.js.map +1 -0
- package/dist/cjs/src/client/v2/algod/models/types.js +18 -12
- package/dist/cjs/src/client/v2/algod/models/types.js.map +1 -1
- package/dist/cjs/src/client/v2/indexer/indexer.js +8 -0
- package/dist/cjs/src/client/v2/indexer/indexer.js.map +1 -1
- package/dist/cjs/src/client/v2/indexer/lookupApplicationLogs.js +48 -0
- package/dist/cjs/src/client/v2/indexer/lookupApplicationLogs.js.map +1 -0
- package/dist/cjs/src/composer.js +319 -0
- package/dist/cjs/src/composer.js.map +1 -0
- package/dist/cjs/src/encoding/address.js +14 -1
- package/dist/cjs/src/encoding/address.js.map +1 -1
- package/dist/cjs/src/encoding/bigint.js +38 -0
- package/dist/cjs/src/encoding/bigint.js.map +1 -0
- package/dist/cjs/src/logic/langspec.json +392 -77
- package/dist/cjs/src/logic/logic.js.map +1 -1
- package/dist/cjs/src/logicsig.js +207 -49
- package/dist/cjs/src/logicsig.js.map +1 -1
- package/dist/cjs/src/main.js +18 -99
- package/dist/cjs/src/main.js.map +1 -1
- package/dist/cjs/src/makeTxn.js +29 -1
- package/dist/cjs/src/makeTxn.js.map +1 -1
- package/dist/cjs/src/multisig.js +115 -21
- package/dist/cjs/src/multisig.js.map +1 -1
- package/dist/cjs/src/signer.js +66 -0
- package/dist/cjs/src/signer.js.map +1 -0
- package/dist/cjs/src/transaction.js +49 -8
- package/dist/cjs/src/transaction.js.map +1 -1
- package/dist/cjs/src/types/intDecoding.js +0 -2
- package/dist/cjs/src/types/intDecoding.js.map +1 -1
- package/dist/cjs/src/types/transactions/base.js +0 -1
- package/dist/cjs/src/types/transactions/base.js.map +1 -1
- package/dist/cjs/src/wait.js +40 -0
- package/dist/cjs/src/wait.js.map +1 -0
- package/dist/esm/src/abi/abi_type.js +652 -0
- package/dist/esm/src/abi/abi_type.js.map +1 -0
- package/dist/esm/src/abi/contract.js +21 -0
- package/dist/esm/src/abi/contract.js.map +1 -0
- package/dist/esm/src/abi/index.js +5 -0
- package/dist/esm/src/abi/index.js.map +1 -0
- package/dist/esm/src/abi/interface.js +17 -0
- package/dist/esm/src/abi/interface.js.map +1 -0
- package/dist/esm/src/abi/method.js +112 -0
- package/dist/esm/src/abi/method.js.map +1 -0
- package/dist/esm/src/client/v2/algod/models/types.js +18 -12
- package/dist/esm/src/client/v2/algod/models/types.js.map +1 -1
- package/dist/esm/src/client/v2/indexer/indexer.js +8 -0
- package/dist/esm/src/client/v2/indexer/indexer.js.map +1 -1
- package/dist/esm/src/client/v2/indexer/lookupApplicationLogs.js +42 -0
- package/dist/esm/src/client/v2/indexer/lookupApplicationLogs.js.map +1 -0
- package/dist/esm/src/composer.js +315 -0
- package/dist/esm/src/composer.js.map +1 -0
- package/dist/esm/src/encoding/address.js +12 -0
- package/dist/esm/src/encoding/address.js.map +1 -1
- package/dist/esm/src/encoding/bigint.js +33 -0
- package/dist/esm/src/encoding/bigint.js.map +1 -0
- package/dist/esm/src/logic/langspec.json +392 -77
- package/dist/esm/src/logic/logic.js.map +1 -1
- package/dist/esm/src/logicsig.js +205 -48
- package/dist/esm/src/logicsig.js.map +1 -1
- package/dist/esm/src/main.js +8 -94
- package/dist/esm/src/main.js.map +1 -1
- package/dist/esm/src/makeTxn.js +27 -0
- package/dist/esm/src/makeTxn.js.map +1 -1
- package/dist/esm/src/multisig.js +111 -20
- package/dist/esm/src/multisig.js.map +1 -1
- package/dist/esm/src/signer.js +59 -0
- package/dist/esm/src/signer.js.map +1 -0
- package/dist/esm/src/transaction.js +49 -8
- package/dist/esm/src/transaction.js.map +1 -1
- package/dist/esm/src/types/intDecoding.js +0 -2
- package/dist/esm/src/types/intDecoding.js.map +1 -1
- package/dist/esm/src/types/transactions/base.js +0 -1
- package/dist/esm/src/types/transactions/base.js.map +1 -1
- package/dist/esm/src/wait.js +36 -0
- package/dist/esm/src/wait.js.map +1 -0
- package/dist/types/src/abi/abi_type.d.ts +102 -0
- package/dist/types/src/abi/contract.d.ts +13 -0
- package/dist/types/src/abi/index.d.ts +4 -0
- package/dist/types/src/abi/interface.d.ts +11 -0
- package/dist/types/src/abi/method.d.ts +37 -0
- package/dist/types/src/client/v2/algod/models/types.d.ts +29 -14
- package/dist/types/src/client/v2/indexer/indexer.d.ts +6 -0
- package/dist/types/src/client/v2/indexer/lookupApplicationLogs.d.ts +20 -0
- package/dist/types/src/composer.d.ts +146 -0
- package/dist/types/src/encoding/address.d.ts +6 -0
- package/dist/types/src/encoding/bigint.d.ts +14 -0
- package/dist/types/src/logic/logic.d.ts +1 -1
- package/dist/types/src/logicsig.d.ts +100 -14
- package/dist/types/src/main.d.ts +8 -49
- package/dist/types/src/makeTxn.d.ts +18 -1
- package/dist/types/src/multisig.d.ts +40 -1
- package/dist/types/src/signer.d.ts +40 -0
- package/dist/types/src/types/transactions/encoded.d.ts +12 -0
- package/dist/types/src/wait.d.ts +11 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intDecoding.js","sourceRoot":"","sources":["../../../../src/types/intDecoding.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"intDecoding.js","sourceRoot":"","sources":["../../../../src/types/intDecoding.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,IAAK,WAuBJ;AAvBD,WAAK,WAAW;IACd;;;OAGG;IACH,kCAAmB,CAAA;IAEnB;;;OAGG;IACH,4BAAa,CAAA;IAEb;;;OAGG;IACH,8BAAe,CAAA;IAEf;;OAEG;IACH,gCAAiB,CAAA;AACnB,CAAC,EAvBI,WAAW,KAAX,WAAW,QAuBf;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../src/types/transactions/base.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../src/types/transactions/base.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,eA8BX;AA9BD,WAAY,eAAe;IACzB;;OAEG;IACH,8BAAW,CAAA;IAEX;;OAEG;IACH,oCAAiB,CAAA;IAEjB;;OAEG;IACH,gCAAa,CAAA;IAEb;;OAEG;IACH,kCAAe,CAAA;IAEf;;OAEG;IACH,gCAAa,CAAA;IAEb;;OAEG;IACH,gCAAa,CAAA;AACf,CAAC,EA9BW,eAAe,KAAf,eAAe,QA8B1B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,qBAsCX;AAtCD,WAAY,qBAAqB;IAC/B;;;OAGG;IACH,qEAAM,CAAA;IAEN;;;OAGG;IACH,uEAAO,CAAA;IAEP;;;OAGG;IACH,6EAAU,CAAA;IAEV;;;;OAIG;IACH,iFAAY,CAAA;IAEZ;;;OAGG;IACH,+FAAmB,CAAA;IAEnB;;;;OAIG;IACH,+FAAmB,CAAA;AACrB,CAAC,EAtCW,qBAAqB,KAArB,qBAAqB,QAsChC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wait until a transaction has been confirmed or rejected by the network, or
|
|
3
|
+
* until 'waitRounds' number of rounds have passed.
|
|
4
|
+
* @param client - An Algodv2 client
|
|
5
|
+
* @param txid - The ID of the transaction to wait for.
|
|
6
|
+
* @param waitRounds - The maximum number of rounds to wait for.
|
|
7
|
+
* @returns A promise that, upon success, will resolve to the output of the
|
|
8
|
+
* `pendingTransactionInformation` call for the confirmed transaction.
|
|
9
|
+
*/
|
|
10
|
+
export async function waitForConfirmation(client, txid, waitRounds) {
|
|
11
|
+
// Wait until the transaction is confirmed or rejected, or until 'waitRounds'
|
|
12
|
+
// number of rounds have passed.
|
|
13
|
+
const status = await client.status().do();
|
|
14
|
+
if (typeof status === 'undefined') {
|
|
15
|
+
throw new Error('Unable to get node status');
|
|
16
|
+
}
|
|
17
|
+
const startRound = status['last-round'] + 1;
|
|
18
|
+
let currentRound = startRound;
|
|
19
|
+
/* eslint-disable no-await-in-loop */
|
|
20
|
+
while (currentRound < startRound + waitRounds) {
|
|
21
|
+
const pendingInfo = await client.pendingTransactionInformation(txid).do();
|
|
22
|
+
if (pendingInfo['confirmed-round']) {
|
|
23
|
+
// Got the completed Transaction
|
|
24
|
+
return pendingInfo;
|
|
25
|
+
}
|
|
26
|
+
if (pendingInfo['pool-error']) {
|
|
27
|
+
// If there was a pool error, then the transaction has been rejected!
|
|
28
|
+
throw new Error(`Transaction Rejected: ${pendingInfo['pool-error']}`);
|
|
29
|
+
}
|
|
30
|
+
await client.statusAfterBlock(currentRound).do();
|
|
31
|
+
currentRound += 1;
|
|
32
|
+
}
|
|
33
|
+
/* eslint-enable no-await-in-loop */
|
|
34
|
+
throw new Error(`Transaction not confirmed after ${waitRounds} rounds!`);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=wait.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wait.js","sourceRoot":"","sources":["../../../src/wait.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,MAAe,EACf,IAAY,EACZ,UAAkB;IAElB,6EAA6E;IAC7E,gCAAgC;IAEhC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1C,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;KAC9C;IACD,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAC5C,IAAI,YAAY,GAAG,UAAU,CAAC;IAE9B,qCAAqC;IACrC,OAAO,YAAY,GAAG,UAAU,GAAG,UAAU,EAAE;QAC7C,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,6BAA6B,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC;QAE1E,IAAI,WAAW,CAAC,iBAAiB,CAAC,EAAE;YAClC,gCAAgC;YAChC,OAAO,WAAW,CAAC;SACpB;QAED,IAAI,WAAW,CAAC,YAAY,CAAC,EAAE;YAC7B,qEAAqE;YACrE,MAAM,IAAI,KAAK,CAAC,yBAAyB,WAAW,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;SACvE;QAED,MAAM,MAAM,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC;QACjD,YAAY,IAAI,CAAC,CAAC;KACnB;IACD,oCAAoC;IACpC,MAAM,IAAI,KAAK,CAAC,mCAAmC,UAAU,UAAU,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export declare const MAX_LEN: number;
|
|
2
|
+
export declare const ADDR_BYTE_SIZE = 32;
|
|
3
|
+
export declare const SINGLE_BYTE_SIZE = 1;
|
|
4
|
+
export declare const SINGLE_BOOL_SIZE = 1;
|
|
5
|
+
export declare const LENGTH_ENCODE_BYTE_SIZE = 2;
|
|
6
|
+
export declare type ABIValue = boolean | number | bigint | string | Uint8Array | ABIValue[];
|
|
7
|
+
export declare abstract class ABIType {
|
|
8
|
+
abstract toString(): string;
|
|
9
|
+
abstract equal(other: ABIType): boolean;
|
|
10
|
+
abstract isDynamic(): boolean;
|
|
11
|
+
abstract byteLen(): number;
|
|
12
|
+
abstract encode(value: ABIValue): Uint8Array;
|
|
13
|
+
abstract decode(byteString: Uint8Array): ABIValue;
|
|
14
|
+
static from(str: string): ABIType;
|
|
15
|
+
}
|
|
16
|
+
export declare class ABIUintType extends ABIType {
|
|
17
|
+
bitSize: number;
|
|
18
|
+
constructor(size: number);
|
|
19
|
+
toString(): string;
|
|
20
|
+
equal(other: ABIUintType): boolean;
|
|
21
|
+
isDynamic(): boolean;
|
|
22
|
+
byteLen(): number;
|
|
23
|
+
encode(value: bigint | number): Uint8Array;
|
|
24
|
+
decode(byteString: Uint8Array): bigint;
|
|
25
|
+
}
|
|
26
|
+
export declare class ABIUfixedType extends ABIType {
|
|
27
|
+
bitSize: number;
|
|
28
|
+
precision: number;
|
|
29
|
+
constructor(size: number, denominator: number);
|
|
30
|
+
toString(): string;
|
|
31
|
+
equal(other: ABIUfixedType): boolean;
|
|
32
|
+
isDynamic(): boolean;
|
|
33
|
+
byteLen(): number;
|
|
34
|
+
encode(value: bigint | number): Uint8Array;
|
|
35
|
+
decode(byteString: Uint8Array): bigint;
|
|
36
|
+
}
|
|
37
|
+
export declare class ABIAddressType extends ABIType {
|
|
38
|
+
toString(): string;
|
|
39
|
+
equal(other: ABIAddressType): boolean;
|
|
40
|
+
isDynamic(): boolean;
|
|
41
|
+
byteLen(): number;
|
|
42
|
+
encode(value: string | Uint8Array): Uint8Array;
|
|
43
|
+
decode(byteString: Uint8Array): string;
|
|
44
|
+
}
|
|
45
|
+
export declare class ABIBoolType extends ABIType {
|
|
46
|
+
toString(): string;
|
|
47
|
+
equal(other: ABIBoolType): boolean;
|
|
48
|
+
isDynamic(): boolean;
|
|
49
|
+
byteLen(): number;
|
|
50
|
+
encode(value: boolean): Uint8Array;
|
|
51
|
+
decode(byteString: Uint8Array): boolean;
|
|
52
|
+
}
|
|
53
|
+
export declare class ABIByteType extends ABIType {
|
|
54
|
+
toString(): string;
|
|
55
|
+
equal(other: ABIByteType): boolean;
|
|
56
|
+
isDynamic(): boolean;
|
|
57
|
+
byteLen(): number;
|
|
58
|
+
encode(value: number): Uint8Array;
|
|
59
|
+
decode(byteString: Uint8Array): number;
|
|
60
|
+
}
|
|
61
|
+
export declare class ABIStringType extends ABIType {
|
|
62
|
+
toString(): string;
|
|
63
|
+
equal(other: ABIStringType): boolean;
|
|
64
|
+
isDynamic(): boolean;
|
|
65
|
+
byteLen(): never;
|
|
66
|
+
encode(value: string): Uint8Array;
|
|
67
|
+
decode(byteString: Uint8Array): string;
|
|
68
|
+
}
|
|
69
|
+
export declare class ABIArrayStaticType extends ABIType {
|
|
70
|
+
childType: ABIType;
|
|
71
|
+
staticLength: number;
|
|
72
|
+
constructor(argType: ABIType, arrayLength: number);
|
|
73
|
+
toString(): string;
|
|
74
|
+
equal(other: ABIArrayStaticType): boolean;
|
|
75
|
+
isDynamic(): boolean;
|
|
76
|
+
byteLen(): number;
|
|
77
|
+
encode(values: ABIValue[]): Uint8Array;
|
|
78
|
+
decode(byteString: Uint8Array): ABIValue[];
|
|
79
|
+
toABITupleType(): ABITupleType;
|
|
80
|
+
}
|
|
81
|
+
export declare class ABIArrayDynamicType extends ABIType {
|
|
82
|
+
childType: ABIType;
|
|
83
|
+
constructor(argType: ABIType);
|
|
84
|
+
toString(): string;
|
|
85
|
+
equal(other: ABIArrayDynamicType): boolean;
|
|
86
|
+
isDynamic(): boolean;
|
|
87
|
+
byteLen(): never;
|
|
88
|
+
encode(values: ABIValue[]): Uint8Array;
|
|
89
|
+
decode(byteString: Uint8Array): ABIValue[];
|
|
90
|
+
toABITupleType(length: number): ABITupleType;
|
|
91
|
+
}
|
|
92
|
+
export declare class ABITupleType extends ABIType {
|
|
93
|
+
childTypes: ABIType[];
|
|
94
|
+
constructor(argTypes: ABIType[]);
|
|
95
|
+
toString(): string;
|
|
96
|
+
equal(other: ABITupleType): boolean;
|
|
97
|
+
isDynamic(): boolean;
|
|
98
|
+
byteLen(): number;
|
|
99
|
+
encode(values: ABIValue[]): Uint8Array;
|
|
100
|
+
decode(byteString: Uint8Array): ABIValue[];
|
|
101
|
+
static parseTupleContent(str: string): string[];
|
|
102
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ABIMethod, ABIMethodParams } from './method';
|
|
2
|
+
export interface ABIContractParams {
|
|
3
|
+
name: string;
|
|
4
|
+
appId: number;
|
|
5
|
+
methods: ABIMethodParams[];
|
|
6
|
+
}
|
|
7
|
+
export declare class ABIContract {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly appId: number;
|
|
10
|
+
readonly methods: ABIMethod[];
|
|
11
|
+
constructor(params: ABIContractParams);
|
|
12
|
+
toJSON(): ABIContractParams;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ABIMethod, ABIMethodParams } from './method';
|
|
2
|
+
export interface ABIInterfaceParams {
|
|
3
|
+
name: string;
|
|
4
|
+
methods: ABIMethodParams[];
|
|
5
|
+
}
|
|
6
|
+
export declare class ABIInterface {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly methods: ABIMethod[];
|
|
9
|
+
constructor(params: ABIInterfaceParams);
|
|
10
|
+
toJSON(): ABIInterfaceParams;
|
|
11
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { TransactionType } from '../types/transactions/base';
|
|
2
|
+
import { ABIType } from './abi_type';
|
|
3
|
+
export declare function abiTypeIsTransaction(type: string): type is TransactionType;
|
|
4
|
+
export interface ABIMethodParams {
|
|
5
|
+
name: string;
|
|
6
|
+
desc?: string;
|
|
7
|
+
args: Array<{
|
|
8
|
+
type: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
desc?: string;
|
|
11
|
+
}>;
|
|
12
|
+
returns: {
|
|
13
|
+
type: string;
|
|
14
|
+
desc?: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare type ABIArgumentType = ABIType | TransactionType;
|
|
18
|
+
export declare type ABIReturnType = ABIType | 'void';
|
|
19
|
+
export declare class ABIMethod {
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly description?: string;
|
|
22
|
+
readonly args: Array<{
|
|
23
|
+
type: ABIArgumentType;
|
|
24
|
+
name?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
}>;
|
|
27
|
+
readonly returns: {
|
|
28
|
+
type: ABIReturnType;
|
|
29
|
+
description?: string;
|
|
30
|
+
};
|
|
31
|
+
constructor(params: ABIMethodParams);
|
|
32
|
+
getSignature(): string;
|
|
33
|
+
getSelector(): Uint8Array;
|
|
34
|
+
txnCount(): number;
|
|
35
|
+
toJSON(): ABIMethodParams;
|
|
36
|
+
static fromSignature(signature: string): ABIMethod;
|
|
37
|
+
}
|
|
@@ -286,7 +286,7 @@ export declare class ApplicationParams extends BaseModel {
|
|
|
286
286
|
*/
|
|
287
287
|
globalState?: TealKeyValue[];
|
|
288
288
|
/**
|
|
289
|
-
* [\
|
|
289
|
+
* [\gsch) global schema
|
|
290
290
|
*/
|
|
291
291
|
globalStateSchema?: ApplicationStateSchema;
|
|
292
292
|
/**
|
|
@@ -301,7 +301,7 @@ export declare class ApplicationParams extends BaseModel {
|
|
|
301
301
|
* parameters and global state for this application can be found.
|
|
302
302
|
* @param extraProgramPages - (epp) the amount of extra program pages available to this app.
|
|
303
303
|
* @param globalState - [\gs) global schema
|
|
304
|
-
* @param globalStateSchema - [\
|
|
304
|
+
* @param globalStateSchema - [\gsch) global schema
|
|
305
305
|
* @param localStateSchema - [\lsch) local schema
|
|
306
306
|
*/
|
|
307
307
|
constructor({ approvalProgram, clearStateProgram, creator, extraProgramPages, globalState, globalStateSchema, localStateSchema, }: {
|
|
@@ -746,6 +746,10 @@ export declare class DryrunTxnResult extends BaseModel {
|
|
|
746
746
|
disassembly: string[];
|
|
747
747
|
appCallMessages?: string[];
|
|
748
748
|
appCallTrace?: DryrunState[];
|
|
749
|
+
/**
|
|
750
|
+
* Execution cost of app call transaction
|
|
751
|
+
*/
|
|
752
|
+
cost?: number | bigint;
|
|
749
753
|
/**
|
|
750
754
|
* Application state delta.
|
|
751
755
|
*/
|
|
@@ -753,24 +757,29 @@ export declare class DryrunTxnResult extends BaseModel {
|
|
|
753
757
|
localDeltas?: AccountStateDelta[];
|
|
754
758
|
logicSigMessages?: string[];
|
|
755
759
|
logicSigTrace?: DryrunState[];
|
|
760
|
+
logs?: Uint8Array[];
|
|
756
761
|
/**
|
|
757
762
|
* Creates a new `DryrunTxnResult` object.
|
|
758
763
|
* @param disassembly - Disassembled program line by line.
|
|
759
764
|
* @param appCallMessages -
|
|
760
765
|
* @param appCallTrace -
|
|
766
|
+
* @param cost - Execution cost of app call transaction
|
|
761
767
|
* @param globalDelta - Application state delta.
|
|
762
768
|
* @param localDeltas -
|
|
763
769
|
* @param logicSigMessages -
|
|
764
770
|
* @param logicSigTrace -
|
|
771
|
+
* @param logs -
|
|
765
772
|
*/
|
|
766
|
-
constructor({ disassembly, appCallMessages, appCallTrace, globalDelta, localDeltas, logicSigMessages, logicSigTrace, }: {
|
|
773
|
+
constructor({ disassembly, appCallMessages, appCallTrace, cost, globalDelta, localDeltas, logicSigMessages, logicSigTrace, logs, }: {
|
|
767
774
|
disassembly: string[];
|
|
768
775
|
appCallMessages?: string[];
|
|
769
776
|
appCallTrace?: DryrunState[];
|
|
777
|
+
cost?: number | bigint;
|
|
770
778
|
globalDelta?: EvalDeltaKeyValue[];
|
|
771
779
|
localDeltas?: AccountStateDelta[];
|
|
772
780
|
logicSigMessages?: string[];
|
|
773
781
|
logicSigTrace?: DryrunState[];
|
|
782
|
+
logs?: Uint8Array[];
|
|
774
783
|
});
|
|
775
784
|
}
|
|
776
785
|
/**
|
|
@@ -939,14 +948,8 @@ export declare class NodeStatusResponse extends BaseModel {
|
|
|
939
948
|
});
|
|
940
949
|
}
|
|
941
950
|
/**
|
|
942
|
-
*
|
|
943
|
-
*
|
|
944
|
-
* - transaction committed (committed round > 0)
|
|
945
|
-
* - transaction still in the pool (committed round = 0, pool error = "")
|
|
946
|
-
* - transaction removed from pool due to error (committed round = 0, pool error !=
|
|
947
|
-
* "")
|
|
948
|
-
* Or the transaction may have happened sufficiently long ago that the node no
|
|
949
|
-
* longer remembers it, and this will return an error.
|
|
951
|
+
* Details about a pending transaction. If the transaction was recently confirmed,
|
|
952
|
+
* includes confirmation details like the round and reward details.
|
|
950
953
|
*/
|
|
951
954
|
export declare class PendingTransactionResponse extends BaseModel {
|
|
952
955
|
/**
|
|
@@ -989,11 +992,19 @@ export declare class PendingTransactionResponse extends BaseModel {
|
|
|
989
992
|
* transaction.
|
|
990
993
|
*/
|
|
991
994
|
globalStateDelta?: EvalDeltaKeyValue[];
|
|
995
|
+
/**
|
|
996
|
+
* Inner transactions produced by application execution.
|
|
997
|
+
*/
|
|
998
|
+
innerTxns?: PendingTransactionResponse[];
|
|
992
999
|
/**
|
|
993
1000
|
* (ld) Local state key/value changes for the application being executed by this
|
|
994
1001
|
* transaction.
|
|
995
1002
|
*/
|
|
996
1003
|
localStateDelta?: AccountStateDelta[];
|
|
1004
|
+
/**
|
|
1005
|
+
* (lg) Logs for the application being executed by this transaction.
|
|
1006
|
+
*/
|
|
1007
|
+
logs?: Uint8Array[];
|
|
997
1008
|
/**
|
|
998
1009
|
* Rewards in microalgos applied to the receiver account.
|
|
999
1010
|
*/
|
|
@@ -1017,12 +1028,14 @@ export declare class PendingTransactionResponse extends BaseModel {
|
|
|
1017
1028
|
* @param confirmedRound - The round where this transaction was confirmed, if present.
|
|
1018
1029
|
* @param globalStateDelta - (gd) Global state key/value changes for the application being executed by this
|
|
1019
1030
|
* transaction.
|
|
1031
|
+
* @param innerTxns - Inner transactions produced by application execution.
|
|
1020
1032
|
* @param localStateDelta - (ld) Local state key/value changes for the application being executed by this
|
|
1021
1033
|
* transaction.
|
|
1034
|
+
* @param logs - (lg) Logs for the application being executed by this transaction.
|
|
1022
1035
|
* @param receiverRewards - Rewards in microalgos applied to the receiver account.
|
|
1023
1036
|
* @param senderRewards - Rewards in microalgos applied to the sender account.
|
|
1024
1037
|
*/
|
|
1025
|
-
constructor({ poolError, txn, applicationIndex, assetClosingAmount, assetIndex, closeRewards, closingAmount, confirmedRound, globalStateDelta, localStateDelta, receiverRewards, senderRewards, }: {
|
|
1038
|
+
constructor({ poolError, txn, applicationIndex, assetClosingAmount, assetIndex, closeRewards, closingAmount, confirmedRound, globalStateDelta, innerTxns, localStateDelta, logs, receiverRewards, senderRewards, }: {
|
|
1026
1039
|
poolError: string;
|
|
1027
1040
|
txn: EncodedSignedTransaction;
|
|
1028
1041
|
applicationIndex?: number | bigint;
|
|
@@ -1032,7 +1045,9 @@ export declare class PendingTransactionResponse extends BaseModel {
|
|
|
1032
1045
|
closingAmount?: number | bigint;
|
|
1033
1046
|
confirmedRound?: number | bigint;
|
|
1034
1047
|
globalStateDelta?: EvalDeltaKeyValue[];
|
|
1048
|
+
innerTxns?: PendingTransactionResponse[];
|
|
1035
1049
|
localStateDelta?: AccountStateDelta[];
|
|
1050
|
+
logs?: Uint8Array[];
|
|
1036
1051
|
receiverRewards?: number | bigint;
|
|
1037
1052
|
senderRewards?: number | bigint;
|
|
1038
1053
|
});
|
|
@@ -1141,7 +1156,7 @@ export declare class TealKeyValue extends BaseModel {
|
|
|
1141
1156
|
*/
|
|
1142
1157
|
export declare class TealValue extends BaseModel {
|
|
1143
1158
|
/**
|
|
1144
|
-
* (tt) value type.
|
|
1159
|
+
* (tt) value type. Value `1` refers to **bytes**, value `2` refers to **uint**
|
|
1145
1160
|
*/
|
|
1146
1161
|
type: number | bigint;
|
|
1147
1162
|
/**
|
|
@@ -1154,7 +1169,7 @@ export declare class TealValue extends BaseModel {
|
|
|
1154
1169
|
uint: number | bigint;
|
|
1155
1170
|
/**
|
|
1156
1171
|
* Creates a new `TealValue` object.
|
|
1157
|
-
* @param type - (tt) value type.
|
|
1172
|
+
* @param type - (tt) value type. Value `1` refers to **bytes**, value `2` refers to **uint**
|
|
1158
1173
|
* @param bytes - (tb) bytes value.
|
|
1159
1174
|
* @param uint - (ui) uint value.
|
|
1160
1175
|
*/
|
|
@@ -9,6 +9,7 @@ import LookupTransactionByID from './lookupTransactionByID';
|
|
|
9
9
|
import LookupAccountByID from './lookupAccountByID';
|
|
10
10
|
import LookupAssetByID from './lookupAssetByID';
|
|
11
11
|
import LookupApplications from './lookupApplications';
|
|
12
|
+
import LookupApplicationLogs from './lookupApplicationLogs';
|
|
12
13
|
import SearchAccounts from './searchAccounts';
|
|
13
14
|
import SearchForTransactions from './searchForTransactions';
|
|
14
15
|
import SearchForAssets from './searchForAssets';
|
|
@@ -59,6 +60,11 @@ export default class IndexerClient extends ServiceClient {
|
|
|
59
60
|
* @param index - The ID of the application to look up.
|
|
60
61
|
*/
|
|
61
62
|
lookupApplications(index: number): LookupApplications;
|
|
63
|
+
/**
|
|
64
|
+
* Returns log messages generated by the passed in application.
|
|
65
|
+
* @param appID - The ID of the application which generated the logs.
|
|
66
|
+
*/
|
|
67
|
+
lookupApplicationLogs(appID: number): LookupApplicationLogs;
|
|
62
68
|
/**
|
|
63
69
|
* Returns information about indexed accounts.
|
|
64
70
|
*/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import JSONRequest from '../jsonrequest';
|
|
2
|
+
import HTTPClient from '../../client';
|
|
3
|
+
import IntDecoding from '../../../types/intDecoding';
|
|
4
|
+
export default class LookupApplicationLogs extends JSONRequest {
|
|
5
|
+
private appID;
|
|
6
|
+
constructor(c: HTTPClient, intDecoding: IntDecoding, appID: number);
|
|
7
|
+
path(): string;
|
|
8
|
+
/** limit for filter, as int */
|
|
9
|
+
limit(limit: number): this;
|
|
10
|
+
/** min round to filter with, as int */
|
|
11
|
+
minRound(round: number): this;
|
|
12
|
+
/** max round to filter with, as int */
|
|
13
|
+
maxRound(round: number): this;
|
|
14
|
+
/** used for pagination */
|
|
15
|
+
nextToken(nextToken: string): this;
|
|
16
|
+
/** only include transactions with this sender address */
|
|
17
|
+
sender(senderAddress: string): this;
|
|
18
|
+
/** txid to filter with, as string */
|
|
19
|
+
txid(txid: string): this;
|
|
20
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { ABIValue, ABIMethod } from './abi';
|
|
2
|
+
import Algodv2 from './client/v2/algod/algod';
|
|
3
|
+
import { TransactionSigner, TransactionWithSigner } from './signer';
|
|
4
|
+
import { OnApplicationComplete, SuggestedParams } from './types/transactions/base';
|
|
5
|
+
export declare type ABIArgument = ABIValue | TransactionWithSigner;
|
|
6
|
+
/** Represents the output from a successful ABI method call. */
|
|
7
|
+
export interface ABIResult {
|
|
8
|
+
/** The TxID of the transaction that invoked the ABI method call. */
|
|
9
|
+
txID: string;
|
|
10
|
+
/**
|
|
11
|
+
* The raw bytes of the return value from the ABI method call. This will be empty if the method
|
|
12
|
+
* does not return a value (return type "void").
|
|
13
|
+
*/
|
|
14
|
+
rawReturnValue: Uint8Array;
|
|
15
|
+
/**
|
|
16
|
+
* The return value from the ABI method call. This will be undefined if the method does not return
|
|
17
|
+
* a value (return type "void"), or if the SDK was unable to decode the returned value.
|
|
18
|
+
*/
|
|
19
|
+
returnValue?: ABIValue;
|
|
20
|
+
/** If the SDK was unable to decode a return value, the error will be here. */
|
|
21
|
+
decodeError?: Error;
|
|
22
|
+
}
|
|
23
|
+
export declare enum AtomicTransactionComposerStatus {
|
|
24
|
+
/** The atomic group is still under construction. */
|
|
25
|
+
BUILDING = 0,
|
|
26
|
+
/** The atomic group has been finalized, but not yet signed. */
|
|
27
|
+
BUILT = 1,
|
|
28
|
+
/** The atomic group has been finalized and signed, but not yet submitted to the network. */
|
|
29
|
+
SIGNED = 2,
|
|
30
|
+
/** The atomic group has been finalized, signed, and submitted to the network. */
|
|
31
|
+
SUBMITTED = 3,
|
|
32
|
+
/** The atomic group has been finalized, signed, submitted, and successfully committed to a block. */
|
|
33
|
+
COMMITTED = 4
|
|
34
|
+
}
|
|
35
|
+
/** A class used to construct and execute atomic transaction groups */
|
|
36
|
+
export declare class AtomicTransactionComposer {
|
|
37
|
+
/** The maximum size of an atomic transaction group. */
|
|
38
|
+
static MAX_GROUP_SIZE: number;
|
|
39
|
+
private status;
|
|
40
|
+
private transactions;
|
|
41
|
+
private methodCalls;
|
|
42
|
+
private signedTxns;
|
|
43
|
+
private txIDs;
|
|
44
|
+
/**
|
|
45
|
+
* Get the status of this composer's transaction group.
|
|
46
|
+
*/
|
|
47
|
+
getStatus(): AtomicTransactionComposerStatus;
|
|
48
|
+
/**
|
|
49
|
+
* Get the number of transactions currently in this atomic group.
|
|
50
|
+
*/
|
|
51
|
+
count(): number;
|
|
52
|
+
/**
|
|
53
|
+
* Create a new composer with the same underlying transactions. The new composer's status will be
|
|
54
|
+
* BUILDING, so additional transactions may be added to it.
|
|
55
|
+
*/
|
|
56
|
+
clone(): AtomicTransactionComposer;
|
|
57
|
+
/**
|
|
58
|
+
* Add a transaction to this atomic group.
|
|
59
|
+
*
|
|
60
|
+
* An error will be thrown if the transaction has a nonzero group ID, the composer's status is
|
|
61
|
+
* not BUILDING, or if adding this transaction causes the current group to exceed MAX_GROUP_SIZE.
|
|
62
|
+
*/
|
|
63
|
+
addTransaction(txnAndSigner: TransactionWithSigner): void;
|
|
64
|
+
/**
|
|
65
|
+
* Add a smart contract method call to this atomic group.
|
|
66
|
+
*
|
|
67
|
+
* An error will be thrown if the composer's status is not BUILDING, if adding this transaction
|
|
68
|
+
* causes the current group to exceed MAX_GROUP_SIZE, or if the provided arguments are invalid
|
|
69
|
+
* for the given method.
|
|
70
|
+
*/
|
|
71
|
+
addMethodCall({ appId, method, methodArgs, sender, suggestedParams, onComplete, note, lease, rekeyTo, signer, }: {
|
|
72
|
+
/** The ID of the smart contract to call */
|
|
73
|
+
appId: number;
|
|
74
|
+
/** The method to call on the smart contract */
|
|
75
|
+
method: ABIMethod;
|
|
76
|
+
/** The arguments to include in the method call. If omitted, no arguments will be passed to the method. */
|
|
77
|
+
methodArgs?: ABIArgument[];
|
|
78
|
+
/** The address of the sender of this application call */
|
|
79
|
+
sender: string;
|
|
80
|
+
/** Transactions params to use for this application call */
|
|
81
|
+
suggestedParams: SuggestedParams;
|
|
82
|
+
/** The OnComplete action to take for this application call. If omitted, OnApplicationComplete.NoOpOC will be used. */
|
|
83
|
+
onComplete?: OnApplicationComplete;
|
|
84
|
+
/** The note value for this application call */
|
|
85
|
+
note?: Uint8Array;
|
|
86
|
+
/** The lease value for this application call */
|
|
87
|
+
lease?: Uint8Array;
|
|
88
|
+
/** If provided, the address that the sender will be rekeyed to at the conclusion of this application call */
|
|
89
|
+
rekeyTo?: string;
|
|
90
|
+
/** A transaction signer that can authorize this application call from sender */
|
|
91
|
+
signer: TransactionSigner;
|
|
92
|
+
}): void;
|
|
93
|
+
/**
|
|
94
|
+
* Finalize the transaction group and returned the finalized transactions.
|
|
95
|
+
*
|
|
96
|
+
* The composer's status will be at least BUILT after executing this method.
|
|
97
|
+
*/
|
|
98
|
+
buildGroup(): TransactionWithSigner[];
|
|
99
|
+
/**
|
|
100
|
+
* Obtain signatures for each transaction in this group. If signatures have already been obtained,
|
|
101
|
+
* this method will return cached versions of the signatures.
|
|
102
|
+
*
|
|
103
|
+
* The composer's status will be at least SIGNED after executing this method.
|
|
104
|
+
*
|
|
105
|
+
* An error will be thrown if signing any of the transactions fails.
|
|
106
|
+
*
|
|
107
|
+
* @returns A promise that resolves to an array of signed transactions.
|
|
108
|
+
*/
|
|
109
|
+
gatherSignatures(): Promise<Uint8Array[]>;
|
|
110
|
+
/**
|
|
111
|
+
* Send the transaction group to the network, but don't wait for it to be committed to a block. An
|
|
112
|
+
* error will be thrown if submission fails.
|
|
113
|
+
*
|
|
114
|
+
* The composer's status must be SUBMITTED or lower before calling this method. If submission is
|
|
115
|
+
* successful, this composer's status will update to SUBMITTED.
|
|
116
|
+
*
|
|
117
|
+
* Note: a group can only be submitted again if it fails.
|
|
118
|
+
*
|
|
119
|
+
* @param client - An Algodv2 client
|
|
120
|
+
*
|
|
121
|
+
* @returns A promise that, upon success, resolves to a list of TxIDs of the submitted transactions.
|
|
122
|
+
*/
|
|
123
|
+
submit(client: Algodv2): Promise<string[]>;
|
|
124
|
+
/**
|
|
125
|
+
* Send the transaction group to the network and wait until it's committed to a block. An error
|
|
126
|
+
* will be thrown if submission or execution fails.
|
|
127
|
+
*
|
|
128
|
+
* The composer's status must be SUBMITTED or lower before calling this method, since execution is
|
|
129
|
+
* only allowed once. If submission is successful, this composer's status will update to SUBMITTED.
|
|
130
|
+
* If the execution is also successful, this composer's status will update to COMMITTED.
|
|
131
|
+
*
|
|
132
|
+
* Note: a group can only be submitted again if it fails.
|
|
133
|
+
*
|
|
134
|
+
* @param client - An Algodv2 client
|
|
135
|
+
* @param waitRounds - The maximum number of rounds to wait for transaction confirmation
|
|
136
|
+
*
|
|
137
|
+
* @returns A promise that, upon success, resolves to an object containing the confirmed round for
|
|
138
|
+
* this transaction, the txIDs of the submitted transactions, and an array of results containing
|
|
139
|
+
* one element for each method call transaction in this group.
|
|
140
|
+
*/
|
|
141
|
+
execute(client: Algodv2, waitRounds: number): Promise<{
|
|
142
|
+
confirmedRound: number;
|
|
143
|
+
txIDs: string[];
|
|
144
|
+
methodResults: ABIResult[];
|
|
145
|
+
}>;
|
|
146
|
+
}
|
|
@@ -49,3 +49,9 @@ export declare function fromMultisigPreImgAddrs({ version, threshold, addrs, }:
|
|
|
49
49
|
threshold: number;
|
|
50
50
|
addrs: string[];
|
|
51
51
|
}): string;
|
|
52
|
+
/**
|
|
53
|
+
* Get the escrow address of an application.
|
|
54
|
+
* @param appID - The ID of the application.
|
|
55
|
+
* @returns The address corresponding to that application's escrow account.
|
|
56
|
+
*/
|
|
57
|
+
export declare function getApplicationAddress(appID: number | bigint): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bigIntToBytes converts a BigInt to a big-endian Uint8Array for encoding.
|
|
3
|
+
* @param bi - The bigint to convert.
|
|
4
|
+
* @param size - The size of the resulting byte array.
|
|
5
|
+
* @returns A byte array containing the big-endian encoding of the input bigint
|
|
6
|
+
*/
|
|
7
|
+
export declare function bigIntToBytes(bi: bigint | number, size: number): Uint8Array;
|
|
8
|
+
/**
|
|
9
|
+
* bytesToBigInt produces a bigint from a binary representation.
|
|
10
|
+
*
|
|
11
|
+
* @param bytes - The Uint8Array to convert.
|
|
12
|
+
* @returns The bigint that was encoded in the input data.
|
|
13
|
+
*/
|
|
14
|
+
export declare function bytesToBigInt(bytes: Uint8Array): bigint;
|
|
@@ -17,7 +17,7 @@ export declare function readProgram(program: Uint8Array, args?: Uint8Array[]): [
|
|
|
17
17
|
* @throws
|
|
18
18
|
* @returns true if success
|
|
19
19
|
*/
|
|
20
|
-
export declare function checkProgram(program: Uint8Array, args
|
|
20
|
+
export declare function checkProgram(program: Uint8Array, args?: Uint8Array[]): boolean;
|
|
21
21
|
export declare function checkIntConstBlock(program: Uint8Array, pc: number): number;
|
|
22
22
|
export declare function checkByteConstBlock(program: Uint8Array, pc: number): number;
|
|
23
23
|
export declare function checkPushIntOp(program: Uint8Array, pc: number): number;
|