Hello all
How do I call a record argument in motoko with JavaScript
Example
GetBalance ( record { account_name } )
How I can call this in JavaScript ?
Thanks
Hello all
How do I call a record argument in motoko with JavaScript
Example
GetBalance ( record { account_name } )
How I can call this in JavaScript ?
Thanks
Corresponding JavaScript values
If the record type is a tuple, the value is translated to an array, for example,["Candid", 42]
.
Else it translates to a record object. For example,{ "first name": "Candid", age: 42 }
.
If the field name is a hash, we use_hash_
as the field name, for example,{ _1_: 42, "1": "test" }
.
From
https://sdk.dfinity.org/docs/candid-guide/candid-types.html