-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathALGO.d.ts
81 lines (81 loc) · 2.78 KB
/
ALGO.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import { Stdlib_User } from './interfaces';
import algosdk from 'algosdk';
import { ethers } from 'ethers';
import type { SuggestedParams } from 'algosdk';
import type { WalletTransaction } from './ALGO_ARC11';
import type { BaseHTTPClient } from 'algosdk';
import { IBackend, ISendRecvArgs, IAccount, IContract, SecretKey } from './shared_impl';
import { CBR_Address, CBR_Val } from './CBR';
import { Token, ALGO_Ty } from './ALGO_compiled';
export type { Token } from './ALGO_compiled';
type BigNumber = ethers.BigNumber;
type AnyALGO_Ty = ALGO_Ty<CBR_Val>;
export type Ty = AnyALGO_Ty;
export type Address = string;
type TxnParams = SuggestedParams;
export type NetworkAccount = {
addr: Address;
sk?: SecretKey;
};
export type ProviderName = string;
export interface BasicProvider {
algod_bc: BaseHTTPClient;
indexer_bc: BaseHTTPClient;
algodClient: algosdk.Algodv2;
indexer: algosdk.Indexer;
}
export interface Provider extends BasicProvider {
nodeWriteOnly: boolean;
getDefaultAddress: () => Promise<Address>;
isIsolatedNetwork: boolean;
signAndPostTxns: (txns: WalletTransaction[], opts?: object) => Promise<unknown>;
}
export interface ProviderEnv {
ALGO_SERVER: string;
ALGO_PORT: string;
ALGO_TOKEN_HEADER: string;
ALGO_TOKEN: string;
ALGO_INDEXER_SERVER: string;
ALGO_INDEXER_PORT: string;
ALGO_INDEXER_TOKEN_HEADER: string;
ALGO_INDEXER_TOKEN: string;
REACH_ISOLATED_NETWORK: string;
ALGO_NODE_WRITE_ONLY: string;
}
export type Backend = IBackend<AnyALGO_Ty> & {
_Connectors: {
ALGO: {
version: number;
ABI: any;
appApproval: string;
appClear: string;
companionInfo: {
[key: string]: number;
} | null;
extraPages: number;
stateSize: number;
stateKeys: number;
unsupported: Array<string>;
warnings: Array<string>;
};
};
};
export type ContractInfo = BigNumber;
type SendRecvArgs = ISendRecvArgs<Address, Token, AnyALGO_Ty, ContractInfo>;
export type Contract = IContract<ContractInfo, Address, Token, AnyALGO_Ty>;
export type Account = IAccount<NetworkAccount, Backend, Contract, ContractInfo, Token>;
type AdjustTxnParams = (who: CBR_Address, sr: SendRecvArgs, ps: TxnParams) => Promise<TxnParams>;
interface ALGOHacks {
signSendAndConfirm: any;
toWTxn: any;
algosdk: any;
getTxnParams: any;
MinTxnFee: any;
makeTransferTxn: any;
setFaucet: any;
setAdjustTxnParams: (atp: AdjustTxnParams) => void;
}
interface ALGOStdlib extends Stdlib_User<Provider, ProviderEnv, ProviderName, Token, ContractInfo, Address, NetworkAccount, Ty, Backend, Contract, Account>, ALGOHacks {
}
export declare const load: () => ALGOStdlib;
//# sourceMappingURL=ALGO.d.ts.map