Comment on page
Reference
To add the API Kit to your project, run:
yarn add @safe-global/api-kit
Returns the information and configuration of the service.
const serviceInfo: SafeServiceInfoResponse = await safeApiKit.getServiceInfo()
Returns the list of Safe singletons.
const singletons: SafeSingletonResponse = await safeApiKit.getServiceSingletonsInfo()
Decodes the specified Safe transaction data.
const decodedData = await safeApiKit.decodeData(data)
Returns the list of Safes where the address provided is an owner.
const safes: OwnerResponse = await safeApiKit.getSafesByOwner(ownerAddress)
Returns the list of Safes where the module address provided is enabled.
const safes: ModulesResponse = await getSafesByModule(moduleAddress)
Returns all the information of a Safe transaction.
const tx: SafeMultisigTransactionResponse = await safeApiKit.getTransaction(safeTxHash)
Returns the list of confirmations for a given a Safe transaction.
const confirmations: SafeMultisigConfirmationListResponse =
await safeApiKit.getTransactionConfirmations(safeTxHash)
Adds a confirmation for a Safe transaction.
const signature: SignatureResponse = await safeApiKit.confirmTransaction(safeTxHash, signature)
Returns the information and configuration of the provided Safe address.
const safeInfo: SafeInfoResponse = await safeApiKit.getSafeInfo(safeAddress)
Returns the list of delegates for a given Safe address.
const delegateConfig: GetSafeDelegateProps = {
safeAddress, // Optional
delegateAddress, // Optional
delegatorAddress, // Optional
label, // Optional
limit, // Optional
offset // Optional
}
const delegates: SafeDelegateListResponse = await safeApiKit.getSafeDelegates(delegateConfig)
Adds a new delegate for a given Safe address.
const delegateConfig: AddSafeDelegateProps = {
safeAddress, // Optional
delegateAddress,
delegatorAddress,
label,
signer
}
await safeApiKit.addSafeDelegate(delegateConfig)
Removes a delegate for a given Safe address.
const delegateConfig: DeleteSafeDelegateProps = {
delegateAddress,
delegatorAddress,
signer
}
await safeApiKit.removeSafeDelegate(delegateConfig)
Returns the creation information of a Safe.
const safeCreationInfo: SafeCreationInfoResponse = await safeApiKit.getSafeCreationInfo(
safeAddress
)
Estimates the safeTxGas for a given Safe multi-signature transaction.
const estimateTx: SafeMultisigTransactionEstimateResponse =
await safeApiKit.estimateSafeTransaction(safeAddress, safeTransaction)
Creates a new multi-signature transaction and stores it in the Safe Transaction Service.
const transactionConfig: ProposeTransactionProps = {
safeAddress,
safeTxHash,
safeTransactionData,
senderAddress,
senderSignature,
origin
}
await safeApiKit.proposeTransaction(transactionConfig)
Returns the history of incoming transactions of a Safe account.
const incomingTxs: TransferListResponse = await safeApiKit.getIncomingTransactions(safeAddress)
Returns the history of module transactions of a Safe account.
const moduleTxs: SafeModuleTransactionListResponse = await safeApiKit.getModuleTransactions(
safeAddress
)
Returns the history of multi-signature transactions of a Safe account.
const multisigTxs: SafeMultisigTransactionListResponse = await safeApiKit.getMultisigTransactions(
safeAddress
)
Returns the list of multi-signature transactions that are waiting for the confirmation of the Safe owners.
const pendingTxs: SafeMultisigTransactionListResponse = await safeApiKit.getPendingTransactions(
safeAddress
)
const pendingTxs: SafeMultisigTransactionListResponse = await safeApiKit.getPendingTransactions(
safeAddress,
currentNonce
)
Returns a list of transactions for a Safe. The list has different structures depending on the transaction type.
const allTxs: SafeMultisigTransactionListResponse = await safeApiKit.getAllTransactions(
safeAddress
)
const allTxsOptions: AllTransactionsOptions = {
executed,
queued,
trusted
}
const allTxs: SafeMultisigTransactionListResponse = await safeApiKit.getAllTransactions(
safeAddress,
allTxsOptions
)
Returns the right nonce to propose a new transaction right after the last pending transaction.
const nextNonce = await safeApiKit.getNextNonce(safeAddress)
Returns the list of all the ERC20 tokens handled by the Safe.
const tokens: TokenInfoListResponse = await safeApiKit.getTokenList()
Returns the information of a given ERC20 token.
const token: TokenInfoResponse = await safeApiKit.getToken(tokenAddress)
Last modified 13d ago