Interface ContractTransactionOptions

Hierarchy

Properties

abis?: Record<string, Abi>

Collection of Abis so that the receiver can parse the operations in the transaction

beforeSend?: ((tx: TransactionJson, options?: SendTransactionOptions) => Promise<void>)

Type declaration

    • (tx: TransactionJson, options?: SendTransactionOptions): Promise<void>
    • Function to be called before sending a transaction to the blockchain. It is useful to apply multisignatures to the transaction.

      Example

      const signer2 = Signer.fromSeed("signer2");
      const signer3 = Signer.fromSeed("signer3");

      const addMoreSignatures = async (tx, opts) => {
      await signer2.signTransaction(tx);
      await signer3.signTransaction(tx);
      };

      const { transaction } = await koin.transfer(
      {
      from: "16MT1VQFgsVxEfJrSGinrA5buiqBsN5ViJ",
      to: "1Gvqdo9if6v6tFomEuTuMWP1D7H7U9yksb",
      value: "1000000",
      },
      {
      payer: signer2.getAddress(),
      beforeSend: addMoreSignatures,
      }
      );

      Parameters

      Returns Promise<void>

broadcast?: boolean

Broadcast

Boolean to define if the transaction should be broadcasted to the different nodes in the network. By default it is true.

Set it to false if you want to interact with a contract for testing purposes and check the possible events triggered.

chainId?: string

Chain ID

If this option is not set it will be taken by querying the blockchain

nextOperations?: OperationJson[]

Next operations

List of extra operations to be included after the actual one in the transaction

nonce?: string

Transaction nonce

It can be the nonce of the payee or the nonce of the payer. Use the payee's nonce when the payer's nonce changes continuosly without your control, for instance, when the payer is a dApp.

The nonce is not required to be consecutive, only greater than the previous one.

If this option is not set it will be taken from the blockchain depending on the payer/payee configuration.

onlyOperation?: boolean

Only operation

Boolean to define if the intention is to get only the operation. No transaction or connection with the provider established. By default it is false.

payee?: string

Payee

Address that increases the nonce. When this option is not set the blockchain will increase the payer's nonce.

payer?: string

Payer

Address that will pay the resource credits (aka mana) consumed in the transaction.

If this option is not set it will take the address of the signer as payer.

previousOperations?: OperationJson[]

Previous operations

List of extra operations to be included before the actual one in the transaction

rcLimit?: string | number

Resource Credits limit

Max amount of mana to be spent. If this option is not set it will be taken by querying the actual mana of the payer

sendAbis?: boolean

Send abis

Boolean to define if the abis should be shared with the signer so it will be able to decode the operations. By default it is true.

sendTransaction?: boolean

Send transaction

Boolean to define if the transaction should be signed and sent to the RPC node. By default it is true.

signTransaction?: boolean

Sign transaction

Boolean to define if the transaction should be signed. By default it is true.

Generated using TypeDoc