Skip to content

Commit

Permalink
ALL-8276 - Add Ton API
Browse files Browse the repository at this point in the history
  • Loading branch information
Hathoriel committed Aug 5, 2024
1 parent 7df5678 commit f21e8bb
Show file tree
Hide file tree
Showing 11 changed files with 166 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/dto/rpc/ton/TonRpcSuite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ import type { PoolInfo } from './models/PoolInfo';
import type { StorageProvider } from './models/StorageProvider';
import type { Seqno } from './models/Seqno';
import { NftItem } from './models/NftItem'
import { TonResponse } from './models/TonResponse'
import { GetTransactions } from './models/GetTransactions'

export interface TonRpcSuite {
status(): Promise<ServiceStatus | { error: string }>;
Expand Down Expand Up @@ -539,4 +541,32 @@ export interface TonRpcSuite {
getWalletsByPublicKey(publicKey: string): Promise<Accounts | { error: string }>;

getAccountSeqno(accountId: string): Promise<Seqno | { error: string }>;

// Ton Http API

// Accounts
getAddressInformation(address: string): Promise<TonResponse>;

getExtendedAddressInformation(address: string): Promise<TonResponse>;

getWalletInformation(address: string): Promise<TonResponse>;

getTransactions(params: GetTransactions): Promise<TonResponse>;

getAddressBalance(address: string): Promise<TonResponse>;

getAddressState(address: string): Promise<TonResponse>;

packAddress(address: string): Promise<TonResponse>;

unpackAddress(address: string): Promise<TonResponse>;

getTokenMetadata(token: string): Promise<TonResponse>;

detectAddress(address: string): Promise<TonResponse>;

// Blocks
getMasterchainInfo(): Promise<TonResponse>;

getMasterchainBlockSignatures(seqno: number): Promise<TonResponse>;
}
26 changes: 26 additions & 0 deletions src/dto/rpc/ton/models/Body_estimate_fee_estimateFee_post.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type Body_estimate_fee_estimateFee_post = {
/**
* Address in any format
*/
address: string;
/**
* b64-encoded cell with message body
*/
body: string;
/**
* b64-encoded cell with init-code
*/
init_code?: string;
/**
* b64-encoded cell with init-data
*/
init_data?: string;
/**
* If true during test query processing assume that all chksig operations return True
*/
ignore_chksig?: boolean;
};
22 changes: 22 additions & 0 deletions src/dto/rpc/ton/models/Body_run_get_method_runGetMethod_post.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type Body_run_get_method_runGetMethod_post = {
/**
* Contract address
*/
address: string;
/**
* Method name or method id
*/
method: (string | number);
/**
* Array of stack elements: `[['num',3], ['cell', cell_object], ['slice', slice_object]]`
*/
stack: Array<Array<any>>;
/**
* Seqno of masterchain block at which moment the Get Method is to be executed
*/
seqno?: number;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type Body_send_boc_return_hash_sendBocReturnHash_post = {
/**
* b64 encoded bag of cells
*/
boc: string;
};
10 changes: 10 additions & 0 deletions src/dto/rpc/ton/models/Body_send_boc_sendBoc_post.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type Body_send_boc_sendBoc_post = {
/**
* b64 encoded bag of cells
*/
boc: string;
};
22 changes: 22 additions & 0 deletions src/dto/rpc/ton/models/Body_send_query_sendQuery_post.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type Body_send_query_sendQuery_post = {
/**
* Address in any format
*/
address: string;
/**
* b64-encoded boc-serialized cell with message body
*/
body: string;
/**
* b64-encoded boc-serialized cell with init-code
*/
init_code?: string;
/**
* b64-encoded boc-serialized cell with init-data
*/
init_data?: string;
};
12 changes: 12 additions & 0 deletions src/dto/rpc/ton/models/DeprecatedTonResponseJsonRPC.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type DeprecatedTonResponseJsonRPC = {
ok: boolean;
result?: any;
error?: string;
code?: number;
id: string;
jsonrpc?: string;
};
6 changes: 6 additions & 0 deletions src/dto/rpc/ton/models/GetShardBlockProof.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface GetShardBlockProof {
workchain: number
shard: number
seqno: number
from_seqno?: number
}
8 changes: 8 additions & 0 deletions src/dto/rpc/ton/models/GetTransactions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export interface GetTransactions {
address: string
limit?: number
It?: number
hash?: string
to_It?: number
archival?: boolean
}
10 changes: 10 additions & 0 deletions src/dto/rpc/ton/models/TonRequestJsonRPC.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type TonRequestJsonRPC = {
method: string;
params?: any;
id?: string;
jsonrpc?: string;
};
10 changes: 10 additions & 0 deletions src/dto/rpc/ton/models/TonResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type TonResponse = {
ok: boolean;
result?: string;
error?: string;
code?: number;
};

0 comments on commit f21e8bb

Please sign in to comment.