@gala-chain/gala-core-sdk 1.1.0-beta.9 → 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.
- package/README.md +48 -2
- 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/classes/error_catalog.js +1 -1
- package/dist/browser/classes/error_catalog.js.map +1 -1
- package/dist/browser/classes/error_phase_table.js +1 -1
- package/dist/browser/classes/error_phase_table.js.map +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/reads/gateway_reads.js +1 -1
- package/dist/browser/reads/nft_collections.js +2 -0
- package/dist/browser/reads/nft_collections.js.map +1 -0
- package/dist/browser/reads/nft_fees.js +2 -0
- package/dist/browser/reads/nft_fees.js.map +1 -0
- package/dist/browser/reads/request.js +1 -1
- package/dist/browser/reads/request.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/gateway_writes.js +1 -1
- package/dist/browser/writes/gateway_writes.js.map +1 -1
- package/dist/browser/writes/identity.js +1 -1
- package/dist/browser/writes/identity.js.map +1 -1
- package/dist/browser/writes/nft.js +2 -0
- package/dist/browser/writes/nft.js.map +1 -0
- package/dist/browser/writes/nft_fee.js +2 -0
- package/dist/browser/writes/nft_fee.js.map +1 -0
- package/dist/browser/writes/submit.js +1 -1
- package/dist/browser/writes/submit.js.map +1 -1
- package/dist/browser/writes/types.js.map +1 -1
- package/dist/index.cjs +761 -141
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +284 -7
- package/dist/index.d.ts +284 -7
- package/dist/index.mjs +753 -142
- package/dist/index.mjs.map +1 -1
- package/package.json +32 -30
package/dist/index.d.cts
CHANGED
|
@@ -89,6 +89,13 @@ type SigningFailureReason = (typeof SIGNING_FAILURE_REASONS)[number];
|
|
|
89
89
|
export declare const INVALID_TOKEN_REFERENCE_REASONS: readonly ['missing', 'ambiguous', 'bad_class_key', 'bad_instance'];
|
|
90
90
|
/** One member of {@link INVALID_TOKEN_REFERENCE_REASONS}. */
|
|
91
91
|
type InvalidTokenReferenceReason = (typeof INVALID_TOKEN_REFERENCE_REASONS)[number];
|
|
92
|
+
/**
|
|
93
|
+
* Why an NFT read's, write's or fee quote's input is refused (`INVALID_NFT_INPUT.params.reason`).
|
|
94
|
+
* A token for the app to map to its own text.
|
|
95
|
+
*/
|
|
96
|
+
export declare const INVALID_NFT_INPUT_REASONS: readonly ['not_a_string', 'empty', 'bad_characters', 'not_a_positive_whole_number', 'above_mint_limit', 'bad_public_key', 'bad_authorities', 'bad_collection_name'];
|
|
97
|
+
/** One member of {@link INVALID_NFT_INPUT_REASONS}. */
|
|
98
|
+
type InvalidNftInputReason = (typeof INVALID_NFT_INPUT_REASONS)[number];
|
|
92
99
|
/**
|
|
93
100
|
* The `GatewayWrites` options that are refused when missing or of the wrong type
|
|
94
101
|
* (`INVALID_WRITES_OPTION.params.option`). `walletAddress`, `requestTimeoutMs` and
|
|
@@ -621,6 +628,14 @@ export declare const GALA_ERROR_CATALOG: {
|
|
|
621
628
|
readonly valueType: 'string';
|
|
622
629
|
};
|
|
623
630
|
};
|
|
631
|
+
readonly INVALID_NFT_INPUT: {
|
|
632
|
+
readonly phase: 'pre_send';
|
|
633
|
+
readonly template: 'Invalid NFT input {field}: {reason}.';
|
|
634
|
+
readonly params: {
|
|
635
|
+
readonly field: 'string';
|
|
636
|
+
readonly reason: readonly ["not_a_string", "empty", "bad_characters", "not_a_positive_whole_number", "above_mint_limit", "bad_public_key", "bad_authorities", "bad_collection_name"];
|
|
637
|
+
};
|
|
638
|
+
};
|
|
624
639
|
readonly NO_TOKEN_NAME_RESOLVER: {
|
|
625
640
|
readonly phase: 'pre_send';
|
|
626
641
|
readonly template: 'The token name "{tokenName}" cannot be resolved: no tokenNameResolver is configured. Pass its tokenClassKey instead.';
|
|
@@ -1008,6 +1023,7 @@ export declare const GALA_ERROR_PHASE_BY_CODE: {
|
|
|
1008
1023
|
readonly INVALID_TOKEN_BATCH: 'pre_send';
|
|
1009
1024
|
readonly INVALID_LOCK_EXPIRES: 'pre_send';
|
|
1010
1025
|
readonly INVALID_LOCK_NAME: 'pre_send';
|
|
1026
|
+
readonly INVALID_NFT_INPUT: 'pre_send';
|
|
1011
1027
|
readonly NO_TOKEN_NAME_RESOLVER: 'pre_send';
|
|
1012
1028
|
readonly TOKEN_NAME_RESOLUTION_FAILED: 'pre_send';
|
|
1013
1029
|
readonly GATEWAY_WRITE_OUTCOME_UNKNOWN: 'in_flight';
|
|
@@ -1784,8 +1800,8 @@ export declare function signTypedDataPayload(privateKey: PrivateKeyInput, payloa
|
|
|
1784
1800
|
* `dtoOperationMap` (the `dtoOperation` / API path table of the GalaChain platform team,
|
|
1785
1801
|
* 2026-10-27). The chain refuses a signed DTO whose `dtoOperation` is not exactly the operation it
|
|
1786
1802
|
* is called through ("The dto was signed to call X operation, but the current operation is Y"), so
|
|
1787
|
-
* the URL a write is POSTed to and the `dtoOperation` it carries both come from this one table
|
|
1788
|
-
*
|
|
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`).
|
|
1789
1805
|
*
|
|
1790
1806
|
* `dtoOperation` is a SIGNED field: it is part of the DTO before the signer sees it, never added by
|
|
1791
1807
|
* a signer or after the signature.
|
|
@@ -1854,10 +1870,33 @@ export declare const CHAIN_CONTRACT_OPERATION_PREFIXES: {
|
|
|
1854
1870
|
readonly 'vox/vox-contract': 'vox_vox_VOXTokenContract';
|
|
1855
1871
|
readonly 'vox/resources-contract': 'vox_vox_VOXResourceToken';
|
|
1856
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; this SDK does not sign it and it was not re-verified against the chain.
|
|
1886
|
+
*
|
|
1887
|
+
* `asset/bridge-contract:BridgeTokenOut` is NOT here: the table's `BridgeContract:BridgeTokenOut` is what was seen
|
|
1888
|
+
* live on stage for the external-chain bridge (GalaConnect-signed). The token contracts' own `BridgeTokenOut`
|
|
1889
|
+
* (`asset/token-contract`, `music/token-contract`, the channel move) is their plain prefix.
|
|
1890
|
+
*/
|
|
1891
|
+
export declare const CHAIN_METHOD_OPERATIONS: {
|
|
1892
|
+
readonly 'asset/bridge-contract:RequestTokenBridgeOut': 'asset-channel_basic-asset_GalaChainToken:RequestTokenBridgeOut';
|
|
1893
|
+
readonly 'asset/bridge-contract:GrantAllowance': 'asset-channel_bridge-chaincode_GalaChainToken:GrantAllowance';
|
|
1894
|
+
};
|
|
1857
1895
|
/** An API path of a GalaChain contract (`asset/token-contract`, `asset/dex-contract`, ...). */
|
|
1858
1896
|
type ChainContractPath = keyof typeof CHAIN_CONTRACT_OPERATION_PREFIXES;
|
|
1859
1897
|
/**
|
|
1860
|
-
* The `dtoOperation` of `method` on the contract served at `contractPath
|
|
1898
|
+
* The `dtoOperation` of `method` on the contract served at `contractPath`: the chain's own
|
|
1899
|
+
* (`CHAIN_METHOD_OPERATIONS`) where it deviates from the platform table, else the table's prefix plus `:<method>`.
|
|
1861
1900
|
*
|
|
1862
1901
|
* `ChainContractPath` is only a type: a plain-JS caller, or a path built at runtime
|
|
1863
1902
|
* (`${channel}/${contract}`), can name a contract the table does not have. That is refused here, before
|
|
@@ -2649,9 +2688,9 @@ interface GatewayWritesOptions {
|
|
|
2649
2688
|
/**
|
|
2650
2689
|
* What a gateway write returns once GalaChain accepted it (`Status: 1`).
|
|
2651
2690
|
*/
|
|
2652
|
-
interface
|
|
2691
|
+
interface WriteReceipt<M extends string> {
|
|
2653
2692
|
/** The method that was submitted. */
|
|
2654
|
-
readonly method:
|
|
2693
|
+
readonly method: M;
|
|
2655
2694
|
/** The `uniqueKey` that was signed (the minted one when the caller gave none). */
|
|
2656
2695
|
readonly uniqueKey: string;
|
|
2657
2696
|
/**
|
|
@@ -2667,8 +2706,134 @@ interface GatewayWriteReceipt {
|
|
|
2667
2706
|
/** The whole parsed answer. */
|
|
2668
2707
|
readonly body: unknown;
|
|
2669
2708
|
}
|
|
2709
|
+
/** What a token write (transfer, burn, lock, unlock) returns once GalaChain accepted it. */
|
|
2710
|
+
type GatewayWriteReceipt = WriteReceipt<GatewayWriteMethod>;
|
|
2711
|
+
//#endregion
|
|
2712
|
+
//#region src/writes/nft.d.ts
|
|
2713
|
+
/**
|
|
2714
|
+
* The NFT methods of GalaChain's token contract that `GatewayWrites` signs and submits, as a closed
|
|
2715
|
+
* set: claim a collection name (`GrantNftCollectionAuthorization`), create the NFT collection's
|
|
2716
|
+
* token class (`CreateNftCollection`), mint NFTs, granting the minter its own mint allowance in
|
|
2717
|
+
* the same transaction (`MintTokenWithAllowance`) or against an allowance it already holds
|
|
2718
|
+
* (`MintToken`).
|
|
2719
|
+
*/
|
|
2720
|
+
export declare const NFT_WRITE_METHODS: readonly ['GrantNftCollectionAuthorization', 'CreateNftCollection', 'MintTokenWithAllowance', 'MintToken'];
|
|
2721
|
+
/** One member of {@link NFT_WRITE_METHODS}. */
|
|
2722
|
+
type NftWriteMethod = (typeof NFT_WRITE_METHODS)[number];
|
|
2723
|
+
/** The most NFTs one mint may create (the chain's `MintTokenDto.MAX_NFT_MINT_SIZE`). */
|
|
2724
|
+
export declare const NFT_MINT_LIMIT = 1000;
|
|
2725
|
+
/** The `additionalKey` an NFT token class carries when its creator names none (GalaChain's `none`). */
|
|
2726
|
+
export declare const NFT_DEFAULT_ADDITIONAL_KEY = "none";
|
|
2727
|
+
/** The four parts of the NFT token class a write names; `additionalKey` defaults to `none`. */
|
|
2728
|
+
interface NftTokenClassInput {
|
|
2729
|
+
/** The NFT collection name (the one claimed with `claimNftCollection`). */
|
|
2730
|
+
collection: string;
|
|
2731
|
+
/** The category of the token class. */
|
|
2732
|
+
category: string;
|
|
2733
|
+
/** The type of the token class. */
|
|
2734
|
+
type: string;
|
|
2735
|
+
/** The additional key of the token class; default `none`. */
|
|
2736
|
+
additionalKey?: string | undefined;
|
|
2737
|
+
}
|
|
2738
|
+
/** `claimNftCollection`: authorize a user to create token classes under a collection name. */
|
|
2739
|
+
interface ClaimNftCollectionInput extends WriteKeyInput {
|
|
2740
|
+
/** The collection name to claim. The chain refuses a name that is taken (case-insensitively). */
|
|
2741
|
+
collection: string;
|
|
2742
|
+
/**
|
|
2743
|
+
* Who is authorized to create the collection: a user reference in any of the forms of
|
|
2744
|
+
* `TransferGalaInput.to`; default the writer. The chain stores the authorization under the
|
|
2745
|
+
* account the reference names (an `eth|` reference becomes that account's `client|` alias).
|
|
2746
|
+
*/
|
|
2747
|
+
authorizedUser?: string | undefined;
|
|
2748
|
+
}
|
|
2749
|
+
/** `createNftCollection`: create the token class of an NFT collection the writer is authorized for. */
|
|
2750
|
+
interface CreateNftCollectionInput extends NftTokenClassInput, WriteKeyInput {
|
|
2751
|
+
/** The token class's name. */
|
|
2752
|
+
name: string;
|
|
2753
|
+
/** The token class's symbol (a string; it may be empty). */
|
|
2754
|
+
symbol: string;
|
|
2755
|
+
/** The token class's description. */
|
|
2756
|
+
description: string;
|
|
2757
|
+
/** The token class's image URL. */
|
|
2758
|
+
image: string;
|
|
2759
|
+
/**
|
|
2760
|
+
* The most NFTs that may ever exist, a positive whole number as a decimal string. Required: the
|
|
2761
|
+
* chain refuses an NFT class whose supply is unbounded ("maxSupply must be finite").
|
|
2762
|
+
*/
|
|
2763
|
+
maxSupply: string;
|
|
2764
|
+
/** The most NFTs that may be held at once, a positive whole number as a decimal string. */
|
|
2765
|
+
maxCapacity?: string | undefined;
|
|
2766
|
+
/** An optional metadata address. */
|
|
2767
|
+
metadataAddress?: string | undefined;
|
|
2768
|
+
/** An optional contract address. */
|
|
2769
|
+
contractAddress?: string | undefined;
|
|
2770
|
+
/** An optional rarity label. */
|
|
2771
|
+
rarity?: string | undefined;
|
|
2772
|
+
/**
|
|
2773
|
+
* The token authorities, as user references. Default (when omitted): the writer. They are the
|
|
2774
|
+
* accounts that may mint; naming others without the writer makes the writer unable to mint.
|
|
2775
|
+
*/
|
|
2776
|
+
authorities?: readonly string[] | undefined;
|
|
2777
|
+
}
|
|
2778
|
+
/** `mintNft`: mint NFTs of a token class the writer is a token authority of. */
|
|
2779
|
+
interface MintNftInput extends NftTokenClassInput, WriteKeyInput {
|
|
2780
|
+
/** How many NFTs to mint, a whole number from 1 to {@link NFT_MINT_LIMIT} as a decimal string. */
|
|
2781
|
+
quantity: string;
|
|
2782
|
+
/** Who receives them: a user reference; default the writer. */
|
|
2783
|
+
owner?: string | undefined;
|
|
2784
|
+
/**
|
|
2785
|
+
* `false` (default): `MintTokenWithAllowance`, which grants the writer its own mint allowance in
|
|
2786
|
+
* the same transaction. `true`: `MintToken`, which spends a mint allowance the writer already
|
|
2787
|
+
* holds and is refused (`INSUFFICIENT_MINT_ALLOWANCE`) without one.
|
|
2788
|
+
*/
|
|
2789
|
+
existingAllowance?: boolean | undefined;
|
|
2790
|
+
}
|
|
2791
|
+
/** What a claim returned: the collection and every account now authorized for it. */
|
|
2792
|
+
type ClaimNftCollectionReceipt = WriteReceipt<'GrantNftCollectionAuthorization'> & {
|
|
2793
|
+
readonly collection: string;
|
|
2794
|
+
readonly authorizedUsers: readonly string[];
|
|
2795
|
+
};
|
|
2796
|
+
/** What a create returned: the token class it created. */
|
|
2797
|
+
type CreateNftCollectionReceipt = WriteReceipt<'CreateNftCollection'> & {
|
|
2798
|
+
readonly tokenClass: Readonly<GalaChainTokenClassKey>;
|
|
2799
|
+
};
|
|
2800
|
+
/** What a mint returned: the NFT instances it created, in the chain's order. */
|
|
2801
|
+
type MintNftReceipt = WriteReceipt<'MintTokenWithAllowance' | 'MintToken'> & {
|
|
2802
|
+
readonly tokenInstances: readonly GalaChainTokenInstanceKey[];
|
|
2803
|
+
};
|
|
2804
|
+
//#endregion
|
|
2805
|
+
//#region src/writes/nft_fee.d.ts
|
|
2806
|
+
/** One fee the simulated write would pay. */
|
|
2807
|
+
interface NftFeeReceipt {
|
|
2808
|
+
/** The chain's fee code (`NftCollectionAuthorization`, `CreateNftCollection`, ...). */
|
|
2809
|
+
readonly feeCode: string;
|
|
2810
|
+
/** The fee in whole GALA, a decimal string. */
|
|
2811
|
+
readonly quantity: string;
|
|
2812
|
+
}
|
|
2813
|
+
/** What GalaChain's DryRun says a write would cost. */
|
|
2814
|
+
interface NftFeeQuote {
|
|
2815
|
+
/** The method that was simulated. */
|
|
2816
|
+
readonly method: NftWriteMethod;
|
|
2817
|
+
/** The network fee in GALA, a decimal string; `"0"` only when the chain wrote no fee receipt. */
|
|
2818
|
+
readonly fee: string;
|
|
2819
|
+
/** The fee token: always GALA. */
|
|
2820
|
+
readonly feeToken: 'GALA';
|
|
2821
|
+
/** The fees the fee is the sum of, as the chain simulated them. */
|
|
2822
|
+
readonly receipts: readonly NftFeeReceipt[];
|
|
2823
|
+
}
|
|
2670
2824
|
//#endregion
|
|
2671
2825
|
//#region src/writes/gateway_writes.d.ts
|
|
2826
|
+
/**
|
|
2827
|
+
* What `estimateNftFee` prices: the input of one NFT write, named by the write's method. It takes the
|
|
2828
|
+
* same checks as the write.
|
|
2829
|
+
*/
|
|
2830
|
+
type NftFeeRequest = ({
|
|
2831
|
+
write: 'claimNftCollection';
|
|
2832
|
+
} & ClaimNftCollectionInput) | ({
|
|
2833
|
+
write: 'createNftCollection';
|
|
2834
|
+
} & CreateNftCollectionInput) | ({
|
|
2835
|
+
write: 'mintNft';
|
|
2836
|
+
} & MintNftInput);
|
|
2672
2837
|
/**
|
|
2673
2838
|
* Signed GalaChain token-contract writes through the gateway: transfer GALA, transfer a token,
|
|
2674
2839
|
* burn, lock and unlock. React Native safe (no Node builtins, no ethers, no `@gala-chain/api`).
|
|
@@ -2735,6 +2900,51 @@ export declare class GatewayWrites {
|
|
|
2735
2900
|
* @throws GalaSDKError as {@link burnTokens}, plus `INVALID_LOCK_NAME`.
|
|
2736
2901
|
*/
|
|
2737
2902
|
unlockTokens(input: UnlockTokensInput): Promise<GatewayWriteReceipt>;
|
|
2903
|
+
/**
|
|
2904
|
+
* Claim an NFT collection name: authorize `authorizedUser` (default the writer) to create token
|
|
2905
|
+
* classes under it. The chain charges its claim fee (see {@link estimateNftFee}) and refuses a
|
|
2906
|
+
* name that is taken, whatever its casing.
|
|
2907
|
+
*
|
|
2908
|
+
* @throws GalaSDKError pre-send: `INVALID_NFT_INPUT`, `INVALID_WALLET_ADDRESS`,
|
|
2909
|
+
* `INVALID_UNIQUE_KEY`, `SIGNING_FAILED`; in flight: `GATEWAY_WRITE_OUTCOME_UNKNOWN` (check
|
|
2910
|
+
* `error.uniqueKey`; never resend under a fresh key); post-send: `GATEWAY_WRITE_REJECTED`,
|
|
2911
|
+
* `GATEWAY_HTTP_ERROR`, `GATEWAY_RESPONSE_INVALID` (also an answer for another collection).
|
|
2912
|
+
*/
|
|
2913
|
+
claimNftCollection(input: ClaimNftCollectionInput): Promise<ClaimNftCollectionReceipt>;
|
|
2914
|
+
/**
|
|
2915
|
+
* Create the token class of an NFT collection the writer is authorized for (`CreateNftCollection`).
|
|
2916
|
+
*
|
|
2917
|
+
* @throws GalaSDKError as {@link claimNftCollection}.
|
|
2918
|
+
*/
|
|
2919
|
+
createNftCollection(input: CreateNftCollectionInput): Promise<CreateNftCollectionReceipt>;
|
|
2920
|
+
/**
|
|
2921
|
+
* Mint 1 to 1000 NFTs of a token class the writer is a token authority of, to `owner` (default
|
|
2922
|
+
* the writer). The receipt lists the instances the chain created, as the chain answered them.
|
|
2923
|
+
*
|
|
2924
|
+
* @throws GalaSDKError as {@link claimNftCollection}.
|
|
2925
|
+
*/
|
|
2926
|
+
mintNft(input: MintNftInput): Promise<MintNftReceipt>;
|
|
2927
|
+
/**
|
|
2928
|
+
* What GalaChain's DryRun says an NFT write would cost, for the same input the write takes,
|
|
2929
|
+
* checked the same way, and with nothing written to the chain. The fee is the network's own
|
|
2930
|
+
* figure for this environment (it differs between stage and mainnet), never a constant.
|
|
2931
|
+
*
|
|
2932
|
+
* `callerPublicKey` is the writer's secp256k1 public key (hex): the chain's DryRun needs a caller
|
|
2933
|
+
* and a signer is not asked for its key. A write the chain would refuse (no authorization, no
|
|
2934
|
+
* balance, no mint allowance) is `GATEWAY_READ_REJECTED`, never a fee.
|
|
2935
|
+
*
|
|
2936
|
+
* @throws GalaSDKError the input checks of the write; `INVALID_NFT_INPUT` for a bad key;
|
|
2937
|
+
* `SIGNING_FAILED`; `REQUEST_TIMEOUT` / `TRANSPORT_ERROR` (`write: false`); `GATEWAY_HTTP_ERROR`;
|
|
2938
|
+
* `GATEWAY_READ_REJECTED`; `GATEWAY_READ_RESPONSE_INVALID`.
|
|
2939
|
+
*/
|
|
2940
|
+
estimateNftFee(request: NftFeeRequest, options: {
|
|
2941
|
+
readonly callerPublicKey: string;
|
|
2942
|
+
}): Promise<NftFeeQuote>;
|
|
2943
|
+
private prepareFeeRequest;
|
|
2944
|
+
/** Everything a claim needs, every input checked before the key is spent. */
|
|
2945
|
+
private prepareClaim;
|
|
2946
|
+
private prepareCreate;
|
|
2947
|
+
private prepareMint;
|
|
2738
2948
|
/** The caller's key, checked, or a fresh one. */
|
|
2739
2949
|
private uniqueKeyOf;
|
|
2740
2950
|
/** Every token and quantity of a batch write, checked synchronously, in order. */
|
|
@@ -2759,7 +2969,9 @@ export declare class GatewayWrites {
|
|
|
2759
2969
|
* - `eth|0x<hex>` is NOT an address form: an `eth|` reference is followed by the digits alone.
|
|
2760
2970
|
* It is refused before anything is signed or sent (see {@link assertNoEthZeroXPrefix}). A bare
|
|
2761
2971
|
* `0x<40 hex>` is an ordinary Ethereum address and is converted to `eth|<EIP-55 digits>`.
|
|
2762
|
-
* - `client|<id>` (`A-Za-z0-9_-`): a GalaChain alias, kept exactly as written.
|
|
2972
|
+
* - `client|<id>` (`A-Za-z0-9_-`): a GalaChain alias, kept exactly as written after the scheme.
|
|
2973
|
+
* - The scheme (before the first `|`) is accepted in any case and sent lower case (`Client|X` -> `client|X`,
|
|
2974
|
+
* `ETH|<hex>` -> `eth|<hex>`); everything after the `|` keeps its case.
|
|
2763
2975
|
*
|
|
2764
2976
|
* Anything else is refused before anything is signed or sent (fail closed): an unknown spelling
|
|
2765
2977
|
* could name an account nobody holds.
|
|
@@ -3114,6 +3326,71 @@ export declare class GatewayReads {
|
|
|
3114
3326
|
private readAllPages;
|
|
3115
3327
|
}
|
|
3116
3328
|
//#endregion
|
|
3329
|
+
//#region src/reads/nft_collections.d.ts
|
|
3330
|
+
interface NftCollectionAuthorization {
|
|
3331
|
+
authorizedUser: string;
|
|
3332
|
+
collection: string;
|
|
3333
|
+
created?: number;
|
|
3334
|
+
}
|
|
3335
|
+
interface FetchNftTokenClassesParams {
|
|
3336
|
+
collection: string;
|
|
3337
|
+
type?: string;
|
|
3338
|
+
category?: string;
|
|
3339
|
+
}
|
|
3340
|
+
interface NftTokenClassWithSupply {
|
|
3341
|
+
collection: string;
|
|
3342
|
+
type: string;
|
|
3343
|
+
category: string;
|
|
3344
|
+
additionalKey: string;
|
|
3345
|
+
totalSupply: string;
|
|
3346
|
+
maxSupply?: string;
|
|
3347
|
+
isNonFungible: boolean;
|
|
3348
|
+
name?: string;
|
|
3349
|
+
description?: string;
|
|
3350
|
+
image?: string;
|
|
3351
|
+
symbol?: string;
|
|
3352
|
+
rarity?: string;
|
|
3353
|
+
}
|
|
3354
|
+
interface NftBalance {
|
|
3355
|
+
owner: string;
|
|
3356
|
+
collection: string;
|
|
3357
|
+
category: string;
|
|
3358
|
+
type: string;
|
|
3359
|
+
additionalKey: string;
|
|
3360
|
+
instanceIds: string[];
|
|
3361
|
+
totalOwned: number;
|
|
3362
|
+
}
|
|
3363
|
+
/** NFT collection reads in Launchpad result shapes, using a shared gateway reader. */
|
|
3364
|
+
export declare class NftCollectionReads {
|
|
3365
|
+
private readonly reads;
|
|
3366
|
+
constructor(reads: GatewayReads);
|
|
3367
|
+
fetchNftCollections(walletAddress: string): Promise<NftCollectionAuthorization[]>;
|
|
3368
|
+
isNftCollectionAvailable(name: string): Promise<boolean>;
|
|
3369
|
+
fetchNftTokenClasses(params: FetchNftTokenClassesParams): Promise<NftTokenClassWithSupply[]>;
|
|
3370
|
+
fetchNftBalances(ownerAddress: string, collectionFilter?: string): Promise<NftBalance[]>;
|
|
3371
|
+
}
|
|
3372
|
+
//#endregion
|
|
3373
|
+
//#region src/reads/nft_fees.d.ts
|
|
3374
|
+
/** Fixed GalaChain NFT operation fees, denominated in GALA. */
|
|
3375
|
+
interface EstimateNftFeesParams {
|
|
3376
|
+
claimCollection?: boolean;
|
|
3377
|
+
createTokenClasses?: number;
|
|
3378
|
+
}
|
|
3379
|
+
interface NftFeeBreakdown {
|
|
3380
|
+
collectionClaim?: string;
|
|
3381
|
+
tokenClassCreate?: string;
|
|
3382
|
+
tokenClassCount?: number;
|
|
3383
|
+
mintFee?: string;
|
|
3384
|
+
}
|
|
3385
|
+
interface NftFeeEstimate {
|
|
3386
|
+
totalFee: string;
|
|
3387
|
+
breakdown: NftFeeBreakdown;
|
|
3388
|
+
}
|
|
3389
|
+
export declare function getNftCollectionClaimFee(): string;
|
|
3390
|
+
export declare function getNftTokenClassCreateFee(): string;
|
|
3391
|
+
/** Calculate the fixed fees for the requested collection and token-class operations. */
|
|
3392
|
+
export declare function estimateNftOperationFees(params: EstimateNftFeesParams): NftFeeEstimate;
|
|
3393
|
+
//#endregion
|
|
3117
3394
|
//#region src/config/environments.d.ts
|
|
3118
3395
|
/** A GalaChain deployment: `prod` (mainnet) or `stage` (testnet). */
|
|
3119
3396
|
type GalaChainEnv = 'prod' | 'stage';
|
|
@@ -3203,5 +3480,5 @@ export declare function walletDeclineCode(value: unknown): number | string | und
|
|
|
3203
3480
|
*/
|
|
3204
3481
|
export declare const GALA_CORE_SDK_VERSION: string;
|
|
3205
3482
|
//#endregion
|
|
3206
|
-
export type { AllPagesOptions, BalancesFilter, BridgeAmountProblem, BridgeDepositStep, BridgeNetwork, BridgeOutStep, BurnTokensInput, ChainContractPath, EIP712DomainValue, EIP712Types, ErrorParamsOf, FailureOutcome, FailureView, GalaChainEnv, GalaChainEnvironmentConfig, GalaChainNftCollectionAuthorization, GalaChainPage, GalaChainPublicKey, GalaChainTokenBalance, GalaChainTokenBalanceSummary, GalaChainTokenClass, GalaChainTokenDetails, GalaChainTokenHold, GalaChainTokenInstanceKey, GalaErrorCatalogEntry, GalaErrorCode, GalaErrorParamKind, GalaErrorParams, GalaErrorPhase, GalaErrorShape, GatewayReadMethod, GatewayReadsOption, GatewayReadsOptions, GatewayWriteMethod, GatewayWriteOutcomeUnknownReason, GatewayWriteReceipt, GatewayWritesOption, GatewayWritesOptions, GeneratedWallet, InvalidPrivateKeyReason, InvalidTokenReferenceReason, LockTokensInput, PageInput, PageRequestField, PersonalSignChainDtoPayload, PrivateKeyInput, PublicKeyResult, RequestHeaderParts, RequestKind, SigningFailureReason, TokenBalanceInput, TokenClassKeyInput, TokenClassesFilter, TokenNameResolver, TokenQuantityInput, TransferGalaInput, TransferTokenInput, TypedDataPayload, UnlockTokensInput, WalletConnectionFailureReason, WalletInputProblem, WalletInputValidation, WalletNotConnectedReason, WalletProviderConfigMissing, WrapDirection, WrapRefusalReason, WriteKeyInput };
|
|
3483
|
+
export type { AllPagesOptions, BalancesFilter, BridgeAmountProblem, BridgeDepositStep, BridgeNetwork, BridgeOutStep, BurnTokensInput, ChainContractPath, ClaimNftCollectionInput, ClaimNftCollectionReceipt, CreateNftCollectionInput, CreateNftCollectionReceipt, EIP712DomainValue, EIP712Types, ErrorParamsOf, EstimateNftFeesParams, FailureOutcome, FailureView, FetchNftTokenClassesParams, GalaChainEnv, GalaChainEnvironmentConfig, GalaChainNftCollectionAuthorization, GalaChainPage, GalaChainPublicKey, GalaChainTokenBalance, GalaChainTokenBalanceSummary, GalaChainTokenClass, GalaChainTokenDetails, GalaChainTokenHold, GalaChainTokenInstanceKey, GalaErrorCatalogEntry, GalaErrorCode, GalaErrorParamKind, GalaErrorParams, GalaErrorPhase, GalaErrorShape, GatewayReadMethod, GatewayReadsOption, GatewayReadsOptions, GatewayWriteMethod, GatewayWriteOutcomeUnknownReason, GatewayWriteReceipt, GatewayWritesOption, GatewayWritesOptions, GeneratedWallet, InvalidNftInputReason, InvalidPrivateKeyReason, InvalidTokenReferenceReason, LockTokensInput, MintNftInput, MintNftReceipt, NftBalance, NftCollectionAuthorization, NftFeeBreakdown, NftFeeEstimate, NftFeeQuote, NftFeeReceipt, NftFeeRequest, NftTokenClassInput, NftTokenClassWithSupply, NftWriteMethod, PageInput, PageRequestField, PersonalSignChainDtoPayload, PrivateKeyInput, PublicKeyResult, RequestHeaderParts, RequestKind, SigningFailureReason, TokenBalanceInput, TokenClassKeyInput, TokenClassesFilter, TokenNameResolver, TokenQuantityInput, TransferGalaInput, TransferTokenInput, TypedDataPayload, UnlockTokensInput, WalletConnectionFailureReason, WalletInputProblem, WalletInputValidation, WalletNotConnectedReason, WalletProviderConfigMissing, WrapDirection, WrapRefusalReason, WriteKeyInput, WriteReceipt };
|
|
3207
3484
|
//# sourceMappingURL=index.d.cts.map
|