Skip to main content

Function: galaChainUserRef()

GalaChain core SDK 1.0.0-rc.8


GalaChain core SDK 1.0.0-rc.8 / index / galaChainUserRef

Function: galaChainUserRef()

galaChainUserRef(value, field): string

Defined in: packages/gala-core-sdk/dist/index.d.ts:2639

The GalaChain user reference a read or write names (owner, sender, recipient, lock authority), in the one spelling the gateway receives:

  • an Ethereum account, as eth|<40 hex>, 0x<40 hex> or bare <40 hex>: sent as eth| plus its EIP-55 checksummed digits (no 0x). The gateway refuses every other casing of an eth| reference (all lower case, all upper case) with HTTP 400 DTO_VALIDATION_FAILED (IsUserRefConstraint; recorded in tests/fixtures/gateway-reads-recorded.json). A mixed-case spelling whose casing is not the EIP-55 checksum is a typo (what EIP-55 exists to catch) and is refused.
  • eth|0x<hex> is NOT an address form: an eth| reference is followed by the digits alone. It is refused before anything is signed or sent (see assertNoEthZeroXPrefix). A bare 0x<40 hex> is an ordinary Ethereum address and is converted to eth|<EIP-55 digits>.
  • client|<id> (A-Za-z0-9_-): a GalaChain alias, kept exactly as written.

Anything else is refused before anything is signed or sent (fail closed): an unknown spelling could name an account nobody holds.

Parameters​

value​

unknown

field​

string

Returns​

string

Throws​

GalaSDKError INVALID_ETH_USER_REF_PREFIX for eth|0x..., otherwise INVALID_WALLET_ADDRESS (params.field = field).