// This is a demo component to transfer NEAR tokens using BOS component with a helper `transfer-near.near` contract as native transfers are not supported on BOS yet: https://t.me/neardev/29391 // Here is the contract itself: https://github.com/frol/transfer-near-contract; it is implemented with nesdie, so it only requires only 1 TGas attached to the function call. State.init({ transferTo: "", deposit: "" }); const transferNEAR = () => { const oneTeraGas = 1000000000000; const oneNEARInYoctoNEAR = 1000000000000000000000000; Near.call( "transfer-near.near", "transfer_near", state.transferTo, oneTeraGas, state.deposit * oneNEARInYoctoNEAR ); }; const Wrapper = styled.div` width: 80%; margin: 15%; `; return ( <Wrapper className="d-flex flex-row gap-3 flex-column"> <input type="text" value={state.transferTo} onChange={(e) => { State.update({ transferTo: e.target.value }); }} placeholder="Send to address" /> <input type="text" value={state.deposit} onChange={(e) => { State.update({ deposit: e.target.value }); }} placeholder="$Near" /> <button onClick={transferNEAR}> Transfer {state.deposit} NEAR to {state.transferTo} </button> </Wrapper> );