// login
// returns { "name": "test1", "address": "t1u3ynne5fllqpv4re5vkqbvowtsb2aggh2p4u5fa"}
const account = await window.filecoin.getAccount();
// logout
// returns {}
await window.filecoin.forgetAccount();
// Send Transaction
const transaction = {
from: this.account.address,//account address
gasPremium: "10000",//Optional type(String)
gasFeeCap:"10000",//Optional type(String)
nonce: 0, // Number
gasLimit: 2200000, //Optional type(Number)
to: "t1uzmmfknk3pq5otq4wosqtzm3oq7675vb27qz6aq",//String
value: "1000000000000000000", // decimals 18,String
method: 0,
params: "" //Optional type(String)
};
await window.filecoin.sendTransaction(transaction);
// Request Signature
const transaction = {
from: this.account.address,//account address
gasPremium: "10000",//String
gasFeeCap:"10000",//String
nonce: 0,//Number
gasLimit: 2200000,
to: "t1uzmmfknk3pq5otq4wosqtzm3oq7675vb27qz6aq",//String
value: "1000000000000000000", //decimals 18,String
method: 0,
params: ""//Optional type(String)
};
await window.filecoin.requestSignature(transaction);
For details, please find the sample in this repo.