Record argument

Hello all

How do I call a record argument in motoko with JavaScript


GetBalance ( record { account_name } )

How I can call this in JavaScript ?

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" } .


1 Like