Solana and SVM Compatible Blockchains (alpha) Actions

action

sign_transaction

The svm::send_transaction is used to sign a transaction and broadcast it to the specified SVM-compatible network.

Inputs

  • Name
    description
    Type
    optional
    Description

    Description of the transaction

  • Name
    transaction_payload_bytes
    Type
    optional
    Description

    The transaction payload bytes, encoded as a clarity buffer.

  • Name
    chain_id
    Type
    optional
    Description

    Coming soon

  • Name
    signer
    Type
    required
    Description

    A reference to a signer construct, which will be used to sign the transaction payload.

  • Name
    nonce
    Type
    optional
    Description

    The account nonce of the signer. This value will be retrieved from the network if omitted.

Outputs

  • Name
    signed_transaction_bytes
    Description

    The signed transaction bytes.

  • Name
    chain_id
    Description

    Coming soon.

Example using sign_transaction

// Coming soon


action

send_transaction

The svm::send_transaction action encodes a transaction, signs the transaction using an in-browser signer, and broadcasts the signed transaction to the network.

Inputs

  • Name
    description
    Type
    optional
    Description

    Description of the transaction

  • Name
    instructions
    Type
    required
    Description

    The address and identifier of the contract to invoke.

  • Name
    rpc_api_url
    Type
    optional
    Description

    The URL to use when making API requests.

  • Name
    rpc_api_auth_token
    Type
    optional
    Description

    The HTTP authentication token to include in the headers when making API requests.

  • Name
    commitment_level
    Type
    optional
    Description

    The commitment level expected for considering this action as done ('processed', 'confirmed', 'finalized'). Default to 'confirmed'.

Outputs

  • Name
    signature
    Description

    The transaction computed signature.

Example using send_transaction

// Coming soon


action

process_instructions

The svm::process_instructions action encodes instructions that are added to a transaction that is signed and broadcasted to the network.

Inputs

  • Name
    description
    Type
    optional
    Description

    Description of the transaction

  • Name
    instruction
    Type
    required
    Description

    Instructions to process

  • Name
    signers
    Type
    required
    Description

    Set of references to a signer construct, which will be used to sign the transaction.

  • Name
    commitment_level
    Type
    optional
    Description

    The commitment level expected for considering this action as done ('processed', 'confirmed', 'finalized'). Default to 'confirmed'.

Outputs

  • Name
    signature
    Description

    The transaction computed signature.

Example using process_instructions


action "program_call" "svm::process_instructions" {
    description = "Invoke instructions"
    instruction {
        program_id = variable.program
        accounts = [svm::account(signer.caller.address, true, true)]
        data = svm::get_instruction_data_from_idl(variable.program.idl, "my_instruction", ["arg1", "arg2"])
    }
    signers = [signer.caller]
}


action

deploy_program

svm::deploy_program deploys an anchor program to the specified SVM-compatible network.

Inputs

  • Name
    description
    Type
    optional
    Description

    Description of the program

  • Name
    program
    Type
    required
    Description

    The Solana program artifacts to deploy.

  • Name
    signers
    Type
    required
    Description

    A reference to a signer construct, which will be used to pay for the deployment.

  • Name
    commitment_level
    Type
    optional
    Description

    The commitment level expected for considering this action as done ('processed', 'confirmed', 'finalized'). Default to 'confirmed'.

  • Name
    auto_extend
    Type
    optional
    Description

    Whether to auto extend the program account for program upgrades. Defaults to true.

Outputs

  • Name
    signature
    Description

    The transaction computed signature.

Example using deploy_program

action "deploy" "svm::deploy_program" {
    description = "Deploy program"
    program = svm::get_program_from_anchor_project("hello_world") 
    signers = [signer.deployer]
}


Was this page helpful?