Function: galaChainUserRef()
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 aseth|plus its EIP-55 checksummed digits (no0x). The gateway refuses every other casing of aneth|reference (all lower case, all upper case) with HTTP 400DTO_VALIDATION_FAILED(IsUserRefConstraint; recorded intests/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: aneth|reference is followed by the digits alone. It is refused before anything is signed or sent (see assertNoEthZeroXPrefix). A bare0x<40 hex>is an ordinary Ethereum address and is converted toeth|<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).