Starter Kit Reference
SafeClient
send

send

If the threshold of the connected Safe is greater than 1, it will create the Safe transaction and store it in the Safe Transaction Service to collect the signatures from the Safe owners.

If the threshold of the connected Safe is 1, the Safe transaction will be submitted and executed immediately.

If the Safe account is not deployed, it will be deployed when this method is called and funds will be required in the connected signer account.

Usage


_24
import { safeClient } from './setup.ts'
_24
_24
const transactions = [{
_24
to: '0x...',
_24
data: '0x...',
_24
value: '0',
_24
operation: 1 // Optional
_24
},
_24
{
_24
to: '0x...',
_24
data: '0x...',
_24
value: '0',
_24
operation: 1 // Optional
_24
}]
_24
_24
const txResult = await safeClient.send({
_24
transactions,
_24
from: '0x...', // Optional
_24
gasLimit: '123', // Optional
_24
gasPrice: '123', // Optional
_24
maxFeePerGas: '123', // Optional
_24
maxPriorityFeePerGas: '123', // Optional
_24
nonce: 123 // Optional
_24
})

Returns

Promise<SafeClientResult>

The result of the Safe transaction sent.

Parameters

transactions.to

  • Type: string

The address of the recipient.


_10
const txResult = await safeClient.send({
_10
transactions: [{
_10
to: '0x...',
_10
value: '123',
_10
data: '0x'
_10
}]
_10
})

transactions.value

  • Type: string

The amount of native tokens that are transferred.


_10
const txResult = await safeClient.send({
_10
transactions: [{
_10
to: '0x...',
_10
value: '123',
_10
data: '0x'
_10
}]
_10
})

transactions.data

  • Type: string

The encoded transaction data.


_10
const txResult = await safeClient.send({
_10
transactions: [{
_10
to: '0x...',
_10
value: '123',
_10
data: '0x'
_10
}]
_10
})

transactions.operation (Optional)

  • Type: OperationType

  • Default: 1

The operation of the Safe transaction.


_10
const txResult = await safeClient.send({
_10
transactions: [{
_10
to: '0x...',
_10
value: '123',
_10
data: '0x',
_10
operation: 0
_10
}]
_10
})

from (Optional)

  • Type: string

The address of the transaction sender.


_10
const txResult = await safeClient.send({
_10
transactions,
_10
from: '0x...'
_10
})

gasLimit (Optional)

  • Type: stringnumber | string | bigint

The maximum amount of gas the transaction can use.


_10
const txResult = await safeClient.send({
_10
transactions,
_10
gasLimit: '123'
_10
})

gasPrice (Optional)

  • Type: number | string

The price in wei that the sender is willing to pay for each unit of gas.


_10
const txResult = await safeClient.send({
_10
transactions,
_10
gasPrice: '123'
_10
})

maxFeePerGas (Optional)

  • Type: number | string

The maximum fee per gas the sender is willing to pay.


_10
const txResult = await safeClient.send({
_10
transactions,
_10
maxFeePerGas: '123'
_10
})

maxPriorityFeePerGas (Optional)

  • Type: number | string

The maximum priority fee per gas the sender is willing to pay.


_10
const txResult = await safeClient.send({
_10
maxPriorityFeePerGas: '123'
_10
})

nonce (Optional)

  • Type: number | string

The nonce of the transaction.


_10
const txResult = await safeClient.send({
_10
transactions,
_10
nonce: 123
_10
})

Was this page helpful?