API ReferenceVaults, collateral, and riskType Alias
DepositToVaultParams
type DepositToVaultParams = object;Properties
collateralContractAddress?
optional collateralContractAddress?: Address;Explicit compatible vault; defaults to the profile’s current vault.
collateralizableToApprove?
optional collateralizableToApprove?: Address;Protocol contract (normally the LetterOfCredit address from
sdk.getContractAddress(AnvilContract.LetterOfCredit)) whose collateralizable allowance should grow
by the deposited amounts in the same transaction, so a following LOC creation needs no separate
allowance signature. Cannot be combined with a non-sender toAccount. Explicit undefined is
equivalent to omission.
toAccount?
optional toAccount?: Address;Vault account to credit; defaults to the transaction sender, and setting it deposits on another
account’s behalf (funds still come from the sender’s wallet). Cannot be combined with
collateralizableToApprove when it differs from the sender, because the two use different contract
functions (depositToAccount vs depositAndApprove). Explicit undefined is equivalent to
omission.
tokenAmounts
tokenAmounts: TokenAmount[];One or more ERC-20 amounts to move from the sender’s wallet into the CollateralVault, in each
token’s smallest unit. Each token must be an enabled collateral token
(CollateralToken.enabled) and the sender must already
hold an ERC-20 allowance for the vault; deposits land in the account’s available balance
(CollateralBalance).