Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AbiModule

Provides message encoding and decoding according to the ABI specification.

Hierarchy

  • AbiModule

Index

Constructors

Properties

client: IClient

Methods

  • Decodes BOC into JSON as a set of provided parameters.

    remarks

    Solidity functions use ABI types for builder encoding. The simplest way to decode such a BOC is to use ABI decoding. ABI has it own rules for fields layout in cells so manually encoded BOC can not be described in terms of ABI rules.

    To solve this problem we introduce a new ABI type Ref(<ParamType>) which allows to store ParamType ABI parameter in cell reference and, thus, decode manually encoded BOCs. This type is available only in decode_boc function and will not be available in ABI messages encoding until it is included into some ABI revision.

    Such BOC descriptions covers most users needs. If someone wants to decode some BOC which can not be described by these rules (i.e. BOC with TLB containing constructors of flags defining some parsing conditions) then they can decode the fields up to fork condition, check the parsed data manually, expand the parsing schema and then decode the whole BOC with the full schema.

    Parameters

    Returns Promise<ResultOfDecodeBoc>

    ResultOfDecodeBoc

  • Decodes BOC into JSON as a set of provided parameters.

    remarks

    Solidity functions use ABI types for builder encoding. The simplest way to decode such a BOC is to use ABI decoding. ABI has it own rules for fields layout in cells so manually encoded BOC can not be described in terms of ABI rules.

    To solve this problem we introduce a new ABI type Ref(<ParamType>) which allows to store ParamType ABI parameter in cell reference and, thus, decode manually encoded BOCs. This type is available only in decode_boc function and will not be available in ABI messages encoding until it is included into some ABI revision.

    Such BOC descriptions covers most users needs. If someone wants to decode some BOC which can not be described by these rules (i.e. BOC with TLB containing constructors of flags defining some parsing conditions) then they can decode the fields up to fork condition, check the parsed data manually, expand the parsing schema and then decode the whole BOC with the full schema.

    NOTE: Available only for lib-node binding.

    Parameters

    Returns ResultOfDecodeBoc

    ResultOfDecodeBoc

  • Decodes initial values of a contract's static variables and owner's public key from account initial data This operation is applicable only for initial account data (before deploy). If the contract is already deployed, its data doesn't contain this data section any more.

    remarks

    Doesn't support ABI version >= 2.4. Use decode_account_data instead

    Parameters

    Returns Promise<ResultOfDecodeInitialData>

    ResultOfDecodeInitialData

  • Decodes initial values of a contract's static variables and owner's public key from account initial data This operation is applicable only for initial account data (before deploy). If the contract is already deployed, its data doesn't contain this data section any more.

    remarks

    Doesn't support ABI version >= 2.4. Use decode_account_data instead

    NOTE: Available only for lib-node binding.

    Parameters

    Returns ResultOfDecodeInitialData

    ResultOfDecodeInitialData

  • Encodes initial account data with initial values for the contract's static variables and owner's public key into a data BOC that can be passed to encode_tvc function afterwards.

    remarks

    This function is analogue of tvm.buildDataInit function in Solidity.

    Parameters

    Returns Promise<ResultOfEncodeInitialData>

    ResultOfEncodeInitialData

  • Encodes initial account data with initial values for the contract's static variables and owner's public key into a data BOC that can be passed to encode_tvc function afterwards.

    remarks

    This function is analogue of tvm.buildDataInit function in Solidity.

    NOTE: Available only for lib-node binding.

    Parameters

    Returns ResultOfEncodeInitialData

    ResultOfEncodeInitialData

  • Encodes an internal ABI-compatible message

    remarks

    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.

    Parameters

    Returns Promise<ResultOfEncodeInternalMessage>

    ResultOfEncodeInternalMessage

  • Encodes an internal ABI-compatible message

    remarks

    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.

    NOTE: Available only for lib-node binding.

    Parameters

    Returns ResultOfEncodeInternalMessage

    ResultOfEncodeInternalMessage

  • Encodes an ABI-compatible message

    remarks

    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.

    Parameters

    Returns Promise<ResultOfEncodeMessage>

    ResultOfEncodeMessage

  • Encodes an ABI-compatible message

    remarks

    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.

    NOTE: Available only for lib-node binding.

    Parameters

    Returns ResultOfEncodeMessage

    ResultOfEncodeMessage

  • Updates initial account data with initial values for the contract's static variables and owner's public key. This operation is applicable only for initial account data (before deploy). If the contract is already deployed, its data doesn't contain this data section any more.

    remarks

    Doesn't support ABI version >= 2.4. Use encode_initial_data instead

    Parameters

    Returns Promise<ResultOfUpdateInitialData>

    ResultOfUpdateInitialData

  • Updates initial account data with initial values for the contract's static variables and owner's public key. This operation is applicable only for initial account data (before deploy). If the contract is already deployed, its data doesn't contain this data section any more.

    remarks

    Doesn't support ABI version >= 2.4. Use encode_initial_data instead

    NOTE: Available only for lib-node binding.

    Parameters

    Returns ResultOfUpdateInitialData

    ResultOfUpdateInitialData

Generated using TypeDoc