Skip to main content

index/functions/userRef.md

userRef(value, field?): AddressFormat

The GalaChain user reference an address names, in the one spelling the gateway accepts: eth|<EIP-55 checksummed digits> for an Ethereum account (given as eth|<40 hex> in any casing, 0x<40 hex> or bare hex; eth|0x... is refused), client|<id> as written. This is galaChainUserRef of @gala-chain/gala-core-sdk, the one implementation; only the error is this package's. Use it for everything the SDK sends to the gateway or signs, and for the identity a signer/transport is declared with. Values for the launchpad backend's own query parameters, paths and bodies go through backendUserRef.

Parameters​

ParameterTypeDescription
valueunknownThe address the caller gave.
field?stringThe field name reported in the error.

Returns​

AddressFormat

eth|<EIP-55 digits> or client|<id>.

Throws​

ValidationError INVALID_FORMAT for anything else (for eth|... with core's message: an eth| reference takes the 40 hex digits with no 0x prefix, and the correct spelling), a mixed-case spelling whose casing is not the EIP-55 checksum included (a typo); nothing is signed or sent.