let result = await (Moralis.Web3 as any).transfer(options);
if(result){
```// does this mean the transfer was good if got here ?
}// else
does this mean transfer didn't go through ?//
}
I donβt know exactly, how that result looks like? You can also look in source code to see what it returns.
I found out . The result will not exist if the transaction doensβt work . So if it does work it looks like this
Object { blockHash: "0xcd198e85843bcd5a11331c75c5c9421765075077b3fdce14409a80038f44ce15", blockNumber: 11862843, contractAddress: null, cumulativeGasUsed: 7770914, effectiveGasPrice: "0x9502f912", from: "0xe3648b1465193b639574459dd33d376bd78f26aa", gasUsed: 35270, logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000008000000000000000000000200000000000000000000000000088000000000800000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000002004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000008000000000", status: true, to: "0x294e1bfd460053c77b991a3ed22482060b54278a", β¦ }
β
blockHash: "0xcd198e85843bcd5a11331c75c5c9421765075077b3fdce14409a80038f44ce15"
β
blockNumber: 11862843
β
contractAddress: null
β
cumulativeGasUsed: 7770914
β
effectiveGasPrice: "0x9502f912"
β
events: Object { 0: {β¦} }
β
from: "0xe3648b1465193b639574459dd33d376bd78f26aa"
β
gasUsed: 35270
β
logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000008000000000000000000000200000000000000000000000000088000000000800000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000002004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000008000000000"
β
status: true
β
to: "0x294e1bfd460053c77b991a3ed22482060b54278a"
β
transactionHash: "0xc11e7559963744a9cc6d4c3fc9e66e9758ff49dc9bb71625422bf3c0c78e0f03"
β
transactionIndex: 163
β
type: "0x2"
is there an easy way to get the userβs eth address ?before they can change it in metamask
What you mean by before they can change it?
Well they can change the account in metamask at any time, do we have to watch out for this ? Or does a normal async call not allow enough time for someone to change the account before the transfer is done ?
Also, I still am wondering how to get the user eth address. Is there something I need to add in here
const { Moralis, refetchUserData, isUserUpdating, userError, user } = useMoralis();
const {
authenticate,
isAuthenticated,
logout,
} = useMoralis();
Or can I find out the eth address of the person signed in to metamask the account they are using their eth address ?from the user object ?
If authenticated ? then get user .eth address . Something like that /.
someone can make a transfer without using your interface
after the transfer is done (as in the transaction sent to a node) it doesnβt matter what you do next if that transaction is mined by the blockchain