Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
197 changes: 197 additions & 0 deletions api/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4991,6 +4991,134 @@
],
"type": "object"
},
"MigrationPrepareRequest": {
"properties": {
"currency": {
"default": "USD",
"description": "fiat currency for the preview values",
"example": "USD",
"type": "string"
},
"from": {
"description": "legacy source wallet to drain",
"format": "address",
"type": "string"
},
"to": {
"description": "destination wallet TON address",
"format": "address",
"type": "string"
}
},
"required": [
"from",
"to"
],
"type": "object"
},
"MigrationPrepareResponse": {
"properties": {
"from": {
"format": "address",
"type": "string"
},
"to": {
"format": "address",
"type": "string"
},
"transactions": {
"description": "ordered; sign and broadcast in array order, one entry per external message",
"items": {
"$ref": "#/components/schemas/MigrationTransaction"
},
"type": "array"
},
"wallet_version": {
"description": "source wallet version (informational)",
"example": "v4R2",
"type": "string"
}
},
"required": [
"from",
"to",
"wallet_version",
"transactions"
],
"type": "object"
},
"MigrationTransaction": {
"properties": {
"boc": {
"description": "base64 BOC of the unsigned wallet body. Sign its hash, prepend the signature, wrap it in an external message and broadcast.\n",
"type": "string"
},
"emulation": {
"$ref": "#/components/schemas/MessageConsequences"
},
"seqno": {
"description": "wallet seqno baked into the unsigned body",
"format": "int32",
"type": "integer"
}
},
"required": [
"seqno",
"boc",
"emulation"
],
"type": "object"
},
"MigrationWalletValue": {
"properties": {
"account": {
"example": "0:97264395BD65A255A429B11326C84128B7D70FFED7949ABAE3036D506BA38621",
"format": "address",
"type": "string"
},
"balance": {
"description": "TON balance in nanotons",
"format": "int64",
"type": "integer"
},
"jettons": {
"items": {
"$ref": "#/components/schemas/JettonBalance"
},
"type": "array"
},
"nft_count": {
"description": "number of NFTs owned by the account",
"format": "int32",
"type": "integer"
},
"status": {
"$ref": "#/components/schemas/AccountStatus"
}
},
"required": [
"account",
"balance",
"status",
"jettons",
"nft_count"
],
"type": "object"
},
"MigrationWallets": {
"properties": {
"wallets": {
"items": {
"$ref": "#/components/schemas/MigrationWalletValue"
},
"type": "array"
}
},
"required": [
"wallets"
],
"type": "object"
},
"MisbehaviourPunishmentConfig": {
"properties": {
"default_flat_fine": {
Expand Down Expand Up @@ -11561,6 +11689,72 @@
]
}
},
"/v2/migration/prepare": {
"post": {
"description": "Prepare ordered signable transactions that migrate every asset from `from` to `to`.",
"operationId": "prepareMigration",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MigrationPrepareRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MigrationPrepareResponse"
}
}
},
"description": "ordered transactions to sign and broadcast"
},
"default": {
"$ref": "#/components/responses/Error"
}
},
"tags": [
"Migration"
]
}
},
"/v2/migration/wallets": {
"post": {
"description": "Get migratable assets value (TON balance, jettons with prices, NFT count) for several wallets at once.",
"operationId": "getMigrationWallets",
"parameters": [
{
"$ref": "#/components/parameters/currenciesQuery"
}
],
"requestBody": {
"$ref": "#/components/requestBodies/AccountIDs"
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MigrationWallets"
}
}
},
"description": "migratable value per requested wallet"
},
"default": {
"$ref": "#/components/responses/Error"
}
},
"tags": [
"Migration"
]
}
},
"/v2/multisig/order/{account_id}": {
"get": {
"description": "Get multisig order",
Expand Down Expand Up @@ -13020,6 +13214,9 @@
},
"name": "Accounts"
},
{
"name": "Migration"
},
{
"externalDocs": {
"description": "Additional documentation",
Expand Down
139 changes: 138 additions & 1 deletion api/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ tags:
externalDocs:
description: Additional documentation
url: https://docs.tonconsole.com/tonapi/rest-api/accounts
- name: Migration
- name: NFT
externalDocs:
description: Additional documentation
Expand Down Expand Up @@ -632,6 +633,46 @@ paths:
type: boolean
default:
$ref: '#/components/responses/Error'
/v2/migration/wallets:
post:
description: Get migratable assets value (TON balance, jettons with prices, NFT count) for several wallets at once.
operationId: getMigrationWallets
tags:
- Migration
parameters:
- $ref: '#/components/parameters/currenciesQuery'
requestBody:
$ref: "#/components/requestBodies/AccountIDs"
responses:
'200':
description: migratable value per requested wallet
content:
application/json:
schema:
$ref: '#/components/schemas/MigrationWallets'
'default':
$ref: '#/components/responses/Error'
/v2/migration/prepare:
post:
description: Prepare ordered signable transactions that migrate every asset from `from` to `to`.
operationId: prepareMigration
tags:
- Migration
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MigrationPrepareRequest'
responses:
'200':
description: ordered transactions to sign and broadcast
content:
application/json:
schema:
$ref: '#/components/schemas/MigrationPrepareResponse'
'default':
$ref: '#/components/responses/Error'
/v2/accounts/_bulk:
post:
description: Get human-friendly information about several accounts without low-level details.
Expand Down Expand Up @@ -6145,7 +6186,103 @@ components:
balances:
type: array
items:
$ref: '#/components/schemas/JettonBalance'
$ref: "#/components/schemas/JettonBalance"
MigrationWallets:
type: object
required:
- wallets
properties:
wallets:
type: array
items:
$ref: "#/components/schemas/MigrationWalletValue"
MigrationWalletValue:
type: object
required:
- account
- balance
- status
- jettons
- nft_count
properties:
account:
type: string
format: address
example: 0:97264395BD65A255A429B11326C84128B7D70FFED7949ABAE3036D506BA38621
balance:
type: integer
format: int64
description: TON balance in nanotons
status:
$ref: "#/components/schemas/AccountStatus"
jettons:
type: array
items:
$ref: "#/components/schemas/JettonBalance"
nft_count:
type: integer
format: int32
description: number of NFTs owned by the account
MigrationPrepareRequest:
type: object
required:
- from
- to
properties:
from:
type: string
format: address
description: legacy source wallet to drain
to:
type: string
format: address
description: destination wallet TON address
currency:
type: string
default: USD
description: fiat currency for the preview values
example: USD
MigrationPrepareResponse:
type: object
required:
- from
- to
- wallet_version
- transactions
properties:
from:
type: string
format: address
to:
type: string
format: address
wallet_version:
type: string
description: source wallet version (informational)
example: v4R2
transactions:
type: array
description: ordered; sign and broadcast in array order, one entry per external message
items:
$ref: "#/components/schemas/MigrationTransaction"
MigrationTransaction:
type: object
required:
- seqno
- boc
- emulation
properties:
seqno:
type: integer
format: int32
description: wallet seqno baked into the unsigned body
boc:
type: string
description: >
base64 BOC of the unsigned wallet body. Sign its hash, prepend the signature,
wrap it in an external message and broadcast.
emulation:
$ref: "#/components/schemas/MessageConsequences"
CurrencyType:
type: string
example: jetton
Expand Down
Loading
Loading