InstantWithdraw

Allows users to withdraw funds from their Futureswap wallet.

Note: Instant withdraw has a different object structure than the other actions

The full object that you’ll need to create.

const instantWithdrawalParams = {
amount: toBn(String(toWei(String(amount)))),
tokenAddress: stableTokenAddress,
registryHolder: registryHolder,
functionId: FunctionId.INSTANT_WITHDRAW_ID,
assetPriceBound: toBn("0"),
stablePriceBound: toBn(String(toWei("1"))),
userInteractionNumber: toBn(createUserInteractionNumberRandom()),
gasStableBound: toBn("0"),
minTransmitterGas: toBn("0"),
signatureTime: toBn(Math.floor(Date.now() / 1000))
};

*RegistryHolder = 0xd9cF4cA71D2Ed15040cC702c2B146Bfb848b7A1B

Same as open trade you would build the full object and sign it with your wallet.

Response

The response back from our system is the userInteractionNumber that was created for the object. Use this id to track the status of the transaction.

{
id: '0xffbb1b35d41ba17fd99eaaa000f82b666bf06b69522db30b2d38809759667201'
}