createSwapOwnerTx
Returns a Safe transaction to replace an owner of the connected Safe with a new one.
Usage
_24import {_24 SwapOwnerTxParams,_24 SafeTransactionOptionalProps_24} from '@safe-global/protocol-kit'_24import { protocolKit } from './setup.ts'_24_24const params: SwapOwnerTxParams = {_24 oldOwnerAddress,_24 newOwnerAddress_24}_24_24const options: SafeTransactionOptionalProps = {_24 safeTxGas: '123', // Optional_24 baseGas: '123', // Optional_24 gasPrice: '123', // Optional_24 gasToken: '0x...', // Optional_24 refundReceiver: '0x...', // Optional_24 nonce: 123 // Optional_24}_24_24const safeTransaction = await protocolKit.createSwapOwnerTx(_24 params,_24 options // Optional_24)
Parameters
params.oldOwnerAddress
- Type:
string
The address of the owner to remove to the Safe.
_10const safeTransaction = await protocolKit.createSwapOwnerTx({_10 oldOwnerAddress: '0x...',_10 newOwnerAddress: '0x...'_10})
params.newOwnerAddress
(Optional)
- Type:
string
The address of the owner to add to the Safe.
_10const safeTransaction = await protocolKit.createSwapOwnerTx({_10 oldOwnerAddress: '0x...',_10 newOwnerAddress: '0x...'_10})
params.newOwnerPasskey
- Type:
PasskeyArgType
The passkey associated with the owner to add to the Safe.
_10const safeTransaction = await protocolKit.createSwapOwnerTx({_10 oldOwnerAddress: '0x...',_10 newOwnerPasskey_10})
options.safeTxGas
(Optional)
- Type:
string
The gas that should be used for the Safe transaction.
_10const safeTransaction = await protocolKit.createSwapOwnerTx(_10 {_10 oldOwnerAddress: '0x...',_10 newOwnerAddress: '0x...'_10 },_10 {_10 safeTxGas: '123'_10 }_10)
options.baseGas
(Optional)
- Type:
string
The gas costs for the data used to trigger the Safe transaction.
_10const safeTransaction = await protocolKit.createSwapOwnerTx(_10 {_10 oldOwnerAddress: '0x...',_10 newOwnerAddress: '0x...'_10 },_10 {_10 baseGas: '123'_10 }_10)
options.gasPrice
(Optional)
- Type:
string
The price in wei that the sender is willing to pay for each unit of gas.
_10const safeTransaction = await protocolKit.createSwapOwnerTx(_10 {_10 oldOwnerAddress: '0x...',_10 newOwnerAddress: '0x...'_10 },_10 {_10 gasPrice: '123'_10 }_10)
options.gasToken
(Optional)
- Type:
string
The token address that is used for the gas payment, or 0x0000000000000000000000000000000000000000
if there is no payment.
_10const safeTransaction = await protocolKit.createSwapOwnerTx(_10 {_10 oldOwnerAddress: '0x...',_10 newOwnerAddress: '0x...'_10 },_10 {_10 gasToken: '0x...'_10 }_10)
options.refundReceiver
(Optional)
- Type:
string
The address of the gas payment receiver or 0x0000000000000000000000000000000000000000
if there is no payment.
_10const safeTransaction = await protocolKit.createSwapOwnerTx(_10 {_10 oldOwnerAddress: '0x...',_10 newOwnerAddress: '0x...'_10 },_10 {_10 refundReceiver: '0x...'_10 }_10)
options.nonce
(Optional)
- Type:
number
The transaction nonce.
_10const safeTransaction = await protocolKit.createSwapOwnerTx(_10 {_10 oldOwnerAddress: '0x...',_10 newOwnerAddress: '0x...'_10 },_10 {_10 nonce: 123_10 }_10)
Returns
Promise<SafeTransaction>
The Safe transaction to replace an owner.