2023-07-24 08:37:18 +00:00
|
|
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
|
|
|
import { WithdrawFormContainer } from '@vegaprotocol/withdraws';
|
2023-10-05 09:25:54 +00:00
|
|
|
import { useVegaTransactionStore } from '@vegaprotocol/web3';
|
2023-07-24 08:37:18 +00:00
|
|
|
|
|
|
|
export const WithdrawContainer = ({ assetId }: { assetId?: string }) => {
|
|
|
|
const { pubKey } = useVegaWallet();
|
|
|
|
const createTransaction = useVegaTransactionStore((state) => state.create);
|
|
|
|
return (
|
|
|
|
<WithdrawFormContainer
|
|
|
|
assetId={assetId}
|
|
|
|
partyId={pubKey ? pubKey : undefined}
|
|
|
|
submit={({ amount, asset, receiverAddress }) => {
|
|
|
|
createTransaction({
|
|
|
|
withdrawSubmission: {
|
|
|
|
amount,
|
|
|
|
asset,
|
|
|
|
ext: {
|
|
|
|
erc20: {
|
|
|
|
receiverAddress,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|