@gala-chain/gala-core-sdk 1.2.0-beta.1 → 1.2.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{BRIDGE_AMOUNT_PROBLEMS as e,BRIDGE_DEPOSIT_STEPS as t,BRIDGE_NETWORKS as n,BRIDGE_OUT_STEPS as r,GALA_ERROR_CATALOG as i,GATEWAY_READS_OPTIONS as a,GATEWAY_WRITES_OPTIONS as o,GATEWAY_WRITE_OUTCOME_UNKNOWN_REASONS as s,INVALID_NFT_INPUT_REASONS as c,INVALID_PRIVATE_KEY_REASONS as l,INVALID_TOKEN_REFERENCE_REASONS as u,PAGE_REQUEST_FIELDS as d,SIGNING_FAILURE_REASONS as f,WALLET_CONNECTION_FAILURE_REASONS as p,WALLET_INPUT_PROBLEMS as m,WALLET_NOT_CONNECTED_REASONS as h,WALLET_PROVIDER_CONFIG_MISSING as g,WRAP_DIRECTIONS as _,WRAP_REFUSAL_REASONS as v,galaErrorTemplates as y,renderGalaErrorTemplate as b,templatePlaceholders as x}from"./classes/error_catalog.js";import{GALA_ERROR_PHASE_BY_CODE as S,isGalaCatalogCode as C}from"./classes/error_phase_table.js";import{GALA_ERROR_PHASES as w}from"./classes/error_phases.js";import{hasGalaErrorBrand as T,isGalaErrorLike as E}from"./utils/error_brand.js";import{GalaSDKError as D,isGalaError as O,parseJson as k}from"./classes/gala_sdk_error.js";import{checksumEthereumAddress as A}from"./utils/eth_address.js";import{galaChainUserRef as j}from"./writes/identity.js";import{EIP712_CAPABLE_METHODS as M,buildEIP712Payload as N,eip712DomainFor as P,generateEIP712Types as F}from"./utils/eip712.js";import{calculatePersonalSignPrefix as I,ethAddressOfPrivateKey as L,fixpointPrefixFor as R,getPayloadToSign as z,normalizePrivateKey as B,personalSignPrefixFor as V,serialize as H,signNative as U,signPersonalMessage as W,signSerializedNative as G}from"./utils/signing.js";import{BrowserWalletSigner as K,GalaWalletSigner as q,PrivateKeySigner as J,createLazyPrivateKeySigner as Y,ethereumAddressOfAccount as X,withGalaWalletIdentity as Z}from"./classes/signers.js";import{canonicalDecimalString as Q,resolvePersonalSignChainDtoPayload as $,signChainDtoHash as ee,signChainDtoNative as te,signChainDtoPersonalSign as ne,signRawObject as re,stripEip712DomainType as ie,tokenClassDollarKey as ae,withPrivateKey as oe}from"./utils/chain_dto_signing.js";import{hashTypedData as se,signTypedDataPayload as ce}from"./utils/typed_data.js";import{CHAIN_CONTRACT_OPERATION_PREFIXES as le,dtoOperationOf as ue,withDtoOperation as de}from"./utils/dto_operation.js";import{isWalletUserRejection as fe,walletDeclineCode as pe}from"./utils/wallet_rejection.js";import{signPreSend as me,signPreSendFor as he}from"./utils/pre_send.js";import{GALA_CORE_SDK_VERSION as ge}from"./version.js";import{armTimeout as _e,buildQueryString as ve,buildRequestHeaders as ye,fetchRequestor as be,readBlockNumberHeader as xe,readHeader as Se,readResponseBody as Ce,readRetryAfter as we,requestWithTimeout as Te,validateTimeoutMs as Ee}from"./utils/transport.js";import{httpRequestorFromAxios as De}from"./utils/axios_requestor.js";import{eip1193ProviderFromEthers as Oe}from"./utils/ethers_provider.js";import{isFetchTransportFailure as ke}from"./utils/fetch_failure.js";import{FAILURE_OUTCOMES as Ae}from"./utils/failure_outcomes.js";import{isWriteView as je,numberParamOf as Me,stringParamOf as Ne,toFailureView as Pe}from"./utils/failure_view.js";import{compositeKeyOf as Fe,isTokenClassKey as Ie,splitClassKey as Le,tryParseCompositeKey as Re,tryParseTokenClassKey as ze}from"./utils/class_key.js";import{isValidUniqueKey as Be}from"./utils/unique_key_syntax.js";import{DEFAULT_UNIQUE_KEY_PREFIX as Ve,assertUniqueKey as He,createUniqueKey as Ue,resolveUniqueKeyPrefix as We}from"./utils/unique_key.js";import{createWallet as Ge,getEthereumAddressFromPrivateKey as Ke,getPublicKeyFromPrivateKey as qe,validateWalletInput as Je}from"./utils/wallet_keys.js";import{NFT_DEFAULT_ADDITIONAL_KEY as Ye,NFT_MINT_LIMIT as Xe,NFT_WRITE_METHODS as Ze}from"./writes/nft.js";import{GALA_TOKEN_CLASS_KEY as Qe}from"./writes/transfer.js";import{GATEWAY_WRITE_BATCH_LIMITS as $e,GATEWAY_WRITE_METHODS as et}from"./writes/types.js";import{GatewayWrites as tt}from"./writes/gateway_writes.js";import{GATEWAY_READ_LIMITS as nt,GATEWAY_READ_METHODS as rt}from"./reads/types.js";import{GatewayReads as it,tokenDetailsOf as at}from"./reads/gateway_reads.js";import{NftCollectionReads as ot}from"./reads/nft_collections.js";import{estimateNftOperationFees as st,getNftCollectionClaimFee as ct,getNftTokenClassCreateFee as lt}from"./reads/nft_fees.js";import{GALA_CHAIN_ENVIRONMENTS as ut}from"./config/environments.js";export{e as BRIDGE_AMOUNT_PROBLEMS,t as BRIDGE_DEPOSIT_STEPS,n as BRIDGE_NETWORKS,r as BRIDGE_OUT_STEPS,K as BrowserWalletSigner,le as CHAIN_CONTRACT_OPERATION_PREFIXES,Ve as DEFAULT_UNIQUE_KEY_PREFIX,M as EIP712_CAPABLE_METHODS,Ae as FAILURE_OUTCOMES,ut as GALA_CHAIN_ENVIRONMENTS,ge as GALA_CORE_SDK_VERSION,i as GALA_ERROR_CATALOG,w as GALA_ERROR_PHASES,S as GALA_ERROR_PHASE_BY_CODE,Qe as GALA_TOKEN_CLASS_KEY,a as GATEWAY_READS_OPTIONS,nt as GATEWAY_READ_LIMITS,rt as GATEWAY_READ_METHODS,o as GATEWAY_WRITES_OPTIONS,$e as GATEWAY_WRITE_BATCH_LIMITS,et as GATEWAY_WRITE_METHODS,s as GATEWAY_WRITE_OUTCOME_UNKNOWN_REASONS,D as GalaSDKError,q as GalaWalletSigner,it as GatewayReads,tt as GatewayWrites,c as INVALID_NFT_INPUT_REASONS,l as INVALID_PRIVATE_KEY_REASONS,u as INVALID_TOKEN_REFERENCE_REASONS,Ye as NFT_DEFAULT_ADDITIONAL_KEY,Xe as NFT_MINT_LIMIT,Ze as NFT_WRITE_METHODS,ot as NftCollectionReads,d as PAGE_REQUEST_FIELDS,J as PrivateKeySigner,f as SIGNING_FAILURE_REASONS,p as WALLET_CONNECTION_FAILURE_REASONS,m as WALLET_INPUT_PROBLEMS,h as WALLET_NOT_CONNECTED_REASONS,g as WALLET_PROVIDER_CONFIG_MISSING,_ as WRAP_DIRECTIONS,v as WRAP_REFUSAL_REASONS,_e as armTimeout,He as assertUniqueKey,N as buildEIP712Payload,ve as buildQueryString,ye as buildRequestHeaders,I as calculatePersonalSignPrefix,Q as canonicalDecimalString,A as checksumEthereumAddress,Fe as compositeKeyOf,Y as createLazyPrivateKeySigner,Ue as createUniqueKey,Ge as createWallet,ue as dtoOperationOf,Oe as eip1193ProviderFromEthers,P as eip712DomainFor,st as estimateNftOperationFees,L as ethAddressOfPrivateKey,X as ethereumAddressOfAccount,be as fetchRequestor,R as fixpointPrefixFor,j as galaChainUserRef,y as galaErrorTemplates,F as generateEIP712Types,Ke as getEthereumAddressFromPrivateKey,ct as getNftCollectionClaimFee,lt as getNftTokenClassCreateFee,z as getPayloadToSign,qe as getPublicKeyFromPrivateKey,T as hasGalaErrorBrand,se as hashTypedData,De as httpRequestorFromAxios,ke as isFetchTransportFailure,C as isGalaCatalogCode,O as isGalaError,E as isGalaErrorLike,Ie as isTokenClassKey,Be as isValidUniqueKey,fe as isWalletUserRejection,je as isWriteView,B as normalizePrivateKey,Me as numberParamOf,k as parseJson,V as personalSignPrefixFor,xe as readBlockNumberHeader,Se as readHeader,Ce as readResponseBody,we as readRetryAfter,b as renderGalaErrorTemplate,Te as requestWithTimeout,$ as resolvePersonalSignChainDtoPayload,We as resolveUniqueKeyPrefix,H as serialize,ee as signChainDtoHash,te as signChainDtoNative,ne as signChainDtoPersonalSign,U as signNative,W as signPersonalMessage,me as signPreSend,he as signPreSendFor,re as signRawObject,G as signSerializedNative,ce as signTypedDataPayload,Le as splitClassKey,Ne as stringParamOf,ie as stripEip712DomainType,x as templatePlaceholders,Pe as toFailureView,ae as tokenClassDollarKey,at as tokenDetailsOf,Re as tryParseCompositeKey,ze as tryParseTokenClassKey,Ee as validateTimeoutMs,Je as validateWalletInput,pe as walletDeclineCode,de as withDtoOperation,Z as withGalaWalletIdentity,oe as withPrivateKey};
1
+ import{BRIDGE_AMOUNT_PROBLEMS as e,BRIDGE_DEPOSIT_STEPS as t,BRIDGE_NETWORKS as n,BRIDGE_OUT_STEPS as r,GALA_ERROR_CATALOG as i,GATEWAY_READS_OPTIONS as a,GATEWAY_WRITES_OPTIONS as o,GATEWAY_WRITE_OUTCOME_UNKNOWN_REASONS as s,INVALID_NFT_INPUT_REASONS as c,INVALID_PRIVATE_KEY_REASONS as l,INVALID_TOKEN_REFERENCE_REASONS as u,PAGE_REQUEST_FIELDS as d,SIGNING_FAILURE_REASONS as f,WALLET_CONNECTION_FAILURE_REASONS as p,WALLET_INPUT_PROBLEMS as m,WALLET_NOT_CONNECTED_REASONS as h,WALLET_PROVIDER_CONFIG_MISSING as g,WRAP_DIRECTIONS as _,WRAP_REFUSAL_REASONS as v,galaErrorTemplates as y,renderGalaErrorTemplate as b,templatePlaceholders as x}from"./classes/error_catalog.js";import{GALA_ERROR_PHASE_BY_CODE as S,isGalaCatalogCode as C}from"./classes/error_phase_table.js";import{GALA_ERROR_PHASES as w}from"./classes/error_phases.js";import{hasGalaErrorBrand as T,isGalaErrorLike as E}from"./utils/error_brand.js";import{GalaSDKError as D,isGalaError as O,parseJson as k}from"./classes/gala_sdk_error.js";import{checksumEthereumAddress as A}from"./utils/eth_address.js";import{galaChainUserRef as j}from"./writes/identity.js";import{EIP712_CAPABLE_METHODS as M,buildEIP712Payload as N,eip712DomainFor as P,generateEIP712Types as F}from"./utils/eip712.js";import{calculatePersonalSignPrefix as I,ethAddressOfPrivateKey as L,fixpointPrefixFor as R,getPayloadToSign as z,normalizePrivateKey as B,personalSignPrefixFor as V,serialize as H,signNative as U,signPersonalMessage as W,signSerializedNative as G}from"./utils/signing.js";import{BrowserWalletSigner as K,GalaWalletSigner as q,PrivateKeySigner as J,createLazyPrivateKeySigner as Y,ethereumAddressOfAccount as X,withGalaWalletIdentity as Z}from"./classes/signers.js";import{canonicalDecimalString as Q,resolvePersonalSignChainDtoPayload as $,signChainDtoHash as ee,signChainDtoNative as te,signChainDtoPersonalSign as ne,signRawObject as re,stripEip712DomainType as ie,tokenClassDollarKey as ae,withPrivateKey as oe}from"./utils/chain_dto_signing.js";import{hashTypedData as se,signTypedDataPayload as ce}from"./utils/typed_data.js";import{CHAIN_CONTRACT_OPERATION_PREFIXES as le,CHAIN_METHOD_OPERATIONS as ue,dtoOperationOf as de,withDtoOperation as fe}from"./utils/dto_operation.js";import{isWalletUserRejection as pe,walletDeclineCode as me}from"./utils/wallet_rejection.js";import{signPreSend as he,signPreSendFor as ge}from"./utils/pre_send.js";import{GALA_CORE_SDK_VERSION as _e}from"./version.js";import{armTimeout as ve,buildQueryString as ye,buildRequestHeaders as be,fetchRequestor as xe,readBlockNumberHeader as Se,readHeader as Ce,readResponseBody as we,readRetryAfter as Te,requestWithTimeout as Ee,validateTimeoutMs as De}from"./utils/transport.js";import{httpRequestorFromAxios as Oe}from"./utils/axios_requestor.js";import{eip1193ProviderFromEthers as ke}from"./utils/ethers_provider.js";import{isFetchTransportFailure as Ae}from"./utils/fetch_failure.js";import{FAILURE_OUTCOMES as je}from"./utils/failure_outcomes.js";import{isWriteView as Me,numberParamOf as Ne,stringParamOf as Pe,toFailureView as Fe}from"./utils/failure_view.js";import{compositeKeyOf as Ie,isTokenClassKey as Le,splitClassKey as Re,tryParseCompositeKey as ze,tryParseTokenClassKey as Be}from"./utils/class_key.js";import{isValidUniqueKey as Ve}from"./utils/unique_key_syntax.js";import{DEFAULT_UNIQUE_KEY_PREFIX as He,assertUniqueKey as Ue,createUniqueKey as We,resolveUniqueKeyPrefix as Ge}from"./utils/unique_key.js";import{createWallet as Ke,getEthereumAddressFromPrivateKey as qe,getPublicKeyFromPrivateKey as Je,validateWalletInput as Ye}from"./utils/wallet_keys.js";import{NFT_DEFAULT_ADDITIONAL_KEY as Xe,NFT_MINT_LIMIT as Ze,NFT_WRITE_METHODS as Qe}from"./writes/nft.js";import{GALA_TOKEN_CLASS_KEY as $e}from"./writes/transfer.js";import{GATEWAY_WRITE_BATCH_LIMITS as et,GATEWAY_WRITE_METHODS as tt}from"./writes/types.js";import{GatewayWrites as nt}from"./writes/gateway_writes.js";import{GATEWAY_READ_LIMITS as rt,GATEWAY_READ_METHODS as it}from"./reads/types.js";import{GatewayReads as at,tokenDetailsOf as ot}from"./reads/gateway_reads.js";import{NftCollectionReads as st}from"./reads/nft_collections.js";import{estimateNftOperationFees as ct,getNftCollectionClaimFee as lt,getNftTokenClassCreateFee as ut}from"./reads/nft_fees.js";import{GALA_CHAIN_ENVIRONMENTS as dt}from"./config/environments.js";export{e as BRIDGE_AMOUNT_PROBLEMS,t as BRIDGE_DEPOSIT_STEPS,n as BRIDGE_NETWORKS,r as BRIDGE_OUT_STEPS,K as BrowserWalletSigner,le as CHAIN_CONTRACT_OPERATION_PREFIXES,ue as CHAIN_METHOD_OPERATIONS,He as DEFAULT_UNIQUE_KEY_PREFIX,M as EIP712_CAPABLE_METHODS,je as FAILURE_OUTCOMES,dt as GALA_CHAIN_ENVIRONMENTS,_e as GALA_CORE_SDK_VERSION,i as GALA_ERROR_CATALOG,w as GALA_ERROR_PHASES,S as GALA_ERROR_PHASE_BY_CODE,$e as GALA_TOKEN_CLASS_KEY,a as GATEWAY_READS_OPTIONS,rt as GATEWAY_READ_LIMITS,it as GATEWAY_READ_METHODS,o as GATEWAY_WRITES_OPTIONS,et as GATEWAY_WRITE_BATCH_LIMITS,tt as GATEWAY_WRITE_METHODS,s as GATEWAY_WRITE_OUTCOME_UNKNOWN_REASONS,D as GalaSDKError,q as GalaWalletSigner,at as GatewayReads,nt as GatewayWrites,c as INVALID_NFT_INPUT_REASONS,l as INVALID_PRIVATE_KEY_REASONS,u as INVALID_TOKEN_REFERENCE_REASONS,Xe as NFT_DEFAULT_ADDITIONAL_KEY,Ze as NFT_MINT_LIMIT,Qe as NFT_WRITE_METHODS,st as NftCollectionReads,d as PAGE_REQUEST_FIELDS,J as PrivateKeySigner,f as SIGNING_FAILURE_REASONS,p as WALLET_CONNECTION_FAILURE_REASONS,m as WALLET_INPUT_PROBLEMS,h as WALLET_NOT_CONNECTED_REASONS,g as WALLET_PROVIDER_CONFIG_MISSING,_ as WRAP_DIRECTIONS,v as WRAP_REFUSAL_REASONS,ve as armTimeout,Ue as assertUniqueKey,N as buildEIP712Payload,ye as buildQueryString,be as buildRequestHeaders,I as calculatePersonalSignPrefix,Q as canonicalDecimalString,A as checksumEthereumAddress,Ie as compositeKeyOf,Y as createLazyPrivateKeySigner,We as createUniqueKey,Ke as createWallet,de as dtoOperationOf,ke as eip1193ProviderFromEthers,P as eip712DomainFor,ct as estimateNftOperationFees,L as ethAddressOfPrivateKey,X as ethereumAddressOfAccount,xe as fetchRequestor,R as fixpointPrefixFor,j as galaChainUserRef,y as galaErrorTemplates,F as generateEIP712Types,qe as getEthereumAddressFromPrivateKey,lt as getNftCollectionClaimFee,ut as getNftTokenClassCreateFee,z as getPayloadToSign,Je as getPublicKeyFromPrivateKey,T as hasGalaErrorBrand,se as hashTypedData,Oe as httpRequestorFromAxios,Ae as isFetchTransportFailure,C as isGalaCatalogCode,O as isGalaError,E as isGalaErrorLike,Le as isTokenClassKey,Ve as isValidUniqueKey,pe as isWalletUserRejection,Me as isWriteView,B as normalizePrivateKey,Ne as numberParamOf,k as parseJson,V as personalSignPrefixFor,Se as readBlockNumberHeader,Ce as readHeader,we as readResponseBody,Te as readRetryAfter,b as renderGalaErrorTemplate,Ee as requestWithTimeout,$ as resolvePersonalSignChainDtoPayload,Ge as resolveUniqueKeyPrefix,H as serialize,ee as signChainDtoHash,te as signChainDtoNative,ne as signChainDtoPersonalSign,U as signNative,W as signPersonalMessage,he as signPreSend,ge as signPreSendFor,re as signRawObject,G as signSerializedNative,ce as signTypedDataPayload,Re as splitClassKey,Pe as stringParamOf,ie as stripEip712DomainType,x as templatePlaceholders,Fe as toFailureView,ae as tokenClassDollarKey,ot as tokenDetailsOf,ze as tryParseCompositeKey,Be as tryParseTokenClassKey,De as validateTimeoutMs,Ye as validateWalletInput,me as walletDeclineCode,fe as withDtoOperation,Z as withGalaWalletIdentity,oe as withPrivateKey};
@@ -1,2 +1,2 @@
1
- import{GalaSDKError as e}from"../classes/gala_sdk_error.js";const t={"asset/public-key-contract":`asset-channel_basic-asset_PublicKeyContract`,"asset/token-contract":`asset-channel_basic-asset_GalaChainToken`,"asset/fee-contract":`asset-channel_basic-asset_GalaChainFee`,"asset/launchpad-contract":`asset-channel_basic-asset_Launchpad`,"asset/dexv3-contract":`asset-channel_basic-asset_DexV3Contract`,"asset/dex-contract":`asset-channel_basic-asset_GalaChainDex`,"asset/registrar-contract":`asset-channel_basic-asset_RegistrarContract`,"asset/staking-contract":`asset-channel_basic-asset_StakingContract`,"asset/wallet-attributes-contract":`asset-channel_basic-asset_WalletAttributesContract`,"asset/bridge-contract":`asset-channel_bridge-chaincode_BridgeContract`,"asset/bridge-public-key-contract":`asset-channel_bridge-chaincode_PublicKeyContract`,"asset/alm-contract":`asset-channel_basic-asset_ALMContract`,"spidertanks/contract":`spidertanks-channel_spidertanks_SpiderTanks`,"music/public-key-contract":`music_music_PublicKeyContract`,"music/music-contract":`music_music_GalaMusic`,"music/token-contract":`music_music_GalaChainToken`,"pokergo/pokergo-contract":`pokergo_pokergo_PokerGo`,"pokergo/public-key-contract":`pokergo_pokergo_PublicKeyContract`,"pokergo/token-contract":`pokergo_pokergo_GalaChainToken`,"championsarena/public-key-contract":`championsarena_championsarena_PublicKeyContract`,"championsarena/champions-arena":`championsarena_championsarena_ChampionsArenaContract`,"championsarena/token-contract":`championsarena_championsarena_GalaChainToken`,"superior/public-key-contract":`superior_superior_PublicKeyContract`,"superior/token-contract":`superior_superior_GalaChainToken`,"superior/superior":`superior_superior_Product`,"legacy/public-key-contract":`legacy_legacy_PublicKeyContract`,"legacy/token-contract":`legacy_legacy_GalaChainToken`,"legacy/legacy":`legacy_legacy_Legacy`,"eternalparadox/public-key-contract":`eternalparadox_eternalparadox_PublicKeyContract`,"eternalparadox/token-contract":`eternalparadox_eternalparadox_GalaChainToken`,"eternalparadox/eternalparadox":`eternalparadox_eternalparadox_EternalParadox`,"echoesofempire/public-key-contract":`echoesofempire_echoesofempire_PublicKeyContract`,"echoesofempire/token-contract":`echoesofempire_echoesofempire_GalaChainToken`,"echoesofempire/echoesofempire-contract":`echoesofempire_echoesofempire_EchoesOfEmpire`,"node/public-key-contract":`node_node_PublicKeyContract`,"node/token-contract":`node_node_GalaChainToken`,"node/node-contract":`node_node_Product`,"townstar/product-contract":`townstar_townstar_TownStar`,"townstar/token-contract":`townstar_townstar_GalaChainToken`,"townstar/public-key-contract":`townstar_townstar_PublicKeyContract`,"mirandus/public-key-contract":`mirandus_mirandus_PublicKeyContract`,"mirandus/token-contract":`mirandus_mirandus_GalaChainToken`,"mirandus/mirandus-contract":`mirandus_mirandus_Product`,"galafilm/public-key-contract":`galafilm_galafilm_PublicKeyContract`,"galafilm/token-contract":`galafilm_galafilm_GalaChainToken`,"galafilm/galafilm-contract":`galafilm_galafilm_Product`,"lastexpedition/public-key-contract":`lastexpedition_lastexpedition_PublicKeyContract`,"lastexpedition/token-contract":`lastexpedition_lastexpedition_GalaChainToken`,"lastexpedition/lastexpedition-contract":`lastexpedition_lastexpedition_Product`,"legendsreborn/public-key-contract":`legendsreborn_legendsreborn_PublicKeyContract`,"legendsreborn/token-contract":`legendsreborn_legendsreborn_GalaChainToken`,"legendsreborn/legendsreborn-contract":`legendsreborn_legendsreborn_Product`,"thewalkingdeadempires/public-key-contract":`thewalkingdeadempires_thewalkingdeadempires_PublicKeyContract`,"thewalkingdeadempires/token-contract":`thewalkingdeadempires_thewalkingdeadempires_GalaChainToken`,"thewalkingdeadempires/thewalkingdeadempires-contract":`thewalkingdeadempires_thewalkingdeadempires_Product`,"vox/public-key-contract":`vox_vox_PublicKeyContract`,"vox/token-contract":`vox_vox_GalaChainToken`,"vox/auction-contract":`vox_vox_AuctionContract`,"vox/phase-contract":`vox_vox_PhaseContract`,"vox/vox-contract":`vox_vox_VOXTokenContract`,"vox/resources-contract":`vox_vox_VOXResourceToken`};function n(n,r){let i=Object.prototype.hasOwnProperty.call(t,n)?t[n]:void 0;if(i===void 0)throw new e(`SIGNING_FAILED`,{method:r,reason:`failed`},{cause:{contractPath:n,reason:`unknown contract path: no dtoOperation is known for it`}});return`${i}:${r}`}function r(t,r,i){let a=n(t,r),o=i.dtoOperation;if(o!==void 0&&o!==a)throw new e(`SIGNING_FAILED`,{method:r,reason:`failed`},{cause:{dtoOperation:o,expected:a}});return{...i,dtoOperation:a}}export{t as CHAIN_CONTRACT_OPERATION_PREFIXES,n as dtoOperationOf,r as withDtoOperation};
1
+ import{GalaSDKError as e}from"../classes/gala_sdk_error.js";const t={"asset/public-key-contract":`asset-channel_basic-asset_PublicKeyContract`,"asset/token-contract":`asset-channel_basic-asset_GalaChainToken`,"asset/fee-contract":`asset-channel_basic-asset_GalaChainFee`,"asset/launchpad-contract":`asset-channel_basic-asset_Launchpad`,"asset/dexv3-contract":`asset-channel_basic-asset_DexV3Contract`,"asset/dex-contract":`asset-channel_basic-asset_GalaChainDex`,"asset/registrar-contract":`asset-channel_basic-asset_RegistrarContract`,"asset/staking-contract":`asset-channel_basic-asset_StakingContract`,"asset/wallet-attributes-contract":`asset-channel_basic-asset_WalletAttributesContract`,"asset/bridge-contract":`asset-channel_bridge-chaincode_BridgeContract`,"asset/bridge-public-key-contract":`asset-channel_bridge-chaincode_PublicKeyContract`,"asset/alm-contract":`asset-channel_basic-asset_ALMContract`,"spidertanks/contract":`spidertanks-channel_spidertanks_SpiderTanks`,"music/public-key-contract":`music_music_PublicKeyContract`,"music/music-contract":`music_music_GalaMusic`,"music/token-contract":`music_music_GalaChainToken`,"pokergo/pokergo-contract":`pokergo_pokergo_PokerGo`,"pokergo/public-key-contract":`pokergo_pokergo_PublicKeyContract`,"pokergo/token-contract":`pokergo_pokergo_GalaChainToken`,"championsarena/public-key-contract":`championsarena_championsarena_PublicKeyContract`,"championsarena/champions-arena":`championsarena_championsarena_ChampionsArenaContract`,"championsarena/token-contract":`championsarena_championsarena_GalaChainToken`,"superior/public-key-contract":`superior_superior_PublicKeyContract`,"superior/token-contract":`superior_superior_GalaChainToken`,"superior/superior":`superior_superior_Product`,"legacy/public-key-contract":`legacy_legacy_PublicKeyContract`,"legacy/token-contract":`legacy_legacy_GalaChainToken`,"legacy/legacy":`legacy_legacy_Legacy`,"eternalparadox/public-key-contract":`eternalparadox_eternalparadox_PublicKeyContract`,"eternalparadox/token-contract":`eternalparadox_eternalparadox_GalaChainToken`,"eternalparadox/eternalparadox":`eternalparadox_eternalparadox_EternalParadox`,"echoesofempire/public-key-contract":`echoesofempire_echoesofempire_PublicKeyContract`,"echoesofempire/token-contract":`echoesofempire_echoesofempire_GalaChainToken`,"echoesofempire/echoesofempire-contract":`echoesofempire_echoesofempire_EchoesOfEmpire`,"node/public-key-contract":`node_node_PublicKeyContract`,"node/token-contract":`node_node_GalaChainToken`,"node/node-contract":`node_node_Product`,"townstar/product-contract":`townstar_townstar_TownStar`,"townstar/token-contract":`townstar_townstar_GalaChainToken`,"townstar/public-key-contract":`townstar_townstar_PublicKeyContract`,"mirandus/public-key-contract":`mirandus_mirandus_PublicKeyContract`,"mirandus/token-contract":`mirandus_mirandus_GalaChainToken`,"mirandus/mirandus-contract":`mirandus_mirandus_Product`,"galafilm/public-key-contract":`galafilm_galafilm_PublicKeyContract`,"galafilm/token-contract":`galafilm_galafilm_GalaChainToken`,"galafilm/galafilm-contract":`galafilm_galafilm_Product`,"lastexpedition/public-key-contract":`lastexpedition_lastexpedition_PublicKeyContract`,"lastexpedition/token-contract":`lastexpedition_lastexpedition_GalaChainToken`,"lastexpedition/lastexpedition-contract":`lastexpedition_lastexpedition_Product`,"legendsreborn/public-key-contract":`legendsreborn_legendsreborn_PublicKeyContract`,"legendsreborn/token-contract":`legendsreborn_legendsreborn_GalaChainToken`,"legendsreborn/legendsreborn-contract":`legendsreborn_legendsreborn_Product`,"thewalkingdeadempires/public-key-contract":`thewalkingdeadempires_thewalkingdeadempires_PublicKeyContract`,"thewalkingdeadempires/token-contract":`thewalkingdeadempires_thewalkingdeadempires_GalaChainToken`,"thewalkingdeadempires/thewalkingdeadempires-contract":`thewalkingdeadempires_thewalkingdeadempires_Product`,"vox/public-key-contract":`vox_vox_PublicKeyContract`,"vox/token-contract":`vox_vox_GalaChainToken`,"vox/auction-contract":`vox_vox_AuctionContract`,"vox/phase-contract":`vox_vox_PhaseContract`,"vox/vox-contract":`vox_vox_VOXTokenContract`,"vox/resources-contract":`vox_vox_VOXResourceToken`},n={"asset/bridge-contract:RequestTokenBridgeOut":`asset-channel_basic-asset_GalaChainToken:RequestTokenBridgeOut`,"asset/bridge-contract:GrantAllowance":`asset-channel_bridge-chaincode_GalaChainToken:GrantAllowance`};function r(r,i){let a=`${r}:${i}`;if(Object.prototype.hasOwnProperty.call(n,a))return n[a];let o=Object.prototype.hasOwnProperty.call(t,r)?t[r]:void 0;if(o===void 0)throw new e(`SIGNING_FAILED`,{method:i,reason:`failed`},{cause:{contractPath:r,reason:`unknown contract path: no dtoOperation is known for it`}});return`${o}:${i}`}function i(t,n,i){let a=r(t,n),o=i.dtoOperation;if(o!==void 0&&o!==a)throw new e(`SIGNING_FAILED`,{method:n,reason:`failed`},{cause:{dtoOperation:o,expected:a}});return{...i,dtoOperation:a}}export{t as CHAIN_CONTRACT_OPERATION_PREFIXES,n as CHAIN_METHOD_OPERATIONS,r as dtoOperationOf,i as withDtoOperation};
2
2
  //# sourceMappingURL=dto_operation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dto_operation.js","names":["CHAIN_CONTRACT_OPERATION_PREFIXES","dtoOperationOf","prefix","contractPath","GalaSDKError","method","withDtoOperation","dtoOperation","present","dto","\"dtoOperation\""],"sources":["../../../src/utils/dto_operation.ts"],"sourcesContent":["/**\n * The chain's operation ids for the GalaChain contracts the gateway routes, from the gateway's\n * `dtoOperationMap` (the `dtoOperation` / API path table of the GalaChain platform team,\n * 2026-10-27). The chain refuses a signed DTO whose `dtoOperation` is not exactly the operation it\n * is called through (\"The dto was signed to call X operation, but the current operation is Y\"), so\n * the URL a write is POSTed to and the `dtoOperation` it carries both come from this one table and\n * can never disagree.\n *\n * `dtoOperation` is a SIGNED field: it is part of the DTO before the signer sees it, never added by\n * a signer or after the signature.\n */\n\nimport { GalaSDKError } from '../classes/gala_sdk_error.js';\n\n/** `<channel>/<contract route>`: the path after `/api/` (or `/v1/chain/`) a contract is served at. */\nexport const CHAIN_CONTRACT_OPERATION_PREFIXES = {\n 'asset/public-key-contract': 'asset-channel_basic-asset_PublicKeyContract',\n 'asset/token-contract': 'asset-channel_basic-asset_GalaChainToken',\n 'asset/fee-contract': 'asset-channel_basic-asset_GalaChainFee',\n 'asset/launchpad-contract': 'asset-channel_basic-asset_Launchpad',\n 'asset/dexv3-contract': 'asset-channel_basic-asset_DexV3Contract',\n 'asset/dex-contract': 'asset-channel_basic-asset_GalaChainDex',\n 'asset/registrar-contract': 'asset-channel_basic-asset_RegistrarContract',\n 'asset/staking-contract': 'asset-channel_basic-asset_StakingContract',\n 'asset/wallet-attributes-contract': 'asset-channel_basic-asset_WalletAttributesContract',\n // The gateway's table lists the bridge contract here. On stage (2026-11-02) a `RequestTokenBridgeOut` is refused\n // under it: the chain's operation for that call is the TOKEN contract's (`asset/token-contract`). `BridgeTokenOut`\n // on `/asset/bridge-contract` IS `asset-channel_bridge-chaincode_BridgeContract:BridgeTokenOut` (seen live on stage;\n // GalaConnect signs it, this SDK does not). The grants embedded in a `BridgeTokenOut` sign\n // `asset-channel_bridge-chaincode_GalaChainToken:GrantAllowance`, which is NOT in the platform CSV or this table\n // (seen live on stage, signed by GalaConnect).\n 'asset/bridge-contract': 'asset-channel_bridge-chaincode_BridgeContract',\n 'asset/bridge-public-key-contract': 'asset-channel_bridge-chaincode_PublicKeyContract',\n 'asset/alm-contract': 'asset-channel_basic-asset_ALMContract',\n 'spidertanks/contract': 'spidertanks-channel_spidertanks_SpiderTanks',\n 'music/public-key-contract': 'music_music_PublicKeyContract',\n 'music/music-contract': 'music_music_GalaMusic',\n 'music/token-contract': 'music_music_GalaChainToken',\n 'pokergo/pokergo-contract': 'pokergo_pokergo_PokerGo',\n 'pokergo/public-key-contract': 'pokergo_pokergo_PublicKeyContract',\n 'pokergo/token-contract': 'pokergo_pokergo_GalaChainToken',\n 'championsarena/public-key-contract': 'championsarena_championsarena_PublicKeyContract',\n 'championsarena/champions-arena': 'championsarena_championsarena_ChampionsArenaContract',\n 'championsarena/token-contract': 'championsarena_championsarena_GalaChainToken',\n 'superior/public-key-contract': 'superior_superior_PublicKeyContract',\n 'superior/token-contract': 'superior_superior_GalaChainToken',\n 'superior/superior': 'superior_superior_Product',\n 'legacy/public-key-contract': 'legacy_legacy_PublicKeyContract',\n 'legacy/token-contract': 'legacy_legacy_GalaChainToken',\n 'legacy/legacy': 'legacy_legacy_Legacy',\n 'eternalparadox/public-key-contract': 'eternalparadox_eternalparadox_PublicKeyContract',\n 'eternalparadox/token-contract': 'eternalparadox_eternalparadox_GalaChainToken',\n 'eternalparadox/eternalparadox': 'eternalparadox_eternalparadox_EternalParadox',\n 'echoesofempire/public-key-contract': 'echoesofempire_echoesofempire_PublicKeyContract',\n 'echoesofempire/token-contract': 'echoesofempire_echoesofempire_GalaChainToken',\n 'echoesofempire/echoesofempire-contract': 'echoesofempire_echoesofempire_EchoesOfEmpire',\n 'node/public-key-contract': 'node_node_PublicKeyContract',\n 'node/token-contract': 'node_node_GalaChainToken',\n 'node/node-contract': 'node_node_Product',\n 'townstar/product-contract': 'townstar_townstar_TownStar',\n 'townstar/token-contract': 'townstar_townstar_GalaChainToken',\n 'townstar/public-key-contract': 'townstar_townstar_PublicKeyContract',\n 'mirandus/public-key-contract': 'mirandus_mirandus_PublicKeyContract',\n 'mirandus/token-contract': 'mirandus_mirandus_GalaChainToken',\n 'mirandus/mirandus-contract': 'mirandus_mirandus_Product',\n 'galafilm/public-key-contract': 'galafilm_galafilm_PublicKeyContract',\n 'galafilm/token-contract': 'galafilm_galafilm_GalaChainToken',\n 'galafilm/galafilm-contract': 'galafilm_galafilm_Product',\n 'lastexpedition/public-key-contract': 'lastexpedition_lastexpedition_PublicKeyContract',\n 'lastexpedition/token-contract': 'lastexpedition_lastexpedition_GalaChainToken',\n 'lastexpedition/lastexpedition-contract': 'lastexpedition_lastexpedition_Product',\n 'legendsreborn/public-key-contract': 'legendsreborn_legendsreborn_PublicKeyContract',\n 'legendsreborn/token-contract': 'legendsreborn_legendsreborn_GalaChainToken',\n 'legendsreborn/legendsreborn-contract': 'legendsreborn_legendsreborn_Product',\n 'thewalkingdeadempires/public-key-contract':\n 'thewalkingdeadempires_thewalkingdeadempires_PublicKeyContract',\n 'thewalkingdeadempires/token-contract':\n 'thewalkingdeadempires_thewalkingdeadempires_GalaChainToken',\n 'thewalkingdeadempires/thewalkingdeadempires-contract':\n 'thewalkingdeadempires_thewalkingdeadempires_Product',\n 'vox/public-key-contract': 'vox_vox_PublicKeyContract',\n 'vox/token-contract': 'vox_vox_GalaChainToken',\n 'vox/auction-contract': 'vox_vox_AuctionContract',\n 'vox/phase-contract': 'vox_vox_PhaseContract',\n 'vox/vox-contract': 'vox_vox_VOXTokenContract',\n 'vox/resources-contract': 'vox_vox_VOXResourceToken',\n} as const;\n\n/** An API path of a GalaChain contract (`asset/token-contract`, `asset/dex-contract`, ...). */\nexport type ChainContractPath = keyof typeof CHAIN_CONTRACT_OPERATION_PREFIXES;\n\n/**\n * The `dtoOperation` of `method` on the contract served at `contractPath`.\n *\n * `ChainContractPath` is only a type: a plain-JS caller, or a path built at runtime\n * (`${channel}/${contract}`), can name a contract the table does not have. That is refused here, before\n * anything is signed, instead of becoming `undefined:<method>` that the chain would refuse after the\n * signature.\n *\n * @throws GalaSDKError SIGNING_FAILED when `contractPath` is not in the table.\n */\nexport function dtoOperationOf(contractPath: ChainContractPath, method: string): string {\n const prefix = Object.prototype.hasOwnProperty.call(\n CHAIN_CONTRACT_OPERATION_PREFIXES,\n contractPath,\n )\n ? CHAIN_CONTRACT_OPERATION_PREFIXES[contractPath]\n : undefined;\n if (prefix === undefined) {\n throw new GalaSDKError(\n 'SIGNING_FAILED',\n { method, reason: 'failed' },\n { cause: { contractPath, reason: 'unknown contract path: no dtoOperation is known for it' } },\n );\n }\n return `${prefix}:${method}`;\n}\n\n/**\n * `dto` with its `dtoOperation` set for `method` on `contractPath`. A DTO that already names a\n * different operation is refused: it was built for another call, and sending it would be rejected\n * by the chain after the signer had already signed it.\n *\n * @throws GalaSDKError SIGNING_FAILED when `dto.dtoOperation` is set and is not the operation of this call.\n */\nexport function withDtoOperation<T extends Record<string, unknown>>(\n contractPath: ChainContractPath,\n method: string,\n dto: T,\n): T & { readonly dtoOperation: string } {\n const dtoOperation = dtoOperationOf(contractPath, method);\n const present = dto['dtoOperation'];\n if (present !== undefined && present !== dtoOperation) {\n throw new GalaSDKError(\n 'SIGNING_FAILED',\n { method, reason: 'failed' },\n { cause: { dtoOperation: present, expected: dtoOperation } },\n );\n }\n return { ...dto, dtoOperation };\n}\n"],"mappings":"A,4DAeA,MAAaA,EAAoC,CAC/C,4BAA6B,8CAC7B,uBAAwB,2CACxB,qBAAsB,yCACtB,2BAA4B,sCAC5B,uBAAwB,0CACxB,qBAAsB,yCACtB,2BAA4B,8CAC5B,yBAA0B,4CAC1B,mCAAoC,qDAOpC,wBAAyB,gDACzB,mCAAoC,mDACpC,qBAAsB,wCACtB,uBAAwB,8CACxB,4BAA6B,gCAC7B,uBAAwB,wBACxB,uBAAwB,6BACxB,2BAA4B,0BAC5B,8BAA+B,oCAC/B,yBAA0B,iCAC1B,qCAAsC,kDACtC,iCAAkC,uDAClC,gCAAiC,+CACjC,+BAAgC,sCAChC,0BAA2B,mCAC3B,oBAAqB,4BACrB,6BAA8B,kCAC9B,wBAAyB,+BACzB,gBAAiB,uBACjB,qCAAsC,kDACtC,gCAAiC,+CACjC,gCAAiC,+CACjC,qCAAsC,kDACtC,gCAAiC,+CACjC,yCAA0C,+CAC1C,2BAA4B,8BAC5B,sBAAuB,2BACvB,qBAAsB,oBACtB,4BAA6B,6BAC7B,0BAA2B,mCAC3B,+BAAgC,sCAChC,+BAAgC,sCAChC,0BAA2B,mCAC3B,6BAA8B,4BAC9B,+BAAgC,sCAChC,0BAA2B,mCAC3B,6BAA8B,4BAC9B,qCAAsC,kDACtC,gCAAiC,+CACjC,yCAA0C,wCAC1C,oCAAqC,gDACrC,+BAAgC,6CAChC,uCAAwC,sCACxC,4CACE,gEACF,uCACE,6DACF,uDACE,sDACF,0BAA2B,4BAC3B,qBAAsB,yBACtB,uBAAwB,0BACxB,qBAAsB,wBACtB,mBAAoB,2BACpB,yBAA0B,0BAC5B,EAeA,SAAgBC,EAAe,EAAiC,EAAwB,CACtF,IAAMC,EAAS,OAAO,UAAU,eAAe,KAC7CF,EACAG,CACF,EACIH,EAAkCG,GAClC,IAAA,GACJ,GAAID,IAAW,IAAA,GACb,MAAM,IAAIE,EACR,iBACA,CAAE,SAAQ,OAAQ,QAAS,EAC3B,CAAE,MAAO,CAAE,eAAc,OAAQ,wDAAyD,CAAE,CAC9F,EAEF,MAAO,GAAGF,EAAO,GAAGG,GACtB,CASA,SAAgBC,EACd,EACA,EACA,EACuC,CACvC,IAAMC,EAAeN,EAAeE,EAAcE,CAAM,EAClDG,EAAUC,EAAIC,aACpB,GAAIF,IAAY,IAAA,IAAaA,IAAYD,EACvC,MAAM,IAAIH,EACR,iBACA,CAAE,SAAQ,OAAQ,QAAS,EAC3B,CAAE,MAAO,CAAE,aAAcI,EAAS,SAAUD,CAAa,CAAE,CAC7D,EAEF,MAAO,CAAE,GAAGE,EAAK,cAAa,CAChC,C"}
1
+ {"version":3,"file":"dto_operation.js","names":["CHAIN_CONTRACT_OPERATION_PREFIXES","CHAIN_METHOD_OPERATIONS","dtoOperationOf","methodKey","contractPath","method","prefix","GalaSDKError","withDtoOperation","dtoOperation","present","dto","\"dtoOperation\""],"sources":["../../../src/utils/dto_operation.ts"],"sourcesContent":["/**\n * The chain's operation ids for the GalaChain contracts the gateway routes, from the gateway's\n * `dtoOperationMap` (the `dtoOperation` / API path table of the GalaChain platform team,\n * 2026-10-27). The chain refuses a signed DTO whose `dtoOperation` is not exactly the operation it\n * is called through (\"The dto was signed to call X operation, but the current operation is Y\"), so\n * the URL a write is POSTed to and the `dtoOperation` it carries both come from this one table\n * (the platform's rows, plus the chain's own deviations in `CHAIN_METHOD_OPERATIONS`).\n *\n * `dtoOperation` is a SIGNED field: it is part of the DTO before the signer sees it, never added by\n * a signer or after the signature.\n */\n\nimport { GalaSDKError } from '../classes/gala_sdk_error.js';\n\n/** `<channel>/<contract route>`: the path after `/api/` (or `/v1/chain/`) a contract is served at. */\nexport const CHAIN_CONTRACT_OPERATION_PREFIXES = {\n 'asset/public-key-contract': 'asset-channel_basic-asset_PublicKeyContract',\n 'asset/token-contract': 'asset-channel_basic-asset_GalaChainToken',\n 'asset/fee-contract': 'asset-channel_basic-asset_GalaChainFee',\n 'asset/launchpad-contract': 'asset-channel_basic-asset_Launchpad',\n 'asset/dexv3-contract': 'asset-channel_basic-asset_DexV3Contract',\n 'asset/dex-contract': 'asset-channel_basic-asset_GalaChainDex',\n 'asset/registrar-contract': 'asset-channel_basic-asset_RegistrarContract',\n 'asset/staking-contract': 'asset-channel_basic-asset_StakingContract',\n 'asset/wallet-attributes-contract': 'asset-channel_basic-asset_WalletAttributesContract',\n // The platform table's bridge contract. Three bridge writes do NOT follow it; they are in\n // `CHAIN_METHOD_OPERATIONS` below.\n 'asset/bridge-contract': 'asset-channel_bridge-chaincode_BridgeContract',\n 'asset/bridge-public-key-contract': 'asset-channel_bridge-chaincode_PublicKeyContract',\n 'asset/alm-contract': 'asset-channel_basic-asset_ALMContract',\n 'spidertanks/contract': 'spidertanks-channel_spidertanks_SpiderTanks',\n 'music/public-key-contract': 'music_music_PublicKeyContract',\n 'music/music-contract': 'music_music_GalaMusic',\n 'music/token-contract': 'music_music_GalaChainToken',\n 'pokergo/pokergo-contract': 'pokergo_pokergo_PokerGo',\n 'pokergo/public-key-contract': 'pokergo_pokergo_PublicKeyContract',\n 'pokergo/token-contract': 'pokergo_pokergo_GalaChainToken',\n 'championsarena/public-key-contract': 'championsarena_championsarena_PublicKeyContract',\n 'championsarena/champions-arena': 'championsarena_championsarena_ChampionsArenaContract',\n 'championsarena/token-contract': 'championsarena_championsarena_GalaChainToken',\n 'superior/public-key-contract': 'superior_superior_PublicKeyContract',\n 'superior/token-contract': 'superior_superior_GalaChainToken',\n 'superior/superior': 'superior_superior_Product',\n 'legacy/public-key-contract': 'legacy_legacy_PublicKeyContract',\n 'legacy/token-contract': 'legacy_legacy_GalaChainToken',\n 'legacy/legacy': 'legacy_legacy_Legacy',\n 'eternalparadox/public-key-contract': 'eternalparadox_eternalparadox_PublicKeyContract',\n 'eternalparadox/token-contract': 'eternalparadox_eternalparadox_GalaChainToken',\n 'eternalparadox/eternalparadox': 'eternalparadox_eternalparadox_EternalParadox',\n 'echoesofempire/public-key-contract': 'echoesofempire_echoesofempire_PublicKeyContract',\n 'echoesofempire/token-contract': 'echoesofempire_echoesofempire_GalaChainToken',\n 'echoesofempire/echoesofempire-contract': 'echoesofempire_echoesofempire_EchoesOfEmpire',\n 'node/public-key-contract': 'node_node_PublicKeyContract',\n 'node/token-contract': 'node_node_GalaChainToken',\n 'node/node-contract': 'node_node_Product',\n 'townstar/product-contract': 'townstar_townstar_TownStar',\n 'townstar/token-contract': 'townstar_townstar_GalaChainToken',\n 'townstar/public-key-contract': 'townstar_townstar_PublicKeyContract',\n 'mirandus/public-key-contract': 'mirandus_mirandus_PublicKeyContract',\n 'mirandus/token-contract': 'mirandus_mirandus_GalaChainToken',\n 'mirandus/mirandus-contract': 'mirandus_mirandus_Product',\n 'galafilm/public-key-contract': 'galafilm_galafilm_PublicKeyContract',\n 'galafilm/token-contract': 'galafilm_galafilm_GalaChainToken',\n 'galafilm/galafilm-contract': 'galafilm_galafilm_Product',\n 'lastexpedition/public-key-contract': 'lastexpedition_lastexpedition_PublicKeyContract',\n 'lastexpedition/token-contract': 'lastexpedition_lastexpedition_GalaChainToken',\n 'lastexpedition/lastexpedition-contract': 'lastexpedition_lastexpedition_Product',\n 'legendsreborn/public-key-contract': 'legendsreborn_legendsreborn_PublicKeyContract',\n 'legendsreborn/token-contract': 'legendsreborn_legendsreborn_GalaChainToken',\n 'legendsreborn/legendsreborn-contract': 'legendsreborn_legendsreborn_Product',\n 'thewalkingdeadempires/public-key-contract':\n 'thewalkingdeadempires_thewalkingdeadempires_PublicKeyContract',\n 'thewalkingdeadempires/token-contract':\n 'thewalkingdeadempires_thewalkingdeadempires_GalaChainToken',\n 'thewalkingdeadempires/thewalkingdeadempires-contract':\n 'thewalkingdeadempires_thewalkingdeadempires_Product',\n 'vox/public-key-contract': 'vox_vox_PublicKeyContract',\n 'vox/token-contract': 'vox_vox_GalaChainToken',\n 'vox/auction-contract': 'vox_vox_AuctionContract',\n 'vox/phase-contract': 'vox_vox_PhaseContract',\n 'vox/vox-contract': 'vox_vox_VOXTokenContract',\n 'vox/resources-contract': 'vox_vox_VOXResourceToken',\n} as const;\n\n/**\n * Where the chain enforces an operation other than the platform table's, keyed `<contract path>:<method>`. The ONE\n * place such a deviation lives: every consumer (core's bridge-out signing, the wrap flow, Connect, the product SDKs)\n * asks `dtoOperationOf`, so nobody hard-codes the exception.\n *\n * - `RequestTokenBridgeOut`: the table maps `asset/bridge-contract` to bridge-chaincode, but a RequestTokenBridgeOut\n * is a TOKEN contract call. Verified on stage (2026-11-02): signed under\n * `asset-channel_bridge-chaincode_BridgeContract:RequestTokenBridgeOut` the chain answers \"signed to call ...\n * BridgeContract:RequestTokenBridgeOut, but the current operation is\n * asset-channel_basic-asset_GalaChainToken:RequestTokenBridgeOut\", and it accepts the token contract's.\n * - `GrantAllowance`: the grants embedded in a `BridgeTokenOut` are signed as\n * `asset-channel_bridge-chaincode_GalaChainToken:GrantAllowance`, which the table has no row for. Observed in\n * GalaConnect-signed stage traffic; this SDK does not sign it and it was not re-verified against the chain.\n *\n * `asset/bridge-contract:BridgeTokenOut` is NOT here: the table's `BridgeContract:BridgeTokenOut` is what was seen\n * live on stage for the external-chain bridge (GalaConnect-signed). The token contracts' own `BridgeTokenOut`\n * (`asset/token-contract`, `music/token-contract`, the channel move) is their plain prefix.\n */\nexport const CHAIN_METHOD_OPERATIONS = {\n 'asset/bridge-contract:RequestTokenBridgeOut':\n 'asset-channel_basic-asset_GalaChainToken:RequestTokenBridgeOut',\n 'asset/bridge-contract:GrantAllowance':\n 'asset-channel_bridge-chaincode_GalaChainToken:GrantAllowance',\n} as const;\n\n/** An API path of a GalaChain contract (`asset/token-contract`, `asset/dex-contract`, ...). */\nexport type ChainContractPath = keyof typeof CHAIN_CONTRACT_OPERATION_PREFIXES;\n\n/**\n * The `dtoOperation` of `method` on the contract served at `contractPath`: the chain's own\n * (`CHAIN_METHOD_OPERATIONS`) where it deviates from the platform table, else the table's prefix plus `:<method>`.\n *\n * `ChainContractPath` is only a type: a plain-JS caller, or a path built at runtime\n * (`${channel}/${contract}`), can name a contract the table does not have. That is refused here, before\n * anything is signed, instead of becoming `undefined:<method>` that the chain would refuse after the\n * signature.\n *\n * @throws GalaSDKError SIGNING_FAILED when `contractPath` is not in the table.\n */\nexport function dtoOperationOf(contractPath: ChainContractPath, method: string): string {\n const methodKey = `${contractPath}:${method}`;\n if (Object.prototype.hasOwnProperty.call(CHAIN_METHOD_OPERATIONS, methodKey)) {\n return CHAIN_METHOD_OPERATIONS[methodKey as keyof typeof CHAIN_METHOD_OPERATIONS];\n }\n const prefix = Object.prototype.hasOwnProperty.call(\n CHAIN_CONTRACT_OPERATION_PREFIXES,\n contractPath,\n )\n ? CHAIN_CONTRACT_OPERATION_PREFIXES[contractPath]\n : undefined;\n if (prefix === undefined) {\n throw new GalaSDKError(\n 'SIGNING_FAILED',\n { method, reason: 'failed' },\n { cause: { contractPath, reason: 'unknown contract path: no dtoOperation is known for it' } },\n );\n }\n return `${prefix}:${method}`;\n}\n\n/**\n * `dto` with its `dtoOperation` set for `method` on `contractPath`. A DTO that already names a\n * different operation is refused: it was built for another call, and sending it would be rejected\n * by the chain after the signer had already signed it.\n *\n * @throws GalaSDKError SIGNING_FAILED when `dto.dtoOperation` is set and is not the operation of this call.\n */\nexport function withDtoOperation<T extends Record<string, unknown>>(\n contractPath: ChainContractPath,\n method: string,\n dto: T,\n): T & { readonly dtoOperation: string } {\n const dtoOperation = dtoOperationOf(contractPath, method);\n const present = dto['dtoOperation'];\n if (present !== undefined && present !== dtoOperation) {\n throw new GalaSDKError(\n 'SIGNING_FAILED',\n { method, reason: 'failed' },\n { cause: { dtoOperation: present, expected: dtoOperation } },\n );\n }\n return { ...dto, dtoOperation };\n}\n"],"mappings":"A,4DAeA,MAAaA,EAAoC,CAC/C,4BAA6B,8CAC7B,uBAAwB,2CACxB,qBAAsB,yCACtB,2BAA4B,sCAC5B,uBAAwB,0CACxB,qBAAsB,yCACtB,2BAA4B,8CAC5B,yBAA0B,4CAC1B,mCAAoC,qDAGpC,wBAAyB,gDACzB,mCAAoC,mDACpC,qBAAsB,wCACtB,uBAAwB,8CACxB,4BAA6B,gCAC7B,uBAAwB,wBACxB,uBAAwB,6BACxB,2BAA4B,0BAC5B,8BAA+B,oCAC/B,yBAA0B,iCAC1B,qCAAsC,kDACtC,iCAAkC,uDAClC,gCAAiC,+CACjC,+BAAgC,sCAChC,0BAA2B,mCAC3B,oBAAqB,4BACrB,6BAA8B,kCAC9B,wBAAyB,+BACzB,gBAAiB,uBACjB,qCAAsC,kDACtC,gCAAiC,+CACjC,gCAAiC,+CACjC,qCAAsC,kDACtC,gCAAiC,+CACjC,yCAA0C,+CAC1C,2BAA4B,8BAC5B,sBAAuB,2BACvB,qBAAsB,oBACtB,4BAA6B,6BAC7B,0BAA2B,mCAC3B,+BAAgC,sCAChC,+BAAgC,sCAChC,0BAA2B,mCAC3B,6BAA8B,4BAC9B,+BAAgC,sCAChC,0BAA2B,mCAC3B,6BAA8B,4BAC9B,qCAAsC,kDACtC,gCAAiC,+CACjC,yCAA0C,wCAC1C,oCAAqC,gDACrC,+BAAgC,6CAChC,uCAAwC,sCACxC,4CACE,gEACF,uCACE,6DACF,uDACE,sDACF,0BAA2B,4BAC3B,qBAAsB,yBACtB,uBAAwB,0BACxB,qBAAsB,wBACtB,mBAAoB,2BACpB,yBAA0B,0BAC5B,EAoBaC,EAA0B,CACrC,8CACE,iEACF,uCACE,8DACJ,EAgBA,SAAgBC,EAAe,EAAiC,EAAwB,CACtF,IAAMC,EAAY,GAAGC,EAAa,GAAGC,IACrC,GAAI,OAAO,UAAU,eAAe,KAAKJ,EAAyBE,CAAS,EACzE,OAAOF,EAAwBE,GAEjC,IAAMG,EAAS,OAAO,UAAU,eAAe,KAC7CN,EACAI,CACF,EACIJ,EAAkCI,GAClC,IAAA,GACJ,GAAIE,IAAW,IAAA,GACb,MAAM,IAAIC,EACR,iBACA,CAAE,SAAQ,OAAQ,QAAS,EAC3B,CAAE,MAAO,CAAE,eAAc,OAAQ,wDAAyD,CAAE,CAC9F,EAEF,MAAO,GAAGD,EAAO,GAAGD,GACtB,CASA,SAAgBG,EACd,EACA,EACA,EACuC,CACvC,IAAMC,EAAeP,EAAeE,EAAcC,CAAM,EAClDK,EAAUC,EAAIC,aACpB,GAAIF,IAAY,IAAA,IAAaA,IAAYD,EACvC,MAAM,IAAIF,EACR,iBACA,CAAE,SAAQ,OAAQ,QAAS,EAC3B,CAAE,MAAO,CAAE,aAAcG,EAAS,SAAUD,CAAa,CAAE,CAC7D,EAEF,MAAO,CAAE,GAAGE,EAAK,cAAa,CAChC,C"}
@@ -1,2 +1,2 @@
1
- import{GalaSDKError as e,isGalaError as t,parseJson as n}from"../classes/gala_sdk_error.js";import"../version.js";function r(e,t){if(t===1/0)return()=>void 0;let n=setTimeout(()=>e.abort(),t);return()=>clearTimeout(n)}function i(t,n){if(t===1/0||Number.isFinite(t)&&t>0)return t;throw new e(`INVALID_TIMEOUT`,{field:n,value:t})}const a=/[A-Za-z0-9\-._~!'()*$|:,]/u;function o(e){let t=``;for(let n of e)n===` `?t+=`+`:a.test(n)?t+=n:t+=s(n);return t}function s(e){try{return encodeURIComponent(e)}catch{return`%EF%BF%BD`}}function c(e,t=`standard`){return t===`readable`?Object.entries(e).map(([e,t])=>`${o(e)}=${o(t)}`).join(`&`):new URLSearchParams(e).toString()}function l(e,t={}){let n=/* @__PURE__ */ new Map,r=(e,t=!1)=>{for(let[r,i]of Object.entries(e??{}))t&&n.delete(r.toLowerCase()),n.set(r.toLowerCase(),[r,i])};return e?.userAgent!==!1&&r({"User-Agent":e?.userAgent??`GalaChain-SDK/1.2.0-beta.1`}),r(t.defaults),r(e?.headers),t.json===!0&&!n.has(`content-type`)&&r({"Content-Type":`application/json`}),r(t.fixed,!0),Object.fromEntries(n.values())}const u=async(t,n)=>{try{return await fetch(t,n)}catch(r){throw n?.signal?.aborted===!0?r:new e(`TRANSPORT_ERROR`,{url:t},{url:t,cause:r})}};async function d(n,i,a,o,s){let c=new AbortController,l=r(c,o),u=a.signal,d=()=>c.abort();u?.addEventListener(`abort`,d,{once:!0});let f=s?.write===!1;try{return await n(i,{...a,signal:c.signal})}catch(n){throw u?.aborted===!0?n:c.signal.aborted?new e(`REQUEST_TIMEOUT`,{url:i,timeoutMs:o},{url:i,cause:n,...f?{write:!1}:{}}):f&&t(n,`TRANSPORT_ERROR`)&&n.write?new e(`TRANSPORT_ERROR`,{url:n.url??i},{url:n.url??i,cause:n.cause,write:!1}):n}finally{l(),u?.removeEventListener(`abort`,d)}}async function f(e){let t=await e.text();return n(t)??t}function p(e,t){let n=e.headers;if(n===void 0)return;if(g(n)){let e=n.get(t);return e===null||e===``?void 0:e}let r=Object.entries(n).find(([e])=>e.toLowerCase()===t.toLowerCase())?.[1];return r===void 0||r===``?void 0:r}function m(e){let t=p(e,`retry-after`);if(t===void 0)return;let n=Number(t);if(Number.isFinite(n)&&n>=0)return n*1e3;let r=Date.parse(t);return Number.isNaN(r)?void 0:Math.max(0,r-Date.now())}function h(e,t=`x-block-number`){let n=p(e,t);if(n===void 0)return;let r=Number(n);return Number.isInteger(r)&&r>=0?r:void 0}function g(e){return`get`in e&&typeof e.get==`function`}export{r as armTimeout,c as buildQueryString,l as buildRequestHeaders,u as fetchRequestor,h as readBlockNumberHeader,p as readHeader,f as readResponseBody,m as readRetryAfter,d as requestWithTimeout,i as validateTimeoutMs};
1
+ import{GalaSDKError as e,isGalaError as t,parseJson as n}from"../classes/gala_sdk_error.js";import"../version.js";function r(e,t){if(t===1/0)return()=>void 0;let n=setTimeout(()=>e.abort(),t);return()=>clearTimeout(n)}function i(t,n){if(t===1/0||Number.isFinite(t)&&t>0)return t;throw new e(`INVALID_TIMEOUT`,{field:n,value:t})}const a=/[A-Za-z0-9\-._~!'()*$|:,]/u;function o(e){let t=``;for(let n of e)n===` `?t+=`+`:a.test(n)?t+=n:t+=s(n);return t}function s(e){try{return encodeURIComponent(e)}catch{return`%EF%BF%BD`}}function c(e,t=`standard`){return t===`readable`?Object.entries(e).map(([e,t])=>`${o(e)}=${o(t)}`).join(`&`):new URLSearchParams(e).toString()}function l(e,t={}){let n=/* @__PURE__ */ new Map,r=(e,t=!1)=>{for(let[r,i]of Object.entries(e??{}))t&&n.delete(r.toLowerCase()),n.set(r.toLowerCase(),[r,i])};return e?.userAgent!==!1&&r({"User-Agent":e?.userAgent??`GalaChain-SDK/1.2.0-beta.2`}),r(t.defaults),r(e?.headers),t.json===!0&&!n.has(`content-type`)&&r({"Content-Type":`application/json`}),r(t.fixed,!0),Object.fromEntries(n.values())}const u=async(t,n)=>{try{return await fetch(t,n)}catch(r){throw n?.signal?.aborted===!0?r:new e(`TRANSPORT_ERROR`,{url:t},{url:t,cause:r})}};async function d(n,i,a,o,s){let c=new AbortController,l=r(c,o),u=a.signal,d=()=>c.abort();u?.addEventListener(`abort`,d,{once:!0});let f=s?.write===!1;try{return await n(i,{...a,signal:c.signal})}catch(n){throw u?.aborted===!0?n:c.signal.aborted?new e(`REQUEST_TIMEOUT`,{url:i,timeoutMs:o},{url:i,cause:n,...f?{write:!1}:{}}):f&&t(n,`TRANSPORT_ERROR`)&&n.write?new e(`TRANSPORT_ERROR`,{url:n.url??i},{url:n.url??i,cause:n.cause,write:!1}):n}finally{l(),u?.removeEventListener(`abort`,d)}}async function f(e){let t=await e.text();return n(t)??t}function p(e,t){let n=e.headers;if(n===void 0)return;if(g(n)){let e=n.get(t);return e===null||e===``?void 0:e}let r=Object.entries(n).find(([e])=>e.toLowerCase()===t.toLowerCase())?.[1];return r===void 0||r===``?void 0:r}function m(e){let t=p(e,`retry-after`);if(t===void 0)return;let n=Number(t);if(Number.isFinite(n)&&n>=0)return n*1e3;let r=Date.parse(t);return Number.isNaN(r)?void 0:Math.max(0,r-Date.now())}function h(e,t=`x-block-number`){let n=p(e,t);if(n===void 0)return;let r=Number(n);return Number.isInteger(r)&&r>=0?r:void 0}function g(e){return`get`in e&&typeof e.get==`function`}export{r as armTimeout,c as buildQueryString,l as buildRequestHeaders,u as fetchRequestor,h as readBlockNumberHeader,p as readHeader,f as readResponseBody,m as readRetryAfter,d as requestWithTimeout,i as validateTimeoutMs};
2
2
  //# sourceMappingURL=transport.js.map
@@ -1,2 +1,2 @@
1
- const e=`1.2.0-beta.1`;export{e as GALA_CORE_SDK_VERSION};
1
+ const e=`1.2.0-beta.2`;export{e as GALA_CORE_SDK_VERSION};
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","names":["GALA_CORE_SDK_VERSION"],"sources":["../../src/version.ts"],"sourcesContent":["declare const __GALA_CORE_SDK_VERSION__: string | undefined;\n\n/**\n * The `@gala-chain/gala-core-sdk` package version, embedded by the bundler, with a source-test\n * fallback. It is the version in the default `User-Agent` (`GalaChain-SDK/<version>`) of every SDK\n * request, whichever product SDK sends it.\n */\nexport const GALA_CORE_SDK_VERSION =\n typeof __GALA_CORE_SDK_VERSION__ === 'string' ? __GALA_CORE_SDK_VERSION__ : '1.2.0-beta.1';\n"],"mappings":"AAOA,MAAaA,EAAA,e"}
1
+ {"version":3,"file":"version.js","names":["GALA_CORE_SDK_VERSION"],"sources":["../../src/version.ts"],"sourcesContent":["declare const __GALA_CORE_SDK_VERSION__: string | undefined;\n\n/**\n * The `@gala-chain/gala-core-sdk` package version, embedded by the bundler, with a source-test\n * fallback. It is the version in the default `User-Agent` (`GalaChain-SDK/<version>`) of every SDK\n * request, whichever product SDK sends it.\n */\nexport const GALA_CORE_SDK_VERSION =\n typeof __GALA_CORE_SDK_VERSION__ === 'string' ? __GALA_CORE_SDK_VERSION__ : '1.2.0-beta.2';\n"],"mappings":"AAOA,MAAaA,EAAA,e"}
@@ -1,2 +1,2 @@
1
- import{GalaSDKError as e}from"../classes/gala_sdk_error.js";import{checksumEthereumAddress as t}from"../utils/eth_address.js";const n=/^(?:eth\||0x)?([0-9a-fA-F]{40})$/u,r=/^client\|[A-Za-z0-9_-]+$/u,i=/^eth\|0[xX](.*)$/su;function a(n,r){if(typeof n!=`string`)return;let a=i.exec(n)?.[1];if(a===void 0)return;let o=/^[0-9a-fA-F]{40}$/u.test(a)?t(a):void 0;throw new e(`INVALID_ETH_USER_REF_PREFIX`,{field:r,value:n,expected:o===void 0?`eth|<40 hex digits>`:`eth|${o.slice(2)}`})}function o(i,o){if(a(i,o),typeof i==`string`){if(r.test(i))return i;let e=n.exec(i)?.[1],a=e===void 0?void 0:t(e);if(a!==void 0)return`eth|${a.slice(2)}`}throw new e(`INVALID_WALLET_ADDRESS`,{field:o,value:String(i)})}export{a as assertNoEthZeroXPrefix,o as galaChainUserRef};
1
+ import{GalaSDKError as e}from"../classes/gala_sdk_error.js";import{checksumEthereumAddress as t}from"../utils/eth_address.js";const n=/^(?:eth\||0x)?([0-9a-fA-F]{40})$/u,r=/^client\|[A-Za-z0-9_-]+$/u,i=/^eth\|0[xX](.*)$/su;function a(e){let t=e.indexOf(`|`);return t<0?e:`${e.slice(0,t).toLowerCase()}${e.slice(t)}`}function o(n,r){if(typeof n!=`string`)return;let o=i.exec(a(n))?.[1];if(o===void 0)return;let s=/^[0-9a-fA-F]{40}$/u.test(o)?t(o):void 0;throw new e(`INVALID_ETH_USER_REF_PREFIX`,{field:r,value:n,expected:s===void 0?`eth|<40 hex digits>`:`eth|${s.slice(2)}`})}function s(i,s){if(o(i,s),typeof i==`string`){let e=a(i);if(r.test(e))return e;let o=n.exec(e)?.[1],s=o===void 0?void 0:t(o);if(s!==void 0)return`eth|${s.slice(2)}`}throw new e(`INVALID_WALLET_ADDRESS`,{field:s,value:String(i)})}export{o as assertNoEthZeroXPrefix,s as galaChainUserRef};
2
2
  //# sourceMappingURL=identity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"identity.js","names":["ACCOUNT","CLIENT_ALIAS","ETH_WITH_0X","assertNoEthZeroXPrefix","value","rest","checksummed","checksumEthereumAddress","GalaSDKError","galaChainUserRef","field","digits","account"],"sources":["../../../src/writes/identity.ts"],"sourcesContent":["import { GalaSDKError } from '../classes/gala_sdk_error.js';\nimport { checksumEthereumAddress } from '../utils/eth_address.js';\n\n/** `eth|`, `0x` or nothing, then the 40 hex digits of an Ethereum account. */\nconst ACCOUNT = /^(?:eth\\||0x)?([0-9a-fA-F]{40})$/u;\nconst CLIENT_ALIAS = /^client\\|[A-Za-z0-9_-]+$/u;\n/** `eth|0x...`: not a user reference. An `eth|` reference is followed by the digits alone. */\nconst ETH_WITH_0X = /^eth\\|0[xX](.*)$/su;\n\n/**\n * Refuses `eth|0x...` (any digits, any casing of the `0x`) with `INVALID_ETH_USER_REF_PREFIX`,\n * naming the correct spelling. `eth|0x...` is not an address form: GalaChain's `eth|` reference is\n * followed by the 40 hex digits only. A bare `0x<40 hex>` is a different, normal thing (an\n * Ethereum address) and is not touched. Every place core reads an account refuses it through this\n * one function, before anything is signed or sent.\n *\n * @throws GalaSDKError `INVALID_ETH_USER_REF_PREFIX` (`params.field` = `field`).\n */\nexport function assertNoEthZeroXPrefix(value: unknown, field: string): void {\n if (typeof value !== 'string') return;\n const rest = ETH_WITH_0X.exec(value)?.[1];\n if (rest === undefined) return;\n const checksummed = /^[0-9a-fA-F]{40}$/u.test(rest) ? checksumEthereumAddress(rest) : undefined;\n throw new GalaSDKError('INVALID_ETH_USER_REF_PREFIX', {\n field,\n value,\n expected: checksummed === undefined ? 'eth|<40 hex digits>' : `eth|${checksummed.slice(2)}`,\n });\n}\n\n/**\n * The GalaChain user reference a read or write names (owner, sender, recipient, lock authority),\n * in the one spelling the gateway receives:\n *\n * - an Ethereum account, as `eth|<40 hex>`, `0x<40 hex>` or bare `<40 hex>`: sent as `eth|` plus\n * its EIP-55 checksummed digits (no `0x`). The gateway refuses every other casing of an `eth|`\n * reference (all lower case, all upper case) with HTTP 400 `DTO_VALIDATION_FAILED`\n * (`IsUserRefConstraint`; recorded in `tests/fixtures/gateway-reads-recorded.json`). A\n * mixed-case spelling whose casing is not the EIP-55 checksum is a typo (what EIP-55 exists to\n * catch) and is refused.\n * - `eth|0x<hex>` is NOT an address form: an `eth|` reference is followed by the digits alone.\n * It is refused before anything is signed or sent (see {@link assertNoEthZeroXPrefix}). A bare\n * `0x<40 hex>` is an ordinary Ethereum address and is converted to `eth|<EIP-55 digits>`.\n * - `client|<id>` (`A-Za-z0-9_-`): a GalaChain alias, kept exactly as written.\n *\n * Anything else is refused before anything is signed or sent (fail closed): an unknown spelling\n * could name an account nobody holds.\n *\n * @throws GalaSDKError `INVALID_ETH_USER_REF_PREFIX` for `eth|0x...`, otherwise\n * `INVALID_WALLET_ADDRESS` (`params.field` = `field`).\n */\nexport function galaChainUserRef(value: unknown, field: string): string {\n assertNoEthZeroXPrefix(value, field);\n if (typeof value === 'string') {\n if (CLIENT_ALIAS.test(value)) return value;\n const digits = ACCOUNT.exec(value)?.[1];\n const account = digits === undefined ? undefined : checksumEthereumAddress(digits);\n if (account !== undefined) return `eth|${account.slice(2)}`;\n }\n throw new GalaSDKError('INVALID_WALLET_ADDRESS', { field, value: String(value) });\n}\n"],"mappings":"A,8HAIA,MAAMA,EAAU,oCACVC,EAAe,4BAEfC,EAAc,qBAWpB,SAAgBC,EAAuB,EAAgB,EAAqB,CAC1E,GAAI,OAAOC,GAAU,SAAU,OAC/B,IAAMC,EAAOH,EAAY,KAAKE,CAAK,CAAC,GAAG,GACvC,GAAIC,IAAS,IAAA,GAAW,OACxB,IAAMC,EAAc,qBAAqB,KAAKD,CAAI,EAAIE,EAAwBF,CAAI,EAAI,IAAA,GACtF,MAAM,IAAIG,EAAa,8BAA+B,CACpD,QACA,QACA,SAAUF,IAAgB,IAAA,GAAY,sBAAwB,OAAOA,EAAY,MAAM,CAAC,GAC1F,CAAC,CACH,CAuBA,SAAgBG,EAAiB,EAAgB,EAAuB,CAEtE,GADAN,EAAuBC,EAAOM,CAAK,EAC/B,OAAON,GAAU,SAAU,CAC7B,GAAIH,EAAa,KAAKG,CAAK,EAAG,OAAOA,EACrC,IAAMO,EAASX,EAAQ,KAAKI,CAAK,CAAC,GAAG,GAC/BQ,EAAUD,IAAW,IAAA,GAAY,IAAA,GAAYJ,EAAwBI,CAAM,EACjF,GAAIC,IAAY,IAAA,GAAW,MAAO,OAAOA,EAAQ,MAAM,CAAC,GAC1D,CACA,MAAM,IAAIJ,EAAa,yBAA0B,CAAE,QAAO,MAAO,OAAOJ,CAAK,CAAE,CAAC,CAClF,C"}
1
+ {"version":3,"file":"identity.js","names":["ACCOUNT","CLIENT_ALIAS","ETH_WITH_0X","lowerScheme","pipe","value","assertNoEthZeroXPrefix","rest","checksummed","checksumEthereumAddress","GalaSDKError","galaChainUserRef","field","spelled","digits","account"],"sources":["../../../src/writes/identity.ts"],"sourcesContent":["import { GalaSDKError } from '../classes/gala_sdk_error.js';\nimport { checksumEthereumAddress } from '../utils/eth_address.js';\n\n/** `eth|`, `0x` or nothing, then the 40 hex digits of an Ethereum account. */\nconst ACCOUNT = /^(?:eth\\||0x)?([0-9a-fA-F]{40})$/u;\nconst CLIENT_ALIAS = /^client\\|[A-Za-z0-9_-]+$/u;\n/** `eth|0x...`: not a user reference. An `eth|` reference is followed by the digits alone. */\nconst ETH_WITH_0X = /^eth\\|0[xX](.*)$/su;\n\n/**\n * `value` with the part before its first `|` lower-cased and everything after it exactly as written (a value with no\n * `|` is returned as is): `Client|X` is the account `client|X`, `ETH|<hex>` is `eth|<hex>`. The scheme is\n * case-insensitive, an alias id is not (launchpad-sdk's `userRef` follows the same rule).\n */\nfunction lowerScheme(value: string): string {\n const pipe = value.indexOf('|');\n return pipe < 0 ? value : `${value.slice(0, pipe).toLowerCase()}${value.slice(pipe)}`;\n}\n\n/**\n * Refuses `eth|0x...` (any digits, any casing of the `0x`) with `INVALID_ETH_USER_REF_PREFIX`,\n * naming the correct spelling. `eth|0x...` is not an address form: GalaChain's `eth|` reference is\n * followed by the 40 hex digits only. A bare `0x<40 hex>` is a different, normal thing (an\n * Ethereum address) and is not touched. Every place core reads an account refuses it through this\n * one function, before anything is signed or sent.\n *\n * @throws GalaSDKError `INVALID_ETH_USER_REF_PREFIX` (`params.field` = `field`).\n */\nexport function assertNoEthZeroXPrefix(value: unknown, field: string): void {\n if (typeof value !== 'string') return;\n const rest = ETH_WITH_0X.exec(lowerScheme(value))?.[1];\n if (rest === undefined) return;\n const checksummed = /^[0-9a-fA-F]{40}$/u.test(rest) ? checksumEthereumAddress(rest) : undefined;\n throw new GalaSDKError('INVALID_ETH_USER_REF_PREFIX', {\n field,\n value,\n expected: checksummed === undefined ? 'eth|<40 hex digits>' : `eth|${checksummed.slice(2)}`,\n });\n}\n\n/**\n * The GalaChain user reference a read or write names (owner, sender, recipient, lock authority),\n * in the one spelling the gateway receives:\n *\n * - an Ethereum account, as `eth|<40 hex>`, `0x<40 hex>` or bare `<40 hex>`: sent as `eth|` plus\n * its EIP-55 checksummed digits (no `0x`). The gateway refuses every other casing of an `eth|`\n * reference (all lower case, all upper case) with HTTP 400 `DTO_VALIDATION_FAILED`\n * (`IsUserRefConstraint`; recorded in `tests/fixtures/gateway-reads-recorded.json`). A\n * mixed-case spelling whose casing is not the EIP-55 checksum is a typo (what EIP-55 exists to\n * catch) and is refused.\n * - `eth|0x<hex>` is NOT an address form: an `eth|` reference is followed by the digits alone.\n * It is refused before anything is signed or sent (see {@link assertNoEthZeroXPrefix}). A bare\n * `0x<40 hex>` is an ordinary Ethereum address and is converted to `eth|<EIP-55 digits>`.\n * - `client|<id>` (`A-Za-z0-9_-`): a GalaChain alias, kept exactly as written after the scheme.\n * - The scheme (before the first `|`) is accepted in any case and sent lower case (`Client|X` -> `client|X`,\n * `ETH|<hex>` -> `eth|<hex>`); everything after the `|` keeps its case.\n *\n * Anything else is refused before anything is signed or sent (fail closed): an unknown spelling\n * could name an account nobody holds.\n *\n * @throws GalaSDKError `INVALID_ETH_USER_REF_PREFIX` for `eth|0x...`, otherwise\n * `INVALID_WALLET_ADDRESS` (`params.field` = `field`).\n */\nexport function galaChainUserRef(value: unknown, field: string): string {\n assertNoEthZeroXPrefix(value, field);\n if (typeof value === 'string') {\n const spelled = lowerScheme(value);\n if (CLIENT_ALIAS.test(spelled)) return spelled;\n const digits = ACCOUNT.exec(spelled)?.[1];\n const account = digits === undefined ? undefined : checksumEthereumAddress(digits);\n if (account !== undefined) return `eth|${account.slice(2)}`;\n }\n throw new GalaSDKError('INVALID_WALLET_ADDRESS', { field, value: String(value) });\n}\n"],"mappings":"A,8HAIA,MAAMA,EAAU,oCACVC,EAAe,4BAEfC,EAAc,qBAOpB,SAASC,EAAY,EAAuB,CAC1C,IAAMC,EAAOC,EAAM,QAAQ,GAAG,EAC9B,OAAOD,EAAO,EAAIC,EAAQ,GAAGA,EAAM,MAAM,EAAGD,CAAI,CAAC,CAAC,YAAY,IAAIC,EAAM,MAAMD,CAAI,GACpF,CAWA,SAAgBE,EAAuB,EAAgB,EAAqB,CAC1E,GAAI,OAAOD,GAAU,SAAU,OAC/B,IAAME,EAAOL,EAAY,KAAKC,EAAYE,CAAK,CAAC,CAAC,GAAG,GACpD,GAAIE,IAAS,IAAA,GAAW,OACxB,IAAMC,EAAc,qBAAqB,KAAKD,CAAI,EAAIE,EAAwBF,CAAI,EAAI,IAAA,GACtF,MAAM,IAAIG,EAAa,8BAA+B,CACpD,QACA,QACA,SAAUF,IAAgB,IAAA,GAAY,sBAAwB,OAAOA,EAAY,MAAM,CAAC,GAC1F,CAAC,CACH,CAyBA,SAAgBG,EAAiB,EAAgB,EAAuB,CAEtE,GADAL,EAAuBD,EAAOO,CAAK,EAC/B,OAAOP,GAAU,SAAU,CAC7B,IAAMQ,EAAUV,EAAYE,CAAK,EACjC,GAAIJ,EAAa,KAAKY,CAAO,EAAG,OAAOA,EACvC,IAAMC,EAASd,EAAQ,KAAKa,CAAO,CAAC,GAAG,GACjCE,EAAUD,IAAW,IAAA,GAAY,IAAA,GAAYL,EAAwBK,CAAM,EACjF,GAAIC,IAAY,IAAA,GAAW,MAAO,OAAOA,EAAQ,MAAM,CAAC,GAC1D,CACA,MAAM,IAAIL,EAAa,yBAA0B,CAAE,QAAO,MAAO,OAAOL,CAAK,CAAE,CAAC,CAClF,C"}
package/dist/index.cjs CHANGED
@@ -1246,6 +1246,15 @@ const CLIENT_ALIAS = /^client\|[A-Za-z0-9_-]+$/u;
1246
1246
  /** `eth|0x...`: not a user reference. An `eth|` reference is followed by the digits alone. */
1247
1247
  const ETH_WITH_0X = /^eth\|0[xX](.*)$/su;
1248
1248
  /**
1249
+ * `value` with the part before its first `|` lower-cased and everything after it exactly as written (a value with no
1250
+ * `|` is returned as is): `Client|X` is the account `client|X`, `ETH|<hex>` is `eth|<hex>`. The scheme is
1251
+ * case-insensitive, an alias id is not (launchpad-sdk's `userRef` follows the same rule).
1252
+ */
1253
+ function lowerScheme(value) {
1254
+ const pipe = value.indexOf("|");
1255
+ return pipe < 0 ? value : `${value.slice(0, pipe).toLowerCase()}${value.slice(pipe)}`;
1256
+ }
1257
+ /**
1249
1258
  * Refuses `eth|0x...` (any digits, any casing of the `0x`) with `INVALID_ETH_USER_REF_PREFIX`,
1250
1259
  * naming the correct spelling. `eth|0x...` is not an address form: GalaChain's `eth|` reference is
1251
1260
  * followed by the 40 hex digits only. A bare `0x<40 hex>` is a different, normal thing (an
@@ -1257,7 +1266,7 @@ const ETH_WITH_0X = /^eth\|0[xX](.*)$/su;
1257
1266
  function assertNoEthZeroXPrefix(value, field) {
1258
1267
  var _ETH_WITH_0X$exec;
1259
1268
  if (typeof value !== "string") return;
1260
- const rest = (_ETH_WITH_0X$exec = ETH_WITH_0X.exec(value)) === null || _ETH_WITH_0X$exec === void 0 ? void 0 : _ETH_WITH_0X$exec[1];
1269
+ const rest = (_ETH_WITH_0X$exec = ETH_WITH_0X.exec(lowerScheme(value))) === null || _ETH_WITH_0X$exec === void 0 ? void 0 : _ETH_WITH_0X$exec[1];
1261
1270
  if (rest === void 0) return;
1262
1271
  const checksummed = /^[0-9a-fA-F]{40}$/u.test(rest) ? checksumEthereumAddress(rest) : void 0;
1263
1272
  throw new GalaSDKError("INVALID_ETH_USER_REF_PREFIX", {
@@ -1279,7 +1288,9 @@ function assertNoEthZeroXPrefix(value, field) {
1279
1288
  * - `eth|0x<hex>` is NOT an address form: an `eth|` reference is followed by the digits alone.
1280
1289
  * It is refused before anything is signed or sent (see {@link assertNoEthZeroXPrefix}). A bare
1281
1290
  * `0x<40 hex>` is an ordinary Ethereum address and is converted to `eth|<EIP-55 digits>`.
1282
- * - `client|<id>` (`A-Za-z0-9_-`): a GalaChain alias, kept exactly as written.
1291
+ * - `client|<id>` (`A-Za-z0-9_-`): a GalaChain alias, kept exactly as written after the scheme.
1292
+ * - The scheme (before the first `|`) is accepted in any case and sent lower case (`Client|X` -> `client|X`,
1293
+ * `ETH|<hex>` -> `eth|<hex>`); everything after the `|` keeps its case.
1283
1294
  *
1284
1295
  * Anything else is refused before anything is signed or sent (fail closed): an unknown spelling
1285
1296
  * could name an account nobody holds.
@@ -1291,8 +1302,9 @@ function galaChainUserRef(value, field) {
1291
1302
  assertNoEthZeroXPrefix(value, field);
1292
1303
  if (typeof value === "string") {
1293
1304
  var _ACCOUNT$exec;
1294
- if (CLIENT_ALIAS.test(value)) return value;
1295
- const digits = (_ACCOUNT$exec = ACCOUNT.exec(value)) === null || _ACCOUNT$exec === void 0 ? void 0 : _ACCOUNT$exec[1];
1305
+ const spelled = lowerScheme(value);
1306
+ if (CLIENT_ALIAS.test(spelled)) return spelled;
1307
+ const digits = (_ACCOUNT$exec = ACCOUNT.exec(spelled)) === null || _ACCOUNT$exec === void 0 ? void 0 : _ACCOUNT$exec[1];
1296
1308
  const account = digits === void 0 ? void 0 : checksumEthereumAddress(digits);
1297
1309
  if (account !== void 0) return `eth|${account.slice(2)}`;
1298
1310
  }
@@ -2595,8 +2607,8 @@ async function signTypedDataPayload(privateKey, payload) {
2595
2607
  * `dtoOperationMap` (the `dtoOperation` / API path table of the GalaChain platform team,
2596
2608
  * 2026-10-27). The chain refuses a signed DTO whose `dtoOperation` is not exactly the operation it
2597
2609
  * is called through ("The dto was signed to call X operation, but the current operation is Y"), so
2598
- * the URL a write is POSTed to and the `dtoOperation` it carries both come from this one table and
2599
- * can never disagree.
2610
+ * the URL a write is POSTed to and the `dtoOperation` it carries both come from this one table
2611
+ * (the platform's rows, plus the chain's own deviations in `CHAIN_METHOD_OPERATIONS`).
2600
2612
  *
2601
2613
  * `dtoOperation` is a SIGNED field: it is part of the DTO before the signer sees it, never added by
2602
2614
  * a signer or after the signature.
@@ -2666,7 +2678,30 @@ const CHAIN_CONTRACT_OPERATION_PREFIXES = {
2666
2678
  "vox/resources-contract": "vox_vox_VOXResourceToken"
2667
2679
  };
2668
2680
  /**
2669
- * The `dtoOperation` of `method` on the contract served at `contractPath`.
2681
+ * Where the chain enforces an operation other than the platform table's, keyed `<contract path>:<method>`. The ONE
2682
+ * place such a deviation lives: every consumer (core's bridge-out signing, the wrap flow, Connect, the product SDKs)
2683
+ * asks `dtoOperationOf`, so nobody hard-codes the exception.
2684
+ *
2685
+ * - `RequestTokenBridgeOut`: the table maps `asset/bridge-contract` to bridge-chaincode, but a RequestTokenBridgeOut
2686
+ * is a TOKEN contract call. Verified on stage (2026-11-02): signed under
2687
+ * `asset-channel_bridge-chaincode_BridgeContract:RequestTokenBridgeOut` the chain answers "signed to call ...
2688
+ * BridgeContract:RequestTokenBridgeOut, but the current operation is
2689
+ * asset-channel_basic-asset_GalaChainToken:RequestTokenBridgeOut", and it accepts the token contract's.
2690
+ * - `GrantAllowance`: the grants embedded in a `BridgeTokenOut` are signed as
2691
+ * `asset-channel_bridge-chaincode_GalaChainToken:GrantAllowance`, which the table has no row for. Observed in
2692
+ * GalaConnect-signed stage traffic; this SDK does not sign it and it was not re-verified against the chain.
2693
+ *
2694
+ * `asset/bridge-contract:BridgeTokenOut` is NOT here: the table's `BridgeContract:BridgeTokenOut` is what was seen
2695
+ * live on stage for the external-chain bridge (GalaConnect-signed). The token contracts' own `BridgeTokenOut`
2696
+ * (`asset/token-contract`, `music/token-contract`, the channel move) is their plain prefix.
2697
+ */
2698
+ const CHAIN_METHOD_OPERATIONS = {
2699
+ "asset/bridge-contract:RequestTokenBridgeOut": "asset-channel_basic-asset_GalaChainToken:RequestTokenBridgeOut",
2700
+ "asset/bridge-contract:GrantAllowance": "asset-channel_bridge-chaincode_GalaChainToken:GrantAllowance"
2701
+ };
2702
+ /**
2703
+ * The `dtoOperation` of `method` on the contract served at `contractPath`: the chain's own
2704
+ * (`CHAIN_METHOD_OPERATIONS`) where it deviates from the platform table, else the table's prefix plus `:<method>`.
2670
2705
  *
2671
2706
  * `ChainContractPath` is only a type: a plain-JS caller, or a path built at runtime
2672
2707
  * (`${channel}/${contract}`), can name a contract the table does not have. That is refused here, before
@@ -2676,6 +2711,8 @@ const CHAIN_CONTRACT_OPERATION_PREFIXES = {
2676
2711
  * @throws GalaSDKError SIGNING_FAILED when `contractPath` is not in the table.
2677
2712
  */
2678
2713
  function dtoOperationOf(contractPath, method) {
2714
+ const methodKey = `${contractPath}:${method}`;
2715
+ if (Object.prototype.hasOwnProperty.call(CHAIN_METHOD_OPERATIONS, methodKey)) return CHAIN_METHOD_OPERATIONS[methodKey];
2679
2716
  const prefix = Object.prototype.hasOwnProperty.call(CHAIN_CONTRACT_OPERATION_PREFIXES, contractPath) ? CHAIN_CONTRACT_OPERATION_PREFIXES[contractPath] : void 0;
2680
2717
  if (prefix === void 0) throw new GalaSDKError("SIGNING_FAILED", {
2681
2718
  method,
@@ -2892,7 +2929,7 @@ async function signPreSendFor(signer, contractPath, method, dto) {
2892
2929
  * fallback. It is the version in the default `User-Agent` (`GalaChain-SDK/<version>`) of every SDK
2893
2930
  * request, whichever product SDK sends it.
2894
2931
  */
2895
- const GALA_CORE_SDK_VERSION = "1.2.0-beta.1";
2932
+ const GALA_CORE_SDK_VERSION = "1.2.0-beta.2";
2896
2933
 
2897
2934
  //#endregion
2898
2935
  //#region src/utils/transport.ts
@@ -2953,7 +2990,7 @@ function buildRequestHeaders(wire, parts = {}) {
2953
2990
  entries.set(name.toLowerCase(), [name, value]);
2954
2991
  }
2955
2992
  };
2956
- if ((wire === null || wire === void 0 ? void 0 : wire.userAgent) !== false) put({ "User-Agent": (wire === null || wire === void 0 ? void 0 : wire.userAgent) ?? `GalaChain-SDK/${"1.2.0-beta.1"}` });
2993
+ if ((wire === null || wire === void 0 ? void 0 : wire.userAgent) !== false) put({ "User-Agent": (wire === null || wire === void 0 ? void 0 : wire.userAgent) ?? `GalaChain-SDK/${"1.2.0-beta.2"}` });
2957
2994
  put(parts.defaults);
2958
2995
  put(wire === null || wire === void 0 ? void 0 : wire.headers);
2959
2996
  if (parts.json === true && !entries.has("content-type")) put({ "Content-Type": "application/json" });
@@ -5507,6 +5544,7 @@ exports.BRIDGE_NETWORKS = BRIDGE_NETWORKS;
5507
5544
  exports.BRIDGE_OUT_STEPS = BRIDGE_OUT_STEPS;
5508
5545
  exports.BrowserWalletSigner = BrowserWalletSigner;
5509
5546
  exports.CHAIN_CONTRACT_OPERATION_PREFIXES = CHAIN_CONTRACT_OPERATION_PREFIXES;
5547
+ exports.CHAIN_METHOD_OPERATIONS = CHAIN_METHOD_OPERATIONS;
5510
5548
  exports.DEFAULT_UNIQUE_KEY_PREFIX = DEFAULT_UNIQUE_KEY_PREFIX;
5511
5549
  exports.EIP712_CAPABLE_METHODS = EIP712_CAPABLE_METHODS;
5512
5550
  exports.FAILURE_OUTCOMES = FAILURE_OUTCOMES;