@algorandfoundation/algorand-typescript-testing 1.0.0-alpha.10
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/abi-metadata.d.ts +16 -0
- package/collections/custom-key-map.d.ts +29 -0
- package/constants.d.ts +27 -0
- package/context-helpers/internal-context.d.ts +26 -0
- package/decode-logs.d.ts +9 -0
- package/encoders.d.ts +9 -0
- package/errors.d.ts +5 -0
- package/impl/account.d.ts +32 -0
- package/impl/acct-params.d.ts +5 -0
- package/impl/app-global.d.ts +2 -0
- package/impl/app-local.d.ts +2 -0
- package/impl/app-params.d.ts +3 -0
- package/impl/application.d.ts +30 -0
- package/impl/asset-holding.d.ts +2 -0
- package/impl/asset-params.d.ts +3 -0
- package/impl/asset.d.ts +24 -0
- package/impl/base.d.ts +18 -0
- package/impl/block.d.ts +2 -0
- package/impl/box.d.ts +2 -0
- package/impl/crypto.d.ts +12 -0
- package/impl/encoded-types.d.ts +165 -0
- package/impl/global.d.ts +18 -0
- package/impl/gtxn.d.ts +2 -0
- package/impl/index.d.ts +15 -0
- package/impl/inner-transactions.d.ts +51 -0
- package/impl/itxn.d.ts +8 -0
- package/impl/pure.d.ts +32 -0
- package/impl/scratch.d.ts +4 -0
- package/impl/state.d.ts +103 -0
- package/impl/transactions.d.ts +140 -0
- package/impl/txn.d.ts +3 -0
- package/index.d.ts +1 -0
- package/index.mjs +4563 -0
- package/index.mjs.map +1 -0
- package/package.json +45 -0
- package/runtime-helpers-DlIX78iw.js +1426 -0
- package/runtime-helpers-DlIX78iw.js.map +1 -0
- package/runtime-helpers.d.ts +11 -0
- package/runtime-helpers.mjs +8 -0
- package/runtime-helpers.mjs.map +1 -0
- package/set-up.d.ts +11 -0
- package/subcontexts/contract-context.d.ts +9 -0
- package/subcontexts/ledger-context.d.ts +45 -0
- package/subcontexts/transaction-context.d.ts +67 -0
- package/test-execution-context.d.ts +53 -0
- package/test-transformer/errors.d.ts +3 -0
- package/test-transformer/helpers.d.ts +3 -0
- package/test-transformer/index.d.ts +6 -0
- package/test-transformer/index.mjs +458 -0
- package/test-transformer/index.mjs.map +1 -0
- package/test-transformer/node-factory.d.ts +14 -0
- package/test-transformer/supported-binary-op-string.d.ts +4 -0
- package/test-transformer/visitors.d.ts +11 -0
- package/typescript-helpers.d.ts +15 -0
- package/util.d.ts +29 -0
- package/value-generators/avm.d.ts +23 -0
- package/value-generators/index.d.ts +6 -0
- package/value-generators/txn.d.ts +10 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseContract, Contract } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
import { AbiMethodConfig, BareMethodConfig, CreateOptions, OnCompleteActionStr } from '@algorandfoundation/algorand-typescript/arc4';
|
|
3
|
+
export interface AbiMetadata {
|
|
4
|
+
methodName: string;
|
|
5
|
+
methodSelector: string;
|
|
6
|
+
argTypes: string[];
|
|
7
|
+
returnType: string;
|
|
8
|
+
onCreate?: CreateOptions;
|
|
9
|
+
allowActions?: OnCompleteActionStr[];
|
|
10
|
+
}
|
|
11
|
+
export declare const attachAbiMetadata: (contract: {
|
|
12
|
+
new (): Contract;
|
|
13
|
+
}, methodName: string, metadata: AbiMetadata) => void;
|
|
14
|
+
export declare const captureMethodConfig: <T extends Contract>(contract: T, methodName: string, config?: AbiMethodConfig<T> | BareMethodConfig) => void;
|
|
15
|
+
export declare const hasAbiMetadata: <T extends Contract>(contract: T) => boolean;
|
|
16
|
+
export declare const getAbiMetadata: <T extends BaseContract>(contract: T, methodName: string) => AbiMetadata;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Account, internal } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
import { DeliberateAny } from '../typescript-helpers';
|
|
3
|
+
export declare abstract class CustomKeyMap<TKey, TValue> implements Map<TKey, TValue> {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(keySerializer: (key: TKey) => number | bigint | string);
|
|
6
|
+
clear(): void;
|
|
7
|
+
delete(key: TKey): boolean;
|
|
8
|
+
forEach(callbackfn: (value: TValue, key: TKey, map: Map<TKey, TValue>) => void, thisArg?: DeliberateAny): void;
|
|
9
|
+
get(key: TKey): TValue | undefined;
|
|
10
|
+
getOrFail(key: TKey): TValue;
|
|
11
|
+
has(key: TKey): boolean;
|
|
12
|
+
set(key: TKey, value: TValue): this;
|
|
13
|
+
get size(): number;
|
|
14
|
+
entries(): MapIterator<[TKey, TValue]>;
|
|
15
|
+
keys(): MapIterator<TKey>;
|
|
16
|
+
values(): MapIterator<TValue>;
|
|
17
|
+
[Symbol.iterator](): MapIterator<[TKey, TValue]>;
|
|
18
|
+
get [Symbol.toStringTag](): string;
|
|
19
|
+
}
|
|
20
|
+
export declare class AccountMap<TValue> extends CustomKeyMap<Account, TValue> {
|
|
21
|
+
constructor();
|
|
22
|
+
private static getAddressStrFromAccount;
|
|
23
|
+
}
|
|
24
|
+
export declare class BytesMap<TValue> extends CustomKeyMap<internal.primitives.StubBytesCompat, TValue> {
|
|
25
|
+
constructor();
|
|
26
|
+
}
|
|
27
|
+
export declare class Uint64Map<TValue> extends CustomKeyMap<internal.primitives.StubUint64Compat, TValue> {
|
|
28
|
+
constructor();
|
|
29
|
+
}
|
package/constants.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const UINT64_SIZE = 64;
|
|
2
|
+
export declare const UINT512_SIZE = 512;
|
|
3
|
+
export declare const MAX_UINT8: number;
|
|
4
|
+
export declare const MAX_UINT64: bigint;
|
|
5
|
+
export declare const MAX_UINT512: bigint;
|
|
6
|
+
export declare const MAX_BYTES_SIZE = 4096;
|
|
7
|
+
export declare const MAX_LOG_SIZE = 1024;
|
|
8
|
+
export declare const MAX_ITEMS_IN_LOG = 32;
|
|
9
|
+
export declare const MAX_BOX_SIZE = 32768;
|
|
10
|
+
export declare const BITS_IN_BYTE = 8;
|
|
11
|
+
export declare const DEFAULT_ACCOUNT_MIN_BALANCE = 100000;
|
|
12
|
+
export declare const DEFAULT_MAX_TXN_LIFE = 1000;
|
|
13
|
+
export declare const DEFAULT_ASSET_CREATE_MIN_BALANCE = 1000000;
|
|
14
|
+
export declare const DEFAULT_ASSET_OPT_IN_MIN_BALANCE = 10000;
|
|
15
|
+
export declare const DEFAULT_GLOBAL_GENESIS_HASH: import("@algorandfoundation/algorand-typescript").bytes;
|
|
16
|
+
export declare const ZERO_ADDRESS_B32 = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ";
|
|
17
|
+
export declare const ZERO_ADDRESS: import("@algorandfoundation/algorand-typescript").bytes;
|
|
18
|
+
/**
|
|
19
|
+
"\x09" # pragma version 9
|
|
20
|
+
"\x81\x01" # pushint 1
|
|
21
|
+
*/
|
|
22
|
+
export declare const ALWAYS_APPROVE_TEAL_PROGRAM: import("@algorandfoundation/algorand-typescript").bytes;
|
|
23
|
+
export declare const LOGIC_DATA_PREFIX: import("@algorandfoundation/algorand-typescript").bytes;
|
|
24
|
+
export declare const MIN_TXN_FEE = 1000;
|
|
25
|
+
export declare const ABI_RETURN_VALUE_LOG_PREFIX: import("@algorandfoundation/algorand-typescript").bytes;
|
|
26
|
+
export declare const UINT64_OVERFLOW_UNDERFLOW_MESSAGE = "Uint64 overflow or underflow";
|
|
27
|
+
export declare const BIGUINT_OVERFLOW_UNDERFLOW_MESSAGE = "BigUint overflow or underflow";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Account, internal } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
import { AccountData } from '../impl/account';
|
|
3
|
+
import { ApplicationData } from '../impl/application';
|
|
4
|
+
import { AssetData } from '../impl/asset';
|
|
5
|
+
import { TransactionGroup } from '../subcontexts/transaction-context';
|
|
6
|
+
import { TestExecutionContext } from '../test-execution-context';
|
|
7
|
+
/**
|
|
8
|
+
* For accessing implementation specific functions, with a convenient single entry
|
|
9
|
+
* point for other modules to import Also allows for a single place to check and
|
|
10
|
+
* provide.
|
|
11
|
+
*/
|
|
12
|
+
declare class InternalContext {
|
|
13
|
+
get value(): TestExecutionContext;
|
|
14
|
+
get defaultSender(): Account;
|
|
15
|
+
get ledger(): import("../subcontexts/ledger-context").LedgerContext;
|
|
16
|
+
get txn(): import("../subcontexts/transaction-context").TransactionContext;
|
|
17
|
+
get contract(): import("../subcontexts/contract-context").ContractContext;
|
|
18
|
+
get any(): import("../value-generators").ValueGenerator;
|
|
19
|
+
get activeApplication(): import("@algorandfoundation/algorand-typescript").Application;
|
|
20
|
+
get activeGroup(): TransactionGroup;
|
|
21
|
+
getAccountData(account: Account): AccountData;
|
|
22
|
+
getAssetData(id: internal.primitives.StubUint64Compat): AssetData;
|
|
23
|
+
getApplicationData(id: internal.primitives.StubUint64Compat): ApplicationData;
|
|
24
|
+
}
|
|
25
|
+
export declare const lazyContext: InternalContext;
|
|
26
|
+
export {};
|
package/decode-logs.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { bytes } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
export type LogDecoding = 'i' | 's' | 'b';
|
|
3
|
+
export type DecodedLog<T extends LogDecoding> = T extends 'i' ? bigint : T extends 's' ? string : Uint8Array;
|
|
4
|
+
export type DecodedLogs<T extends [...LogDecoding[]]> = {
|
|
5
|
+
[Index in keyof T]: DecodedLog<T[Index]>;
|
|
6
|
+
} & {
|
|
7
|
+
length: T['length'];
|
|
8
|
+
};
|
|
9
|
+
export declare function decodeLogs<const T extends [...LogDecoding[]]>(logs: bytes[], decoding: T): DecodedLogs<T>;
|
package/encoders.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { internal } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
import { DeliberateAny } from './typescript-helpers';
|
|
3
|
+
export type TypeInfo = {
|
|
4
|
+
name: string;
|
|
5
|
+
genericArgs?: TypeInfo[] | Record<string, TypeInfo>;
|
|
6
|
+
};
|
|
7
|
+
export type fromBytes<T> = (val: Uint8Array | internal.primitives.StubBytesCompat, typeInfo: TypeInfo, prefix?: 'none' | 'log') => T;
|
|
8
|
+
export declare const encoders: Record<string, fromBytes<DeliberateAny>>;
|
|
9
|
+
export declare const getEncoder: <T>(typeInfo: TypeInfo) => fromBytes<T>;
|
package/errors.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Account, Application, Asset, bytes, internal, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
import { Uint64Map } from '../collections/custom-key-map';
|
|
3
|
+
import { Mutable } from '../typescript-helpers';
|
|
4
|
+
import { BytesBackedCls } from './base';
|
|
5
|
+
export declare class AssetHolding {
|
|
6
|
+
balance: uint64;
|
|
7
|
+
frozen: boolean;
|
|
8
|
+
constructor(balance: internal.primitives.StubUint64Compat, frozen: boolean);
|
|
9
|
+
}
|
|
10
|
+
export declare class AccountData {
|
|
11
|
+
optedAssets: Uint64Map<AssetHolding>;
|
|
12
|
+
optedApplications: Uint64Map<Application>;
|
|
13
|
+
account: Mutable<Omit<Account, 'bytes' | 'isOptedIn'>>;
|
|
14
|
+
constructor();
|
|
15
|
+
}
|
|
16
|
+
export declare class AccountCls extends BytesBackedCls implements Account {
|
|
17
|
+
constructor(address?: bytes);
|
|
18
|
+
private get data();
|
|
19
|
+
get balance(): uint64;
|
|
20
|
+
get minBalance(): uint64;
|
|
21
|
+
get authAddress(): Account;
|
|
22
|
+
get totalNumUint(): uint64;
|
|
23
|
+
get totalNumByteSlice(): uint64;
|
|
24
|
+
get totalExtraAppPages(): uint64;
|
|
25
|
+
get totalAppsCreated(): uint64;
|
|
26
|
+
get totalAppsOptedIn(): uint64;
|
|
27
|
+
get totalAssetsCreated(): uint64;
|
|
28
|
+
get totalAssets(): uint64;
|
|
29
|
+
get totalBoxes(): uint64;
|
|
30
|
+
get totalBoxBytes(): uint64;
|
|
31
|
+
isOptedIn(assetOrApp: Asset | Application): boolean;
|
|
32
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Account, internal, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
export declare const getAccount: (acct: Account | internal.primitives.StubUint64Compat) => Account;
|
|
3
|
+
export declare const balance: (a: Account | internal.primitives.StubUint64Compat) => uint64;
|
|
4
|
+
export declare const minBalance: (a: Account | internal.primitives.StubUint64Compat) => uint64;
|
|
5
|
+
export declare const AcctParams: internal.opTypes.AcctParamsType;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Account, Application, bytes, LocalState, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
import { BytesMap } from '../collections/custom-key-map';
|
|
3
|
+
import { Mutable } from '../typescript-helpers';
|
|
4
|
+
import { Uint64BackedCls } from './base';
|
|
5
|
+
import { GlobalStateCls } from './state';
|
|
6
|
+
export declare class ApplicationData {
|
|
7
|
+
application: Mutable<Omit<Application, 'id' | 'address'>> & {
|
|
8
|
+
appLogs: bytes[];
|
|
9
|
+
globalStates: BytesMap<GlobalStateCls<unknown>>;
|
|
10
|
+
localStates: BytesMap<LocalState<unknown>>;
|
|
11
|
+
boxes: BytesMap<Uint8Array>;
|
|
12
|
+
};
|
|
13
|
+
isCreating: boolean;
|
|
14
|
+
get appLogs(): bytes[];
|
|
15
|
+
constructor();
|
|
16
|
+
}
|
|
17
|
+
export declare class ApplicationCls extends Uint64BackedCls implements Application {
|
|
18
|
+
get id(): uint64;
|
|
19
|
+
constructor(id?: uint64);
|
|
20
|
+
private get data();
|
|
21
|
+
get approvalProgram(): bytes;
|
|
22
|
+
get clearStateProgram(): bytes;
|
|
23
|
+
get globalNumUint(): uint64;
|
|
24
|
+
get globalNumBytes(): uint64;
|
|
25
|
+
get localNumUint(): uint64;
|
|
26
|
+
get localNumBytes(): uint64;
|
|
27
|
+
get extraProgramPages(): uint64;
|
|
28
|
+
get creator(): Account;
|
|
29
|
+
get address(): Account;
|
|
30
|
+
}
|
package/impl/asset.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Account, Asset, bytes, internal, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
import { Mutable } from '../typescript-helpers';
|
|
3
|
+
import { Uint64BackedCls } from './base';
|
|
4
|
+
export type AssetData = Mutable<Omit<Asset, 'id' | 'balance' | 'frozen'>>;
|
|
5
|
+
export declare class AssetCls extends Uint64BackedCls implements Asset {
|
|
6
|
+
get id(): uint64;
|
|
7
|
+
constructor(id?: internal.primitives.StubUint64Compat);
|
|
8
|
+
private get data();
|
|
9
|
+
get total(): uint64;
|
|
10
|
+
get decimals(): uint64;
|
|
11
|
+
get defaultFrozen(): boolean;
|
|
12
|
+
get unitName(): bytes;
|
|
13
|
+
get name(): bytes;
|
|
14
|
+
get url(): bytes;
|
|
15
|
+
get metadataHash(): bytes;
|
|
16
|
+
get manager(): Account;
|
|
17
|
+
get reserve(): Account;
|
|
18
|
+
get freeze(): Account;
|
|
19
|
+
get clawback(): Account;
|
|
20
|
+
get creator(): Account;
|
|
21
|
+
balance(account: Account): uint64;
|
|
22
|
+
frozen(account: Account): boolean;
|
|
23
|
+
private getAssetHolding;
|
|
24
|
+
}
|
package/impl/base.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { bytes, internal, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
import type { TypeInfo } from '../encoders';
|
|
3
|
+
export declare abstract class BytesBackedCls {
|
|
4
|
+
#private;
|
|
5
|
+
get bytes(): bytes;
|
|
6
|
+
constructor(value: bytes, _typeInfo?: TypeInfo);
|
|
7
|
+
static fromBytes<T extends BytesBackedCls>(this: {
|
|
8
|
+
new (v: bytes, typeInfo?: TypeInfo): T;
|
|
9
|
+
}, value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo?: TypeInfo): T;
|
|
10
|
+
}
|
|
11
|
+
export declare abstract class Uint64BackedCls {
|
|
12
|
+
#private;
|
|
13
|
+
get uint64(): uint64;
|
|
14
|
+
constructor(value: uint64);
|
|
15
|
+
static fromBytes<T extends Uint64BackedCls>(this: {
|
|
16
|
+
new (v: uint64): T;
|
|
17
|
+
}, value: internal.primitives.StubBytesCompat | Uint8Array): T;
|
|
18
|
+
}
|
package/impl/block.d.ts
ADDED
package/impl/box.d.ts
ADDED
package/impl/crypto.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { bytes, Ecdsa, internal, VrfVerify } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
export declare const sha256: (a: internal.primitives.StubBytesCompat) => bytes;
|
|
3
|
+
export declare const sha3_256: (a: internal.primitives.StubBytesCompat) => bytes;
|
|
4
|
+
export declare const keccak256: (a: internal.primitives.StubBytesCompat) => bytes;
|
|
5
|
+
export declare const sha512_256: (a: internal.primitives.StubBytesCompat) => bytes;
|
|
6
|
+
export declare const ed25519verifyBare: (a: internal.primitives.StubBytesCompat, b: internal.primitives.StubBytesCompat, c: internal.primitives.StubBytesCompat) => boolean;
|
|
7
|
+
export declare const ed25519verify: (a: internal.primitives.StubBytesCompat, b: internal.primitives.StubBytesCompat, c: internal.primitives.StubBytesCompat) => boolean;
|
|
8
|
+
export declare const ecdsaVerify: (v: Ecdsa, a: internal.primitives.StubBytesCompat, b: internal.primitives.StubBytesCompat, c: internal.primitives.StubBytesCompat, d: internal.primitives.StubBytesCompat, e: internal.primitives.StubBytesCompat) => boolean;
|
|
9
|
+
export declare const ecdsaPkRecover: (v: Ecdsa, a: internal.primitives.StubBytesCompat, b: internal.primitives.StubUint64Compat, c: internal.primitives.StubBytesCompat, d: internal.primitives.StubBytesCompat) => readonly [bytes, bytes];
|
|
10
|
+
export declare const ecdsaPkDecompress: (v: Ecdsa, a: internal.primitives.StubBytesCompat) => readonly [bytes, bytes];
|
|
11
|
+
export declare const vrfVerify: (_s: VrfVerify, _a: internal.primitives.StubBytesCompat, _b: internal.primitives.StubBytesCompat, _c: internal.primitives.StubBytesCompat) => readonly [bytes, boolean];
|
|
12
|
+
export declare const EllipticCurve: internal.opTypes.EllipticCurveType;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { Account, BigUintCompat, bytes, internal, StringCompat, uint64, Uint64Compat } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
import { Address, ARC4Encoded, BitSize, Bool, Byte, DynamicArray, DynamicBytes, StaticArray, StaticBytes, Str, Tuple, UFixedNxM, UintN } from '@algorandfoundation/algorand-typescript/arc4';
|
|
3
|
+
import { fromBytes, TypeInfo } from '../encoders';
|
|
4
|
+
import { DeliberateAny } from '../typescript-helpers';
|
|
5
|
+
type CompatForArc4Int<N extends BitSize> = N extends 8 | 16 | 32 | 64 ? Uint64Compat : BigUintCompat;
|
|
6
|
+
export declare class UintNImpl<N extends BitSize> extends UintN<N> {
|
|
7
|
+
private value;
|
|
8
|
+
private bitSize;
|
|
9
|
+
typeInfo: TypeInfo;
|
|
10
|
+
constructor(typeInfo: TypeInfo | string, v?: CompatForArc4Int<N>);
|
|
11
|
+
get native(): UintN<N>["native"];
|
|
12
|
+
get bytes(): bytes;
|
|
13
|
+
equals(other: this): boolean;
|
|
14
|
+
static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): UintNImpl<BitSize>;
|
|
15
|
+
static getMaxBitsLength(typeInfo: TypeInfo): BitSize;
|
|
16
|
+
}
|
|
17
|
+
export declare class UFixedNxMImpl<N extends BitSize, M extends number> extends UFixedNxM<N, M> {
|
|
18
|
+
private value;
|
|
19
|
+
private bitSize;
|
|
20
|
+
private precision;
|
|
21
|
+
private typeInfo;
|
|
22
|
+
constructor(typeInfo: TypeInfo | string, v: `${number}.${number}`);
|
|
23
|
+
get native(): UFixedNxM<N, M>["native"];
|
|
24
|
+
get bytes(): bytes;
|
|
25
|
+
equals(other: this): boolean;
|
|
26
|
+
static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): UFixedNxM<BitSize, number>;
|
|
27
|
+
static getMaxBitsLength(typeInfo: TypeInfo): BitSize;
|
|
28
|
+
}
|
|
29
|
+
export declare class ByteImpl extends Byte {
|
|
30
|
+
private value;
|
|
31
|
+
constructor(typeInfo: TypeInfo | string, v?: CompatForArc4Int<8>);
|
|
32
|
+
get native(): uint64;
|
|
33
|
+
get bytes(): bytes;
|
|
34
|
+
equals(other: this): boolean;
|
|
35
|
+
static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): ByteImpl;
|
|
36
|
+
static getMaxBitsLength(typeInfo: TypeInfo): BitSize;
|
|
37
|
+
}
|
|
38
|
+
export declare class StrImpl extends Str {
|
|
39
|
+
private value;
|
|
40
|
+
constructor(_typeInfo: TypeInfo | string, s?: StringCompat);
|
|
41
|
+
get native(): string;
|
|
42
|
+
get bytes(): bytes;
|
|
43
|
+
equals(other: this): boolean;
|
|
44
|
+
static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): StrImpl;
|
|
45
|
+
}
|
|
46
|
+
export declare class BoolImpl extends Bool {
|
|
47
|
+
private value;
|
|
48
|
+
constructor(_typeInfo: TypeInfo | string, v?: boolean);
|
|
49
|
+
get native(): boolean;
|
|
50
|
+
equals(other: this): boolean;
|
|
51
|
+
get bytes(): bytes;
|
|
52
|
+
static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): BoolImpl;
|
|
53
|
+
}
|
|
54
|
+
type StaticArrayGenericArgs = {
|
|
55
|
+
elementType: TypeInfo;
|
|
56
|
+
size: TypeInfo;
|
|
57
|
+
};
|
|
58
|
+
export declare class StaticArrayImpl<TItem extends ARC4Encoded, TLength extends number> extends StaticArray<TItem, TLength> {
|
|
59
|
+
private value?;
|
|
60
|
+
private uint8ArrayValue?;
|
|
61
|
+
private typeInfo;
|
|
62
|
+
private size;
|
|
63
|
+
genericArgs: StaticArrayGenericArgs;
|
|
64
|
+
constructor(typeInfo: TypeInfo | string, ...items: TItem[] & {
|
|
65
|
+
length: TLength;
|
|
66
|
+
});
|
|
67
|
+
constructor(typeInfo: TypeInfo | string, ...items: TItem[]);
|
|
68
|
+
get bytes(): bytes;
|
|
69
|
+
equals(other: this): boolean;
|
|
70
|
+
get length(): uint64;
|
|
71
|
+
get items(): TItem[];
|
|
72
|
+
setItem(index: number, value: TItem): void;
|
|
73
|
+
copy(): StaticArrayImpl<TItem, TLength>;
|
|
74
|
+
static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): StaticArrayImpl<ARC4Encoded, number>;
|
|
75
|
+
static getMaxBytesLength(typeInfo: TypeInfo): number;
|
|
76
|
+
}
|
|
77
|
+
export declare class AddressImpl extends Address {
|
|
78
|
+
private typeInfo;
|
|
79
|
+
private value;
|
|
80
|
+
constructor(typeInfo: TypeInfo | string, value?: Account | string | bytes);
|
|
81
|
+
get bytes(): bytes;
|
|
82
|
+
equals(other: this): boolean;
|
|
83
|
+
get length(): uint64;
|
|
84
|
+
get native(): Account;
|
|
85
|
+
get items(): ByteImpl[];
|
|
86
|
+
setItem(_index: number, _value: ByteImpl): void;
|
|
87
|
+
static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): AddressImpl;
|
|
88
|
+
static getMaxBytesLength(typeInfo: TypeInfo): number;
|
|
89
|
+
}
|
|
90
|
+
type DynamicArrayGenericArgs = {
|
|
91
|
+
elementType: TypeInfo;
|
|
92
|
+
};
|
|
93
|
+
export declare class DynamicArrayImpl<TItem extends ARC4Encoded> extends DynamicArray<TItem> {
|
|
94
|
+
private value?;
|
|
95
|
+
private uint8ArrayValue?;
|
|
96
|
+
private typeInfo;
|
|
97
|
+
genericArgs: DynamicArrayGenericArgs;
|
|
98
|
+
constructor(typeInfo: TypeInfo | string, ...items: TItem[]);
|
|
99
|
+
get bytes(): bytes;
|
|
100
|
+
equals(other: this): boolean;
|
|
101
|
+
get length(): uint64;
|
|
102
|
+
get items(): TItem[];
|
|
103
|
+
setItem(index: number, value: TItem): void;
|
|
104
|
+
copy(): DynamicArrayImpl<TItem>;
|
|
105
|
+
push(...values: TItem[]): void;
|
|
106
|
+
pop(): TItem;
|
|
107
|
+
static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): DynamicArrayImpl<ARC4Encoded>;
|
|
108
|
+
private encodeWithLength;
|
|
109
|
+
}
|
|
110
|
+
export declare class TupleImpl<TTuple extends [ARC4Encoded, ...ARC4Encoded[]]> extends Tuple<TTuple> {
|
|
111
|
+
private value?;
|
|
112
|
+
private uint8ArrayValue?;
|
|
113
|
+
private typeInfo;
|
|
114
|
+
genericArgs: TypeInfo[];
|
|
115
|
+
constructor(typeInfo: TypeInfo | string);
|
|
116
|
+
get bytes(): bytes;
|
|
117
|
+
equals(other: this): boolean;
|
|
118
|
+
get length(): TTuple['length'] & uint64;
|
|
119
|
+
get native(): TTuple;
|
|
120
|
+
at<TIndex extends keyof TTuple>(index: TIndex): TTuple[TIndex];
|
|
121
|
+
private get items();
|
|
122
|
+
static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): TupleImpl<[ARC4Encoded, ...ARC4Encoded[]]>;
|
|
123
|
+
static getMaxBytesLength(typeInfo: TypeInfo): number;
|
|
124
|
+
}
|
|
125
|
+
type StructConstraint = Record<string, ARC4Encoded>;
|
|
126
|
+
declare const StructImpl_base: any;
|
|
127
|
+
export declare class StructImpl<T extends StructConstraint> extends StructImpl_base {
|
|
128
|
+
private uint8ArrayValue?;
|
|
129
|
+
private typeInfo;
|
|
130
|
+
genericArgs: Record<string, TypeInfo>;
|
|
131
|
+
constructor(typeInfo: TypeInfo | string, value?: T);
|
|
132
|
+
get bytes(): bytes;
|
|
133
|
+
get items(): T;
|
|
134
|
+
private decodeAsProperties;
|
|
135
|
+
static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): StructImpl<StructConstraint>;
|
|
136
|
+
}
|
|
137
|
+
export declare class DynamicBytesImpl extends DynamicBytes {
|
|
138
|
+
private typeInfo;
|
|
139
|
+
private value;
|
|
140
|
+
constructor(typeInfo: TypeInfo | string, value?: bytes | string);
|
|
141
|
+
get bytes(): bytes;
|
|
142
|
+
equals(other: this): boolean;
|
|
143
|
+
get length(): uint64;
|
|
144
|
+
get native(): bytes;
|
|
145
|
+
get items(): ByteImpl[];
|
|
146
|
+
setItem(_index: number, _value: ByteImpl): void;
|
|
147
|
+
static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): DynamicBytesImpl;
|
|
148
|
+
}
|
|
149
|
+
export declare class StaticBytesImpl extends StaticBytes {
|
|
150
|
+
private value;
|
|
151
|
+
private typeInfo;
|
|
152
|
+
constructor(typeInfo: TypeInfo | string, value?: bytes | string);
|
|
153
|
+
get bytes(): bytes;
|
|
154
|
+
equals(other: this): boolean;
|
|
155
|
+
get length(): uint64;
|
|
156
|
+
get native(): bytes;
|
|
157
|
+
get items(): ByteImpl[];
|
|
158
|
+
setItem(_index: number, _value: ByteImpl): void;
|
|
159
|
+
static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): StaticBytesImpl;
|
|
160
|
+
static getMaxBytesLength(typeInfo: TypeInfo): number;
|
|
161
|
+
}
|
|
162
|
+
export declare function interpretAsArc4Impl<T extends ARC4Encoded>(typeInfoString: string, bytes: internal.primitives.StubBytesCompat, prefix?: 'none' | 'log'): T;
|
|
163
|
+
export declare const arc4Encoders: Record<string, fromBytes<DeliberateAny>>;
|
|
164
|
+
export declare const getArc4Encoder: <T>(typeInfo: TypeInfo, encoders?: Record<string, fromBytes<DeliberateAny>>) => fromBytes<T>;
|
|
165
|
+
export {};
|
package/impl/global.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Account, bytes, internal, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
export declare class GlobalData {
|
|
3
|
+
minTxnFee: uint64;
|
|
4
|
+
minBalance: uint64;
|
|
5
|
+
maxTxnLife: uint64;
|
|
6
|
+
zeroAddress: Account;
|
|
7
|
+
logicSigVersion?: uint64;
|
|
8
|
+
round?: uint64;
|
|
9
|
+
latestTimestamp?: uint64;
|
|
10
|
+
groupId?: bytes;
|
|
11
|
+
callerApplicationId: uint64;
|
|
12
|
+
assetCreateMinBalance: uint64;
|
|
13
|
+
assetOptInMinBalance: uint64;
|
|
14
|
+
genesisHash: bytes;
|
|
15
|
+
opcodeBudget?: uint64;
|
|
16
|
+
constructor();
|
|
17
|
+
}
|
|
18
|
+
export declare const Global: internal.opTypes.GlobalType;
|
package/impl/gtxn.d.ts
ADDED
package/impl/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { AcctParams, balance, minBalance } from './acct-params';
|
|
2
|
+
export { AppGlobal } from './app-global';
|
|
3
|
+
export { AppLocal } from './app-local';
|
|
4
|
+
export { AppParams } from './app-params';
|
|
5
|
+
export { AssetHolding } from './asset-holding';
|
|
6
|
+
export { AssetParams } from './asset-params';
|
|
7
|
+
export { Box } from './box';
|
|
8
|
+
export * from './crypto';
|
|
9
|
+
export { Global } from './global';
|
|
10
|
+
export { GTxn } from './gtxn';
|
|
11
|
+
export { GITxn, ITxn, ITxnCreate } from './itxn';
|
|
12
|
+
export * from './pure';
|
|
13
|
+
export { Scratch, gloadBytes, gloadUint64 } from './scratch';
|
|
14
|
+
export { Block } from './block';
|
|
15
|
+
export { Txn, gaid } from './txn';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { arc4, itxn, TransactionType, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
import { ApplicationTransaction, AssetConfigTransaction, AssetFreezeTransaction, AssetTransferTransaction, KeyRegistrationTransaction, PaymentTransaction } from './transactions';
|
|
3
|
+
import { InnerTxn, InnerTxnFields } from './itxn';
|
|
4
|
+
import { Mutable } from '../typescript-helpers';
|
|
5
|
+
export declare class PaymentInnerTxn extends PaymentTransaction implements itxn.PaymentInnerTxn {
|
|
6
|
+
readonly isItxn?: true;
|
|
7
|
+
static create(fields: itxn.PaymentFields): PaymentInnerTxn;
|
|
8
|
+
constructor(fields: itxn.PaymentFields);
|
|
9
|
+
}
|
|
10
|
+
export declare class KeyRegistrationInnerTxn extends KeyRegistrationTransaction implements itxn.KeyRegistrationInnerTxn {
|
|
11
|
+
readonly isItxn?: true;
|
|
12
|
+
static create(fields: itxn.KeyRegistrationFields): KeyRegistrationInnerTxn;
|
|
13
|
+
constructor(fields: itxn.KeyRegistrationFields);
|
|
14
|
+
}
|
|
15
|
+
export declare class AssetConfigInnerTxn extends AssetConfigTransaction implements itxn.AssetConfigInnerTxn {
|
|
16
|
+
readonly isItxn?: true;
|
|
17
|
+
static create(fields: itxn.AssetConfigFields): AssetConfigInnerTxn;
|
|
18
|
+
constructor(fields: itxn.AssetConfigFields);
|
|
19
|
+
}
|
|
20
|
+
export declare class AssetTransferInnerTxn extends AssetTransferTransaction implements itxn.AssetTransferInnerTxn {
|
|
21
|
+
readonly isItxn?: true;
|
|
22
|
+
static create(fields: Partial<itxn.AssetTransferFields>): AssetTransferInnerTxn;
|
|
23
|
+
constructor(fields: itxn.AssetTransferFields);
|
|
24
|
+
}
|
|
25
|
+
export declare class AssetFreezeInnerTxn extends AssetFreezeTransaction implements itxn.AssetFreezeInnerTxn {
|
|
26
|
+
readonly isItxn?: true;
|
|
27
|
+
static create(fields: Partial<itxn.AssetFreezeFields>): AssetFreezeInnerTxn;
|
|
28
|
+
constructor(fields: itxn.AssetFreezeFields);
|
|
29
|
+
}
|
|
30
|
+
export declare class ApplicationInnerTxn extends ApplicationTransaction implements itxn.ApplicationInnerTxn {
|
|
31
|
+
readonly isItxn?: true;
|
|
32
|
+
static create(fields: Omit<itxn.ApplicationCallFields, 'onCompletion'> & {
|
|
33
|
+
onCompletion?: arc4.OnCompleteAction | uint64 | arc4.OnCompleteActionStr;
|
|
34
|
+
}): ApplicationInnerTxn;
|
|
35
|
+
constructor(fields: Mutable<itxn.ApplicationCallFields>);
|
|
36
|
+
}
|
|
37
|
+
export declare const createInnerTxn: <TFields extends InnerTxnFields>(fields: TFields) => PaymentInnerTxn | KeyRegistrationInnerTxn | AssetTransferInnerTxn | ApplicationInnerTxn | AssetConfigInnerTxn | AssetFreezeInnerTxn;
|
|
38
|
+
export declare function submitGroup<TFields extends itxn.InnerTxnList>(...transactionFields: TFields): itxn.TxnFor<TFields>;
|
|
39
|
+
export declare function payment(fields: itxn.PaymentFields): itxn.PaymentItxnParams;
|
|
40
|
+
export declare function keyRegistration(fields: itxn.KeyRegistrationFields): itxn.KeyRegistrationItxnParams;
|
|
41
|
+
export declare function assetConfig(fields: itxn.AssetConfigFields): itxn.AssetConfigItxnParams;
|
|
42
|
+
export declare function assetTransfer(fields: itxn.AssetTransferFields): itxn.AssetTransferItxnParams;
|
|
43
|
+
export declare function assetFreeze(fields: itxn.AssetFreezeFields): itxn.AssetFreezeItxnParams;
|
|
44
|
+
export declare function applicationCall(fields: itxn.ApplicationCallFields): itxn.ApplicationCallItxnParams;
|
|
45
|
+
export declare class ItxnParams<TFields extends InnerTxnFields, TTransaction extends InnerTxn> {
|
|
46
|
+
#private;
|
|
47
|
+
constructor(fields: TFields, type: TransactionType);
|
|
48
|
+
submit(): TTransaction;
|
|
49
|
+
set(p: Partial<TFields>): void;
|
|
50
|
+
copy(): ItxnParams<TFields, TTransaction>;
|
|
51
|
+
}
|
package/impl/itxn.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { internal, itxn, TransactionType } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
export type InnerTxn = itxn.PaymentInnerTxn | itxn.KeyRegistrationInnerTxn | itxn.AssetConfigInnerTxn | itxn.AssetTransferInnerTxn | itxn.AssetFreezeInnerTxn | itxn.ApplicationInnerTxn;
|
|
3
|
+
export type InnerTxnFields = (itxn.PaymentFields | itxn.KeyRegistrationFields | itxn.AssetConfigFields | itxn.AssetTransferFields | itxn.AssetFreezeFields | itxn.ApplicationCallFields) & {
|
|
4
|
+
type?: TransactionType;
|
|
5
|
+
};
|
|
6
|
+
export declare const GITxn: internal.opTypes.GITxnType;
|
|
7
|
+
export declare const ITxn: internal.opTypes.ITxnType;
|
|
8
|
+
export declare const ITxnCreate: internal.opTypes.ITxnCreateType;
|
package/impl/pure.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Base64, biguint, bytes, internal, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
export declare const addw: (a: internal.primitives.StubUint64Compat, b: internal.primitives.StubUint64Compat) => readonly [uint64, uint64];
|
|
3
|
+
export declare const base64Decode: (e: Base64, a: internal.primitives.StubBytesCompat) => bytes;
|
|
4
|
+
export declare const bitLength: (a: internal.primitives.StubUint64Compat | internal.primitives.StubBytesCompat) => uint64;
|
|
5
|
+
export declare const bsqrt: (a: internal.primitives.StubBigUintCompat) => biguint;
|
|
6
|
+
export declare const btoi: (a: internal.primitives.StubBytesCompat) => uint64;
|
|
7
|
+
export declare const bzero: (a: internal.primitives.StubUint64Compat) => bytes;
|
|
8
|
+
export declare const concat: (a: internal.primitives.StubBytesCompat, b: internal.primitives.StubBytesCompat) => bytes;
|
|
9
|
+
export declare const divmodw: (a: internal.primitives.StubUint64Compat, b: internal.primitives.StubUint64Compat, c: internal.primitives.StubUint64Compat, d: internal.primitives.StubUint64Compat) => readonly [uint64, uint64, uint64, uint64];
|
|
10
|
+
export declare const divw: (a: internal.primitives.StubUint64Compat, b: internal.primitives.StubUint64Compat, c: internal.primitives.StubUint64Compat) => uint64;
|
|
11
|
+
export declare const exp: (a: internal.primitives.StubUint64Compat, b: internal.primitives.StubUint64Compat) => uint64;
|
|
12
|
+
export declare const expw: (a: internal.primitives.StubUint64Compat, b: internal.primitives.StubUint64Compat) => readonly [uint64, uint64];
|
|
13
|
+
export declare const extract: (a: internal.primitives.StubBytesCompat, b: internal.primitives.StubUint64Compat, c: internal.primitives.StubUint64Compat) => bytes;
|
|
14
|
+
export declare const extractUint16: (a: internal.primitives.StubBytesCompat, b: internal.primitives.StubUint64Compat) => uint64;
|
|
15
|
+
export declare const extractUint32: (a: internal.primitives.StubBytesCompat, b: internal.primitives.StubUint64Compat) => uint64;
|
|
16
|
+
export declare const extractUint64: (a: internal.primitives.StubBytesCompat, b: internal.primitives.StubUint64Compat) => uint64;
|
|
17
|
+
export declare const getBit: (a: internal.primitives.StubUint64Compat | internal.primitives.StubBytesCompat, b: internal.primitives.StubUint64Compat) => uint64;
|
|
18
|
+
export declare const getByte: (a: internal.primitives.StubBytesCompat, b: internal.primitives.StubUint64Compat) => uint64;
|
|
19
|
+
export declare const itob: (a: internal.primitives.StubUint64Compat) => bytes;
|
|
20
|
+
export declare const mulw: (a: internal.primitives.StubUint64Compat, b: internal.primitives.StubUint64Compat) => readonly [uint64, uint64];
|
|
21
|
+
export declare const replace: (a: internal.primitives.StubBytesCompat, b: internal.primitives.StubUint64Compat, c: internal.primitives.StubBytesCompat) => bytes;
|
|
22
|
+
type selectType = ((a: internal.primitives.StubBytesCompat, b: internal.primitives.StubBytesCompat, c: internal.primitives.StubUint64Compat) => bytes) & ((a: internal.primitives.StubUint64Compat, b: internal.primitives.StubUint64Compat, c: internal.primitives.StubUint64Compat) => uint64);
|
|
23
|
+
export declare const select: selectType;
|
|
24
|
+
type SetBitType = ((target: internal.primitives.StubBytesCompat, n: internal.primitives.StubUint64Compat, c: internal.primitives.StubUint64Compat) => bytes) & ((target: internal.primitives.StubUint64Compat, n: internal.primitives.StubUint64Compat, c: internal.primitives.StubUint64Compat) => uint64);
|
|
25
|
+
export declare const setBit: SetBitType;
|
|
26
|
+
export declare const setByte: (a: internal.primitives.StubBytesCompat, b: internal.primitives.StubUint64Compat, c: internal.primitives.StubUint64Compat) => bytes;
|
|
27
|
+
export declare const shl: (a: internal.primitives.StubUint64Compat, b: internal.primitives.StubUint64Compat) => uint64;
|
|
28
|
+
export declare const shr: (a: internal.primitives.StubUint64Compat, b: internal.primitives.StubUint64Compat) => uint64;
|
|
29
|
+
export declare const sqrt: (a: internal.primitives.StubUint64Compat) => uint64;
|
|
30
|
+
export declare const substring: (a: internal.primitives.StubBytesCompat, b: internal.primitives.StubUint64Compat, c: internal.primitives.StubUint64Compat) => bytes;
|
|
31
|
+
export declare const JsonRef: internal.opTypes.JsonRefType;
|
|
32
|
+
export {};
|