Filecoin SDK is used to interact with the Filecoin blockchain, it contains various functions can be used to web3 wallet.
To obtain the latest version, simply require the project using :
go get -u github.com/sonr-io/coins/filecoin privateKeyHex := "0x7c6207c56b6aa5ed4345c5f662816408e273cbdf64e2f01d54ced0125d6172c2"
address, err := GetAddressByPrivateKey(privateKeyHex, MainnetPrefix)
if err != nil {
// todo
} from := "f1bh3d2y6xxugpg3ygzxnjhcrs5ffxh5nvqmanbia"
to := "f1fvs2fjqr6ozk477zkwzvermhledmfkswt34cmhi"
nonce := 0
value := big.NewInt(20000000000000000)
gasLimit := 210000
gasFeeCap := big.NewInt(9455791480)
gasPremium := big.NewInt(120242)
method := 0
message := NewTx(from, to, nonce, method, gasLimit, value, gasFeeCap, gasPremium)
privateKeyHex := "0x7c6207c56b6aa5ed4345c5f662816408e273cbdf64e2f01d54ced0125d6172c2"
tx, err := SignTx(message, privateKeyHex)
if err != nil {
// todo
}
hash, err := CalTxHash(tx)
if err != nil {
// todo
}- lotus - Filecoin Go SDK
If you are the original author and would like credit adjusted, please contact us.
Most packages or folder are MIT licensed, see package or folder for the respective license.