Withdraw ERC20
Withdraw ERC20 from Loopring L2 to Ethereum L1
Withdrawing an ERC20 token will move it from the Loopring Layer2 environment to Ethereum Layer1.
Last updated
Was this helpful?
Withdraw ERC20 from Loopring L2 to Ethereum L1
Withdrawing an ERC20 token will move it from the Loopring Layer2 environment to Ethereum Layer1.
Last updated
Was this helpful?
Was this helpful?
const response = await LoopringAPI.userAPI.submitOffchainWithdraw({
request: {
exchange: LOOPRING_EXPORTED_ACCOUNT.exchangeAddress,
accountId: LOOPRING_EXPORTED_ACCOUNT.accountId,
counterFactualInfo: undefined,
fastWithdrawalMode: false,
hashApproved: "",
maxFee: {
tokenId: TOKEN_INFO.tokenMap["LRC"].tokenId,
volume: fee.fees["LRC"].fee ?? "9400000000000000000",
},
minGas: 0,
owner: LOOPRING_EXPORTED_ACCOUNT.address,
to: LOOPRING_EXPORTED_ACCOUNT.address,
storageId: 0,
token: {
tokenId: TOKEN_INFO.tokenMap.LRC.tokenId,
volume: LOOPRING_EXPORTED_ACCOUNT.tradeLRCValue.toString(),
},
validUntil: 0,
},
web3,
chainId: sdk.ChainId.GOERLI,
walletType: sdk.ConnectorNames.MetaMask,
eddsaKey: eddsaKey.sk,
apiKey,
});
console.log("response:", response);