Add withdrawBEP2 function
@@ -227,6 +227,17 @@ func (tg *DAppChainGateway) WithdrawLoomToBinanceDex(identity *client.Identity,
return err
}
+func (tg *DAppChainGateway) WithdrawBEP2(identity *client.Identity, amount *big.Int, contract loom.Address, mainnetRecipientAddress common.Address) error {
+ req := &tgtypes.TransferGatewayWithdrawTokenRequest{
+ TokenKind: tgtypes.TransferGatewayTokenKind_BEP2,
+ TokenAmount: &types.BigUInt{Value: *loom.NewBigUInt(amount)},
+ TokenContract: contract.MarshalPB(),
+ Recipient: client.LoomAddressFromBinanceAddress(mainnetRecipientAddress).MarshalPB(),
+ }
+ _, err := tg.contract.Call("WithdrawToken", req, identity.LoomSigner, nil)
+ return err
+}
+
func (tg *DAppChainGateway) WithdrawETH(identity *client.Identity, amount *big.Int, mainnetGateway common.Address) error {
req := &tgtypes.TransferGatewayWithdrawETHRequest{
Amount: &types.BigUInt{Value: *loom.NewBigUInt(amount)},
