tonapi-sdk-js
Version:
Autogenerated SDK for tonapi.io
1,988 lines (1,987 loc) • 136 kB
TypeScript
export interface Error {
/** @example "error description" */
error: string;
}
export interface AccountAddress {
/**
* @format address
* @example "0:10C1073837B93FDAAD594284CE8B8EFF7B9CF25427440EB2FC682762E1471365"
*/
address: string;
/**
* Display name. Data collected from different sources like moderation lists, dns, collections names and over.
* @example "Ton foundation"
*/
name?: string;
/**
* Is this account was marked as part of scammers activity
* @example true
*/
is_scam: boolean;
/** @example "https://ton.org/logo.png" */
icon?: string;
/** @example true */
is_wallet: boolean;
}
export interface BlockCurrencyCollection {
/**
* @format int64
* @example 10000000000
*/
grams: number;
other: {
/**
* @format int64
* @example 13
*/
id: number;
/** @example "10000000000" */
value: string;
}[];
}
export interface BlockValueFlow {
from_prev_blk: BlockCurrencyCollection;
to_next_blk: BlockCurrencyCollection;
imported: BlockCurrencyCollection;
exported: BlockCurrencyCollection;
fees_collected: BlockCurrencyCollection;
burned?: BlockCurrencyCollection;
fees_imported: BlockCurrencyCollection;
recovered: BlockCurrencyCollection;
created: BlockCurrencyCollection;
minted: BlockCurrencyCollection;
}
export interface ServiceStatus {
/** @default true */
rest_online: boolean;
/** @example 100 */
indexing_latency: number;
/**
* @format int32
* @example 123456
*/
last_known_masterchain_seqno: number;
}
export interface ReducedBlock {
/**
* @format int32
* @example 0
*/
workchain_id: number;
/** @example "8000000000000000" */
shard: string;
/**
* @format int32
* @example 21734019
*/
seqno: number;
/** @example "(-1,4234234,8000000000000000)" */
master_ref?: string;
/** @example 130 */
tx_quantity: number;
/**
* @format int64
* @example 23814011000000
*/
utime: number;
shards_blocks: string[];
parent: string[];
}
export interface BlockchainBlock {
/** @example 130 */
tx_quantity: number;
value_flow: BlockValueFlow;
/**
* @format int32
* @example 0
*/
workchain_id: number;
/** @example "8000000000000000" */
shard: string;
/**
* @format int32
* @example 21734019
*/
seqno: number;
/** @example "131D0C65055F04E9C19D687B51BC70F952FD9CA6F02C2801D3B89964A779DF85" */
root_hash: string;
/** @example "A6A0BD6608672B11B79538A50B2204E748305C12AA0DED9C16CF0006CE3AF8DB" */
file_hash: string;
/**
* @format int32
* @example -239
*/
global_id: number;
/**
* @format int32
* @example 0
*/
version: number;
/** @example true */
after_merge: boolean;
/** @example true */
before_split: boolean;
/** @example true */
after_split: boolean;
/** @example true */
want_split: boolean;
/** @example true */
want_merge: boolean;
/** @example true */
key_block: boolean;
/**
* @format int64
* @example 1674826775
*/
gen_utime: number;
/**
* @format int64
* @example 23814011000000
*/
start_lt: number;
/**
* @format int64
* @example 23814011000001
*/
end_lt: number;
/**
* @format int32
* @example 0
*/
vert_seqno: number;
/**
* @format int32
* @example 0
*/
gen_catchain_seqno: number;
/**
* @format int32
* @example 0
*/
min_ref_mc_seqno: number;
/**
* @format int32
* @example 0
*/
prev_key_block_seqno: number;
/**
* @format int32
* @example 0
*/
gen_software_version?: number;
/**
* @format int64
* @example 0
*/
gen_software_capabilities?: number;
/** @example "(-1,4234234,8000000000000000)" */
master_ref?: string;
prev_refs: string[];
/**
* @format int64
* @example 0
*/
in_msg_descr_length: number;
/**
* @format int64
* @example 0
*/
out_msg_descr_length: number;
/** @example "131D0C65055F04E9C19D687B51BC70F952FD9CA6F02C2801D3B89964A779DF85" */
rand_seed: string;
/** @example "A6A0BD6608672B11B79538A50B2204E748305C12AA0DED9C16CF0006CE3AF8DB" */
created_by: string;
}
export interface BlockchainBlocks {
blocks: BlockchainBlock[];
}
export interface ReducedBlocks {
blocks: ReducedBlock[];
}
export interface BlockchainBlockShards {
shards: {
/** @example "(0,8000000000000000,4234234)" */
last_known_block_id: string;
last_known_block: BlockchainBlock;
}[];
}
/** @example "active" */
export declare enum AccountStatus {
Nonexist = "nonexist",
Uninit = "uninit",
Active = "active",
Frozen = "frozen"
}
export interface StateInit {
/**
* @format cell
* @example "b5ee9c72010106010044000114ff00f4a413f4bcf2c80b01020120020302014804050004f2300038d06c21d31f30ed44d0d33f3001c00197a4c8cb3fc9ed549330f206e20011a13431da89a1a67e61"
*/
boc: string;
interfaces: string[];
}
export interface Message {
/** @example "int_msg" */
msg_type: "int_msg" | "ext_in_msg" | "ext_out_msg";
/**
* @format int64
* @example 25713146000001
*/
created_lt: number;
/** @example true */
ihr_disabled: boolean;
/** @example true */
bounce: boolean;
/** @example true */
bounced: boolean;
/**
* @format int64
* @example 60000000
*/
value: number;
value_extra?: ExtraCurrency[];
/**
* @format int64
* @example 5681002
*/
fwd_fee: number;
/**
* @format int64
* @example 5681002
*/
ihr_fee: number;
destination?: AccountAddress;
source?: AccountAddress;
/**
* @format int64
* @example 5681002
*/
import_fee: number;
/**
* @format int64
* @example 5681002
*/
created_at: number;
/** @example "0xdeadbeaf" */
op_code?: string;
init?: StateInit;
/** @example "1219de582369ac80ee1afe12147930f458a54ff1eea612611a8bc6bd31581a6c" */
hash: string;
/**
* hex-encoded BoC with raw message body
* @format cell
* @example "B5EE9C7201010101001100001D00048656C6C6F2C20776F726C64218"
*/
raw_body?: string;
/** @example "nft_transfer" */
decoded_op_name?: string;
decoded_body?: any;
}
/** @example "TransOrd" */
export declare enum TransactionType {
TransOrd = "TransOrd",
TransTickTock = "TransTickTock",
TransSplitPrepare = "TransSplitPrepare",
TransSplitInstall = "TransSplitInstall",
TransMergePrepare = "TransMergePrepare",
TransMergeInstall = "TransMergeInstall",
TransStorage = "TransStorage"
}
/** @example "acst_unchanged" */
export declare enum AccStatusChange {
AcstUnchanged = "acst_unchanged",
AcstFrozen = "acst_frozen",
AcstDeleted = "acst_deleted"
}
/** @example "cskip_no_state" */
export declare enum ComputeSkipReason {
CskipNoState = "cskip_no_state",
CskipBadState = "cskip_bad_state",
CskipNoGas = "cskip_no_gas",
CskipSuspended = "cskip_suspended"
}
/** @example "cskip_no_state" */
export declare enum BouncePhaseType {
TrPhaseBounceNegfunds = "TrPhaseBounceNegfunds",
TrPhaseBounceNofunds = "TrPhaseBounceNofunds",
TrPhaseBounceOk = "TrPhaseBounceOk"
}
export interface ComputePhase {
/** @example true */
skipped: boolean;
skip_reason?: ComputeSkipReason;
/** @example true */
success?: boolean;
/**
* @format int64
* @example 1000
*/
gas_fees?: number;
/**
* @format int64
* @example 10000
*/
gas_used?: number;
/**
* @format int32
* @example 5
*/
vm_steps?: number;
/**
* @format int32
* @example 0
*/
exit_code?: number;
exit_code_description?: string;
}
export interface StoragePhase {
/**
* @format int64
* @example 25713146000001
*/
fees_collected: number;
/**
* @format int64
* @example 25713146000001
*/
fees_due?: number;
status_change: AccStatusChange;
}
export interface CreditPhase {
/**
* @format int64
* @example 100
*/
fees_collected: number;
/**
* @format int64
* @example 1000
*/
credit: number;
}
export interface ActionPhase {
/** @example true */
success: boolean;
/**
* @format int32
* @example 5
*/
result_code: number;
/**
* @format int32
* @example 5
*/
total_actions: number;
/**
* @format int32
* @example 5
*/
skipped_actions: number;
/**
* @format int64
* @example 1000
*/
fwd_fees: number;
/**
* @format int64
* @example 1000
*/
total_fees: number;
result_code_description?: string;
}
export interface Transaction {
/** @example "55e8809519cd3c49098c9ee45afdafcea7a894a74d0f628d94a115a50e045122" */
hash: string;
/**
* @format int64
* @example 25713146000001
*/
lt: number;
account: AccountAddress;
/** @example true */
success: boolean;
/**
* @format int64
* @example 1645544908
*/
utime: number;
orig_status: AccountStatus;
end_status: AccountStatus;
/**
* @format int64
* @example 25713146000001
*/
total_fees: number;
/**
* @format int64
* @example 25713146000001
*/
end_balance: number;
transaction_type: TransactionType;
/** @example "55e8809519cd3c49098c9ee45afdafcea7a894a74d0f628d94a115a50e045122" */
state_update_old: string;
/** @example "55e8809519cd3c49098c9ee45afdafcea7a894a74d0f628d94a115a50e045122" */
state_update_new: string;
in_msg?: Message;
out_msgs: Message[];
/** @example "(-1,4234234,8000000000000000)" */
block: string;
/** @example "55e8809519cd3c49098c9ee45afdafcea7a894a74d0f628d94a115a50e045122" */
prev_trans_hash?: string;
/**
* @format int64
* @example 25713146000001
*/
prev_trans_lt?: number;
compute_phase?: ComputePhase;
storage_phase?: StoragePhase;
credit_phase?: CreditPhase;
action_phase?: ActionPhase;
bounce_phase?: BouncePhaseType;
/** @example true */
aborted: boolean;
/** @example true */
destroyed: boolean;
/**
* hex encoded boc with raw transaction
* @format cell
* @example "b5ee9c72410206010001380003b372cf3b5b8c891e517c9addbda1c0386a09ccacbb0e3faf630b51cfc8152325acb00002ac5795c0e41fdf79135cb7da03cc623b165d614b562a51eeccd8a5e097f405abf6b37f4e73000002ac5629732c1666887ed000144030480102030101a004008272abc8f2971aa4404ac6da1597720f348b2e1247b1ad9f55cbd3b6812f0a5f08b269bb65039fb1f6074d00f794e857f6dfd01131d299df456af10a8a4943d4d165000d0c80608840492001ab48015581f575c3b8c6ab3d6"
*/
raw: string;
}
export interface Transactions {
transactions: Transaction[];
}
export interface ConfigProposalSetup {
/** @example 2 */
min_tot_rounds: number;
/** @example 6 */
max_tot_rounds: number;
/** @example 2 */
min_wins: number;
/** @example 6 */
max_losses: number;
/**
* @format int64
* @example 1000000
*/
min_store_sec: number;
/**
* @format int64
* @example 10000000
*/
max_store_sec: number;
/**
* @format int64
* @example 1
*/
bit_price: number;
/**
* @format int64
* @example 500
*/
cell_price: number;
}
export interface GasLimitPrices {
/** @format int64 */
special_gas_limit?: number;
/** @format int64 */
flat_gas_limit?: number;
/** @format int64 */
flat_gas_price?: number;
/**
* @format int64
* @example 1
*/
gas_price: number;
/**
* @format int64
* @example 1000000
*/
gas_limit: number;
/**
* @format int64
* @example 1000000
*/
gas_credit: number;
/**
* @format int64
* @example 1000000
*/
block_gas_limit: number;
/**
* @format int64
* @example 1000000
*/
freeze_due_limit: number;
/**
* @format int64
* @example 1000000
*/
delete_due_limit: number;
}
export interface BlockParamLimits {
/**
* @format int64
* @example 1000000
*/
underload: number;
/**
* @format int64
* @example 1000000
*/
soft_limit: number;
/**
* @format int64
* @example 1000000
*/
hard_limit: number;
}
export interface BlockLimits {
bytes: BlockParamLimits;
gas: BlockParamLimits;
lt_delta: BlockParamLimits;
}
export interface MsgForwardPrices {
/**
* @format int64
* @example 1000000
*/
lump_price: number;
/**
* @format int64
* @example 1000000
*/
bit_price: number;
/**
* @format int64
* @example 1000000
*/
cell_price: number;
/**
* @format int64
* @example 1000000
*/
ihr_price_factor: number;
/**
* @format int64
* @example 1000000
*/
first_frac: number;
/**
* @format int64
* @example 1000000
*/
next_frac: number;
}
export interface WorkchainDescr {
/**
* @format int
* @example 0
*/
workchain: number;
/**
* @format int64
* @example 1000000
*/
enabled_since: number;
/**
* @format int
* @example 1000000
*/
actual_min_split: number;
/**
* @format int
* @example 1000000
*/
min_split: number;
/**
* @format int
* @example 1000000
*/
max_split: number;
/** @example 1000000 */
basic: number;
/** @example true */
active: boolean;
/** @example true */
accept_msgs: boolean;
/**
* @format int
* @example 1000000
*/
flags: number;
/** @example "131D0C65055F04E9C19D687B51BC70F952FD9CA6F02C2801D3B89964A779DF85" */
zerostate_root_hash: string;
/** @example "A6A0BD6608672B11B79538A50B2204E748305C12AA0DED9C16CF0006CE3AF8DB" */
zerostate_file_hash: string;
/**
* @format int64
* @example 1000000
*/
version: number;
}
export interface MisbehaviourPunishmentConfig {
/**
* @format int64
* @example 1000000
*/
default_flat_fine: number;
/**
* @format int64
* @example 1000000
*/
default_proportional_fine: number;
/** @example 1000000 */
severity_flat_mult: number;
/** @example 1000000 */
severity_proportional_mult: number;
/** @example 1000000 */
unpunishable_interval: number;
/** @example 1000000 */
long_interval: number;
/** @example 1000000 */
long_flat_mult: number;
/** @example 1000000 */
long_proportional_mult: number;
/** @example 1000000 */
medium_interval: number;
/** @example 1000000 */
medium_flat_mult: number;
/** @example 1000000 */
medium_proportional_mult: number;
}
export interface SizeLimitsConfig {
/**
* @format int64
* @example 1000000
*/
max_msg_bits: number;
/**
* @format int64
* @example 1000000
*/
max_msg_cells: number;
/**
* @format int64
* @example 1000000
*/
max_library_cells: number;
/**
* @format int
* @example 1000000
*/
max_vm_data_depth: number;
/**
* @format int64
* @example 1000000
*/
max_ext_msg_size: number;
/**
* @format int
* @example 1000000
*/
max_ext_msg_depth: number;
/**
* @format int64
* @example 1000000
*/
max_acc_state_cells?: number;
/**
* @format int64
* @example 1000000
*/
max_acc_state_bits?: number;
}
export interface ValidatorsSet {
utime_since: number;
utime_until: number;
total: number;
main: number;
/** @example "1152921504606846800" */
total_weight?: string;
list: {
public_key: string;
/** @format int64 */
weight: number;
/** @example "45061C1D4EC44A937D0318589E13C73D151D1CEF5D3C0E53AFBCF56A6C2FE2BD" */
adnl_addr?: string;
}[];
}
export interface Oracle {
/**
* @format address
* @example "0:55e8809519cd3c49098c9ee45afdafcea7a894a74d0f628d94a115a50e045122"
*/
address: string;
/** @example "00000000000000000000000017dcab1b1481610f6c7a7a98cf0370dc0ec704a6" */
secp_pubkey: string;
}
export interface OracleBridgeParams {
/** @format address */
bridge_addr: string;
/** @format address */
oracle_multisig_address: string;
external_chain_address: string;
oracles: Oracle[];
}
export interface JettonBridgePrices {
/** @format int64 */
bridge_burn_fee: number;
/** @format int64 */
bridge_mint_fee: number;
/** @format int64 */
wallet_min_tons_for_storage: number;
/** @format int64 */
wallet_gas_consumption: number;
/** @format int64 */
minter_min_tons_for_storage: number;
/** @format int64 */
discover_gas_consumption: number;
}
export interface JettonBridgeParams {
/** @format address */
bridge_address: string;
/** @format address */
oracles_address: string;
state_flags: number;
/** @format int64 */
burn_bridge_fee?: number;
oracles: Oracle[];
external_chain_address?: string;
prices?: JettonBridgePrices;
}
export interface Validator {
/**
* @format address
* @example "0:55e8809519cd3c49098c9ee45afdafcea7a894a74d0f628d94a115a50e045122"
*/
address: string;
/** @example "10C1073837B93FDAAD594284CE8B8EFF7B9CF25427440EB2FC682762E1471365" */
adnl_address: string;
/**
* @format int64
* @example 123456789
*/
stake: number;
/**
* @format int64
* @example 123456789
*/
max_factor: number;
}
export interface Validators {
/**
* @format int64
* @example 123456789
*/
elect_at: number;
/**
* @format int64
* @example 123456789
*/
elect_close: number;
/**
* @format int64
* @example 123456789
*/
min_stake: number;
/**
* @format int64
* @example 123456789
*/
total_stake: number;
validators: Validator[];
}
export interface AccountStorageInfo {
/**
* @format int64
* @example 567
*/
used_cells: number;
/**
* @format int64
* @example 567
*/
used_bits: number;
/**
* @format int64
* @example 567
*/
used_public_cells: number;
/**
* time of the last payment
* @format int64
* @example 1720860269
*/
last_paid: number;
/**
* @format int64
* @example 567
*/
due_payment: number;
}
export interface BlockchainRawAccount {
/**
* @format address
* @example "0:da6b1b6663a0e4d18cc8574ccd9db5296e367dd9324706f3bbd9eb1cd2caf0bf"
*/
address: string;
/**
* @format int64
* @example 123456789
*/
balance: number;
extra_balance?: ExtraCurrency[];
/**
* @format cell
* @example "b5ee9c72410104010087000114ff00f4a413f4a0f2c80b0102012002030002d200dfa5ffff76a268698fe9ffe8e42c5267858f90e785ffe4f6aa6467c444ffb365ffc10802faf0807d014035e7a064b87d804077e7857fc10803dfd2407d014035e7a064b86467cd8903a32b9ba4410803ade68afd014035e7a045ea432b6363796103bb7b9363210c678b64b87d807d8040c249b3e4"
*/
code?: string;
/**
* @format cell
* @example "b5ee9c7241010101002600004811fd096c0000000000000000000000000000000000000000000000000000000000000000cb78264d"
*/
data?: string;
/**
* @format int64
* @example 123456789
*/
last_transaction_lt: number;
/** @example "088b436a846d92281734236967970612f87fbd64a2cd3573107948379e8e4161" */
last_transaction_hash?: string;
/** @example "088b436a846d92281734236967970612f87fbd64a2cd3573107948379e8e4161" */
frozen_hash?: string;
status: AccountStatus;
storage: AccountStorageInfo;
libraries?: {
/** @example true */
public: boolean;
/** @format cell */
root: string;
}[];
}
export interface WalletStats {
/**
* @format int32
* @example 123456789
*/
nfts_count: number;
/**
* @format int32
* @example 123456789
*/
jettons_count: number;
/**
* @format int32
* @example 123456789
*/
multisig_count: number;
/**
* @format int32
* @example 123456789
*/
staking_count: number;
}
export interface WalletPlugin {
/**
* @format address
* @example "0:da6b1b6663a0e4d18cc8574ccd9db5296e367dd9324706f3bbd9eb1cd2caf0bf"
*/
address: string;
/** @example "subscription_v1" */
type: string;
status: AccountStatus;
}
export interface Wallets {
accounts: Wallet[];
}
export interface Wallet {
/**
* @format address
* @example "0:da6b1b6663a0e4d18cc8574ccd9db5296e367dd9324706f3bbd9eb1cd2caf0bf"
*/
address: string;
is_wallet: boolean;
/**
* @format int64
* @example 123456789
*/
balance: number;
stats: WalletStats;
plugins: WalletPlugin[];
status: AccountStatus;
/**
* unix timestamp
* @format int64
* @example 1720860269
*/
last_activity: number;
/** @example "Ton foundation" */
name?: string;
/** @example "https://ton.org/logo.png" */
icon?: string;
/**
* @deprecated
* @example ["get_item_data"]
*/
get_methods: string[];
is_suspended?: boolean;
signature_disabled?: boolean;
interfaces?: string[];
/**
* @format int64
* @example 25713146000001
*/
last_lt: number;
}
export interface Account {
/**
* @format address
* @example "0:da6b1b6663a0e4d18cc8574ccd9db5296e367dd9324706f3bbd9eb1cd2caf0bf"
*/
address: string;
/**
* @format int64
* @example 123456789
*/
balance: number;
extra_balance?: ExtraCurrency[];
/**
* {'USD': 1, 'IDR': 1000}
* @example {}
*/
currencies_balance?: Record<string, any>;
/**
* unix timestamp
* @format int64
* @example 1720860269
*/
last_activity: number;
status: AccountStatus;
interfaces?: string[];
/** @example "Ton foundation" */
name?: string;
/** @example true */
is_scam?: boolean;
/** @example "https://ton.org/logo.png" */
icon?: string;
/** @example true */
memo_required?: boolean;
/** @example ["get_item_data"] */
get_methods: string[];
is_suspended?: boolean;
is_wallet: boolean;
}
export interface Accounts {
accounts: Account[];
}
export interface GaslessConfig {
/**
* sending excess to this address decreases the commission of a gasless transfer
* @format address
* @example "0:dfbd5be8497fdc0c9fcbdfc676864840ddf8ad6423d6d5657d9b0e8270d6c8ac"
*/
relay_address: string;
/** list of jettons, any of them can be used to pay for gas */
gas_jettons: {
/** @format address */
master_id: string;
}[];
}
export interface SignRawMessage {
/**
* @format address
* @example "0:da6b1b6663a0e4d18cc8574ccd9db5296e367dd9324706f3bbd9eb1cd2caf0bf"
*/
address: string;
/** Number of nanocoins to send. Decimal string. */
amount: string;
/**
* Raw one-cell BoC encoded in hex.
* @format cell
*/
payload?: string;
/**
* Raw once-cell BoC encoded in hex.
* @format cell
*/
stateInit?: string;
}
export interface GaslessTx {
protocol_name: string;
}
export interface SignRawParams {
protocol_name: string;
/**
* @format address
* @example "0:da6b1b6663a0e4d18cc8574ccd9db5296e367dd9324706f3bbd9eb1cd2caf0bf"
*/
relay_address: string;
/**
* Commission for the transaction. In nanocoins.
* @example "1000000"
*/
commission: string;
/**
* @format address
* @example "0:da6b1b6663a0e4d18cc8574ccd9db5296e367dd9324706f3bbd9eb1cd2caf0bf"
*/
from: string;
/**
* @format int64
* @example 1717397217
*/
valid_until: number;
messages: SignRawMessage[];
emulation?: MessageConsequences;
}
export interface MethodExecutionResult {
/** @example true */
success: boolean;
/**
* tvm exit code
* @example 0
*/
exit_code: number;
stack: TvmStackRecord[];
decoded?: any;
}
/** @format tuple-item */
export interface TvmStackRecord {
/** @example "cell" */
type: "cell" | "num" | "nan" | "null" | "tuple";
/** @format cell */
cell?: string;
/** @format cell */
slice?: string;
/** @example "" */
num?: string;
/** @example [] */
tuple?: TvmStackRecord[];
}
export interface RawBlockchainConfig {
/** @example {} */
config: Record<string, any>;
}
export interface BlockchainConfig {
/**
* config address
* @format address
*/
"0": string;
/**
* elector address
* @format address
*/
"1": string;
/**
* minter address
* @format address
*/
"2": string;
/**
* The address of the transaction fee collector.
* @format address
*/
"3"?: string;
/**
* dns root address
* @format address
*/
"4": string;
"5"?: {
/** @format address */
blackhole_addr?: string;
/** @format int64 */
fee_burn_nom: number;
/** @format int64 */
fee_burn_denom: number;
};
/** Minting fees of new currencies. */
"6"?: {
/** @format int64 */
mint_new_price: number;
/** @format int64 */
mint_add_price: number;
};
/** The volume of each of the additional currencies in circulation. */
"7"?: {
currencies: {
/** @format int64 */
currency_id: number;
amount: string;
}[];
};
/** The network version and additional capabilities supported by the validators. */
"8"?: {
/** @format int64 */
version: number;
/** @format int64 */
capabilities: number;
};
/** List of mandatory parameters of the blockchain config. */
"9"?: {
mandatory_params: number[];
};
/** List of critical TON parameters, the change of which significantly affects the network, so more voting rounds are held. */
"10"?: {
critical_params: number[];
};
/** This parameter indicates under what conditions proposals to change the TON configuration are accepted. */
"11"?: {
normal_params: ConfigProposalSetup;
critical_params: ConfigProposalSetup;
};
/** Workchains in the TON Blockchain */
"12"?: {
workchains: WorkchainDescr[];
};
/** The cost of filing complaints about incorrect operation of validators. */
"13"?: {
/** @format int64 */
deposit: number;
/** @format int64 */
bit_price: number;
/** @format int64 */
cell_price: number;
};
/** The reward in nanoTons for block creation in the TON blockchain. */
"14"?: {
/** @format int64 */
masterchain_block_fee: number;
/** @format int64 */
basechain_block_fee: number;
};
/** The reward in nanoTons for block creation in the TON blockchain. */
"15"?: {
/**
* @format int64
* @example 65536
*/
validators_elected_for: number;
/**
* @format int64
* @example 32768
*/
elections_start_before: number;
/**
* @format int64
* @example 8192
*/
elections_end_before: number;
/**
* @format int64
* @example 32768
*/
stake_held_for: number;
};
/** The limits on the number of validators in the TON blockchain. */
"16"?: {
/** @example 400 */
max_validators: number;
/** @example 100 */
max_main_validators: number;
/** @example 75 */
min_validators: number;
};
/** The stake parameters configuration in the TON blockchain. */
"17"?: {
min_stake: string;
max_stake: string;
min_total_stake: string;
/** @format int64 */
max_stake_factor: number;
};
/** The prices for data storage. */
"18"?: {
storage_prices: {
/**
* @format int64
* @example 0
*/
utime_since: number;
/**
* @format int64
* @example 1
*/
bit_price_ps: number;
/**
* @format int64
* @example 500
*/
cell_price_ps: number;
/**
* @format int64
* @example 1000
*/
mc_bit_price_ps: number;
/**
* @format int64
* @example 500000
*/
mc_cell_price_ps: number;
}[];
};
/** The cost of computations in the masterchain. The complexity of any computation is estimated in gas units. */
"20"?: {
gas_limits_prices: GasLimitPrices;
};
/** The cost of computations in the basechains. The complexity of any computation is estimated in gas units. */
"21"?: {
gas_limits_prices: GasLimitPrices;
};
/** The limits on the block in the masterchain, upon reaching which the block is finalized and the callback of the remaining messages (if any) is carried over to the next block. */
"22"?: {
block_limits: BlockLimits;
};
/** The limits on the block in the basechains, upon reaching which the block is finalized and the callback of the remaining messages (if any) is carried over to the next block. */
"23"?: {
block_limits: BlockLimits;
};
/** The cost of sending messages in the masterchain of the TON blockchain. */
"24"?: {
msg_forward_prices: MsgForwardPrices;
};
/** The cost of sending messages in the basechains of the TON blockchain. */
"25"?: {
msg_forward_prices: MsgForwardPrices;
};
/** The configuration for the Catchain protocol. */
"28"?: {
/**
* @format int64
* @example 1000000
*/
mc_catchain_lifetime: number;
/**
* @format int64
* @example 1000000
*/
shard_catchain_lifetime: number;
/**
* @format int64
* @example 1000000
*/
shard_validators_lifetime: number;
/**
* @format int64
* @example 1000000
*/
shard_validators_num: number;
/**
* @format int
* @example 1000000
*/
flags?: number;
shuffle_mc_validators?: boolean;
};
/** The configuration for the consensus protocol above catchain. */
"29"?: {
/**
* @format int
* @example 0
*/
flags?: number;
/** @example true */
new_catchain_ids?: boolean;
/**
* @format int64
* @example 3
*/
round_candidates: number;
/**
* @format int64
* @example 2000
*/
next_candidate_delay_ms: number;
/**
* @format int64
* @example 16000
*/
consensus_timeout_ms: number;
/**
* @format int64
* @example 3
*/
fast_attempts: number;
/**
* @format int64
* @example 8
*/
attempt_duration: number;
/**
* @format int64
* @example 4
*/
catchain_max_deps: number;
/**
* @format int64
* @example 2097152
*/
max_block_bytes: number;
/**
* @format int64
* @example 2097152
*/
max_collated_bytes: number;
/**
* @format int64
* @example 2
*/
proto_version?: number;
/**
* @format int64
* @example 10000
*/
catchain_max_blocks_coeff?: number;
};
/** The configuration for the consensus protocol above catchain. */
"31"?: {
fundamental_smc_addr: string[];
};
"32"?: ValidatorsSet;
"33"?: ValidatorsSet;
"34"?: ValidatorsSet;
"35"?: ValidatorsSet;
"36"?: ValidatorsSet;
"37"?: ValidatorsSet;
/** The configuration for punishment for improper behavior (non-validation). In the absence of the parameter, the default fine size is 101 TON */
"40"?: {
misbehaviour_punishment_config: MisbehaviourPunishmentConfig;
};
/** The size limits and some other characteristics of accounts and messages. */
"43"?: {
size_limits_config: SizeLimitsConfig;
};
/** suspended accounts */
"44": {
accounts: string[];
suspended_until: number;
};
/** precompiled contracts */
"45"?: {
contracts: {
/** @format address */
code_hash: string;
/** @format int64 */
gas_usage: number;
}[];
};
/** Bridge parameters for wrapping TON in other networks. */
"71"?: {
oracle_bridge_params: OracleBridgeParams;
};
/** Bridge parameters for wrapping TON in other networks. */
"72"?: {
oracle_bridge_params: OracleBridgeParams;
};
/** Bridge parameters for wrapping TON in other networks. */
"73"?: {
oracle_bridge_params: OracleBridgeParams;
};
/** Bridge parameters for wrapping tokens from other networks into tokens on the TON network. */
"79"?: {
jetton_bridge_params: JettonBridgeParams;
};
/** Bridge parameters for wrapping tokens from other networks into tokens on the TON network. */
"81"?: {
jetton_bridge_params: JettonBridgeParams;
};
/** Bridge parameters for wrapping tokens from other networks into tokens on the TON network. */
"82"?: {
jetton_bridge_params: JettonBridgeParams;
};
/**
* config boc in hex format
* @format cell
*/
raw: string;
}
export interface DomainNames {
domains: string[];
}
export interface DomainBid {
/**
* @default false
* @example true
*/
success: boolean;
/**
* @format int64
* @example 1660050553
*/
value: number;
/**
* @format int64
* @example 1660050553
*/
txTime: number;
/** @example "55e8809519cd3c49098c9ee45afdafcea7a894a74d0f628d94a115a50e045122" */
txHash: string;
bidder: AccountAddress;
}
export interface DomainBids {
data: DomainBid[];
}
export declare enum JettonVerificationType {
Whitelist = "whitelist",
Blacklist = "blacklist",
None = "none"
}
export interface JettonPreview {
/**
* @format address
* @example "0:0BB5A9F69043EEBDDA5AD2E946EB953242BD8F603FE795D90698CEEC6BFC60A0"
*/
address: string;
/** @example "Wrapped TON" */
name: string;
/** @example "WTON" */
symbol: string;
/** @example 9 */
decimals: number;
/** @example "https://cache.tonapi.io/images/jetton.jpg" */
image: string;
verification: JettonVerificationType;
custom_payload_api_uri?: string;
/** @format int32 */
score: number;
}
export interface JettonBalance {
/** @example "597968399" */
balance: string;
price?: TokenRates;
wallet_address: AccountAddress;
jetton: JettonPreview;
/** @example ["custom_payload","non_transferable"] */
extensions?: string[];
lock?: {
/** @example "597968399" */
amount: string;
/**
* @format int64
* @example 1678223064
*/
till: number;
};
}
export interface JettonsBalances {
balances: JettonBalance[];
}
/** @example "jetton" */
export declare enum CurrencyType {
Native = "native",
ExtraCurrency = "extra_currency",
Jetton = "jetton",
Fiat = "fiat"
}
export interface Price {
currency_type: CurrencyType;
/** @example "123000000000" */
value: string;
/** @example 9 */
decimals: number;
/** @example "TON" */
token_name: string;
verification: TrustType;
/** @example "https://cache.tonapi.io/images/jetton.jpg" */
image: string;
/**
* @format address
* @example "0:0BB5A9F69043EEBDDA5AD2E946EB953242BD8F603FE795D90698CEEC6BFC60A0"
*/
jetton?: string;
}
export interface ImagePreview {
/** @example "100x100" */
resolution: string;
/** @example "https://site.com/pic1.jpg" */
url: string;
}
export type NftApprovedBy = ("getgems" | "tonkeeper")[];
/** @example "whitelist" */
export declare enum TrustType {
Whitelist = "whitelist",
Graylist = "graylist",
Blacklist = "blacklist",
None = "none"
}
export interface Sale {
/**
* @format address
* @example "0:10C1073837B93FDAAD594284CE8B8EFF7B9CF25427440EB2FC682762E1471365"
*/
address: string;
market: AccountAddress;
owner?: AccountAddress;
price: Price;
}
export interface NftItem {
/**
* @format address
* @example "0:E93E7D444180608B8520C00DC664383A387356FB6E16FDDF99DBE5E1415A574B"
*/
address: string;
/**
* @format int64
* @example 58
*/
index: number;
owner?: AccountAddress;
collection?: {
/**
* @format address
* @example "0:E93E7D444180608B8520C00DC664383A387356FB6E16FDDF99DBE5E1415A574B"
*/
address: string;
/** @example "TON Diamonds" */
name: string;
/** @example "Best collection in TON network" */
description: string;
};
/**
* Collection master contract confirmed that this item is part of collection
* @example true
*/
verified: boolean;
/** @example {} */
metadata: Record<string, any>;
sale?: Sale;
previews?: ImagePreview[];
/** @example "crypto.ton" */
dns?: string;
/**
* please use trust field
* @deprecated
*/
approved_by: NftApprovedBy;
/** @example false */
include_cnft?: boolean;
trust: TrustType;
}
export interface NftItems {
nft_items: NftItem[];
}
export interface Multisigs {
multisigs: Multisig[];
}
export interface Multisig {
/**
* @format address
* @example "0:da6b1b6663a0e4d18cc8574ccd9db5296e367dd9324706f3bbd9eb1cd2caf0bf"
*/
address: string;
/**
* @format int64
* @example 1
*/
seqno: number;
/** @format int32 */
threshold: number;
signers: string[];
proposers: string[];
orders: MultisigOrder[];
}
export interface MultisigOrder {
/**
* @format address
* @example "0:da6b1b6663a0e4d18cc8574ccd9db5296e367dd9324706f3bbd9eb1cd2caf0bf"
*/
address: string;
/**
* @format int64
* @example 1
*/
order_seqno: number;
/** @format int32 */
threshold: number;
/** @example false */
sent_for_execution: boolean;
signers: string[];
/** @format int32 */
approvals_num: number;
/** @format int64 */
expiration_date: number;
/** Risk specifies assets that could be lost if a message would be sent to a malicious smart contract. It makes sense to understand the risk BEFORE sending a message to the blockchain. */
risk: Risk;
/** @format int64 */
creation_date: number;
signed_by: string[];
/**
* @format address
* @example "0:da6b1b6663a0e4d18cc8574ccd9db5296e367dd9324706f3bbd9eb1cd2caf0bf"
*/
multisig_address: string;
changing_parameters?: {
/** @format int32 */
threshold: number;
signers: string[];
proposers: string[];
};
}
export interface Refund {
/** @example "DNS.ton" */
type: "DNS.ton" | "DNS.tg" | "GetGems";
/** @example "0:da6b1b6663a0e4d18cc8574ccd9db5296e367dd9324706f3bbd9eb1cd2caf0bf" */
origin: string;
}
export interface ValueFlow {
account: AccountAddress;
/**
* @format int64
* @example 80
*/
ton: number;
/**
* @format int64
* @example 10
*/
fees: number;
jettons?: {
account: AccountAddress;
jetton: JettonPreview;
/** @example "200" */
qty: string;
/**
* @deprecated
* @format int64
* @example 10
*/
quantity: number;
}[];
}
export interface Action {
/** @example "TonTransfer" */
type: string;
/** @example "ok" */
status: "ok" | "failed";
TonTransfer?: TonTransferAction;
ExtraCurrencyTransfer?: ExtraCurrencyTransferAction;
ContractDeploy?: ContractDeployAction;
JettonTransfer?: JettonTransferAction;
JettonBurn?: JettonBurnAction;
JettonMint?: JettonMintAction;
NftItemTransfer?: NftItemTransferAction;
Subscribe?: SubscriptionAction;
UnSubscribe?: UnSubscriptionAction;
AuctionBid?: AuctionBidAction;
NftPurchase?: NftPurchaseAction;
/** validator's participation in elections */
DepositStake?: DepositStakeAction;
/** validator's participation in elections */
WithdrawStake?: WithdrawStakeAction;
/** validator's participation in elections */
WithdrawStakeRequest?: WithdrawStakeRequestAction;
ElectionsDepositStake?: ElectionsDepositStakeAction;
ElectionsRecoverStake?: ElectionsRecoverStakeAction;
JettonSwap?: JettonSwapAction;
SmartContractExec?: SmartContractAction;
DomainRenew?: DomainRenewAction;
Purchase?: PurchaseAction;
GasRelay?: GasRelayAction;
/** shortly describes what this action is about. */
simple_preview: ActionSimplePreview;
base_transactions: string[];
}
export interface TonTransferAction {
sender: AccountAddress;
recipient: AccountAddress;
/**
* amount in nanotons
* @format int64
* @example 123456789
*/
amount: number;
/**
* @example "Hi! This is your salary.
* From accounting with love."
*/
comment?: string;
encrypted_comment?: EncryptedComment;
refund?: Refund;
}
export interface ExtraCurrencies {
extra_currencies: EcPreview[];
}
export interface EcPreview {
/**
* @format int32
* @example 239
*/
id: number;
/** @example "FMS" */
symbol: string;
/** @example 5 */
decimals: number;
/** @example "https://cache.tonapi.io/images/extra.jpg" */
image: string;
}
export interface ExtraCurrencyTransferAction {
sender: AccountAddress;
recipient: AccountAddress;
/**
* amount in quanta of tokens
* @example "1000000000"
*/
amount: string;
/**
* @example "Hi! This is your salary.
* From accounting with love."
*/
comment?: string;
encrypted_comment?: EncryptedComment;
currency: EcPreview;
}
export interface SmartContractAction {
executor: AccountAddress;
contract: AccountAddress;
/**
* amount in nanotons
* @format int64
* @example 123456789
*/
ton_attached: number;
/** @example "NftTransfer or 0x35d95a12" */
operation: string;
payload?: string;
refund?: Refund;
}
export interface DomainRenewAction {
/** @example "vasya.ton" */
domain: string;
/**
* @format address
* @example "0:da6b1b6663a0e4d18cc8574ccd9db5296e367dd9324706f3bbd9eb1cd2caf0bf"
*/
contract_address: string;
renewer: AccountAddress;
}
export interface GasRelayAction {
/**
* @format int64
* @example 1000000000
*/
amount: number;
relayer: AccountAddress;
target: AccountAddress;
}
export interface PurchaseAction {
source: AccountAddress;
destination: AccountAddress;
/** @example "03cfc582-b1c3-410a-a9a7-1f3afe326b3b" */
invoice_id: string;
amount: Price;
metadata: Metadata;
}
export interface NftItemTransferAction {
sender?: AccountAddress;
recipient?: AccountAddress;
/** @example "" */
nft: string;
/**
* @example "Hi! This is your salary.
* From accounting with love."
*/
comment?: string;
encrypted_comment?: EncryptedComment;
/**
* raw hex encoded payload
* @example "0234de3e21d21b3ee21f3"
*/
payload?: string;
refund?: Refund;
}
export interface JettonTransferAction {
sender?: AccountAddress;
recipient?: AccountAddress;
/**
* @format address
* @example "0:E93E7D444180608B8520C00DC664383A387356FB6E16FDDF99DBE5E1415A574B"
*/
senders_wallet: string;
/**
* @format address
* @example "0:E93E7D444180608B8520C00DC664383A387356FB6E16FDDF99DBE5E1415A574B"
*/
recipients_wallet: string;
/**
* amount in quanta of tokens
* @example "1000000000"
*/
amount: string;
/**
* @example "Hi! This is your salary.
* From accounting with love."
*/
comment?: string;
encrypted_comment?: EncryptedComment;
refund?: Refund;
jetton: JettonPreview;
}
export interface JettonBurnAction {
sender: AccountAddress;
/**
* @format address
* @example "0:E93E7D444180608B8520C00DC664383A387356FB6E16FDDF99DBE5E1415A574B"
*/
senders_wallet: string;
/**
* amount in quanta of tokens
* @example "1000000000"
*/
amount: string;
jetton: JettonPreview;
}
export interface JettonMintAction {
recipient: AccountAddress;
/**
* @format address
* @example "0:E93E7D444180608B8520C00DC664383A387356FB6E16FDDF99DBE5E1415A574B"
*/
recipients_wallet: string;
/**
* amount in quanta of tokens
* @example "1000000000"
*/
amount: string;
jetton: JettonPreview;
}
export interface ContractDeployAction {
/**
* @format address
* @example "0:da6b1b6663a0e4d18cc8574ccd9db5296e367dd9324706f3bbd9eb1cd2caf0bf"
*/
address: string;
/** @example ["nft_item","nft_royalty"] */
interfaces: string[];
}
export interface SubscriptionAction {
subscriber: AccountAddress;
/**
* @format address
* @example "0:da6b1b6663a0e4d18cc8574ccd9db5296e367dd9324706f3bbd9eb1cd2caf0bf"
*/
subscription: string;
beneficiary: AccountAddress;
/**
* @format int64
* @example 1000000000
*/
amount: number;
/** @example false */
initial: boolean;
}
export interface UnSubscriptionAction {
subscriber: AccountAddress;
/**
* @format address
* @example "0:da6b1b6663a0e4d18cc8574ccd9db5296e367dd9324706f3bbd9eb1cd2caf0bf"
*/
subscription: string;
beneficiary: AccountAddress;
}
export interface AuctionBidAction {
auction_type: "DNS.ton" | "DNS.tg" | "NUMBER.tg" | "getgems";
amount: Price;
nft?: NftItem;
bidder: AccountAddress;
auction: AccountAddress;
}
/** validator's participation in elections */
export interface DepositStakeAction {
/**
* @format int64
* @example 1660050553
*/
amount: number;
staker: AccountAddress;
pool: AccountAddress;
implementation: PoolImplementationType;
}
/** validator's participation in elections */
export interface WithdrawStakeAction {
/**
* @format int64
* @example 1660050553
*/
amount: number;
staker: AccountAddress;
pool: AccountAddress;
implementation: PoolImplementationType;
}
/** validator's participation in elections */
export interface WithdrawStakeRequestAction {
/**
* @format int64
* @example 1660050553
*/
amount?: number;
staker: AccountAddress;
pool: AccountAddress;
implementation: PoolImplementationType;
}
export interface ElectionsRecoverStakeAction {
/**
* @format int64
* @example 1660050553
*/
amount: number;
staker: AccountAddress;
}
export interface ElectionsDepositStakeAction {
/**
* @format int64
* @example 1660050553
*/
amount: number;
staker: AccountAddress;
}
export interface JettonSwapAction {
dex: "stonfi" | "dedust" | "megatonfi";
/** @example "1660050553" */
amount_in: string;
/** @example "1660050553" */
amount_out: string;
/**
* @format int64
* @example 1000000000
*/
ton_in?: number;
/**
* @format int64
* @example 2000000000
*/
ton_out?: number;
user_wallet: AccountAddress;
router: AccountAddress;
jetton_master_in?: JettonPreview;
jetton_master_out?: JettonPreview;
}
export interface NftPurchaseAction {
auction_type: "DNS.ton" | "DNS.tg" | "NUMBER.tg" | "getgems";
amount: Price;
nft: NftItem;
seller: AccountAddress;
buyer: AccountAddress;
}
/** shortly describes what this action is about. */
export interface ActionSimplePreview {
/** @example "Ton Transfer" */
name: string;
/** @example "Transferring 5 Ton" */
description: string;
/** a link to an image for this particular action. */
action_image?: string;
/** @example "5 Ton" */
value?: string;
/** a link to an image that depicts this action's asset. */
value_image?: string;
accounts: AccountAddress[];
}
/** An event is built on top of a trace which is a series of transactions caused by one inbound message. TonAPI looks for known patterns inside the trace and splits the trace into actions, where a single action represents a meaningful high-level operation like a Jetton Transfer or an NFT Purchase. Actions are expected to be shown to users. It is advised not to build any logic on top of actions because actions can be changed at any time. */
export interface AccountEvent {
/** @example "e8b0e3fee4a26bd2317ac1f9952fcdc87dc08fdb617656b5202416323337372e" */
event_id: string;
account: AccountAddress;
/**