
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@pnsdomains/safe-service-client
Advanced tools
Software development kit that facilitates the interaction with the Safe Transaction Service API.
Install the package with yarn or npm:
yarn install
npm install
Build the package with yarn or npm:
yarn build
npm build
First of all, we need to create an EthAdapter, which contains all the required utilities for the SDKs to interact with the blockchain. It acts as a wrapper for web3.js or ethers.js Ethereum libraries.
Depending on the library used by the Dapp, there are two options:
Once the instance of EthersAdapter or Web3Adapter is created, it can be used in the SDK initialization.
import SafeServiceClient from '@pnsdomains/safe-service-client'
const safeService = new SafeServiceClient({
txServiceUrl: 'https://safe-transaction-mainnet.safe.global',
ethAdapter
})
Returns the information and configuration of the service.
const serviceInfo: SafeServiceInfoResponse = await safeService.getServiceInfo()
Returns the list of Safe master copies.
const masterCopies: MasterCopyResponse = await safeService.getServiceMasterCopiesInfo()
Decodes the specified Safe transaction data.
const decodedData = await safeService.decodeData(data)
Returns the list of Safes where the address provided is an owner.
const safes: OwnerResponse = await safeService.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 safeService.getTransaction(safeTxHash)
Returns the list of confirmations for a given a Safe transaction.
const confirmations: SafeMultisigConfirmationListResponse = await safeService.getTransactionConfirmations(safeTxHash)
Adds a confirmation for a Safe transaction.
const signature: SignatureResponse = await safeService.confirmTransaction(safeTxHash, signature)
Returns the information and configuration of the provided Safe address.
const safeInfo: SafeInfoResponse = await safeService.getSafeInfo(safeAddress)
Returns the list of delegates for a given Safe address.
const delegates: SafeDelegateListResponse = await safeService.getSafeDelegates(safeAddress)
Adds a new delegate for a given Safe address.
const delegateConfig: SafeDelegateConfig = {
safe,
delegate,
label,
signer
}
await safeService.addSafeDelegate(delegateConfig)
Removes all delegates for a given Safe address.
await safeService.removeAllSafeDelegates(safeAddress, signer)
Removes a delegate for a given Safe address.
const delegateConfig: SafeDelegateDeleteConfig = {
safe,
delegate,
signer
}
await safeService.removeSafeDelegate(delegateConfig)
Returns the creation information of a Safe.
const safeCreationInfo: SafeCreationInfoResponse = await safeService.getSafeCreationInfo(safeAddress)
Estimates the safeTxGas for a given Safe multi-signature transaction.
const estimateTx: SafeMultisigTransactionEstimateResponse = await safeService.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 safeService.proposeTransaction(transactionConfig)
Returns the history of incoming transactions of a Safe account.
const incomingTxs: TransferListResponse = await safeService.getIncomingTransactions(safeAddress)
Returns the history of module transactions of a Safe account.
const moduleTxs: SafeModuleTransactionListResponse = await safeService.getModuleTransactions(safeAddress)
Returns the history of multi-signature transactions of a Safe account.
const multisigTxs: SafeMultisigTransactionListResponse = await safeService.getMultisigTransactions(safeAddress)
Returns the list of multi-signature transactions that are waiting for the confirmation of the Safe owners.
const pendingTxs: SafeMultisigTransactionListResponse = await safeService.getPendingTransactions(safeAddress)
const pendingTxs: SafeMultisigTransactionListResponse = await safeService.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 safeService.getAllTransactions(safeAddress)
const allTxsOptions: AllTransactionsOptions = {
executed,
queued,
trusted
}
const allTxs: SafeMultisigTransactionListResponse = await safeService.getAllTransactions(
safeAddress,
allTxsOptions
)
Returns the right nonce to propose a new transaction right after the last pending transaction.
const nextNonce = await safeService.getNextNonce(safeAddress)
Returns the balances for Ether and ERC20 tokens of a Safe.
const balances: SafeBalanceResponse[] = await safeService.getBalances(safeAddress)
This method can optionally receive the options parameter:
const options: SafeBalancesOptions = {
excludeSpamTokens // Optional. Default value is `true`.
}
const balances: SafeBalanceResponse[] = await safeService.getBalances(safeAddress, options)
Returns the balances for Ether and ERC20 tokens of a Safe with USD fiat conversion.
const usdBalances: SafeBalanceUsdResponse[] = await safeService.getUsdBalances(safeAddress)
This method can optionally receive the options parameter:
const options: SafeBalancesUsdOptions = {
excludeSpamTokens // Optional. Default value is `true`.
}
const usdBalances: SafeBalanceUsdResponse[] = await safeService.getUsdBalances(safeAddress, options)
Returns the collectibles (ERC721 tokens) owned by the given Safe and information about them.
const collectibles: SafeCollectibleListResponse = await safeService.getCollectibles(safeAddress)
This method can optionally receive the options parameter:
const options: SafeCollectiblesOptions = {
limit // Optional. Default value is 10. This limit is the maximum available value per service limitation.
offset // Optional. Default value is 0.
excludeSpamTokens // Optional. Default value is `true`.
}
const collectibles: SafeCollectibleListResponse = await safeService.getCollectibles(safeAddress, options)
Returns the list of all the ERC20 tokens handled by the Safe.
const tokens: TokenInfoListResponse = await safeService.getTokenList()
Returns the information of a given ERC20 token.
const token: TokenInfoResponse = await safeService.getToken(tokenAddress)
This library is released under MIT.
FAQs
Safe Service Client
We found that @pnsdomains/safe-service-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.