Deposit and withdraw
Deposit and encumber funds
Release and withdraw funds
TypeScript SDK
const sellerId = "2";
const amount = parseEther("0.01");
const tokenAddress = "0x00000000000000000000000000000000"; // native token
await coreSDK.depositFunds(sellerId, amount, tokenAddress);Withdraw specific tokens and amount
const entityId = "6";
const tokenList = [
"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"0x0000000000000000000000000000000000000000"
];
const tokenAmounts = [parseEther("0.03"), parseEther("0.05")];
await coreSdk.withdrawFunds(entityId, tokenList, tokenAmounts);Withdraw all available funds
const entityId = "6";
await coreSdk.withdrawAllAvailableFunds(entityId);Solidity
IBosonFundsHandler bosonProtocol = IBosonFundsHandler(_bosonProtocolAddress);
uint256 sellerId = 2;
uint256 amount = 0.01 ether;
address tokenAddress = 0x00000000000000000000000000000000; // native token
bosonProtocol.depositFunds{ value: amount }(seller, tokenAddress, amount);Withdraw specific tokens and amount
IBosonFundsHandler bosonProtocol = IBosonFundsHandler(_bosonProtocolAddress);
uint256 entityId = 6;
address[] memory tokenList = new address[](2);
uint256[] memory tokenAmounts = new uint256[](2);
tokenList[0] = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
tokenList[1] = 0x0000000000000000000000000000000000000000;
tokenAmounts[0] = 0.03 ether;
tokenAmounts[1] = 0.05 ether;
bosonProtocol.withdrawFunds(entityId, tokenList, tokenAmounts);Withdraw all available funds
IBosonFundsHandler bosonProtocol = IBosonFundsHandler(_bosonProtocolAddress);
uint256 entityId = 6;
// Empty lists mean "all"
address[] memory tokenList;
uint256[] memory tokenAmounts;
bosonProtocol.withdrawFunds(entityId, tokenList, tokenAmounts);Last updated