-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
Hey there everyone!!!
I trying to invoke a Contract's method using the Go-SDK. The Method implementation is such:
public entry fun mint( validator: &signer, avatar_cid: String, public_key: vector<u8>, proxyaddress: Option<address> ) {}
And the Script I have written in go is below:
`func Mint(client aptos.Client, accountaptos.Account, avatarCID string, publicKey crypto.PublicKey, proxyAddress *aptos.AccountAddress) {
pubKeyBytes, := bcs.Serialize(publicKey)
avatarBytes := []byte(avatarCID)
serializedAvatarBytes, := bcs.SerializeBytes(avatarBytes)
proxyBytes := []byte{}
if proxyAddress != nil {
proxyBytes, = bcs.Serialize(proxyAddress)
}
rawTx, err := client.BuildTransaction(account.Address, aptos.TransactionPayload{
Payload: &aptos.EntryFunction{
Module: aptos.ModuleId{
Address: MODULE_ADDRESS,
Name: MODULE_NAME,
},
Function: "mint_poa_nft",
ArgTypes: []aptos.TypeTag{},
Args: [][]byte{
serializedAvatarBytes,
pubKeyBytes,
proxyBytes,
},
},
})}`
now the problem I'm facing is related to the proxy_address which is an optional parameter.
Can anyone please help me this one.
Metadata
Metadata
Assignees
Labels
No labels