@ton-api/client
Version:
Autogenerated SDK for tonapi.io
1,216 lines • 203 kB
JavaScript
"use strict";
/* eslint-disable */
/* tslint:disable */
/*
* ---------------------------------------------------------------
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
* ## ##
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TonApiClient = exports.ContentType = exports.PoolImplementationType = exports.TrustType = exports.JettonVerificationType = exports.BouncePhaseType = exports.ComputeSkipReason = exports.AccStatusChange = exports.TransactionType = exports.AccountStatus = void 0;
/** @example "active" */
var AccountStatus;
(function (AccountStatus) {
AccountStatus["Nonexist"] = "nonexist";
AccountStatus["Uninit"] = "uninit";
AccountStatus["Active"] = "active";
AccountStatus["Frozen"] = "frozen";
})(AccountStatus || (exports.AccountStatus = AccountStatus = {}));
/** @example "TransOrd" */
var TransactionType;
(function (TransactionType) {
TransactionType["TransOrd"] = "TransOrd";
TransactionType["TransTickTock"] = "TransTickTock";
TransactionType["TransSplitPrepare"] = "TransSplitPrepare";
TransactionType["TransSplitInstall"] = "TransSplitInstall";
TransactionType["TransMergePrepare"] = "TransMergePrepare";
TransactionType["TransMergeInstall"] = "TransMergeInstall";
TransactionType["TransStorage"] = "TransStorage";
})(TransactionType || (exports.TransactionType = TransactionType = {}));
/** @example "acst_unchanged" */
var AccStatusChange;
(function (AccStatusChange) {
AccStatusChange["AcstUnchanged"] = "acst_unchanged";
AccStatusChange["AcstFrozen"] = "acst_frozen";
AccStatusChange["AcstDeleted"] = "acst_deleted";
})(AccStatusChange || (exports.AccStatusChange = AccStatusChange = {}));
/** @example "cskip_no_state" */
var ComputeSkipReason;
(function (ComputeSkipReason) {
ComputeSkipReason["CskipNoState"] = "cskip_no_state";
ComputeSkipReason["CskipBadState"] = "cskip_bad_state";
ComputeSkipReason["CskipNoGas"] = "cskip_no_gas";
})(ComputeSkipReason || (exports.ComputeSkipReason = ComputeSkipReason = {}));
/** @example "cskip_no_state" */
var BouncePhaseType;
(function (BouncePhaseType) {
BouncePhaseType["TrPhaseBounceNegfunds"] = "TrPhaseBounceNegfunds";
BouncePhaseType["TrPhaseBounceNofunds"] = "TrPhaseBounceNofunds";
BouncePhaseType["TrPhaseBounceOk"] = "TrPhaseBounceOk";
})(BouncePhaseType || (exports.BouncePhaseType = BouncePhaseType = {}));
var JettonVerificationType;
(function (JettonVerificationType) {
JettonVerificationType["Whitelist"] = "whitelist";
JettonVerificationType["Blacklist"] = "blacklist";
JettonVerificationType["None"] = "none";
})(JettonVerificationType || (exports.JettonVerificationType = JettonVerificationType = {}));
/** @example "whitelist" */
var TrustType;
(function (TrustType) {
TrustType["Whitelist"] = "whitelist";
TrustType["Graylist"] = "graylist";
TrustType["Blacklist"] = "blacklist";
TrustType["None"] = "none";
})(TrustType || (exports.TrustType = TrustType = {}));
var PoolImplementationType;
(function (PoolImplementationType) {
PoolImplementationType["Whales"] = "whales";
PoolImplementationType["Tf"] = "tf";
PoolImplementationType["LiquidTF"] = "liquidTF";
})(PoolImplementationType || (exports.PoolImplementationType = PoolImplementationType = {}));
var ContentType;
(function (ContentType) {
ContentType["Json"] = "application/json";
ContentType["FormData"] = "multipart/form-data";
ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
ContentType["Text"] = "text/plain";
})(ContentType || (exports.ContentType = ContentType = {}));
const core_1 = require("@ton/core");
// @ts-ignore
const parse_1 = __importDefault(require("core-js-pure/actual/json/parse"));
// @ts-ignore
const raw_json_1 = __importDefault(require("core-js-pure/actual/json/raw-json"));
// @ts-ignore
const stringify_1 = __importDefault(require("core-js-pure/actual/json/stringify"));
const JSONParse = (source) => (0, parse_1.default)(source,
// @ts-ignore JSON bigint support from core-js
(_, value, context) => {
if (typeof value === 'number') {
const string = context.source;
return Number.isSafeInteger(value)
? value
: /[\.eE]/.test(string)
? value
: BigInt(string);
}
return value;
});
const JSONStringify = (value) => (0, stringify_1.default)(value,
// @ts-ignore JSON bigint support from core-js
(_, value) => {
if (typeof value === 'bigint') {
// @ts-ignore JSON rawJSON support from core-js
return (0, raw_json_1.default)(value.toString());
}
return value;
});
class HttpClient {
baseUrl = 'https://tonapi.io';
abortControllers = new Map();
providedFetch = null;
customFetch = (...fetchParams) => this.providedFetch ? this.providedFetch(...fetchParams) : fetch(...fetchParams);
baseApiParams = {
credentials: 'same-origin',
headers: {},
redirect: 'follow',
referrerPolicy: 'no-referrer'
};
constructor(apiConfig = {}) {
const tonapi = typeof window !== 'undefined' && window && window.tonapi;
const providedFetch = apiConfig.fetch ?? (tonapi && tonapi.fetch) ?? null;
const baseApiParams = apiConfig.baseApiParams || {};
const { apiKey, ...apiConfigWithoutApiKey } = apiConfig;
const headers = {
...(baseApiParams.headers ?? {}),
...(apiKey ? { Authorization: `Bearer ${apiKey}` } : {}),
'x-tonapi-client': `tonapi-js@0.4.0`
};
const preparedApiConfig = {
...apiConfigWithoutApiKey,
providedFetch,
baseApiParams: {
...baseApiParams,
headers
}
};
Object.assign(this, preparedApiConfig);
}
encodeQueryParam(key, value) {
const encodedKey = encodeURIComponent(key);
return `${encodedKey}=${encodeURIComponent(typeof value === 'number' ? value : `${value}`)}`;
}
addQueryParam(query, key) {
return this.encodeQueryParam(key, query[key]);
}
addImplodeArrayQueryParam(query, key) {
const value = query[key]
.map((val) => encodeURIComponent(typeof val === 'number' ? val : `${val}`))
.join(',');
return this.encodeQueryParam(key, value);
}
addArrayQueryParam(query, key, implodeParams) {
const value = query[key];
return implodeParams?.includes(key)
? this.addImplodeArrayQueryParam(query, key)
: value.map((v) => this.encodeQueryParam(key, v)).join('&');
}
toQueryString(rawQuery, implodeParams) {
const query = rawQuery || {};
const keys = Object.keys(query).filter(key => 'undefined' !== typeof query[key]);
return keys
.map(key => Array.isArray(query[key])
? this.addArrayQueryParam(query, key, implodeParams)
: this.addQueryParam(query, key))
.join('&');
}
addQueryParams(rawQuery) {
const queryString = this.toQueryString(rawQuery);
return queryString ? `?${queryString}` : '';
}
contentFormatters = {
[ContentType.Json]: (input) => input !== null && (typeof input === 'object' || typeof input === 'string')
? JSONStringify(input)
: input,
[ContentType.Text]: (input) => input !== null && typeof input !== 'string' ? JSONStringify(input) : input,
[ContentType.FormData]: (input) => Object.keys(input || {}).reduce((formData, key) => {
const property = input[key];
formData.append(key, property instanceof Blob
? property
: typeof property === 'object' && property !== null
? JSONStringify(property)
: `${property}`);
return formData;
}, new FormData()),
[ContentType.UrlEncoded]: (input) => this.toQueryString(input)
};
mergeRequestParams(params1, params2) {
return {
...this.baseApiParams,
...params1,
...(params2 || {}),
headers: {
...(this.baseApiParams.headers || {}),
...(params1.headers || {}),
...((params2 && params2.headers) || {})
}
};
}
createAbortSignal = (cancelToken) => {
if (this.abortControllers.has(cancelToken)) {
const abortController = this.abortControllers.get(cancelToken);
if (abortController) {
return abortController.signal;
}
return void 0;
}
const abortController = new AbortController();
this.abortControllers.set(cancelToken, abortController);
return abortController.signal;
};
abortRequest = (cancelToken) => {
const abortController = this.abortControllers.get(cancelToken);
if (abortController) {
abortController.abort();
this.abortControllers.delete(cancelToken);
}
};
request = async ({ body, secure, path, type, query, queryImplode, format, baseUrl, cancelToken, ...params }) => {
const requestParams = this.mergeRequestParams(params);
const queryString = query && this.toQueryString(query, queryImplode);
const contentType = type ?? ContentType.Json;
const payloadFormatter = this.contentFormatters[contentType];
const responseFormat = format || requestParams.format;
return this.customFetch(`${baseUrl || this.baseUrl || ''}${path}${queryString ? `?${queryString}` : ''}`, {
...requestParams,
headers: {
...(requestParams.headers || {}),
...(contentType && contentType !== ContentType.FormData
? { 'Content-Type': contentType }
: {})
},
signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) ||
null,
body: typeof body === 'undefined' || body === null ? null : payloadFormatter(body)
}).then(async (response) => {
const r = response;
r.data = null;
r.error = null;
const customResponseFormat = responseFormat === 'json' ? 'text' : responseFormat;
const result = !customResponseFormat
? r
: await response[customResponseFormat]()
.then(data => {
if (r.ok) {
r.data = responseFormat === 'json' ? JSONParse(data) : data;
return r;
}
r.error = data;
return r;
})
.catch(e => {
r.error = e;
return r;
});
if (cancelToken) {
this.abortControllers.delete(cancelToken);
}
if (!response.ok)
throw result;
return result.data;
});
};
}
const components = {
'#/components/schemas/Error': {
type: 'object',
required: ['error'],
properties: { error: { type: 'string' } }
},
'#/components/schemas/AccountAddress': {
type: 'object',
required: ['address', 'is_scam', 'is_wallet'],
properties: {
address: { type: 'string', format: 'address' },
name: { type: 'string' },
is_scam: { type: 'boolean' },
icon: { type: 'string' },
is_wallet: { type: 'boolean' }
}
},
'#/components/schemas/BlockCurrencyCollection': {
type: 'object',
required: ['grams', 'other'],
properties: {
grams: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
other: {
type: 'array',
items: {
type: 'object',
required: ['id', 'value'],
properties: {
id: { type: 'integer', format: 'int64' },
value: { type: 'string', 'x-js-format': 'bigint' }
}
}
}
}
},
'#/components/schemas/BlockValueFlow': {
type: 'object',
required: [
'from_prev_blk',
'to_next_blk',
'imported',
'exported',
'fees_collected',
'fees_imported',
'recovered',
'created',
'minted'
],
properties: {
from_prev_blk: { $ref: '#/components/schemas/BlockCurrencyCollection' },
to_next_blk: { $ref: '#/components/schemas/BlockCurrencyCollection' },
imported: { $ref: '#/components/schemas/BlockCurrencyCollection' },
exported: { $ref: '#/components/schemas/BlockCurrencyCollection' },
fees_collected: { $ref: '#/components/schemas/BlockCurrencyCollection' },
burned: { $ref: '#/components/schemas/BlockCurrencyCollection' },
fees_imported: { $ref: '#/components/schemas/BlockCurrencyCollection' },
recovered: { $ref: '#/components/schemas/BlockCurrencyCollection' },
created: { $ref: '#/components/schemas/BlockCurrencyCollection' },
minted: { $ref: '#/components/schemas/BlockCurrencyCollection' }
}
},
'#/components/schemas/ServiceStatus': {
type: 'object',
required: ['indexing_latency', 'rest_online', 'last_known_masterchain_seqno'],
properties: {
rest_online: { type: 'boolean', default: true },
indexing_latency: { type: 'integer' },
last_known_masterchain_seqno: { type: 'integer', format: 'int32' }
}
},
'#/components/schemas/ReducedBlock': {
type: 'object',
required: [
'workchain_id',
'shard',
'seqno',
'tx_quantity',
'utime',
'shards_blocks',
'parent'
],
properties: {
workchain_id: { type: 'integer', format: 'int32' },
shard: { type: 'string' },
seqno: { type: 'integer', format: 'int32' },
master_ref: { type: 'string' },
tx_quantity: { type: 'integer' },
utime: { type: 'integer', format: 'int64' },
shards_blocks: { type: 'array', items: { type: 'string' } },
parent: { type: 'array', items: { type: 'string' } }
}
},
'#/components/schemas/BlockchainBlock': {
type: 'object',
required: [
'workchain_id',
'shard',
'seqno',
'root_hash',
'file_hash',
'global_id',
'value_flow',
'version',
'after_merge',
'before_split',
'after_split',
'want_split',
'want_merge',
'key_block',
'gen_utime',
'start_lt',
'end_lt',
'vert_seqno',
'gen_catchain_seqno',
'min_ref_mc_seqno',
'prev_key_block_seqno',
'prev_refs',
'in_msg_descr_length',
'out_msg_descr_length',
'rand_seed',
'created_by',
'tx_quantity'
],
properties: {
tx_quantity: { type: 'integer' },
value_flow: { $ref: '#/components/schemas/BlockValueFlow' },
workchain_id: { type: 'integer', format: 'int32' },
shard: { type: 'string' },
seqno: { type: 'integer', format: 'int32' },
root_hash: { type: 'string' },
file_hash: { type: 'string' },
global_id: { type: 'integer', format: 'int32' },
version: { type: 'integer', format: 'int32' },
after_merge: { type: 'boolean' },
before_split: { type: 'boolean' },
after_split: { type: 'boolean' },
want_split: { type: 'boolean' },
want_merge: { type: 'boolean' },
key_block: { type: 'boolean' },
gen_utime: { type: 'integer', format: 'int64' },
start_lt: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
end_lt: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
vert_seqno: { type: 'integer', format: 'int32' },
gen_catchain_seqno: { type: 'integer', format: 'int32' },
min_ref_mc_seqno: { type: 'integer', format: 'int32' },
prev_key_block_seqno: { type: 'integer', format: 'int32' },
gen_software_version: { type: 'integer', format: 'int32' },
gen_software_capabilities: { type: 'integer', format: 'int64' },
master_ref: { type: 'string' },
prev_refs: { type: 'array', items: { type: 'string' } },
in_msg_descr_length: { type: 'integer', format: 'int64' },
out_msg_descr_length: { type: 'integer', format: 'int64' },
rand_seed: { type: 'string' },
created_by: { type: 'string' }
}
},
'#/components/schemas/BlockchainBlocks': {
type: 'object',
required: ['blocks'],
properties: {
blocks: { type: 'array', items: { $ref: '#/components/schemas/BlockchainBlock' } }
}
},
'#/components/schemas/ReducedBlocks': {
type: 'object',
required: ['blocks'],
properties: {
blocks: { type: 'array', items: { $ref: '#/components/schemas/ReducedBlock' } }
}
},
'#/components/schemas/BlockchainBlockShards': {
type: 'object',
required: ['shards'],
properties: {
shards: {
type: 'array',
items: {
type: 'object',
required: ['last_known_block_id', 'last_known_block'],
properties: {
last_known_block_id: { type: 'string' },
last_known_block: { $ref: '#/components/schemas/BlockchainBlock' }
}
}
}
}
},
'#/components/schemas/AccountStatus': {
type: 'string',
enum: ['nonexist', 'uninit', 'active', 'frozen']
},
'#/components/schemas/StateInit': {
type: 'object',
required: ['boc', 'interfaces'],
properties: {
boc: { type: 'string', format: 'cell' },
interfaces: { type: 'array', items: { type: 'string' } }
}
},
'#/components/schemas/Message': {
type: 'object',
required: [
'msg_type',
'created_lt',
'ihr_disabled',
'bounce',
'bounced',
'value',
'fwd_fee',
'ihr_fee',
'import_fee',
'created_at',
'hash'
],
properties: {
msg_type: { type: 'string', enum: ['int_msg', 'ext_in_msg', 'ext_out_msg'] },
created_lt: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
ihr_disabled: { type: 'boolean' },
bounce: { type: 'boolean' },
bounced: { type: 'boolean' },
value: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
value_extra: { type: 'array', items: { $ref: '#/components/schemas/ExtraCurrency' } },
fwd_fee: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
ihr_fee: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
destination: { $ref: '#/components/schemas/AccountAddress' },
source: { $ref: '#/components/schemas/AccountAddress' },
import_fee: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
created_at: { type: 'integer', format: 'int64' },
op_code: { type: 'string', 'x-js-format': 'bigint' },
init: { $ref: '#/components/schemas/StateInit' },
hash: { type: 'string' },
raw_body: { type: 'string', format: 'cell' },
decoded_op_name: { type: 'string' },
decoded_body: {}
}
},
'#/components/schemas/TransactionType': {
type: 'string',
enum: [
'TransOrd',
'TransTickTock',
'TransSplitPrepare',
'TransSplitInstall',
'TransMergePrepare',
'TransMergeInstall',
'TransStorage'
]
},
'#/components/schemas/AccStatusChange': {
type: 'string',
enum: ['acst_unchanged', 'acst_frozen', 'acst_deleted']
},
'#/components/schemas/ComputeSkipReason': {
type: 'string',
enum: ['cskip_no_state', 'cskip_bad_state', 'cskip_no_gas']
},
'#/components/schemas/BouncePhaseType': {
type: 'string',
enum: ['TrPhaseBounceNegfunds', 'TrPhaseBounceNofunds', 'TrPhaseBounceOk']
},
'#/components/schemas/ComputePhase': {
type: 'object',
required: ['skipped'],
properties: {
skipped: { type: 'boolean' },
skip_reason: { $ref: '#/components/schemas/ComputeSkipReason' },
success: { type: 'boolean' },
gas_fees: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
gas_used: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
vm_steps: { type: 'integer', format: 'int32' },
exit_code: { type: 'integer', format: 'int32' },
exit_code_description: { type: 'string' }
}
},
'#/components/schemas/StoragePhase': {
type: 'object',
required: ['fees_collected', 'status_change'],
properties: {
fees_collected: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
fees_due: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
status_change: { $ref: '#/components/schemas/AccStatusChange' }
}
},
'#/components/schemas/CreditPhase': {
type: 'object',
required: ['fees_collected', 'credit'],
properties: {
fees_collected: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
credit: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' }
}
},
'#/components/schemas/ActionPhase': {
type: 'object',
required: [
'success',
'result_code',
'total_actions',
'skipped_actions',
'fwd_fees',
'total_fees'
],
properties: {
success: { type: 'boolean' },
result_code: { type: 'integer', format: 'int32' },
total_actions: { type: 'integer', format: 'int32' },
skipped_actions: { type: 'integer', format: 'int32' },
fwd_fees: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
total_fees: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
result_code_description: { type: 'string' }
}
},
'#/components/schemas/Transaction': {
type: 'object',
required: [
'hash',
'lt',
'account',
'end_balance',
'success',
'utime',
'orig_status',
'end_status',
'total_fees',
'transaction_type',
'state_update_old',
'state_update_new',
'out_msgs',
'block',
'aborted',
'destroyed',
'raw'
],
properties: {
hash: { type: 'string' },
lt: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
account: { $ref: '#/components/schemas/AccountAddress' },
success: { type: 'boolean' },
utime: { type: 'integer', format: 'int64' },
orig_status: { $ref: '#/components/schemas/AccountStatus' },
end_status: { $ref: '#/components/schemas/AccountStatus' },
total_fees: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
end_balance: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
transaction_type: { $ref: '#/components/schemas/TransactionType' },
state_update_old: { type: 'string' },
state_update_new: { type: 'string' },
in_msg: { $ref: '#/components/schemas/Message' },
out_msgs: { type: 'array', items: { $ref: '#/components/schemas/Message' } },
block: { type: 'string' },
prev_trans_hash: { type: 'string' },
prev_trans_lt: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
compute_phase: { $ref: '#/components/schemas/ComputePhase' },
storage_phase: { $ref: '#/components/schemas/StoragePhase' },
credit_phase: { $ref: '#/components/schemas/CreditPhase' },
action_phase: { $ref: '#/components/schemas/ActionPhase' },
bounce_phase: { $ref: '#/components/schemas/BouncePhaseType' },
aborted: { type: 'boolean' },
destroyed: { type: 'boolean' },
raw: { type: 'string', format: 'cell' }
}
},
'#/components/schemas/Transactions': {
type: 'object',
required: ['transactions'],
properties: {
transactions: { type: 'array', items: { $ref: '#/components/schemas/Transaction' } }
}
},
'#/components/schemas/ConfigProposalSetup': {
type: 'object',
required: [
'min_tot_rounds',
'max_tot_rounds',
'min_wins',
'max_losses',
'min_store_sec',
'max_store_sec',
'bit_price',
'cell_price'
],
properties: {
min_tot_rounds: { type: 'integer' },
max_tot_rounds: { type: 'integer' },
min_wins: { type: 'integer' },
max_losses: { type: 'integer' },
min_store_sec: { type: 'integer', format: 'int64' },
max_store_sec: { type: 'integer', format: 'int64' },
bit_price: { type: 'integer', format: 'int64' },
cell_price: { type: 'integer', format: 'int64' }
}
},
'#/components/schemas/GasLimitPrices': {
type: 'object',
required: [
'gas_price',
'gas_limit',
'gas_credit',
'block_gas_limit',
'freeze_due_limit',
'delete_due_limit'
],
properties: {
special_gas_limit: { type: 'integer', format: 'int64' },
flat_gas_limit: { type: 'integer', format: 'int64' },
flat_gas_price: { type: 'integer', format: 'int64' },
gas_price: { type: 'integer', format: 'int64' },
gas_limit: { type: 'integer', format: 'int64' },
gas_credit: { type: 'integer', format: 'int64' },
block_gas_limit: { type: 'integer', format: 'int64' },
freeze_due_limit: { type: 'integer', format: 'int64' },
delete_due_limit: { type: 'integer', format: 'int64' }
}
},
'#/components/schemas/BlockParamLimits': {
type: 'object',
required: ['underload', 'soft_limit', 'hard_limit'],
properties: {
underload: { type: 'integer', format: 'int64' },
soft_limit: { type: 'integer', format: 'int64' },
hard_limit: { type: 'integer', format: 'int64' }
}
},
'#/components/schemas/BlockLimits': {
type: 'object',
required: ['bytes', 'gas', 'lt_delta'],
properties: {
bytes: { $ref: '#/components/schemas/BlockParamLimits' },
gas: { $ref: '#/components/schemas/BlockParamLimits' },
lt_delta: { $ref: '#/components/schemas/BlockParamLimits' }
}
},
'#/components/schemas/MsgForwardPrices': {
type: 'object',
required: [
'lump_price',
'bit_price',
'cell_price',
'ihr_price_factor',
'first_frac',
'next_frac'
],
properties: {
lump_price: { type: 'integer', format: 'int64' },
bit_price: { type: 'integer', format: 'int64' },
cell_price: { type: 'integer', format: 'int64' },
ihr_price_factor: { type: 'integer', format: 'int64' },
first_frac: { type: 'integer', format: 'int64' },
next_frac: { type: 'integer', format: 'int64' }
}
},
'#/components/schemas/WorkchainDescr': {
type: 'object',
required: [
'workchain',
'enabled_since',
'actual_min_split',
'min_split',
'max_split',
'basic',
'active',
'accept_msgs',
'flags',
'zerostate_root_hash',
'zerostate_file_hash',
'version'
],
properties: {
workchain: { type: 'integer', format: 'int' },
enabled_since: { type: 'integer', format: 'int64' },
actual_min_split: { type: 'integer', format: 'int' },
min_split: { type: 'integer', format: 'int' },
max_split: { type: 'integer', format: 'int' },
basic: { type: 'integer' },
active: { type: 'boolean' },
accept_msgs: { type: 'boolean' },
flags: { type: 'integer', format: 'int' },
zerostate_root_hash: { type: 'string' },
zerostate_file_hash: { type: 'string' },
version: { type: 'integer', format: 'int64' }
}
},
'#/components/schemas/MisbehaviourPunishmentConfig': {
type: 'object',
required: [
'default_flat_fine',
'default_proportional_fine',
'severity_flat_mult',
'severity_proportional_mult',
'unpunishable_interval',
'long_interval',
'long_flat_mult',
'long_proportional_mult',
'medium_interval',
'medium_flat_mult',
'medium_proportional_mult'
],
properties: {
default_flat_fine: { type: 'integer', format: 'int64' },
default_proportional_fine: { type: 'integer', format: 'int64' },
severity_flat_mult: { type: 'integer' },
severity_proportional_mult: { type: 'integer' },
unpunishable_interval: { type: 'integer' },
long_interval: { type: 'integer' },
long_flat_mult: { type: 'integer' },
long_proportional_mult: { type: 'integer' },
medium_interval: { type: 'integer' },
medium_flat_mult: { type: 'integer' },
medium_proportional_mult: { type: 'integer' }
}
},
'#/components/schemas/SizeLimitsConfig': {
type: 'object',
required: [
'max_msg_bits',
'max_msg_cells',
'max_library_cells',
'max_vm_data_depth',
'max_ext_msg_size',
'max_ext_msg_depth'
],
properties: {
max_msg_bits: { type: 'integer', format: 'int64' },
max_msg_cells: { type: 'integer', format: 'int64' },
max_library_cells: { type: 'integer', format: 'int64' },
max_vm_data_depth: { type: 'integer', format: 'int' },
max_ext_msg_size: { type: 'integer', format: 'int64' },
max_ext_msg_depth: { type: 'integer', format: 'int' },
max_acc_state_cells: { type: 'integer', format: 'int64' },
max_acc_state_bits: { type: 'integer', format: 'int64' }
}
},
'#/components/schemas/ValidatorsSet': {
type: 'object',
required: ['utime_since', 'utime_until', 'total', 'main', 'list'],
properties: {
utime_since: { type: 'integer' },
utime_until: { type: 'integer' },
total: { type: 'integer' },
main: { type: 'integer' },
total_weight: { type: 'string', 'x-js-format': 'bigint' },
list: {
type: 'array',
items: {
type: 'object',
required: ['public_key', 'weight'],
properties: {
public_key: { type: 'string' },
weight: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
adnl_addr: { type: 'string' }
}
}
}
}
},
'#/components/schemas/Oracle': {
type: 'object',
required: ['address', 'secp_pubkey'],
properties: {
address: { type: 'string', format: 'address' },
secp_pubkey: { type: 'string' }
}
},
'#/components/schemas/OracleBridgeParams': {
type: 'object',
required: ['bridge_addr', 'oracle_multisig_address', 'external_chain_address', 'oracles'],
properties: {
bridge_addr: { type: 'string', format: 'address' },
oracle_multisig_address: { type: 'string', format: 'address' },
external_chain_address: { type: 'string' },
oracles: { type: 'array', items: { $ref: '#/components/schemas/Oracle' } }
}
},
'#/components/schemas/JettonBridgePrices': {
type: 'object',
required: [
'bridge_burn_fee',
'bridge_mint_fee',
'wallet_min_tons_for_storage',
'wallet_gas_consumption',
'minter_min_tons_for_storage',
'discover_gas_consumption'
],
properties: {
bridge_burn_fee: { type: 'integer', format: 'int64' },
bridge_mint_fee: { type: 'integer', format: 'int64' },
wallet_min_tons_for_storage: { type: 'integer', format: 'int64' },
wallet_gas_consumption: { type: 'integer', format: 'int64' },
minter_min_tons_for_storage: { type: 'integer', format: 'int64' },
discover_gas_consumption: { type: 'integer', format: 'int64' }
}
},
'#/components/schemas/JettonBridgeParams': {
type: 'object',
required: ['bridge_address', 'oracles_address', 'state_flags', 'oracles'],
properties: {
bridge_address: { type: 'string', format: 'address' },
oracles_address: { type: 'string', format: 'address' },
state_flags: { type: 'integer' },
burn_bridge_fee: { type: 'integer', format: 'int64' },
oracles: { type: 'array', items: { $ref: '#/components/schemas/Oracle' } },
external_chain_address: { type: 'string' },
prices: { $ref: '#/components/schemas/JettonBridgePrices' }
}
},
'#/components/schemas/Validator': {
type: 'object',
required: ['address', 'adnl_address', 'stake', 'max_factor'],
properties: {
address: { type: 'string', format: 'address' },
adnl_address: { type: 'string' },
stake: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
max_factor: { type: 'integer', format: 'int64' }
}
},
'#/components/schemas/Validators': {
type: 'object',
required: ['validators', 'elect_at', 'elect_close', 'min_stake', 'total_stake'],
properties: {
elect_at: { type: 'integer', format: 'int64' },
elect_close: { type: 'integer', format: 'int64' },
min_stake: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
total_stake: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
validators: { type: 'array', items: { $ref: '#/components/schemas/Validator' } }
}
},
'#/components/schemas/AccountStorageInfo': {
type: 'object',
required: ['used_cells', 'used_bits', 'used_public_cells', 'last_paid', 'due_payment'],
properties: {
used_cells: { type: 'integer', format: 'int64' },
used_bits: { type: 'integer', format: 'int64' },
used_public_cells: { type: 'integer', format: 'int64' },
last_paid: { type: 'integer', format: 'int64' },
due_payment: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' }
}
},
'#/components/schemas/BlockchainRawAccount': {
type: 'object',
required: ['address', 'balance', 'status', 'last_transaction_lt', 'storage'],
properties: {
address: { type: 'string', format: 'address' },
balance: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
extra_balance: { type: 'object', additionalProperties: { type: 'string' } },
code: { type: 'string', format: 'cell' },
data: { type: 'string', format: 'cell' },
last_transaction_lt: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
last_transaction_hash: { type: 'string' },
frozen_hash: { type: 'string' },
status: { $ref: '#/components/schemas/AccountStatus' },
storage: { $ref: '#/components/schemas/AccountStorageInfo' },
libraries: {
type: 'array',
items: {
type: 'object',
required: ['public', 'root'],
properties: {
public: { type: 'boolean' },
root: { type: 'string', format: 'cell' }
}
}
}
}
},
'#/components/schemas/Account': {
type: 'object',
required: ['address', 'balance', 'status', 'last_activity', 'get_methods', 'is_wallet'],
properties: {
address: { type: 'string', format: 'address' },
balance: { type: 'integer', format: 'int64', 'x-js-format': 'bigint' },
extra_balance: { type: 'array', items: { $ref: '#/components/schemas/ExtraCurrency' } },
currencies_balance: { type: 'object', additionalProperties: true },
last_activity: { type: 'integer', format: 'int64' },
status: { $ref: '#/components/schemas/AccountStatus' },
interfaces: { type: 'array', items: { type: 'string' } },
name: { type: 'string' },
is_scam: { type: 'boolean' },
icon: { type: 'string' },
memo_required: { type: 'boolean' },
get_methods: { type: 'array', items: { type: 'string' } },
is_suspended: { type: 'boolean' },
is_wallet: { type: 'boolean' }
}
},
'#/components/schemas/Accounts': {
type: 'object',
required: ['accounts'],
properties: { accounts: { type: 'array', items: { $ref: '#/components/schemas/Account' } } }
},
'#/components/schemas/GaslessConfig': {
type: 'object',
required: ['gas_jettons', 'relay_address'],
properties: {
relay_address: { type: 'string', format: 'address' },
gas_jettons: {
type: 'array',
items: {
type: 'object',
required: ['master_id'],
properties: { master_id: { type: 'string', format: 'address' } }
}
}
}
},
'#/components/schemas/SignRawMessage': {
type: 'object',
required: ['address', 'amount'],
properties: {
address: { type: 'string', format: 'address' },
amount: { type: 'string' },
payload: { type: 'string', format: 'cell' },
stateInit: { type: 'string', format: 'cell' }
}
},
'#/components/schemas/SignRawParams': {
type: 'object',
required: ['messages', 'relay_address', 'commission', 'from', 'valid_until'],
properties: {
relay_address: { type: 'string', format: 'address' },
commission: { type: 'string', 'x-js-format': 'bigint' },
from: { type: 'string', format: 'address' },
valid_until: { type: 'integer', format: 'int64' },
messages: { type: 'array', items: { $ref: '#/components/schemas/SignRawMessage' } }
}
},
'#/components/schemas/MethodExecutionResult': {
type: 'object',
required: ['success', 'exit_code', 'stack'],
properties: {
success: { type: 'boolean' },
exit_code: { type: 'integer' },
stack: { type: 'array', items: { $ref: '#/components/schemas/TvmStackRecord' } },
decoded: {}
}
},
'#/components/schemas/TvmStackRecord': {
type: 'object',
format: 'tuple-item',
required: ['type'],
properties: {
type: { type: 'string', enum: ['cell', 'num', 'nan', 'null', 'tuple'] },
cell: { type: 'string', format: 'cell' },
slice: { type: 'string', format: 'cell' },
num: { type: 'string' },
tuple: { type: 'array', items: { $ref: '#/components/schemas/TvmStackRecord' } }
}
},
'#/components/schemas/RawBlockchainConfig': {
type: 'object',
required: ['config'],
properties: { config: { type: 'object', additionalProperties: true } }
},
'#/components/schemas/BlockchainConfig': {
type: 'object',
required: ['raw', '0', '1', '2', '4', '44'],
properties: {
'0': { type: 'string', format: 'address' },
'1': { type: 'string', format: 'address' },
'2': { type: 'string', format: 'address' },
'3': { type: 'string', format: 'address' },
'4': { type: 'string', format: 'address' },
'5': {
type: 'object',
required: ['fee_burn_nom', 'fee_burn_denom'],
properties: {
blackhole_addr: { type: 'string', format: 'address' },
fee_burn_nom: { type: 'integer', format: 'int64' },
fee_burn_denom: { type: 'integer', format: 'int64' }
}
},
'6': {
type: 'object',
required: ['mint_new_price', 'mint_add_price'],
properties: {
mint_new_price: { type: 'integer', format: 'int64' },
mint_add_price: { type: 'integer', format: 'int64' }
}
},
'7': {
type: 'object',
required: ['currencies'],
properties: {
currencies: {
type: 'array',
items: {
type: 'object',
required: ['currency_id', 'amount'],
properties: {
currency_id: { type: 'integer', format: 'int64' },
amount: { type: 'string' }
}
}
}
}
},
'8': {
type: 'object',
required: ['version', 'capabilities'],
properties: {
version: { type: 'integer', format: 'int64' },
capabilities: { type: 'integer', format: 'int64' }
}
},
'9': {
type: 'object',
required: ['mandatory_params'],
properties: {
mandatory_params: { type: 'array', items: { type: 'integer', format: 'int32' } }
}
},
'10': {
type: 'object',
required: ['critical_params'],
properties: {
critical_params: { type: 'array', items: { type: 'integer', format: 'int32' } }
}
},
'11': {
type: 'object',
required: ['normal_params', 'critical_params'],
properties: {
normal_params: { $ref: '#/components/schemas/ConfigProposalSetup' },
critical_params: { $ref: '#/components/schemas/ConfigProposalSetup' }
}
},
'12': {
type: 'object',
required: ['workchains'],
properties: {
workchains: {
type: 'array',
items: { $ref: '#/components/schemas/WorkchainDescr' }
}
}
},
'13': {
type: 'object',
required: ['deposit', 'bit_price', 'cell_price'],
properties: {
deposit: { type: 'integer', format: 'int64' },
bit_price: { type: 'integer', format: 'int64' },
cell_price: { type: 'integer', format: 'int64' }
}
},
'14': {
type: 'object',
required: ['masterchain_block_fee', 'basechain_block_fee'],
properties: {
masterchain_block_fee: { type: 'integer', format: 'int64' },
basechain_block_fee: { type: 'integer', format: 'int64' }
}
},
'15': {
type: 'object',
required: [
'validators_elected_for',
'elections_start_before',
'elections_end_before',
'stake_held_for'
],
properties: {
validators_elected_for: { type: 'integer', format: 'int64' },
elections_start_before: { type: 'integer', format: 'int64' },
elections_end_before: { type: 'integer', format: 'int64' },
stake_held_for: { type: 'integer', format: 'int64' }
}
},
'16': {
type: 'object',
required: ['max_validators', 'max_main_validators', 'min_validators'],
properties: {
max_validators: { type: 'integer' },
max_main_validators: { type: 'integer' },
min_validators: { type: 'integer' }
}
},
'17': {
type: 'object',
required: ['min_stake', 'max_stake', 'min_total_stake', 'max_stake_factor'],
properties: {
min_stake: { type: 'string' },
max_stake: { type: 'string' },
min_total_stake: { type: 'string' },
max_stake_factor: { type: 'integer', format: 'int64' }
}
},
'18': {
type: 'object',
required: ['storage_prices'],
properties: {
storage_prices: {
type: 'array',
items: {
type: 'object',
required: [
'utime_since',
'bit_price_ps',
'cell_price_ps',
'mc_bit_price_ps',
'mc_cell_price_ps'
],
properties: {
utime_since: { type: 'integer', format: 'int64' },
bit_price_ps: { type: 'integer', format: 'int64' },
cell_price_ps: { type: 'integer', format: 'int64' },
mc_bit_price_ps: { type: 'integer', format: 'int64' },
mc_cell_price_ps: { type: 'integer', format: 'int64' }
}
}
}
}
},
'20': {
type: 'object',
required: ['gas_limits_prices'],
properties: { gas_limits_prices: { $ref: '#/components/schemas/GasLimitPrices' } }
},
'21': {
type: 'object',
required: ['gas_limits_prices'],
properties: { gas_limits_prices: { $ref: '#/components/schemas/GasLimitPrices' } }
},
'22': {
type: 'object',
required: ['block_limits'],
properties: { block_limits: { $ref: '#/components/schemas/BlockLimits' } }
},
'23': {
type: 'object',
required: ['block_limits'],
properties: { block_limits: { $ref: '#/components/schemas/BlockLimits' } }
},
'24': {
type: 'object',
required: ['msg_forward_prices'],
properties: {
msg_forward_prices: { $ref: '#/components/schemas/MsgForwardPrices' }
}
},
'25': {
type: 'object',
required: ['msg_forward_prices'],
properties: {
msg_forward_prices: { $ref: '#/components/schemas/MsgForwardPrices' }
}
},
'28': {
type: 'object',
required: [
'mc_catchain_lif