Skip to content

Latest commit

 

History

History
1140 lines (874 loc) · 31.5 KB

mod_abi.md

File metadata and controls

1140 lines (874 loc) · 31.5 KB

Module abi

Provides message encoding and decoding according to the ABI specification.

Functions

encode_message_body – Encodes message body according to ABI function call.

attach_signature_to_message_body

encode_message – Encodes an ABI-compatible message

encode_internal_message – Encodes an internal ABI-compatible message

attach_signature – Combines hex-encoded signature with base64-encoded unsigned_message. Returns signed message encoded in base64.

decode_message – Decodes message body using provided message BOC and ABI.

decode_message_body – Decodes message body using provided body BOC and ABI.

encode_account – Creates account state BOC

decode_account_data – Decodes account data using provided data BOC and ABI.

Types

AbiErrorCode

Abi

AbiHandle

FunctionHeader – The ABI function header.

CallSet

DeploySet

Signer

MessageBodyType

StateInitSource

StateInitParams

MessageSource

AbiParam

AbiEvent

AbiData

AbiFunction

AbiContract

ParamsOfEncodeMessageBody

ResultOfEncodeMessageBody

ParamsOfAttachSignatureToMessageBody

ResultOfAttachSignatureToMessageBody

ParamsOfEncodeMessage

ResultOfEncodeMessage

ParamsOfEncodeInternalMessage

ResultOfEncodeInternalMessage

ParamsOfAttachSignature

ResultOfAttachSignature

ParamsOfDecodeMessage

DecodedMessageBody

ParamsOfDecodeMessageBody

ParamsOfEncodeAccount

ResultOfEncodeAccount

ParamsOfDecodeAccountData

ResultOfDecodeData

Functions

encode_message_body

Encodes message body according to ABI function call.

type ParamsOfEncodeMessageBody = {
    abi: Abi,
    call_set: CallSet,
    is_internal: boolean,
    signer: Signer,
    processing_try_index?: number
}

type ResultOfEncodeMessageBody = {
    body: string,
    data_to_sign?: string
}

function encode_message_body(
    params: ParamsOfEncodeMessageBody,
): Promise<ResultOfEncodeMessageBody>;

Parameters

  • abi: Abi – Contract ABI.
  • call_set: CallSet – Function call parameters.
    Must be specified in non deploy message.

    In case of deploy message contains parameters of constructor.
  • is_internal: boolean – True if internal message body must be encoded.
  • signer: Signer – Signing parameters.
  • processing_try_index?: number – Processing try index.
    Used in message processing with retries.

    Encoder uses the provided try index to calculate message
    expiration time.

    Expiration timeouts will grow with every retry.

    Default value is 0.

Result

  • body: string – Message body BOC encoded with base64.
  • data_to_sign?: string – Optional data to sign.
    Encoded with base64.
    Presents when message is unsigned. Can be used for external
    message signing. Is this case you need to sing this data and
    produce signed message using abi.attach_signature.

attach_signature_to_message_body

type ParamsOfAttachSignatureToMessageBody = {
    abi: Abi,
    public_key: string,
    message: string,
    signature: string
}

type ResultOfAttachSignatureToMessageBody = {
    body: string
}

function attach_signature_to_message_body(
    params: ParamsOfAttachSignatureToMessageBody,
): Promise<ResultOfAttachSignatureToMessageBody>;

Parameters

  • abi: Abi – Contract ABI
  • public_key: string – Public key.
    Must be encoded with hex.
  • message: string – Unsigned message body BOC.
    Must be encoded with base64.
  • signature: string – Signature.
    Must be encoded with hex.

Result

  • body: string

encode_message

Encodes an ABI-compatible message

Allows to encode deploy and function call messages, both signed and unsigned.

Use cases include messages of any possible type:

  • deploy with initial function call (i.e. constructor or any other function that is used for some kind of initialization);
  • deploy without initial function call;
  • signed/unsigned + data for signing.

Signer defines how the message should or shouldn't be signed:

Signer::None creates an unsigned message. This may be needed in case of some public methods, that do not require authorization by pubkey.

Signer::External takes public key and returns data_to_sign for later signing. Use attach_signature method with the result signature to get the signed message.

Signer::Keys creates a signed message with provided key pair.

[SOON] Signer::SigningBox Allows using a special interface to implement signing without private key disclosure to SDK. For instance, in case of using a cold wallet or HSM, when application calls some API to sign data.

There is an optional public key can be provided in deploy set in order to substitute one in TVM file.

Public key resolving priority:

  1. Public key from deploy set.
  2. Public key, specified in TVM file.
  3. Public key, provided by signer.
type ParamsOfEncodeMessage = {
    abi: Abi,
    address?: string,
    deploy_set?: DeploySet,
    call_set?: CallSet,
    signer: Signer,
    processing_try_index?: number
}

type ResultOfEncodeMessage = {
    message: string,
    data_to_sign?: string,
    address: string,
    message_id: string
}

function encode_message(
    params: ParamsOfEncodeMessage,
): Promise<ResultOfEncodeMessage>;

Parameters

  • abi: Abi – Contract ABI.
  • address?: string – Target address the message will be sent to.
    Must be specified in case of non-deploy message.
  • deploy_set?: DeploySet – Deploy parameters.
    Must be specified in case of deploy message.
  • call_set?: CallSet – Function call parameters.
    Must be specified in case of non-deploy message.

    In case of deploy message it is optional and contains parameters
    of the functions that will to be called upon deploy transaction.
  • signer: Signer – Signing parameters.
  • processing_try_index?: number – Processing try index.
    Used in message processing with retries (if contract's ABI includes "expire" header).

    Encoder uses the provided try index to calculate message
    expiration time. The 1st message expiration time is specified in
    Client config.

    Expiration timeouts will grow with every retry.
    Retry grow factor is set in Client config:
    <.....add config parameter with default value here>

    Default value is 0.

Result

  • message: string – Message BOC encoded with base64.
  • data_to_sign?: string – Optional data to be signed encoded in base64.
    Returned in case of Signer::External. Can be used for external
    message signing. Is this case you need to use this data to create signature and
    then produce signed message using abi.attach_signature.
  • address: string – Destination address.
  • message_id: string – Message id.

encode_internal_message

Encodes an internal ABI-compatible message

Allows to encode deploy and function call messages.

Use cases include messages of any possible type:

  • deploy with initial function call (i.e. constructor or any other function that is used for some kind of initialization);
  • deploy without initial function call;
  • simple function call

There is an optional public key can be provided in deploy set in order to substitute one in TVM file.

Public key resolving priority:

  1. Public key from deploy set.
  2. Public key, specified in TVM file.
type ParamsOfEncodeInternalMessage = {
    abi?: Abi,
    address?: string,
    src_address?: string,
    deploy_set?: DeploySet,
    call_set?: CallSet,
    value: string,
    bounce?: boolean,
    enable_ihr?: boolean
}

type ResultOfEncodeInternalMessage = {
    message: string,
    address: string,
    message_id: string
}

function encode_internal_message(
    params: ParamsOfEncodeInternalMessage,
): Promise<ResultOfEncodeInternalMessage>;

Parameters

  • abi?: Abi – Contract ABI.
    Can be None if both deploy_set and call_set are None.
  • address?: string – Target address the message will be sent to.
    Must be specified in case of non-deploy message.
  • src_address?: string – Source address of the message.
  • deploy_set?: DeploySet – Deploy parameters.
    Must be specified in case of deploy message.
  • call_set?: CallSet – Function call parameters.
    Must be specified in case of non-deploy message.

    In case of deploy message it is optional and contains parameters
    of the functions that will to be called upon deploy transaction.
  • value: string – Value in nanotokens to be sent with message.
  • bounce?: boolean – Flag of bounceable message.
    Default is true.
  • enable_ihr?: boolean – Enable Instant Hypercube Routing for the message.
    Default is false.

Result

  • message: string – Message BOC encoded with base64.
  • address: string – Destination address.
  • message_id: string – Message id.

attach_signature

Combines hex-encoded signature with base64-encoded unsigned_message. Returns signed message encoded in base64.

type ParamsOfAttachSignature = {
    abi: Abi,
    public_key: string,
    message: string,
    signature: string
}

type ResultOfAttachSignature = {
    message: string,
    message_id: string
}

function attach_signature(
    params: ParamsOfAttachSignature,
): Promise<ResultOfAttachSignature>;

Parameters

  • abi: Abi – Contract ABI
  • public_key: string – Public key encoded in hex.
  • message: string – Unsigned message BOC encoded in base64.
  • signature: string – Signature encoded in hex.

Result

  • message: string – Signed message BOC
  • message_id: string – Message ID

decode_message

Decodes message body using provided message BOC and ABI.

type ParamsOfDecodeMessage = {
    abi: Abi,
    message: string
}

type DecodedMessageBody = {
    body_type: MessageBodyType,
    name: string,
    value?: any,
    header?: FunctionHeader
}

function decode_message(
    params: ParamsOfDecodeMessage,
): Promise<DecodedMessageBody>;

Parameters

  • abi: Abi – contract ABI
  • message: string – Message BOC

Result

  • body_type: MessageBodyType – Type of the message body content.
  • name: string – Function or event name.
  • value?: any – Parameters or result value.
  • header?: FunctionHeader – Function header.

decode_message_body

Decodes message body using provided body BOC and ABI.

type ParamsOfDecodeMessageBody = {
    abi: Abi,
    body: string,
    is_internal: boolean
}

type DecodedMessageBody = {
    body_type: MessageBodyType,
    name: string,
    value?: any,
    header?: FunctionHeader
}

function decode_message_body(
    params: ParamsOfDecodeMessageBody,
): Promise<DecodedMessageBody>;

Parameters

  • abi: Abi – Contract ABI used to decode.
  • body: string – Message body BOC encoded in base64.
  • is_internal: boolean – True if the body belongs to the internal message.

Result

  • body_type: MessageBodyType – Type of the message body content.
  • name: string – Function or event name.
  • value?: any – Parameters or result value.
  • header?: FunctionHeader – Function header.

encode_account

Creates account state BOC

Creates account state provided with one of these sets of data :

  1. BOC of code, BOC of data, BOC of library
  2. TVC (string in base64), keys, init params
type ParamsOfEncodeAccount = {
    state_init: StateInitSource,
    balance?: bigint,
    last_trans_lt?: bigint,
    last_paid?: number,
    boc_cache?: BocCacheType
}

type ResultOfEncodeAccount = {
    account: string,
    id: string
}

function encode_account(
    params: ParamsOfEncodeAccount,
): Promise<ResultOfEncodeAccount>;

Parameters

  • state_init: StateInitSource – Source of the account state init.
  • balance?: bigint – Initial balance.
  • last_trans_lt?: bigint – Initial value for the last_trans_lt.
  • last_paid?: number – Initial value for the last_paid.
  • boc_cache?: BocCacheType – Cache type to put the result.
    The BOC itself returned if no cache type provided

Result

  • account: string – Account BOC encoded in base64.
  • id: string – Account ID encoded in hex.

decode_account_data

Decodes account data using provided data BOC and ABI.

Note: this feature requires ABI 2.1 or higher.

type ParamsOfDecodeAccountData = {
    abi: Abi,
    data: string
}

type ResultOfDecodeData = {
    data: any
}

function decode_account_data(
    params: ParamsOfDecodeAccountData,
): Promise<ResultOfDecodeData>;

Parameters

  • abi: Abi – Contract ABI
  • data: string – Data BOC or BOC handle

Result

  • data: any – Decoded data as a JSON structure.

Types

AbiErrorCode

enum AbiErrorCode {
    RequiredAddressMissingForEncodeMessage = 301,
    RequiredCallSetMissingForEncodeMessage = 302,
    InvalidJson = 303,
    InvalidMessage = 304,
    EncodeDeployMessageFailed = 305,
    EncodeRunMessageFailed = 306,
    AttachSignatureFailed = 307,
    InvalidTvcImage = 308,
    RequiredPublicKeyMissingForFunctionHeader = 309,
    InvalidSigner = 310,
    InvalidAbi = 311,
    InvalidFunctionId = 312,
    InvalidData = 313
}

One of the following value:

  • RequiredAddressMissingForEncodeMessage = 301
  • RequiredCallSetMissingForEncodeMessage = 302
  • InvalidJson = 303
  • InvalidMessage = 304
  • EncodeDeployMessageFailed = 305
  • EncodeRunMessageFailed = 306
  • AttachSignatureFailed = 307
  • InvalidTvcImage = 308
  • RequiredPublicKeyMissingForFunctionHeader = 309
  • InvalidSigner = 310
  • InvalidAbi = 311
  • InvalidFunctionId = 312
  • InvalidData = 313

Abi

type Abi = {
    type: 'Contract'
    value: AbiContract
} | {
    type: 'Json'
    value: string
} | {
    type: 'Handle'
    value: AbiHandle
} | {
    type: 'Serialized'
    value: AbiContract
}

Depends on value of the type field.

When type is 'Contract'

When type is 'Json'

  • value: string

When type is 'Handle'

When type is 'Serialized'

Variant constructors:

function abiContract(value: AbiContract): Abi;
function abiJson(value: string): Abi;
function abiHandle(value: AbiHandle): Abi;
function abiSerialized(value: AbiContract): Abi;

AbiHandle

type AbiHandle = number

FunctionHeader

The ABI function header.

Includes several hidden function parameters that contract uses for security, message delivery monitoring and replay protection reasons.

The actual set of header fields depends on the contract's ABI. If a contract's ABI does not include some headers, then they are not filled.

type FunctionHeader = {
    expire?: number,
    time?: bigint,
    pubkey?: string
}
  • expire?: number – Message expiration time in seconds. If not specified - calculated automatically from message_expiration_timeout(), try_index and message_expiration_timeout_grow_factor() (if ABI includes expire header).
  • time?: bigint – Message creation time in milliseconds.
    If not specified, now is used (if ABI includes time header).
  • pubkey?: string – Public key is used by the contract to check the signature.
    Encoded in hex. If not specified, method fails with exception (if ABI includes pubkey header)..

CallSet

type CallSet = {
    function_name: string,
    header?: FunctionHeader,
    input?: any
}
  • function_name: string – Function name that is being called. Or function id encoded as string in hex (starting with 0x).
  • header?: FunctionHeader – Function header.
    If an application omits some header parameters required by the
    contract's ABI, the library will set the default values for
    them.
  • input?: any – Function input parameters according to ABI.

DeploySet

type DeploySet = {
    tvc: string,
    workchain_id?: number,
    initial_data?: any,
    initial_pubkey?: string
}
  • tvc: string – Content of TVC file encoded in base64.
  • workchain_id?: number – Target workchain for destination address.
    Default is 0.
  • initial_data?: any – List of initial values for contract's public variables.
  • initial_pubkey?: string – Optional public key that can be provided in deploy set in order to substitute one in TVM file or provided by Signer.
    Public key resolving priority:
    1. Public key from deploy set.
    2. Public key, specified in TVM file.
    3. Public key, provided by Signer.

Signer

type Signer = {
    type: 'None'
} | {
    type: 'External'
    public_key: string
} | {
    type: 'Keys'
    keys: KeyPair
} | {
    type: 'SigningBox'
    handle: SigningBoxHandle
}

Depends on value of the type field.

When type is 'None'

No keys are provided.

Creates an unsigned message.

When type is 'External'

Only public key is provided in unprefixed hex string format to generate unsigned message and data_to_sign which can be signed later.

  • public_key: string

When type is 'Keys'

Key pair is provided for signing

When type is 'SigningBox'

Signing Box interface is provided for signing, allows Dapps to sign messages using external APIs, such as HSM, cold wallet, etc.

Variant constructors:

function signerNone(): Signer;
function signerExternal(public_key: string): Signer;
function signerKeys(keys: KeyPair): Signer;
function signerSigningBox(handle: SigningBoxHandle): Signer;

MessageBodyType

enum MessageBodyType {
    Input = "Input",
    Output = "Output",
    InternalOutput = "InternalOutput",
    Event = "Event"
}

One of the following value:

  • Input = "Input" – Message contains the input of the ABI function.
  • Output = "Output" – Message contains the output of the ABI function.
  • InternalOutput = "InternalOutput" – Message contains the input of the imported ABI function.
    Occurs when contract sends an internal message to other
    contract.
  • Event = "Event" – Message contains the input of the ABI event.

StateInitSource

type StateInitSource = {
    type: 'Message'
    source: MessageSource
} | {
    type: 'StateInit'
    code: string,
    data: string,
    library?: string
} | {
    type: 'Tvc'
    tvc: string,
    public_key?: string,
    init_params?: StateInitParams
}

Depends on value of the type field.

When type is 'Message'

Deploy message.

When type is 'StateInit'

State init data.

  • code: string – Code BOC.
    Encoded in base64.
  • data: string – Data BOC.
    Encoded in base64.
  • library?: string – Library BOC.
    Encoded in base64.

When type is 'Tvc'

Content of the TVC file.

Encoded in base64.

Variant constructors:

function stateInitSourceMessage(source: MessageSource): StateInitSource;
function stateInitSourceStateInit(code: string, data: string, library?: string): StateInitSource;
function stateInitSourceTvc(tvc: string, public_key?: string, init_params?: StateInitParams): StateInitSource;

StateInitParams

type StateInitParams = {
    abi: Abi,
    value: any
}
  • abi: Abi
  • value: any

MessageSource

type MessageSource = {
    type: 'Encoded'
    message: string,
    abi?: Abi
} | ({
    type: 'EncodingParams'
} & ParamsOfEncodeMessage)

Depends on value of the type field.

When type is 'Encoded'

  • message: string
  • abi?: Abi

When type is 'EncodingParams'

  • abi: Abi – Contract ABI.
  • address?: string – Target address the message will be sent to.
    Must be specified in case of non-deploy message.
  • deploy_set?: DeploySet – Deploy parameters.
    Must be specified in case of deploy message.
  • call_set?: CallSet – Function call parameters.
    Must be specified in case of non-deploy message.

    In case of deploy message it is optional and contains parameters
    of the functions that will to be called upon deploy transaction.
  • signer: Signer – Signing parameters.
  • processing_try_index?: number – Processing try index.
    Used in message processing with retries (if contract's ABI includes "expire" header).

    Encoder uses the provided try index to calculate message
    expiration time. The 1st message expiration time is specified in
    Client config.

    Expiration timeouts will grow with every retry.
    Retry grow factor is set in Client config:
    <.....add config parameter with default value here>

    Default value is 0.

Variant constructors:

function messageSourceEncoded(message: string, abi?: Abi): MessageSource;
function messageSourceEncodingParams(params: ParamsOfEncodeMessage): MessageSource;

AbiParam

type AbiParam = {
    name: string,
    type: string,
    components?: AbiParam[]
}
  • name: string
  • type: string
  • components?: AbiParam[]

AbiEvent

type AbiEvent = {
    name: string,
    inputs: AbiParam[],
    id?: string | null
}
  • name: string
  • inputs: AbiParam[]
  • id?: string?

AbiData

type AbiData = {
    key: number,
    name: string,
    type: string,
    components?: AbiParam[]
}
  • key: number
  • name: string
  • type: string
  • components?: AbiParam[]

AbiFunction

type AbiFunction = {
    name: string,
    inputs: AbiParam[],
    outputs: AbiParam[],
    id?: string | null
}

AbiContract

type AbiContract = {
    'ABI version'?: number,
    abi_version?: number,
    version?: string | null,
    header?: string[],
    functions?: AbiFunction[],
    events?: AbiEvent[],
    data?: AbiData[],
    fields?: AbiParam[]
}

ParamsOfEncodeMessageBody

type ParamsOfEncodeMessageBody = {
    abi: Abi,
    call_set: CallSet,
    is_internal: boolean,
    signer: Signer,
    processing_try_index?: number
}
  • abi: Abi – Contract ABI.
  • call_set: CallSet – Function call parameters.
    Must be specified in non deploy message.

    In case of deploy message contains parameters of constructor.
  • is_internal: boolean – True if internal message body must be encoded.
  • signer: Signer – Signing parameters.
  • processing_try_index?: number – Processing try index.
    Used in message processing with retries.

    Encoder uses the provided try index to calculate message
    expiration time.

    Expiration timeouts will grow with every retry.

    Default value is 0.

ResultOfEncodeMessageBody

type ResultOfEncodeMessageBody = {
    body: string,
    data_to_sign?: string
}
  • body: string – Message body BOC encoded with base64.
  • data_to_sign?: string – Optional data to sign.
    Encoded with base64.
    Presents when message is unsigned. Can be used for external
    message signing. Is this case you need to sing this data and
    produce signed message using abi.attach_signature.

ParamsOfAttachSignatureToMessageBody

type ParamsOfAttachSignatureToMessageBody = {
    abi: Abi,
    public_key: string,
    message: string,
    signature: string
}
  • abi: Abi – Contract ABI
  • public_key: string – Public key.
    Must be encoded with hex.
  • message: string – Unsigned message body BOC.
    Must be encoded with base64.
  • signature: string – Signature.
    Must be encoded with hex.

ResultOfAttachSignatureToMessageBody

type ResultOfAttachSignatureToMessageBody = {
    body: string
}
  • body: string

ParamsOfEncodeMessage

type ParamsOfEncodeMessage = {
    abi: Abi,
    address?: string,
    deploy_set?: DeploySet,
    call_set?: CallSet,
    signer: Signer,
    processing_try_index?: number
}
  • abi: Abi – Contract ABI.
  • address?: string – Target address the message will be sent to.
    Must be specified in case of non-deploy message.
  • deploy_set?: DeploySet – Deploy parameters.
    Must be specified in case of deploy message.
  • call_set?: CallSet – Function call parameters.
    Must be specified in case of non-deploy message.

    In case of deploy message it is optional and contains parameters
    of the functions that will to be called upon deploy transaction.
  • signer: Signer – Signing parameters.
  • processing_try_index?: number – Processing try index.
    Used in message processing with retries (if contract's ABI includes "expire" header).

    Encoder uses the provided try index to calculate message
    expiration time. The 1st message expiration time is specified in
    Client config.

    Expiration timeouts will grow with every retry.
    Retry grow factor is set in Client config:
    <.....add config parameter with default value here>

    Default value is 0.

ResultOfEncodeMessage

type ResultOfEncodeMessage = {
    message: string,
    data_to_sign?: string,
    address: string,
    message_id: string
}
  • message: string – Message BOC encoded with base64.
  • data_to_sign?: string – Optional data to be signed encoded in base64.
    Returned in case of Signer::External. Can be used for external
    message signing. Is this case you need to use this data to create signature and
    then produce signed message using abi.attach_signature.
  • address: string – Destination address.
  • message_id: string – Message id.

ParamsOfEncodeInternalMessage

type ParamsOfEncodeInternalMessage = {
    abi?: Abi,
    address?: string,
    src_address?: string,
    deploy_set?: DeploySet,
    call_set?: CallSet,
    value: string,
    bounce?: boolean,
    enable_ihr?: boolean
}
  • abi?: Abi – Contract ABI.
    Can be None if both deploy_set and call_set are None.
  • address?: string – Target address the message will be sent to.
    Must be specified in case of non-deploy message.
  • src_address?: string – Source address of the message.
  • deploy_set?: DeploySet – Deploy parameters.
    Must be specified in case of deploy message.
  • call_set?: CallSet – Function call parameters.
    Must be specified in case of non-deploy message.

    In case of deploy message it is optional and contains parameters
    of the functions that will to be called upon deploy transaction.
  • value: string – Value in nanotokens to be sent with message.
  • bounce?: boolean – Flag of bounceable message.
    Default is true.
  • enable_ihr?: boolean – Enable Instant Hypercube Routing for the message.
    Default is false.

ResultOfEncodeInternalMessage

type ResultOfEncodeInternalMessage = {
    message: string,
    address: string,
    message_id: string
}
  • message: string – Message BOC encoded with base64.
  • address: string – Destination address.
  • message_id: string – Message id.

ParamsOfAttachSignature

type ParamsOfAttachSignature = {
    abi: Abi,
    public_key: string,
    message: string,
    signature: string
}
  • abi: Abi – Contract ABI
  • public_key: string – Public key encoded in hex.
  • message: string – Unsigned message BOC encoded in base64.
  • signature: string – Signature encoded in hex.

ResultOfAttachSignature

type ResultOfAttachSignature = {
    message: string,
    message_id: string
}
  • message: string – Signed message BOC
  • message_id: string – Message ID

ParamsOfDecodeMessage

type ParamsOfDecodeMessage = {
    abi: Abi,
    message: string
}
  • abi: Abi – contract ABI
  • message: string – Message BOC

DecodedMessageBody

type DecodedMessageBody = {
    body_type: MessageBodyType,
    name: string,
    value?: any,
    header?: FunctionHeader
}
  • body_type: MessageBodyType – Type of the message body content.
  • name: string – Function or event name.
  • value?: any – Parameters or result value.
  • header?: FunctionHeader – Function header.

ParamsOfDecodeMessageBody

type ParamsOfDecodeMessageBody = {
    abi: Abi,
    body: string,
    is_internal: boolean
}
  • abi: Abi – Contract ABI used to decode.
  • body: string – Message body BOC encoded in base64.
  • is_internal: boolean – True if the body belongs to the internal message.

ParamsOfEncodeAccount

type ParamsOfEncodeAccount = {
    state_init: StateInitSource,
    balance?: bigint,
    last_trans_lt?: bigint,
    last_paid?: number,
    boc_cache?: BocCacheType
}
  • state_init: StateInitSource – Source of the account state init.
  • balance?: bigint – Initial balance.
  • last_trans_lt?: bigint – Initial value for the last_trans_lt.
  • last_paid?: number – Initial value for the last_paid.
  • boc_cache?: BocCacheType – Cache type to put the result.
    The BOC itself returned if no cache type provided

ResultOfEncodeAccount

type ResultOfEncodeAccount = {
    account: string,
    id: string
}
  • account: string – Account BOC encoded in base64.
  • id: string – Account ID encoded in hex.

ParamsOfDecodeAccountData

type ParamsOfDecodeAccountData = {
    abi: Abi,
    data: string
}
  • abi: Abi – Contract ABI
  • data: string – Data BOC or BOC handle

ResultOfDecodeData

type ResultOfDecodeData = {
    data: any
}
  • data: any – Decoded data as a JSON structure.