@gala-chain/gala-core-sdk 1.0.0-rc.7 → 1.0.0

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/dist/index.d.cts CHANGED
@@ -1405,11 +1405,10 @@ export declare function createLazyPrivateKeySigner(getPrivateKey: PrivateKeyProv
1405
1405
  *
1406
1406
  * `scheme: 'personal-sign'` calls
1407
1407
  * `gala_signChainDto([serialize({ ...dto, prefix }), walletAddress, methodName])` and REQUIRES
1408
- * a wallet build that contains wallet_extension commit 34ca4e4 (strips the embedded `prefix`
1409
- * field and hashes `prefix` + the prefix-less canonical body, the chain's scheme). Wallets
1410
- * released before that fix hash the string with the `prefix` field still inside it and the
1411
- * signature recovers to an address nobody holds, so only opt in once the fixed wallet is
1412
- * released. See SIGNING-PARITY.md.
1408
+ * a Gala Wallet build that strips the embedded `prefix` field and hashes `prefix` + the
1409
+ * prefix-less canonical body (the chain's scheme). Wallet builds that predate that fix hash the
1410
+ * string with the `prefix` field still inside it and the signature recovers to an address
1411
+ * nobody holds, so only opt in once the wallet you target has the fix.
1413
1412
  */
1414
1413
  export declare class GalaWalletSigner implements GalaChainSigner {
1415
1414
  /** The wallet address supplied to Gala Wallet for each signing request. */
@@ -1428,9 +1427,9 @@ export declare class GalaWalletSigner implements GalaChainSigner {
1428
1427
  * @param walletAddress - The account passed to Gala Wallet as the signer address. An Ethereum
1429
1428
  * account is `0x` plus 40 hex digits (Gala Wallet's `eth|...` form is normalized to it and held
1430
1429
  * to the same check); a GalaChain id is `client|` plus 24 hex digits, or the bare 24 hex digits
1431
- * frontend_v2 keeps for a direct `client|` login, and is passed through unchanged.
1430
+ * a web app keeps for a direct `client|` login, and is passed through unchanged.
1432
1431
  * @param options - Select native signing (default) or personal-sign explicitly.
1433
- * `'personal-sign'` requires a Gala Wallet build with wallet_extension commit 34ca4e4.
1432
+ * `'personal-sign'` requires a Gala Wallet build that signs the bare serialized DTO.
1434
1433
  * `selectAddress` is the identity (`client|...` / `eth|...`) Gala Wallet is switched to with
1435
1434
  * `setAddress` before every signature, when the wallet offers it. `wallet` is the Gala Wallet
1436
1435
  * object to sign through (the one an EIP-6963 announcement or a wallet provider holds); without
@@ -1545,15 +1544,15 @@ export declare function calculatePersonalSignPrefix(message: string): string;
1545
1544
  */
1546
1545
  export declare function personalSignPrefixFor(dto: Record<string, unknown>): string;
1547
1546
  /**
1548
- * The `@gala-chain/connect`-style prefix frontend_v2 puts in the body of an EIP-712 write: the
1547
+ * The `@gala-chain/connect`-style prefix the gSwap web app puts in the body of an EIP-712 write: the
1549
1548
  * EIP-191 header whose number counts the prefix string ITSELF plus the body (the UTF-8 length of
1550
1549
  * `getPayloadToSign({ ...dto, prefix })`), found by fixpoint because adding the prefix changes the
1551
1550
  * length (a body of 99 bytes settles on 101).
1552
1551
  *
1553
1552
  * It is NOT a personal-sign prefix (a personal-sign write with this value recovers a phantom
1554
1553
  * signer; use `personalSignPrefixFor`). Under EIP-712 the field is an untyped extra that the
1555
- * typed-data hash ignores and defi-backend recomputes, so it only exists to keep the submitted
1556
- * body byte-identical to what frontend_v2 has always sent.
1554
+ * typed-data hash ignores and the backend recomputes, so it only exists to keep the submitted
1555
+ * body byte-identical to what the gSwap web app has always sent.
1557
1556
  */
1558
1557
  export declare function fixpointPrefixFor(dto: Record<string, unknown>): string;
1559
1558
  /**
@@ -1707,10 +1706,10 @@ interface EIP712DomainValue {
1707
1706
  chainId: number;
1708
1707
  }
1709
1708
  /**
1710
- * Builds the EIP-712 domain from the wallet's LIVE `eth_chainId` result, exactly like frontend_v2
1711
- * (DEFI-1895): a wallet hashes whatever domain it is handed, and MetaMask refuses a `chainId` that
1712
- * differs from its active network, so a hardcoded `1` breaks every wallet that is not on Mainnet.
1713
- * defi-backend recovers the signer from the `domain` the payload carries (live-proven for chain
1709
+ * Builds the EIP-712 domain from the wallet's LIVE `eth_chainId` result: a wallet hashes whatever
1710
+ * domain it is handed, and MetaMask refuses a `chainId` that differs from its active network, so
1711
+ * a hardcoded `1` breaks every wallet that is not on Mainnet.
1712
+ * The backend recovers the signer from the `domain` the payload carries (live-proven for chain
1714
1713
  * ids 1, 56 and 11155111), so following the wallet is correct on every network.
1715
1714
  *
1716
1715
  * @param chainId - The raw `eth_chainId` result: a `0x` hex string (the JSON-RPC form) or an integer.
@@ -1800,7 +1799,7 @@ export type HttpRequestor = (uri: string, options?: Parameters<typeof fetch>[1])
1800
1799
  //#region src/types/wire.d.ts
1801
1800
  /**
1802
1801
  * How the SDK writes a read request on the wire. The defaults suit a server-side caller; an app
1803
- * that already issues the same requests from its own HTTP stack (frontend_v2, the Gala Wallet)
1802
+ * that already issues the same requests from its own HTTP stack (a web app, the Gala Wallet)
1804
1803
  * sets these so the SDK's requests are indistinguishable from the ones it replaces.
1805
1804
  *
1806
1805
  * One object, carried by {@link ChainGateway}, so every service built on a gateway (symbols,
@@ -1816,7 +1815,7 @@ export interface WireOptions {
1816
1815
  * composite key such as `GALA$Unit$none$none` or `client|abc` reads as written. Everything
1817
1816
  * that would change a query's meaning (`& = # % +`, space, non-ASCII, controls) is still
1818
1817
  * percent-encoded (a space is `+`), so the server decodes exactly the value that was passed.
1819
- * This is the text frontend_v2's `formatUrl` produces for every value it can represent.
1818
+ * This is the text a hand-written `formatUrl` helper produces for every value it can represent.
1820
1819
  */
1821
1820
  queryEncoding?: 'standard' | 'readable' | undefined;
1822
1821
  /**
@@ -2072,7 +2071,7 @@ type FailureOutcome = (typeof FAILURE_OUTCOMES)[number];
2072
2071
  * A failure as a PLAIN OBJECT: the facts the SDKs' guards and classifiers (gswap-sdk's
2073
2072
  * `classifyFailure`) read, and nothing else. A real `GalaSDKError` is one (every field below is on
2074
2073
  * it, and on every product subclass); so is the wrapper an app makes from an SDK error to carry
2075
- * through its own layers (frontend_v2's `V2Failure`, the wallet's `WalletSwapError` data), which
2074
+ * through its own layers (an app's own failure class or error data), which
2076
2075
  * has a `code` and `params` but is not an `instanceof` anything the SDK owns. gswap-sdk's
2077
2076
  * `classifyFailure`, `isRelayableRefusal`, `isUnprovenAcknowledgement`, `isUninterpretedAnswer`,
2078
2077
  * `isPreSendError`, `isShadowError`, `isNoMarket` and `mayHaveBeenQueued` all accept such an
@@ -2239,8 +2238,8 @@ export declare function tryParseCompositeKey(value: unknown): GalaChainTokenClas
2239
2238
  //#endregion
2240
2239
  //#region src/utils/unique_key.d.ts
2241
2240
  /**
2242
- * The `uniqueKey` prefix frontend_v2 and wallet_extension have always sent
2243
- * (`galaswap-operation-<uuid>`). defi-backend does not depend on it: the chain-write verifier
2241
+ * The `uniqueKey` prefix the Gala Wallet and the gSwap web app have always sent
2242
+ * (`galaswap-operation-<uuid>`). The backend does not depend on it: the chain-write verifier
2244
2243
  * only requires a non-empty key of at most 256 characters, and apply-results accepts
2245
2244
  * `[A-Za-z0-9._:-]{1,128}`; the only code that mints a prefixed key itself is the server-side v1
2246
2245
  * trade builder, which nothing reads back by prefix.
package/dist/index.d.ts CHANGED
@@ -1405,11 +1405,10 @@ export declare function createLazyPrivateKeySigner(getPrivateKey: PrivateKeyProv
1405
1405
  *
1406
1406
  * `scheme: 'personal-sign'` calls
1407
1407
  * `gala_signChainDto([serialize({ ...dto, prefix }), walletAddress, methodName])` and REQUIRES
1408
- * a wallet build that contains wallet_extension commit 34ca4e4 (strips the embedded `prefix`
1409
- * field and hashes `prefix` + the prefix-less canonical body, the chain's scheme). Wallets
1410
- * released before that fix hash the string with the `prefix` field still inside it and the
1411
- * signature recovers to an address nobody holds, so only opt in once the fixed wallet is
1412
- * released. See SIGNING-PARITY.md.
1408
+ * a Gala Wallet build that strips the embedded `prefix` field and hashes `prefix` + the
1409
+ * prefix-less canonical body (the chain's scheme). Wallet builds that predate that fix hash the
1410
+ * string with the `prefix` field still inside it and the signature recovers to an address
1411
+ * nobody holds, so only opt in once the wallet you target has the fix.
1413
1412
  */
1414
1413
  export declare class GalaWalletSigner implements GalaChainSigner {
1415
1414
  /** The wallet address supplied to Gala Wallet for each signing request. */
@@ -1428,9 +1427,9 @@ export declare class GalaWalletSigner implements GalaChainSigner {
1428
1427
  * @param walletAddress - The account passed to Gala Wallet as the signer address. An Ethereum
1429
1428
  * account is `0x` plus 40 hex digits (Gala Wallet's `eth|...` form is normalized to it and held
1430
1429
  * to the same check); a GalaChain id is `client|` plus 24 hex digits, or the bare 24 hex digits
1431
- * frontend_v2 keeps for a direct `client|` login, and is passed through unchanged.
1430
+ * a web app keeps for a direct `client|` login, and is passed through unchanged.
1432
1431
  * @param options - Select native signing (default) or personal-sign explicitly.
1433
- * `'personal-sign'` requires a Gala Wallet build with wallet_extension commit 34ca4e4.
1432
+ * `'personal-sign'` requires a Gala Wallet build that signs the bare serialized DTO.
1434
1433
  * `selectAddress` is the identity (`client|...` / `eth|...`) Gala Wallet is switched to with
1435
1434
  * `setAddress` before every signature, when the wallet offers it. `wallet` is the Gala Wallet
1436
1435
  * object to sign through (the one an EIP-6963 announcement or a wallet provider holds); without
@@ -1545,15 +1544,15 @@ export declare function calculatePersonalSignPrefix(message: string): string;
1545
1544
  */
1546
1545
  export declare function personalSignPrefixFor(dto: Record<string, unknown>): string;
1547
1546
  /**
1548
- * The `@gala-chain/connect`-style prefix frontend_v2 puts in the body of an EIP-712 write: the
1547
+ * The `@gala-chain/connect`-style prefix the gSwap web app puts in the body of an EIP-712 write: the
1549
1548
  * EIP-191 header whose number counts the prefix string ITSELF plus the body (the UTF-8 length of
1550
1549
  * `getPayloadToSign({ ...dto, prefix })`), found by fixpoint because adding the prefix changes the
1551
1550
  * length (a body of 99 bytes settles on 101).
1552
1551
  *
1553
1552
  * It is NOT a personal-sign prefix (a personal-sign write with this value recovers a phantom
1554
1553
  * signer; use `personalSignPrefixFor`). Under EIP-712 the field is an untyped extra that the
1555
- * typed-data hash ignores and defi-backend recomputes, so it only exists to keep the submitted
1556
- * body byte-identical to what frontend_v2 has always sent.
1554
+ * typed-data hash ignores and the backend recomputes, so it only exists to keep the submitted
1555
+ * body byte-identical to what the gSwap web app has always sent.
1557
1556
  */
1558
1557
  export declare function fixpointPrefixFor(dto: Record<string, unknown>): string;
1559
1558
  /**
@@ -1707,10 +1706,10 @@ interface EIP712DomainValue {
1707
1706
  chainId: number;
1708
1707
  }
1709
1708
  /**
1710
- * Builds the EIP-712 domain from the wallet's LIVE `eth_chainId` result, exactly like frontend_v2
1711
- * (DEFI-1895): a wallet hashes whatever domain it is handed, and MetaMask refuses a `chainId` that
1712
- * differs from its active network, so a hardcoded `1` breaks every wallet that is not on Mainnet.
1713
- * defi-backend recovers the signer from the `domain` the payload carries (live-proven for chain
1709
+ * Builds the EIP-712 domain from the wallet's LIVE `eth_chainId` result: a wallet hashes whatever
1710
+ * domain it is handed, and MetaMask refuses a `chainId` that differs from its active network, so
1711
+ * a hardcoded `1` breaks every wallet that is not on Mainnet.
1712
+ * The backend recovers the signer from the `domain` the payload carries (live-proven for chain
1714
1713
  * ids 1, 56 and 11155111), so following the wallet is correct on every network.
1715
1714
  *
1716
1715
  * @param chainId - The raw `eth_chainId` result: a `0x` hex string (the JSON-RPC form) or an integer.
@@ -1800,7 +1799,7 @@ export type HttpRequestor = (uri: string, options?: Parameters<typeof fetch>[1])
1800
1799
  //#region src/types/wire.d.ts
1801
1800
  /**
1802
1801
  * How the SDK writes a read request on the wire. The defaults suit a server-side caller; an app
1803
- * that already issues the same requests from its own HTTP stack (frontend_v2, the Gala Wallet)
1802
+ * that already issues the same requests from its own HTTP stack (a web app, the Gala Wallet)
1804
1803
  * sets these so the SDK's requests are indistinguishable from the ones it replaces.
1805
1804
  *
1806
1805
  * One object, carried by {@link ChainGateway}, so every service built on a gateway (symbols,
@@ -1816,7 +1815,7 @@ export interface WireOptions {
1816
1815
  * composite key such as `GALA$Unit$none$none` or `client|abc` reads as written. Everything
1817
1816
  * that would change a query's meaning (`& = # % +`, space, non-ASCII, controls) is still
1818
1817
  * percent-encoded (a space is `+`), so the server decodes exactly the value that was passed.
1819
- * This is the text frontend_v2's `formatUrl` produces for every value it can represent.
1818
+ * This is the text a hand-written `formatUrl` helper produces for every value it can represent.
1820
1819
  */
1821
1820
  queryEncoding?: 'standard' | 'readable' | undefined;
1822
1821
  /**
@@ -2072,7 +2071,7 @@ type FailureOutcome = (typeof FAILURE_OUTCOMES)[number];
2072
2071
  * A failure as a PLAIN OBJECT: the facts the SDKs' guards and classifiers (gswap-sdk's
2073
2072
  * `classifyFailure`) read, and nothing else. A real `GalaSDKError` is one (every field below is on
2074
2073
  * it, and on every product subclass); so is the wrapper an app makes from an SDK error to carry
2075
- * through its own layers (frontend_v2's `V2Failure`, the wallet's `WalletSwapError` data), which
2074
+ * through its own layers (an app's own failure class or error data), which
2076
2075
  * has a `code` and `params` but is not an `instanceof` anything the SDK owns. gswap-sdk's
2077
2076
  * `classifyFailure`, `isRelayableRefusal`, `isUnprovenAcknowledgement`, `isUninterpretedAnswer`,
2078
2077
  * `isPreSendError`, `isShadowError`, `isNoMarket` and `mayHaveBeenQueued` all accept such an
@@ -2239,8 +2238,8 @@ export declare function tryParseCompositeKey(value: unknown): GalaChainTokenClas
2239
2238
  //#endregion
2240
2239
  //#region src/utils/unique_key.d.ts
2241
2240
  /**
2242
- * The `uniqueKey` prefix frontend_v2 and wallet_extension have always sent
2243
- * (`galaswap-operation-<uuid>`). defi-backend does not depend on it: the chain-write verifier
2241
+ * The `uniqueKey` prefix the Gala Wallet and the gSwap web app have always sent
2242
+ * (`galaswap-operation-<uuid>`). The backend does not depend on it: the chain-write verifier
2244
2243
  * only requires a non-empty key of at most 256 characters, and apply-results accepts
2245
2244
  * `[A-Za-z0-9._:-]{1,128}`; the only code that mints a prefixed key itself is the server-side v1
2246
2245
  * trade builder, which nothing reads back by prefix.
package/dist/index.mjs CHANGED
@@ -1253,15 +1253,12 @@ function galaChainUserRef(value, field) {
1253
1253
  //#endregion
1254
1254
  //#region src/utils/eip712.ts
1255
1255
  /**
1256
- * Genuine EIP-712 typed-data signing for the four v2 dex-contract operations proven (2026-09-16,
1257
- * live bisection against stage — see defi-backend's `chain-findings-artifact` memory /
1258
- * https://claude.ai/artifact/3N9MevSjoQdU7gqnVB3dfU) to recover the `client|` identity correctly
1259
- * via `eth_signTypedData_v4`, unlike `personal_sign` (which only ever resolves the bare `eth|`
1260
- * form — see `BrowserWalletSigner`'s own doc comment). Mirrors frontend_v2's
1261
- * `src/Services/eip712Types.ts` + `readWriteUtilsV2.ts`'s `EIP712_FIELD_COMPLETERS` exactly —
1262
- * ported here rather than shared as a package because the SDKs have no frontend_v2 dependency
1263
- * and should not gain one for four small functions. (Moved from gswap-sdk with the rest of the
1264
- * signing closure; the four methods are dex-contract methods, the derivation is generic.)
1256
+ * Genuine EIP-712 typed-data signing for the four v2 dex-contract operations, proven by a live
1257
+ * bisection against the staging chain to recover the `client|` identity correctly via
1258
+ * `eth_signTypedData_v4`, unlike `personal_sign` (which only ever resolves the bare `eth|` form;
1259
+ * see `BrowserWalletSigner`'s own doc comment). The field completers mirror the web app's
1260
+ * typed-data builders exactly. (Moved from gswap-sdk with the rest of the signing closure; the
1261
+ * four methods are dex-contract methods, the derivation is generic.)
1265
1262
  */
1266
1263
  /**
1267
1264
  * Derives the EIP-712 `types` for a DTO from its runtime shape.
@@ -1329,10 +1326,10 @@ function generateEIP712Types(typeName, params) {
1329
1326
  return types;
1330
1327
  }
1331
1328
  /**
1332
- * Builds the EIP-712 domain from the wallet's LIVE `eth_chainId` result, exactly like frontend_v2
1333
- * (DEFI-1895): a wallet hashes whatever domain it is handed, and MetaMask refuses a `chainId` that
1334
- * differs from its active network, so a hardcoded `1` breaks every wallet that is not on Mainnet.
1335
- * defi-backend recovers the signer from the `domain` the payload carries (live-proven for chain
1329
+ * Builds the EIP-712 domain from the wallet's LIVE `eth_chainId` result: a wallet hashes whatever
1330
+ * domain it is handed, and MetaMask refuses a `chainId` that differs from its active network, so
1331
+ * a hardcoded `1` breaks every wallet that is not on Mainnet.
1332
+ * The backend recovers the signer from the `domain` the payload carries (live-proven for chain
1336
1333
  * ids 1, 56 and 11155111), so following the wallet is correct on every network.
1337
1334
  *
1338
1335
  * @param chainId - The raw `eth_chainId` result: a `0x` hex string (the JSON-RPC form) or an integer.
@@ -1454,7 +1451,7 @@ function buildEIP712Payload(methodName, dto) {
1454
1451
  *
1455
1452
  * Every function here is pinned byte-for-byte to the signatures produced by `@gala-chain/api`
1456
1453
  * (`serialize`, `signatures.getSignature`), `@gala-chain/connect`, the Gala Wallet extension and
1457
- * frontend_v2 by the golden-vector suite in `tests/signing-golden.test.ts`.
1454
+ * the gSwap web app by the golden-vector suite in `tests/signing-golden.test.ts`.
1458
1455
  */
1459
1456
  const textEncoder$1 = new TextEncoder();
1460
1457
  function toDeterministicNode(node) {
@@ -1525,15 +1522,15 @@ function personalSignPrefixFor(dto) {
1525
1522
  return calculatePersonalSignPrefix(serialize(withoutPrefix));
1526
1523
  }
1527
1524
  /**
1528
- * The `@gala-chain/connect`-style prefix frontend_v2 puts in the body of an EIP-712 write: the
1525
+ * The `@gala-chain/connect`-style prefix the gSwap web app puts in the body of an EIP-712 write: the
1529
1526
  * EIP-191 header whose number counts the prefix string ITSELF plus the body (the UTF-8 length of
1530
1527
  * `getPayloadToSign({ ...dto, prefix })`), found by fixpoint because adding the prefix changes the
1531
1528
  * length (a body of 99 bytes settles on 101).
1532
1529
  *
1533
1530
  * It is NOT a personal-sign prefix (a personal-sign write with this value recovers a phantom
1534
1531
  * signer; use `personalSignPrefixFor`). Under EIP-712 the field is an untyped extra that the
1535
- * typed-data hash ignores and defi-backend recomputes, so it only exists to keep the submitted
1536
- * body byte-identical to what frontend_v2 has always sent.
1532
+ * typed-data hash ignores and the backend recomputes, so it only exists to keep the submitted
1533
+ * body byte-identical to what the gSwap web app has always sent.
1537
1534
  */
1538
1535
  function fixpointPrefixFor(dto) {
1539
1536
  const withoutPrefix = { ...dto };
@@ -1702,8 +1699,8 @@ function normalizeEthereumAccount(address, allowGalaPrefix, field = "walletAddre
1702
1699
  * The account handed to Gala Wallet as the signer address. An Ethereum account is held to the
1703
1700
  * same strict check as ever (`0x` plus 40 hex digits; `eth|` plus 40 hex digits is normalized to
1704
1701
  * it; `eth|0x...` is refused). A GalaChain id the wallet can also be asked to sign for is passed
1705
- * through verbatim: `client|` plus 24 hex digits, or the bare 24 hex digits that frontend_v2 keeps
1706
- * in `state.user.wallet` after a direct `client|` login. Nothing else is accepted.
1702
+ * through verbatim: `client|` plus 24 hex digits, or the bare 24 hex digits that a web app keeps
1703
+ * after a direct `client|` login. Nothing else is accepted.
1707
1704
  */
1708
1705
  function normalizeGalaWalletAccount(address) {
1709
1706
  assertNoEthZeroXPrefix(address, "walletAddress");
@@ -1923,11 +1920,10 @@ function createLazyPrivateKeySigner(getPrivateKey, options = {}) {
1923
1920
  *
1924
1921
  * `scheme: 'personal-sign'` calls
1925
1922
  * `gala_signChainDto([serialize({ ...dto, prefix }), walletAddress, methodName])` and REQUIRES
1926
- * a wallet build that contains wallet_extension commit 34ca4e4 (strips the embedded `prefix`
1927
- * field and hashes `prefix` + the prefix-less canonical body, the chain's scheme). Wallets
1928
- * released before that fix hash the string with the `prefix` field still inside it and the
1929
- * signature recovers to an address nobody holds, so only opt in once the fixed wallet is
1930
- * released. See SIGNING-PARITY.md.
1923
+ * a Gala Wallet build that strips the embedded `prefix` field and hashes `prefix` + the
1924
+ * prefix-less canonical body (the chain's scheme). Wallet builds that predate that fix hash the
1925
+ * string with the `prefix` field still inside it and the signature recovers to an address
1926
+ * nobody holds, so only opt in once the wallet you target has the fix.
1931
1927
  */
1932
1928
  var GalaWalletSigner = class {
1933
1929
  /** The wallet address supplied to Gala Wallet for each signing request. */
@@ -1946,9 +1942,9 @@ var GalaWalletSigner = class {
1946
1942
  * @param walletAddress - The account passed to Gala Wallet as the signer address. An Ethereum
1947
1943
  * account is `0x` plus 40 hex digits (Gala Wallet's `eth|...` form is normalized to it and held
1948
1944
  * to the same check); a GalaChain id is `client|` plus 24 hex digits, or the bare 24 hex digits
1949
- * frontend_v2 keeps for a direct `client|` login, and is passed through unchanged.
1945
+ * a web app keeps for a direct `client|` login, and is passed through unchanged.
1950
1946
  * @param options - Select native signing (default) or personal-sign explicitly.
1951
- * `'personal-sign'` requires a Gala Wallet build with wallet_extension commit 34ca4e4.
1947
+ * `'personal-sign'` requires a Gala Wallet build that signs the bare serialized DTO.
1952
1948
  * `selectAddress` is the identity (`client|...` / `eth|...`) Gala Wallet is switched to with
1953
1949
  * `setAddress` before every signature, when the wallet offers it. `wallet` is the Gala Wallet
1954
1950
  * object to sign through (the one an EIP-6963 announcement or a wallet provider holds); without
@@ -2063,9 +2059,8 @@ var BrowserWalletSigner = class {
2063
2059
  * String-key signing entry points for apps that hold a private key only briefly (the Gala Wallet
2064
2060
  * extension reads its session key at sign time and must not keep it in a long-lived object).
2065
2061
  *
2066
- * These are thin, byte-exact ports of the functions the wallet shipped in
2067
- * `wallet_extension/src/helpers/wallet/signing.ts` (including the fail-closed personal-sign
2068
- * payload resolver from its commit 34ca4e4), re-expressed over the SDK's own primitives. Every
2062
+ * These are thin, byte-exact ports of the functions the wallet shipped (including the
2063
+ * fail-closed personal-sign payload resolver), re-expressed over the SDK's own primitives. Every
2069
2064
  * function takes the key as a string (`0x`-optional hex, or base64) or as bytes, normalizes it per
2070
2065
  * call, and zeroes the normalized copy before returning, so nothing in this module retains a key.
2071
2066
  * A JavaScript string cannot be wiped; the caller owns the lifetime of the string it passes in.
@@ -2107,7 +2102,7 @@ function isPersonalSignHeader(prefix) {
2107
2102
  return prefix.startsWith(PERSONAL_SIGN_HEADER) && PERSONAL_SIGN_LENGTH_PATTERN.test(prefix.slice(26));
2108
2103
  }
2109
2104
  /**
2110
- * Top-level fields that would make the chain (`getPayloadToSign`) or defi-backend's personal-sign
2105
+ * Top-level fields that would make the chain (`getPayloadToSign`) or the swap backend's personal-sign
2111
2106
  * verifier hash something other than `prefix + serialize(dto minus prefix)`. An unsigned DTO from
2112
2107
  * a dApp never legitimately carries any of them, so they fail closed. Order is part of the error
2113
2108
  * message the wallet shows its user.
@@ -2345,7 +2340,7 @@ function leafEncoder(base) {
2345
2340
  const fixed = /^bytes([1-9][0-9]?)$/u.exec(base);
2346
2341
  if (fixed !== null) {
2347
2342
  const width = Number(fixed[1]);
2348
- if (width > 32 || String(width) !== fixed[1]) return void 0;
2343
+ if (width > 32) return void 0;
2349
2344
  return (value) => {
2350
2345
  const bytes = toBytes(value, base);
2351
2346
  if (bytes.length !== width) throw new GalaSDKError("TYPED_DATA_BYTES_LENGTH", {
@@ -2372,7 +2367,7 @@ function leafEncoder(base) {
2372
2367
  function parseType(type) {
2373
2368
  const match = TYPE_SYNTAX.exec(type);
2374
2369
  if (match === null) throw new GalaSDKError("TYPED_DATA_UNSUPPORTED_TYPE", { type });
2375
- const dimensions = [...(match[2] ?? "").matchAll(/\[([0-9]*)\]/gu)].map((dimension) => dimension[1] === "" ? -1 : Number(dimension[1]));
2370
+ const dimensions = [...match[2].matchAll(/\[([0-9]*)\]/gu)].map((dimension) => dimension[1] === "" ? -1 : Number(dimension[1]));
2376
2371
  return {
2377
2372
  base: match[1],
2378
2373
  dimensions
@@ -2441,19 +2436,19 @@ function createStructEncoder(rawTypes) {
2441
2436
  if (visiting.has(name)) throw new GalaSDKError("TYPED_DATA_CIRCULAR_TYPE", { typeName: name });
2442
2437
  if (checked.has(name)) return;
2443
2438
  visiting.add(name);
2444
- for (const child of children.get(name) ?? []) checkCircular(child);
2439
+ for (const child of children.get(name)) checkCircular(child);
2445
2440
  visiting.delete(name);
2446
2441
  checked.add(name);
2447
2442
  };
2448
2443
  checkCircular(primaryType);
2449
2444
  const dependencies = (name, found) => {
2450
- for (const child of children.get(name) ?? []) if (!found.has(child)) {
2445
+ for (const child of children.get(name)) if (!found.has(child)) {
2451
2446
  found.add(child);
2452
2447
  dependencies(child, found);
2453
2448
  }
2454
2449
  return found;
2455
2450
  };
2456
- const encodeOne = (name) => `${name}(${(fields.get(name) ?? []).map((field) => `${field.type} ${field.name}`).join(",")})`;
2451
+ const encodeOne = (name) => `${name}(${fields.get(name).map((field) => `${field.type} ${field.name}`).join(",")})`;
2457
2452
  const typeHashes = /* @__PURE__ */ new Map();
2458
2453
  for (const name of names) {
2459
2454
  const sorted = [...dependencies(name, /* @__PURE__ */ new Set())].filter((dep) => dep !== name).sort();
@@ -2473,7 +2468,6 @@ function createStructEncoder(rawTypes) {
2473
2468
  function hashStruct(typeName, value) {
2474
2469
  const list = fields.get(typeName);
2475
2470
  const typeHash = typeHashes.get(typeName);
2476
- if (list === void 0 || typeHash === void 0) throw new Error(`Internal error: no encoder for struct ${typeName}`);
2477
2471
  if (value === null || typeof value !== "object" || Array.isArray(value)) throw new GalaSDKError("TYPED_DATA_STRUCT_NOT_OBJECT", { typeName });
2478
2472
  const record = value;
2479
2473
  const words = list.map((field) => {
@@ -2544,7 +2538,7 @@ const REJECTION_NAME = "UserRejectedRequestError";
2544
2538
  /**
2545
2539
  * Wordings of a decline, matched case-insensitively as substrings. This is a LAST RESORT for
2546
2540
  * wallets that set neither a `code` nor a `name`: it reads a third party's text, so it is broad on
2547
- * purpose (a superset of the matchers the Gala wallet and frontend_v2 used) and can in principle
2541
+ * purpose (a superset of the matchers the Gala wallet and gSwap web app used) and can in principle
2548
2542
  * match an unrelated message that uses these words.
2549
2543
  */
2550
2544
  const REJECTION_PHRASES = [
@@ -2692,7 +2686,7 @@ async function signPreSend(signer, method, dto) {
2692
2686
  * fallback. It is the version in the default `User-Agent` (`GalaChain-SDK/<version>`) of every SDK
2693
2687
  * request, whichever product SDK sends it.
2694
2688
  */
2695
- const GALA_CORE_SDK_VERSION = "1.0.0-rc.7";
2689
+ const GALA_CORE_SDK_VERSION = "1.0.0";
2696
2690
 
2697
2691
  //#endregion
2698
2692
  //#region src/utils/transport.ts
@@ -2753,7 +2747,7 @@ function buildRequestHeaders(wire, parts = {}) {
2753
2747
  entries.set(name.toLowerCase(), [name, value]);
2754
2748
  }
2755
2749
  };
2756
- 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.0.0-rc.7"}` });
2750
+ 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.0.0"}` });
2757
2751
  put(parts.defaults);
2758
2752
  put(wire === null || wire === void 0 ? void 0 : wire.headers);
2759
2753
  if (parts.json === true && !entries.has("content-type")) put({ "Content-Type": "application/json" });
@@ -3285,8 +3279,8 @@ function isValidUniqueKey(uniqueKey) {
3285
3279
  //#endregion
3286
3280
  //#region src/utils/unique_key.ts
3287
3281
  /**
3288
- * The `uniqueKey` prefix frontend_v2 and wallet_extension have always sent
3289
- * (`galaswap-operation-<uuid>`). defi-backend does not depend on it: the chain-write verifier
3282
+ * The `uniqueKey` prefix the Gala Wallet and the gSwap web app have always sent
3283
+ * (`galaswap-operation-<uuid>`). The backend does not depend on it: the chain-write verifier
3290
3284
  * only requires a non-empty key of at most 256 characters, and apply-results accepts
3291
3285
  * `[A-Za-z0-9._:-]{1,128}`; the only code that mints a prefixed key itself is the server-side v1
3292
3286
  * trade builder, which nothing reads back by prefix.