JSON API

Contract Function Call

Method:

stacks_contractCall

Request a Stacks contract function call.

Parameters:

pubkey required - string

The stacks address of sender.

contractAddress required - string

The STX address of the contract.

contractName required - string

The name of the contract.

functionName required - string

The name of the contract function to be called.

functionArgs required - Array<ClarityValue>

An array of function arguments of ClarityValue type.

postConditions optional - Array<PostCondition>

An array of post conditions to attach to the transaction.

postConditionMode optional - PostConditionMode

The post condition mode to use. Defaults to PostConditionMode.Allow.

anchorMode optional - AnchorMode

The anchor mode to use. Defaults to AnchorMode.Any.

nonce optional - BigInt

Custom nonce to set for the transaction. Default value is the next nonce for the address.

version optional - string

Version of parameter format.

sponsored optional - boolean to create a sponsored transaction

Example:

STX Token Transfer

Method:

stacks_stxTransfer

Request a transfer of STX tokens.

Parameters:

pubkey required - string

The stacks address of sender.

recipient required - string

The STX address of the recipient.

amount required - BigInt

Amount of STX tokens to transfer in microstacks.

memo optional - string

Memo string to be included with the transfer transaction.

postConditions optional - Array<PostCondition>

An array of post conditions to attach to the transaction.

postConditionMode optional - PostConditionMode

The post condition mode to use. Defaults to PostConditionMode.Allow.

version optional - string

Version of parameter format.

Example:

Message Signing

Method:

stacks_signMessage

Request signing of an arbitrary message.

Parameters:

pubkey required - string

The stacks address of sender.

message required - string

Message payload to be signed.

version optional - string

Version of parameter format.

Example:

Structured Message Signing

Method:

stacks_signMessage Request signing of structured ClarityValue message

Parameters:

pubkey required - string

The stacks address of sender.

message required - Buffer

Message to be signed. domain required - string

domain of be signed

version optional - string

Version of parameter format.

Example:

Contract Deploy

Method:

stacks_contractDeploy

Request a Clarity contract deployment

Parameters:

pubkey required - string

The stacks address of sender.

contractName required - string

The name the contract is to be deployed as.

codeBody required - string

Body of the contract source code.

postConditions optional - Array<PostCondition>

An array of post conditions to attach to the transaction.

postConditionMode optional - PostConditionMode

The post condition mode to use. Defaults to PostConditionMode.Allow.

version optional - string

Version of parameter format.

Example:

Last updated