Private
layer2Private
Optional
layer2Optional
saltNonce: stringOptional
txnOptions: TransactionOptionsPrivate
transferThis call is used to view a specific safe in the layer 2 network in which the Card Protocol runs.
promise for an object that contains a Safe
and the block number at which the subgraph was last indexed:
let safeDetails = await safes.viewSafe(safeAddress); // returns { safe: Safe | undefined; blockNumber: number; }
This call is used to view all the gnosis safes owned by a particular address in the layer 2 network in which the Card Protocol runs.
a promise that includes an array of all the gnosis safes owned by the specified address. The result is an object contains a Safe[]
type which conforms to the Safe
shape below, and the block number at which the subgraph was last indexed:
let safeDetails = await safes.view(); // returns { safes: Safe[]; blockNumber: number; }
Optional
options: Partial<Options>Optional
owner: stringOptional
owner: stringOptional
options: Partial<Options>This call will return the gas estimate for sending tokens from a safe.
Note that the returned amount is in units of the token specified in the function params, tokenAddress
the address of the gnosis safe
the address of the token contract
the address of the recipient
optionally, amount of tokens to send as a string in native units of the token (e.g. wei
)
This call is used to send tokens from a gnosis safe to an arbitrary address in the layer 2 network. Note that the gas will be paid with the token you are transferring so there must be enough token balance in teh safe to cover both the transferred amount of tokens and gas.
a promise for a web3 transaction receipt.
let cardCpxd = await getAddress('cardCpxd', web3);
let result = await safes.sendTokens(
depotSafeAddress,
cardCpxd,
relayTxnFunderAddress
[10000000000000000000000]
);
Note that the returned amount is in units of the token specified in the function params, tokenAddress
Optional
amount: stringOptional
txnOptions: TransactionOptionsOptional
contractOptions: ContractOptionsPrivate
transferGenerated using TypeDoc
The
Safes
API is used to query the card protocol about the gnosis safes in the layer 2 network in which the Card Protocol runs. This can includes safes in which bridged tokens are deposited as well as prepaid cards (which in turn are actually gnosis safes). TheSafes
API can be obtained fromgetSDK()
with aWeb3
instance that is configured to operate on a layer 2 network (like Gnosis Chain or Sokol).Example