@gala-chain/gala-core-sdk 1.1.0-beta.2 → 1.1.0-beta.4
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 +13 -4
- package/dist/bridge.cjs +12 -3
- package/dist/bridge.cjs.map +1 -1
- package/dist/bridge.mjs +12 -3
- 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/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/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -99,9 +99,18 @@ bridge-out request was accepted the tokens may be locked: a later failure is
|
|
|
99
99
|
`BRIDGE_OUT_OUTCOME_UNKNOWN` (with the step, the bridge request id and the `uniqueKey`), and a
|
|
100
100
|
deposit that may have been sent is `BRIDGE_DEPOSIT_OUTCOME_UNKNOWN`; neither is ever retried by the
|
|
101
101
|
SDK. `WrapService` wraps a token from its own channel to the asset channel (MUSIC to GMUSIC) and
|
|
102
|
-
back, signed natively by a `GalaChainSigner`.
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
back, signed natively by a `GalaChainSigner`. A `RequestTokenBridgeOut` (the bridge-out and the wrap /
|
|
103
|
+
unwrap) signs the TOKEN contract's `dtoOperation`
|
|
104
|
+
(`asset-channel_basic-asset_GalaChainToken:RequestTokenBridgeOut`, not the bridge contract's, which the
|
|
105
|
+
chain refuses; verified on stage, 2026-11-02) as a field of its EIP-712 `GalaTransaction` type, so the
|
|
106
|
+
signature covers it; `buildBridgeOutPayload` does this. The wrap / unwrap request carries no `wrap` field:
|
|
107
|
+
the contract's `RequestTokenBridgeOut` DTO has none (strict validation refuses it) and the direction is the
|
|
108
|
+
destination channel id. The other bridge strings, all seen live on stage and signed by GalaConnect (this SDK
|
|
109
|
+
signs none of them): `BridgeTokenOut` on `/asset/bridge-contract` is
|
|
110
|
+
`asset-channel_bridge-chaincode_BridgeContract:BridgeTokenOut` (the operation table's bridge-contract entry
|
|
111
|
+
is right for it), and the grants embedded in a `BridgeTokenOut` sign
|
|
112
|
+
`asset-channel_bridge-chaincode_GalaChainToken:GrantAllowance`, which is NOT in the platform's operation
|
|
113
|
+
table.
|
|
105
114
|
|
|
106
115
|
TypeScript: the `./bridge` declarations name `@solana/web3.js` types, whose own declarations import
|
|
107
116
|
Node's `http` and `https`, so a TypeScript app that imports `./bridge` has `@types/node` (with
|
|
@@ -283,7 +292,7 @@ gzipped, before `ethers` and `@solana/*`) are loaded only by an app that imports
|
|
|
283
292
|
|
|
284
293
|
## Status
|
|
285
294
|
|
|
286
|
-
<!-- docs:var version -->1.1.0-beta.
|
|
295
|
+
<!-- docs:var version -->1.1.0-beta.4<!-- /docs:var --> (rc.7: `eth|0x<hex>` is refused as `INVALID_ETH_USER_REF_PREFIX`, not an address form; rc.6: `fetchPublicKey`, MetaMask and Trust Wallet detection, silent `restore()`;
|
|
287
296
|
rc.5: every Ethereum account a read, write or GalaConnect client sends is
|
|
288
297
|
`eth|<EIP-55>`, the only spelling the gateway accepts, and `galaChainUserRef` is exported; rc.4:
|
|
289
298
|
`bridgeableTokenService` is required). In: signing, signers, transport and the error model (rc.0, from gswap-sdk); the
|
package/dist/bridge.cjs
CHANGED
|
@@ -2230,6 +2230,16 @@ function destinationChainIdOf(value) {
|
|
|
2230
2230
|
/** The method a bridge-out signing failure names. */
|
|
2231
2231
|
const BRIDGE_OUT_METHOD = "RequestTokenBridgeOut";
|
|
2232
2232
|
/**
|
|
2233
|
+
* The contract path whose operation a `RequestTokenBridgeOut` signs: the TOKEN contract's
|
|
2234
|
+
* (`asset-channel_basic-asset_GalaChainToken:RequestTokenBridgeOut`). Verified on stage (2026-11-02): the
|
|
2235
|
+
* chain refuses `...BridgeContract:RequestTokenBridgeOut` ("signed to call ...BridgeContract:RequestTokenBridgeOut,
|
|
2236
|
+
* but the current operation is asset-channel_basic-asset_GalaChainToken:RequestTokenBridgeOut") and accepts this one.
|
|
2237
|
+
* The table's `asset/bridge-contract` entry is right for `BridgeTokenOut` (seen live on stage:
|
|
2238
|
+
* `asset-channel_bridge-chaincode_BridgeContract:BridgeTokenOut`, signed by GalaConnect, not by this SDK), and the grants
|
|
2239
|
+
* embedded in it sign `asset-channel_bridge-chaincode_GalaChainToken:GrantAllowance`, which the table lacks.
|
|
2240
|
+
*/
|
|
2241
|
+
const BRIDGE_OUT_CONTRACT_PATH = "asset/token-contract";
|
|
2242
|
+
/**
|
|
2233
2243
|
* Signs the bridge-out typed data with the app's signer. Whatever the signer throws that is not
|
|
2234
2244
|
* already an SDK error (a declined or locked wallet, a message ethers cannot encode) is
|
|
2235
2245
|
* `SIGNING_FAILED` (`user_rejected` or `failed`, the original as `cause`), and so is a signature
|
|
@@ -2289,7 +2299,7 @@ async function buildBridgeOutPayload(dto, config) {
|
|
|
2289
2299
|
const message = {
|
|
2290
2300
|
destinationChainId,
|
|
2291
2301
|
destinationChainTxFee: sanitizeObject(sanitizedFeeObj),
|
|
2292
|
-
dtoOperation: (0, _gala_chain_gala_core_sdk.dtoOperationOf)(
|
|
2302
|
+
dtoOperation: (0, _gala_chain_gala_core_sdk.dtoOperationOf)(BRIDGE_OUT_CONTRACT_PATH, BRIDGE_OUT_METHOD),
|
|
2293
2303
|
quantity: dto.quantity,
|
|
2294
2304
|
recipient: dto.recipient,
|
|
2295
2305
|
tokenInstance: dto.tokenInstance,
|
|
@@ -4779,10 +4789,9 @@ var WrapService = class {
|
|
|
4779
4789
|
},
|
|
4780
4790
|
destinationChainId: routing.destinationChannelId,
|
|
4781
4791
|
recipient,
|
|
4782
|
-
wrap: true,
|
|
4783
4792
|
uniqueKey
|
|
4784
4793
|
};
|
|
4785
|
-
const requestBody = await (0, _gala_chain_gala_core_sdk.signPreSend)(this.signer,
|
|
4794
|
+
const requestBody = await (0, _gala_chain_gala_core_sdk.signPreSend)(this.signer, BRIDGE_OUT_CONTRACT_PATH, "RequestTokenBridgeOut", message);
|
|
4786
4795
|
const response = await this.galaConnectClient.requestBridgeOut(requestBody);
|
|
4787
4796
|
assertRequestAccepted("RequestTokenBridgeOut", response, uniqueKey);
|
|
4788
4797
|
return {
|