There is no (official) option type in Go in general.
I am also not very sure where you took that function signature for the
mint function from. The only place I could find it was your Github issue
with the exact same contents as this email, and there did not seem to be
a direct parallel in the Go or Rust SDKs.
What I could find, though, was that a number of methods in the Go SDK
appear to be variadic functions, with the variadic argument(?) being
named "options". And, if there were any optional arguments passed, then
they will be used.
Example 1:
https://github.com/aptos-labs/aptos-go-sdk/blob/f3612d50315f593d7d6b02a92a7a73313a0c2461/client.go#L440
Here, the NewClient method can be called with a *http.Client argument to
specify the HTTP client used by the client. If it is not passed, then a
default value is used.
Example 2:
https://github.com/aptos-labs/aptos-go-sdk/blob/f3612d50315f593d7d6b02a92a7a73313a0c2461/nodeClient.go#L597
Here, SimulateTransaction can accept optional arguments to adjust
simulation parameters relating to gas.
Something like this could be done to implement optional arguments in
whatever you're using.
Is there any Go code sample that you could post? Posting snippets of
typescript(?) while asking about Go does not seem very productive.
Rudresh Koranne:
Hi everyone! 👋
I'm trying to invoke a contract method using the Aptos Go-SDK. Here's
the method definition in the Move module:
```public entry fun mint(validator: &signer, avatar_cid: String,
public_key: vector<u8>, proxyaddress: Option<address>) {}```
The issue I'm facing is with the proxy_address parameter, which is an
optional parameter of type Option<address>.
In the TypeScript SDK, this can be achieved as follows:
```const option = new
MoveOption<AccountAddress>(ownerAcc.accountAddress);```
How can I properly construct the Option<address> type in Go using the
Aptos Go-SDK? Any help or pointers would be greatly appreciated!
--
You received this message because you are subscribed to the Google
Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to golang-nuts+unsubscr...@googlegroups.com <mailto:golang-
nuts+unsubscr...@googlegroups.com>.
To view this discussion visit https://groups.google.com/d/msgid/golang-
nuts/763c88c2-c8ac-4491-aaf5-508e90d824c6n%40googlegroups.com <https://
groups.google.com/d/msgid/golang-nuts/763c88c2-c8ac-4491-
aaf5-508e90d824c6n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion visit
https://groups.google.com/d/msgid/golang-nuts/9f8d4039-f2f5-41ec-8e86-18412a1eaa09%40gmail.com.