@gala-chain/gala-core-sdk 1.2.0-beta.1 → 1.2.0-beta.3
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.
- package/README.md +1 -1
- package/dist/bridge.cjs +1 -11
- package/dist/bridge.cjs.map +1 -1
- package/dist/bridge.mjs +1 -11
- package/dist/bridge.mjs.map +1 -1
- package/dist/browser/bridge.js +1 -1
- package/dist/browser/bridge.js.map +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/reads/nft_collections.js +1 -1
- package/dist/browser/reads/nft_collections.js.map +1 -1
- package/dist/browser/utils/dto_operation.js +1 -1
- package/dist/browser/utils/dto_operation.js.map +1 -1
- package/dist/browser/utils/transport.js +1 -1
- package/dist/browser/version.js +1 -1
- package/dist/browser/version.js.map +1 -1
- package/dist/browser/writes/identity.js +1 -1
- package/dist/browser/writes/identity.js.map +1 -1
- package/dist/index.cjs +58 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -4
- package/dist/index.d.ts +38 -4
- package/dist/index.mjs +58 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1800,8 +1800,8 @@ export declare function signTypedDataPayload(privateKey: PrivateKeyInput, payloa
|
|
|
1800
1800
|
* `dtoOperationMap` (the `dtoOperation` / API path table of the GalaChain platform team,
|
|
1801
1801
|
* 2026-10-27). The chain refuses a signed DTO whose `dtoOperation` is not exactly the operation it
|
|
1802
1802
|
* is called through ("The dto was signed to call X operation, but the current operation is Y"), so
|
|
1803
|
-
* the URL a write is POSTed to and the `dtoOperation` it carries both come from this one table
|
|
1804
|
-
*
|
|
1803
|
+
* the URL a write is POSTed to and the `dtoOperation` it carries both come from this one table
|
|
1804
|
+
* (the platform's rows, plus the chain's own deviations in `CHAIN_METHOD_OPERATIONS`).
|
|
1805
1805
|
*
|
|
1806
1806
|
* `dtoOperation` is a SIGNED field: it is part of the DTO before the signer sees it, never added by
|
|
1807
1807
|
* a signer or after the signature.
|
|
@@ -1870,10 +1870,37 @@ export declare const CHAIN_CONTRACT_OPERATION_PREFIXES: {
|
|
|
1870
1870
|
readonly 'vox/vox-contract': 'vox_vox_VOXTokenContract';
|
|
1871
1871
|
readonly 'vox/resources-contract': 'vox_vox_VOXResourceToken';
|
|
1872
1872
|
};
|
|
1873
|
+
/**
|
|
1874
|
+
* Where the chain enforces an operation other than the platform table's, keyed `<contract path>:<method>`. The ONE
|
|
1875
|
+
* place such a deviation lives: every consumer (core's bridge-out signing, the wrap flow, Connect, the product SDKs)
|
|
1876
|
+
* asks `dtoOperationOf`, so nobody hard-codes the exception.
|
|
1877
|
+
*
|
|
1878
|
+
* - `RequestTokenBridgeOut`: the table maps `asset/bridge-contract` to bridge-chaincode, but a RequestTokenBridgeOut
|
|
1879
|
+
* is a TOKEN contract call. Verified on stage (2026-11-02): signed under
|
|
1880
|
+
* `asset-channel_bridge-chaincode_BridgeContract:RequestTokenBridgeOut` the chain answers "signed to call ...
|
|
1881
|
+
* BridgeContract:RequestTokenBridgeOut, but the current operation is
|
|
1882
|
+
* asset-channel_basic-asset_GalaChainToken:RequestTokenBridgeOut", and it accepts the token contract's.
|
|
1883
|
+
* - `GrantAllowance`: the grants embedded in a `BridgeTokenOut` are signed as
|
|
1884
|
+
* `asset-channel_bridge-chaincode_GalaChainToken:GrantAllowance`, which the table has no row for. Observed in
|
|
1885
|
+
* GalaConnect-signed stage traffic and verified against the chain with real signed writes (2026-11-05):
|
|
1886
|
+
* a bridge-out with the grants signed this way is accepted, the same DTO with the grants signed as
|
|
1887
|
+
* `BridgeContract:GrantAllowance` or `basic-asset_GalaChainToken:GrantAllowance` is refused at batch index 0. A
|
|
1888
|
+
* standalone GrantAllowance is a different route and keeps `basic-asset_GalaChainToken`. This SDK does not sign
|
|
1889
|
+
* the embedded grant itself.
|
|
1890
|
+
*
|
|
1891
|
+
* `asset/bridge-contract:BridgeTokenOut` is NOT here: the table's `BridgeContract:BridgeTokenOut` is accepted by the
|
|
1892
|
+
* chain for the external-chain bridge (verified 2026-11-05). The token contracts' own `BridgeTokenOut`
|
|
1893
|
+
* (`asset/token-contract`, `music/token-contract`, the channel move) is their plain prefix.
|
|
1894
|
+
*/
|
|
1895
|
+
export declare const CHAIN_METHOD_OPERATIONS: {
|
|
1896
|
+
readonly 'asset/bridge-contract:RequestTokenBridgeOut': 'asset-channel_basic-asset_GalaChainToken:RequestTokenBridgeOut';
|
|
1897
|
+
readonly 'asset/bridge-contract:GrantAllowance': 'asset-channel_bridge-chaincode_GalaChainToken:GrantAllowance';
|
|
1898
|
+
};
|
|
1873
1899
|
/** An API path of a GalaChain contract (`asset/token-contract`, `asset/dex-contract`, ...). */
|
|
1874
1900
|
type ChainContractPath = keyof typeof CHAIN_CONTRACT_OPERATION_PREFIXES;
|
|
1875
1901
|
/**
|
|
1876
|
-
* The `dtoOperation` of `method` on the contract served at `contractPath
|
|
1902
|
+
* The `dtoOperation` of `method` on the contract served at `contractPath`: the chain's own
|
|
1903
|
+
* (`CHAIN_METHOD_OPERATIONS`) where it deviates from the platform table, else the table's prefix plus `:<method>`.
|
|
1877
1904
|
*
|
|
1878
1905
|
* `ChainContractPath` is only a type: a plain-JS caller, or a path built at runtime
|
|
1879
1906
|
* (`${channel}/${contract}`), can name a contract the table does not have. That is refused here, before
|
|
@@ -2946,7 +2973,9 @@ export declare class GatewayWrites {
|
|
|
2946
2973
|
* - `eth|0x<hex>` is NOT an address form: an `eth|` reference is followed by the digits alone.
|
|
2947
2974
|
* It is refused before anything is signed or sent (see {@link assertNoEthZeroXPrefix}). A bare
|
|
2948
2975
|
* `0x<40 hex>` is an ordinary Ethereum address and is converted to `eth|<EIP-55 digits>`.
|
|
2949
|
-
* - `client|<id>` (`A-Za-z0-9_-`): a GalaChain alias, kept exactly as written.
|
|
2976
|
+
* - `client|<id>` (`A-Za-z0-9_-`): a GalaChain alias, kept exactly as written after the scheme.
|
|
2977
|
+
* - The scheme (before the first `|`) is accepted in any case and sent lower case (`Client|X` -> `client|X`,
|
|
2978
|
+
* `ETH|<hex>` -> `eth|<hex>`); everything after the `|` keeps its case.
|
|
2950
2979
|
*
|
|
2951
2980
|
* Anything else is refused before anything is signed or sent (fail closed): an unknown spelling
|
|
2952
2981
|
* could name an account nobody holds.
|
|
@@ -3340,6 +3369,11 @@ export declare class NftCollectionReads {
|
|
|
3340
3369
|
private readonly reads;
|
|
3341
3370
|
constructor(reads: GatewayReads);
|
|
3342
3371
|
fetchNftCollections(walletAddress: string): Promise<NftCollectionAuthorization[]>;
|
|
3372
|
+
/**
|
|
3373
|
+
* Whether a collection name can still be claimed. The chain owns uniqueness and compares names
|
|
3374
|
+
* case-insensitively (`COLLECTION_NAME_ALREADY_CLAIMED` for `abc` once `ABC` is claimed), so
|
|
3375
|
+
* so does this check: a case-sensitive one reports a refused name as free.
|
|
3376
|
+
*/
|
|
3343
3377
|
isNftCollectionAvailable(name: string): Promise<boolean>;
|
|
3344
3378
|
fetchNftTokenClasses(params: FetchNftTokenClassesParams): Promise<NftTokenClassWithSupply[]>;
|
|
3345
3379
|
fetchNftBalances(ownerAddress: string, collectionFilter?: string): Promise<NftBalance[]>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1800,8 +1800,8 @@ export declare function signTypedDataPayload(privateKey: PrivateKeyInput, payloa
|
|
|
1800
1800
|
* `dtoOperationMap` (the `dtoOperation` / API path table of the GalaChain platform team,
|
|
1801
1801
|
* 2026-10-27). The chain refuses a signed DTO whose `dtoOperation` is not exactly the operation it
|
|
1802
1802
|
* is called through ("The dto was signed to call X operation, but the current operation is Y"), so
|
|
1803
|
-
* the URL a write is POSTed to and the `dtoOperation` it carries both come from this one table
|
|
1804
|
-
*
|
|
1803
|
+
* the URL a write is POSTed to and the `dtoOperation` it carries both come from this one table
|
|
1804
|
+
* (the platform's rows, plus the chain's own deviations in `CHAIN_METHOD_OPERATIONS`).
|
|
1805
1805
|
*
|
|
1806
1806
|
* `dtoOperation` is a SIGNED field: it is part of the DTO before the signer sees it, never added by
|
|
1807
1807
|
* a signer or after the signature.
|
|
@@ -1870,10 +1870,37 @@ export declare const CHAIN_CONTRACT_OPERATION_PREFIXES: {
|
|
|
1870
1870
|
readonly 'vox/vox-contract': 'vox_vox_VOXTokenContract';
|
|
1871
1871
|
readonly 'vox/resources-contract': 'vox_vox_VOXResourceToken';
|
|
1872
1872
|
};
|
|
1873
|
+
/**
|
|
1874
|
+
* Where the chain enforces an operation other than the platform table's, keyed `<contract path>:<method>`. The ONE
|
|
1875
|
+
* place such a deviation lives: every consumer (core's bridge-out signing, the wrap flow, Connect, the product SDKs)
|
|
1876
|
+
* asks `dtoOperationOf`, so nobody hard-codes the exception.
|
|
1877
|
+
*
|
|
1878
|
+
* - `RequestTokenBridgeOut`: the table maps `asset/bridge-contract` to bridge-chaincode, but a RequestTokenBridgeOut
|
|
1879
|
+
* is a TOKEN contract call. Verified on stage (2026-11-02): signed under
|
|
1880
|
+
* `asset-channel_bridge-chaincode_BridgeContract:RequestTokenBridgeOut` the chain answers "signed to call ...
|
|
1881
|
+
* BridgeContract:RequestTokenBridgeOut, but the current operation is
|
|
1882
|
+
* asset-channel_basic-asset_GalaChainToken:RequestTokenBridgeOut", and it accepts the token contract's.
|
|
1883
|
+
* - `GrantAllowance`: the grants embedded in a `BridgeTokenOut` are signed as
|
|
1884
|
+
* `asset-channel_bridge-chaincode_GalaChainToken:GrantAllowance`, which the table has no row for. Observed in
|
|
1885
|
+
* GalaConnect-signed stage traffic and verified against the chain with real signed writes (2026-11-05):
|
|
1886
|
+
* a bridge-out with the grants signed this way is accepted, the same DTO with the grants signed as
|
|
1887
|
+
* `BridgeContract:GrantAllowance` or `basic-asset_GalaChainToken:GrantAllowance` is refused at batch index 0. A
|
|
1888
|
+
* standalone GrantAllowance is a different route and keeps `basic-asset_GalaChainToken`. This SDK does not sign
|
|
1889
|
+
* the embedded grant itself.
|
|
1890
|
+
*
|
|
1891
|
+
* `asset/bridge-contract:BridgeTokenOut` is NOT here: the table's `BridgeContract:BridgeTokenOut` is accepted by the
|
|
1892
|
+
* chain for the external-chain bridge (verified 2026-11-05). The token contracts' own `BridgeTokenOut`
|
|
1893
|
+
* (`asset/token-contract`, `music/token-contract`, the channel move) is their plain prefix.
|
|
1894
|
+
*/
|
|
1895
|
+
export declare const CHAIN_METHOD_OPERATIONS: {
|
|
1896
|
+
readonly 'asset/bridge-contract:RequestTokenBridgeOut': 'asset-channel_basic-asset_GalaChainToken:RequestTokenBridgeOut';
|
|
1897
|
+
readonly 'asset/bridge-contract:GrantAllowance': 'asset-channel_bridge-chaincode_GalaChainToken:GrantAllowance';
|
|
1898
|
+
};
|
|
1873
1899
|
/** An API path of a GalaChain contract (`asset/token-contract`, `asset/dex-contract`, ...). */
|
|
1874
1900
|
type ChainContractPath = keyof typeof CHAIN_CONTRACT_OPERATION_PREFIXES;
|
|
1875
1901
|
/**
|
|
1876
|
-
* The `dtoOperation` of `method` on the contract served at `contractPath
|
|
1902
|
+
* The `dtoOperation` of `method` on the contract served at `contractPath`: the chain's own
|
|
1903
|
+
* (`CHAIN_METHOD_OPERATIONS`) where it deviates from the platform table, else the table's prefix plus `:<method>`.
|
|
1877
1904
|
*
|
|
1878
1905
|
* `ChainContractPath` is only a type: a plain-JS caller, or a path built at runtime
|
|
1879
1906
|
* (`${channel}/${contract}`), can name a contract the table does not have. That is refused here, before
|
|
@@ -2946,7 +2973,9 @@ export declare class GatewayWrites {
|
|
|
2946
2973
|
* - `eth|0x<hex>` is NOT an address form: an `eth|` reference is followed by the digits alone.
|
|
2947
2974
|
* It is refused before anything is signed or sent (see {@link assertNoEthZeroXPrefix}). A bare
|
|
2948
2975
|
* `0x<40 hex>` is an ordinary Ethereum address and is converted to `eth|<EIP-55 digits>`.
|
|
2949
|
-
* - `client|<id>` (`A-Za-z0-9_-`): a GalaChain alias, kept exactly as written.
|
|
2976
|
+
* - `client|<id>` (`A-Za-z0-9_-`): a GalaChain alias, kept exactly as written after the scheme.
|
|
2977
|
+
* - The scheme (before the first `|`) is accepted in any case and sent lower case (`Client|X` -> `client|X`,
|
|
2978
|
+
* `ETH|<hex>` -> `eth|<hex>`); everything after the `|` keeps its case.
|
|
2950
2979
|
*
|
|
2951
2980
|
* Anything else is refused before anything is signed or sent (fail closed): an unknown spelling
|
|
2952
2981
|
* could name an account nobody holds.
|
|
@@ -3340,6 +3369,11 @@ export declare class NftCollectionReads {
|
|
|
3340
3369
|
private readonly reads;
|
|
3341
3370
|
constructor(reads: GatewayReads);
|
|
3342
3371
|
fetchNftCollections(walletAddress: string): Promise<NftCollectionAuthorization[]>;
|
|
3372
|
+
/**
|
|
3373
|
+
* Whether a collection name can still be claimed. The chain owns uniqueness and compares names
|
|
3374
|
+
* case-insensitively (`COLLECTION_NAME_ALREADY_CLAIMED` for `abc` once `ABC` is claimed), so
|
|
3375
|
+
* so does this check: a case-sensitive one reports a refused name as free.
|
|
3376
|
+
*/
|
|
3343
3377
|
isNftCollectionAvailable(name: string): Promise<boolean>;
|
|
3344
3378
|
fetchNftTokenClasses(params: FetchNftTokenClassesParams): Promise<NftTokenClassWithSupply[]>;
|
|
3345
3379
|
fetchNftBalances(ownerAddress: string, collectionFilter?: string): Promise<NftBalance[]>;
|
package/dist/index.mjs
CHANGED
|
@@ -1217,6 +1217,15 @@ const CLIENT_ALIAS = /^client\|[A-Za-z0-9_-]+$/u;
|
|
|
1217
1217
|
/** `eth|0x...`: not a user reference. An `eth|` reference is followed by the digits alone. */
|
|
1218
1218
|
const ETH_WITH_0X = /^eth\|0[xX](.*)$/su;
|
|
1219
1219
|
/**
|
|
1220
|
+
* `value` with the part before its first `|` lower-cased and everything after it exactly as written (a value with no
|
|
1221
|
+
* `|` is returned as is): `Client|X` is the account `client|X`, `ETH|<hex>` is `eth|<hex>`. The scheme is
|
|
1222
|
+
* case-insensitive, an alias id is not (launchpad-sdk's `userRef` follows the same rule).
|
|
1223
|
+
*/
|
|
1224
|
+
function lowerScheme(value) {
|
|
1225
|
+
const pipe = value.indexOf("|");
|
|
1226
|
+
return pipe < 0 ? value : `${value.slice(0, pipe).toLowerCase()}${value.slice(pipe)}`;
|
|
1227
|
+
}
|
|
1228
|
+
/**
|
|
1220
1229
|
* Refuses `eth|0x...` (any digits, any casing of the `0x`) with `INVALID_ETH_USER_REF_PREFIX`,
|
|
1221
1230
|
* naming the correct spelling. `eth|0x...` is not an address form: GalaChain's `eth|` reference is
|
|
1222
1231
|
* followed by the 40 hex digits only. A bare `0x<40 hex>` is a different, normal thing (an
|
|
@@ -1228,7 +1237,7 @@ const ETH_WITH_0X = /^eth\|0[xX](.*)$/su;
|
|
|
1228
1237
|
function assertNoEthZeroXPrefix(value, field) {
|
|
1229
1238
|
var _ETH_WITH_0X$exec;
|
|
1230
1239
|
if (typeof value !== "string") return;
|
|
1231
|
-
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];
|
|
1240
|
+
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];
|
|
1232
1241
|
if (rest === void 0) return;
|
|
1233
1242
|
const checksummed = /^[0-9a-fA-F]{40}$/u.test(rest) ? checksumEthereumAddress(rest) : void 0;
|
|
1234
1243
|
throw new GalaSDKError("INVALID_ETH_USER_REF_PREFIX", {
|
|
@@ -1250,7 +1259,9 @@ function assertNoEthZeroXPrefix(value, field) {
|
|
|
1250
1259
|
* - `eth|0x<hex>` is NOT an address form: an `eth|` reference is followed by the digits alone.
|
|
1251
1260
|
* It is refused before anything is signed or sent (see {@link assertNoEthZeroXPrefix}). A bare
|
|
1252
1261
|
* `0x<40 hex>` is an ordinary Ethereum address and is converted to `eth|<EIP-55 digits>`.
|
|
1253
|
-
* - `client|<id>` (`A-Za-z0-9_-`): a GalaChain alias, kept exactly as written.
|
|
1262
|
+
* - `client|<id>` (`A-Za-z0-9_-`): a GalaChain alias, kept exactly as written after the scheme.
|
|
1263
|
+
* - The scheme (before the first `|`) is accepted in any case and sent lower case (`Client|X` -> `client|X`,
|
|
1264
|
+
* `ETH|<hex>` -> `eth|<hex>`); everything after the `|` keeps its case.
|
|
1254
1265
|
*
|
|
1255
1266
|
* Anything else is refused before anything is signed or sent (fail closed): an unknown spelling
|
|
1256
1267
|
* could name an account nobody holds.
|
|
@@ -1262,8 +1273,9 @@ function galaChainUserRef(value, field) {
|
|
|
1262
1273
|
assertNoEthZeroXPrefix(value, field);
|
|
1263
1274
|
if (typeof value === "string") {
|
|
1264
1275
|
var _ACCOUNT$exec;
|
|
1265
|
-
|
|
1266
|
-
|
|
1276
|
+
const spelled = lowerScheme(value);
|
|
1277
|
+
if (CLIENT_ALIAS.test(spelled)) return spelled;
|
|
1278
|
+
const digits = (_ACCOUNT$exec = ACCOUNT.exec(spelled)) === null || _ACCOUNT$exec === void 0 ? void 0 : _ACCOUNT$exec[1];
|
|
1267
1279
|
const account = digits === void 0 ? void 0 : checksumEthereumAddress(digits);
|
|
1268
1280
|
if (account !== void 0) return `eth|${account.slice(2)}`;
|
|
1269
1281
|
}
|
|
@@ -2566,8 +2578,8 @@ async function signTypedDataPayload(privateKey, payload) {
|
|
|
2566
2578
|
* `dtoOperationMap` (the `dtoOperation` / API path table of the GalaChain platform team,
|
|
2567
2579
|
* 2026-10-27). The chain refuses a signed DTO whose `dtoOperation` is not exactly the operation it
|
|
2568
2580
|
* is called through ("The dto was signed to call X operation, but the current operation is Y"), so
|
|
2569
|
-
* the URL a write is POSTed to and the `dtoOperation` it carries both come from this one table
|
|
2570
|
-
*
|
|
2581
|
+
* the URL a write is POSTed to and the `dtoOperation` it carries both come from this one table
|
|
2582
|
+
* (the platform's rows, plus the chain's own deviations in `CHAIN_METHOD_OPERATIONS`).
|
|
2571
2583
|
*
|
|
2572
2584
|
* `dtoOperation` is a SIGNED field: it is part of the DTO before the signer sees it, never added by
|
|
2573
2585
|
* a signer or after the signature.
|
|
@@ -2637,7 +2649,34 @@ const CHAIN_CONTRACT_OPERATION_PREFIXES = {
|
|
|
2637
2649
|
"vox/resources-contract": "vox_vox_VOXResourceToken"
|
|
2638
2650
|
};
|
|
2639
2651
|
/**
|
|
2640
|
-
*
|
|
2652
|
+
* Where the chain enforces an operation other than the platform table's, keyed `<contract path>:<method>`. The ONE
|
|
2653
|
+
* place such a deviation lives: every consumer (core's bridge-out signing, the wrap flow, Connect, the product SDKs)
|
|
2654
|
+
* asks `dtoOperationOf`, so nobody hard-codes the exception.
|
|
2655
|
+
*
|
|
2656
|
+
* - `RequestTokenBridgeOut`: the table maps `asset/bridge-contract` to bridge-chaincode, but a RequestTokenBridgeOut
|
|
2657
|
+
* is a TOKEN contract call. Verified on stage (2026-11-02): signed under
|
|
2658
|
+
* `asset-channel_bridge-chaincode_BridgeContract:RequestTokenBridgeOut` the chain answers "signed to call ...
|
|
2659
|
+
* BridgeContract:RequestTokenBridgeOut, but the current operation is
|
|
2660
|
+
* asset-channel_basic-asset_GalaChainToken:RequestTokenBridgeOut", and it accepts the token contract's.
|
|
2661
|
+
* - `GrantAllowance`: the grants embedded in a `BridgeTokenOut` are signed as
|
|
2662
|
+
* `asset-channel_bridge-chaincode_GalaChainToken:GrantAllowance`, which the table has no row for. Observed in
|
|
2663
|
+
* GalaConnect-signed stage traffic and verified against the chain with real signed writes (2026-11-05):
|
|
2664
|
+
* a bridge-out with the grants signed this way is accepted, the same DTO with the grants signed as
|
|
2665
|
+
* `BridgeContract:GrantAllowance` or `basic-asset_GalaChainToken:GrantAllowance` is refused at batch index 0. A
|
|
2666
|
+
* standalone GrantAllowance is a different route and keeps `basic-asset_GalaChainToken`. This SDK does not sign
|
|
2667
|
+
* the embedded grant itself.
|
|
2668
|
+
*
|
|
2669
|
+
* `asset/bridge-contract:BridgeTokenOut` is NOT here: the table's `BridgeContract:BridgeTokenOut` is accepted by the
|
|
2670
|
+
* chain for the external-chain bridge (verified 2026-11-05). The token contracts' own `BridgeTokenOut`
|
|
2671
|
+
* (`asset/token-contract`, `music/token-contract`, the channel move) is their plain prefix.
|
|
2672
|
+
*/
|
|
2673
|
+
const CHAIN_METHOD_OPERATIONS = {
|
|
2674
|
+
"asset/bridge-contract:RequestTokenBridgeOut": "asset-channel_basic-asset_GalaChainToken:RequestTokenBridgeOut",
|
|
2675
|
+
"asset/bridge-contract:GrantAllowance": "asset-channel_bridge-chaincode_GalaChainToken:GrantAllowance"
|
|
2676
|
+
};
|
|
2677
|
+
/**
|
|
2678
|
+
* The `dtoOperation` of `method` on the contract served at `contractPath`: the chain's own
|
|
2679
|
+
* (`CHAIN_METHOD_OPERATIONS`) where it deviates from the platform table, else the table's prefix plus `:<method>`.
|
|
2641
2680
|
*
|
|
2642
2681
|
* `ChainContractPath` is only a type: a plain-JS caller, or a path built at runtime
|
|
2643
2682
|
* (`${channel}/${contract}`), can name a contract the table does not have. That is refused here, before
|
|
@@ -2647,6 +2686,8 @@ const CHAIN_CONTRACT_OPERATION_PREFIXES = {
|
|
|
2647
2686
|
* @throws GalaSDKError SIGNING_FAILED when `contractPath` is not in the table.
|
|
2648
2687
|
*/
|
|
2649
2688
|
function dtoOperationOf(contractPath, method) {
|
|
2689
|
+
const methodKey = `${contractPath}:${method}`;
|
|
2690
|
+
if (Object.prototype.hasOwnProperty.call(CHAIN_METHOD_OPERATIONS, methodKey)) return CHAIN_METHOD_OPERATIONS[methodKey];
|
|
2650
2691
|
const prefix = Object.prototype.hasOwnProperty.call(CHAIN_CONTRACT_OPERATION_PREFIXES, contractPath) ? CHAIN_CONTRACT_OPERATION_PREFIXES[contractPath] : void 0;
|
|
2651
2692
|
if (prefix === void 0) throw new GalaSDKError("SIGNING_FAILED", {
|
|
2652
2693
|
method,
|
|
@@ -2863,7 +2904,7 @@ async function signPreSendFor(signer, contractPath, method, dto) {
|
|
|
2863
2904
|
* fallback. It is the version in the default `User-Agent` (`GalaChain-SDK/<version>`) of every SDK
|
|
2864
2905
|
* request, whichever product SDK sends it.
|
|
2865
2906
|
*/
|
|
2866
|
-
const GALA_CORE_SDK_VERSION = "1.2.0-beta.
|
|
2907
|
+
const GALA_CORE_SDK_VERSION = "1.2.0-beta.3";
|
|
2867
2908
|
|
|
2868
2909
|
//#endregion
|
|
2869
2910
|
//#region src/utils/transport.ts
|
|
@@ -2924,7 +2965,7 @@ function buildRequestHeaders(wire, parts = {}) {
|
|
|
2924
2965
|
entries.set(name.toLowerCase(), [name, value]);
|
|
2925
2966
|
}
|
|
2926
2967
|
};
|
|
2927
|
-
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.
|
|
2968
|
+
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.3"}` });
|
|
2928
2969
|
put(parts.defaults);
|
|
2929
2970
|
put(wire === null || wire === void 0 ? void 0 : wire.headers);
|
|
2930
2971
|
if (parts.json === true && !entries.has("content-type")) put({ "Content-Type": "application/json" });
|
|
@@ -5379,9 +5420,14 @@ var NftCollectionReads = class {
|
|
|
5379
5420
|
collection: row.collection
|
|
5380
5421
|
}));
|
|
5381
5422
|
}
|
|
5423
|
+
/**
|
|
5424
|
+
* Whether a collection name can still be claimed. The chain owns uniqueness and compares names
|
|
5425
|
+
* case-insensitively (`COLLECTION_NAME_ALREADY_CLAIMED` for `abc` once `ABC` is claimed), so
|
|
5426
|
+
* so does this check: a case-sensitive one reports a refused name as free.
|
|
5427
|
+
*/
|
|
5382
5428
|
async isNftCollectionAvailable(name) {
|
|
5383
|
-
const collection = collectionName(name, "collection");
|
|
5384
|
-
return !(await this.reads.fetchAllNftCollectionAuthorizations({ pageSize: 1e3 })).some((row) => row.collection === collection);
|
|
5429
|
+
const collection = collectionName(name, "collection").toLowerCase();
|
|
5430
|
+
return !(await this.reads.fetchAllNftCollectionAuthorizations({ pageSize: 1e3 })).some((row) => row.collection.toLowerCase() === collection);
|
|
5385
5431
|
}
|
|
5386
5432
|
async fetchNftTokenClasses(params) {
|
|
5387
5433
|
collectionName(params.collection, "collection");
|
|
@@ -5472,5 +5518,5 @@ const GALA_CHAIN_ENVIRONMENTS = Object.freeze({
|
|
|
5472
5518
|
});
|
|
5473
5519
|
|
|
5474
5520
|
//#endregion
|
|
5475
|
-
export { BRIDGE_AMOUNT_PROBLEMS, BRIDGE_DEPOSIT_STEPS, BRIDGE_NETWORKS, BRIDGE_OUT_STEPS, BrowserWalletSigner, CHAIN_CONTRACT_OPERATION_PREFIXES, DEFAULT_UNIQUE_KEY_PREFIX, EIP712_CAPABLE_METHODS, FAILURE_OUTCOMES, GALA_CHAIN_ENVIRONMENTS, GALA_CORE_SDK_VERSION, GALA_ERROR_CATALOG, GALA_ERROR_PHASES, GALA_ERROR_PHASE_BY_CODE, GALA_TOKEN_CLASS_KEY, GATEWAY_READS_OPTIONS, GATEWAY_READ_LIMITS, GATEWAY_READ_METHODS, GATEWAY_WRITES_OPTIONS, GATEWAY_WRITE_BATCH_LIMITS, GATEWAY_WRITE_METHODS, GATEWAY_WRITE_OUTCOME_UNKNOWN_REASONS, GalaSDKError, GalaWalletSigner, GatewayReads, GatewayWrites, INVALID_NFT_INPUT_REASONS, INVALID_PRIVATE_KEY_REASONS, INVALID_TOKEN_REFERENCE_REASONS, NFT_DEFAULT_ADDITIONAL_KEY, NFT_MINT_LIMIT, NFT_WRITE_METHODS, NftCollectionReads, PAGE_REQUEST_FIELDS, PrivateKeySigner, SIGNING_FAILURE_REASONS, WALLET_CONNECTION_FAILURE_REASONS, WALLET_INPUT_PROBLEMS, WALLET_NOT_CONNECTED_REASONS, WALLET_PROVIDER_CONFIG_MISSING, WRAP_DIRECTIONS, WRAP_REFUSAL_REASONS, armTimeout, assertUniqueKey, buildEIP712Payload, buildQueryString, buildRequestHeaders, calculatePersonalSignPrefix, canonicalDecimalString, checksumEthereumAddress, compositeKeyOf, createLazyPrivateKeySigner, createUniqueKey, createWallet, dtoOperationOf, eip1193ProviderFromEthers, eip712DomainFor, estimateNftOperationFees, ethAddressOfPrivateKey, ethereumAddressOfAccount, fetchRequestor, fixpointPrefixFor, galaChainUserRef, galaErrorTemplates, generateEIP712Types, getEthereumAddressFromPrivateKey, getNftCollectionClaimFee, getNftTokenClassCreateFee, getPayloadToSign, getPublicKeyFromPrivateKey, hasGalaErrorBrand, hashTypedData, httpRequestorFromAxios, isFetchTransportFailure, isGalaCatalogCode, isGalaError, isGalaErrorLike, isTokenClassKey, isValidUniqueKey, isWalletUserRejection, isWriteView, normalizePrivateKey, numberParamOf, parseJson, personalSignPrefixFor, readBlockNumberHeader, readHeader, readResponseBody, readRetryAfter, renderGalaErrorTemplate, requestWithTimeout, resolvePersonalSignChainDtoPayload, resolveUniqueKeyPrefix, serialize, signChainDtoHash, signChainDtoNative, signChainDtoPersonalSign, signNative, signPersonalMessage, signPreSend, signPreSendFor, signRawObject, signSerializedNative, signTypedDataPayload, splitClassKey, stringParamOf, stripEip712DomainType, templatePlaceholders, toFailureView, tokenClassDollarKey, tokenDetailsOf, tryParseCompositeKey, tryParseTokenClassKey, validateTimeoutMs, validateWalletInput, walletDeclineCode, withDtoOperation, withGalaWalletIdentity, withPrivateKey };
|
|
5521
|
+
export { BRIDGE_AMOUNT_PROBLEMS, BRIDGE_DEPOSIT_STEPS, BRIDGE_NETWORKS, BRIDGE_OUT_STEPS, BrowserWalletSigner, CHAIN_CONTRACT_OPERATION_PREFIXES, CHAIN_METHOD_OPERATIONS, DEFAULT_UNIQUE_KEY_PREFIX, EIP712_CAPABLE_METHODS, FAILURE_OUTCOMES, GALA_CHAIN_ENVIRONMENTS, GALA_CORE_SDK_VERSION, GALA_ERROR_CATALOG, GALA_ERROR_PHASES, GALA_ERROR_PHASE_BY_CODE, GALA_TOKEN_CLASS_KEY, GATEWAY_READS_OPTIONS, GATEWAY_READ_LIMITS, GATEWAY_READ_METHODS, GATEWAY_WRITES_OPTIONS, GATEWAY_WRITE_BATCH_LIMITS, GATEWAY_WRITE_METHODS, GATEWAY_WRITE_OUTCOME_UNKNOWN_REASONS, GalaSDKError, GalaWalletSigner, GatewayReads, GatewayWrites, INVALID_NFT_INPUT_REASONS, INVALID_PRIVATE_KEY_REASONS, INVALID_TOKEN_REFERENCE_REASONS, NFT_DEFAULT_ADDITIONAL_KEY, NFT_MINT_LIMIT, NFT_WRITE_METHODS, NftCollectionReads, PAGE_REQUEST_FIELDS, PrivateKeySigner, SIGNING_FAILURE_REASONS, WALLET_CONNECTION_FAILURE_REASONS, WALLET_INPUT_PROBLEMS, WALLET_NOT_CONNECTED_REASONS, WALLET_PROVIDER_CONFIG_MISSING, WRAP_DIRECTIONS, WRAP_REFUSAL_REASONS, armTimeout, assertUniqueKey, buildEIP712Payload, buildQueryString, buildRequestHeaders, calculatePersonalSignPrefix, canonicalDecimalString, checksumEthereumAddress, compositeKeyOf, createLazyPrivateKeySigner, createUniqueKey, createWallet, dtoOperationOf, eip1193ProviderFromEthers, eip712DomainFor, estimateNftOperationFees, ethAddressOfPrivateKey, ethereumAddressOfAccount, fetchRequestor, fixpointPrefixFor, galaChainUserRef, galaErrorTemplates, generateEIP712Types, getEthereumAddressFromPrivateKey, getNftCollectionClaimFee, getNftTokenClassCreateFee, getPayloadToSign, getPublicKeyFromPrivateKey, hasGalaErrorBrand, hashTypedData, httpRequestorFromAxios, isFetchTransportFailure, isGalaCatalogCode, isGalaError, isGalaErrorLike, isTokenClassKey, isValidUniqueKey, isWalletUserRejection, isWriteView, normalizePrivateKey, numberParamOf, parseJson, personalSignPrefixFor, readBlockNumberHeader, readHeader, readResponseBody, readRetryAfter, renderGalaErrorTemplate, requestWithTimeout, resolvePersonalSignChainDtoPayload, resolveUniqueKeyPrefix, serialize, signChainDtoHash, signChainDtoNative, signChainDtoPersonalSign, signNative, signPersonalMessage, signPreSend, signPreSendFor, signRawObject, signSerializedNative, signTypedDataPayload, splitClassKey, stringParamOf, stripEip712DomainType, templatePlaceholders, toFailureView, tokenClassDollarKey, tokenDetailsOf, tryParseCompositeKey, tryParseTokenClassKey, validateTimeoutMs, validateWalletInput, walletDeclineCode, withDtoOperation, withGalaWalletIdentity, withPrivateKey };
|
|
5476
5522
|
//# sourceMappingURL=index.mjs.map
|