@xyo-network/chain-bridge 1.19.10 → 1.19.11
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/node/config/getGateway.d.ts.map +1 -1
- package/dist/node/index.mjs +51 -53
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/manifest/getNode.d.ts +1 -1
- package/dist/node/manifest/getNode.d.ts.map +1 -1
- package/dist/node/queue/workers/util/submitXl1Transaction.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/config/getGateway.ts +3 -2
- package/src/manifest/getNode.ts +2 -2
- package/src/queue/workers/util/submitXl1Transaction.ts +10 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNode.d.ts","sourceRoot":"","sources":["../../../src/manifest/getNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"getNode.d.ts","sourceRoot":"","sources":["../../../src/manifest/getNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EACV,MAAM,EACP,MAAM,sBAAsB,CAAA;AAO7B,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,cAAc,CAAA;CACvB;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAU,SAAS,cAAc,uKAgBpD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submitXl1Transaction.d.ts","sourceRoot":"","sources":["../../../../../src/queue/workers/util/submitXl1Transaction.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"submitXl1Transaction.d.ts","sourceRoot":"","sources":["../../../../../src/queue/workers/util/submitXl1Transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EACkB,KAAK,yBAAyB,EAAE,KAAK,gBAAgB,EAC7E,MAAM,sBAAsB,CAAA;AAE7B,eAAO,MAAM,oBAAoB,GAC/B,YAAY,yBAAyB,EACrC,SAAS,gBAAgB,KACxB,OAAO,CAAC,CAAC,WAAW,EAAE,yBAAyB,CAAC,CAkBlD,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/chain-bridge",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.11",
|
|
4
4
|
"description": "XYO Layer One Bridge",
|
|
5
5
|
"homepage": "https://xylabs.com",
|
|
6
6
|
"bugs": {
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"@xyo-network/archivist-view": "~5.3.2",
|
|
61
61
|
"@xyo-network/bios": "~7.2.1",
|
|
62
62
|
"@xyo-network/boundwitness-validator": "~5.3.2",
|
|
63
|
-
"@xyo-network/chain-orchestration": "~1.19.
|
|
64
|
-
"@xyo-network/chain-protocol": "~1.19.
|
|
65
|
-
"@xyo-network/chain-services": "~1.19.
|
|
66
|
-
"@xyo-network/chain-telemetry": "~1.19.
|
|
63
|
+
"@xyo-network/chain-orchestration": "~1.19.11",
|
|
64
|
+
"@xyo-network/chain-protocol": "~1.19.11",
|
|
65
|
+
"@xyo-network/chain-services": "~1.19.11",
|
|
66
|
+
"@xyo-network/chain-telemetry": "~1.19.11",
|
|
67
67
|
"@xyo-network/manifest-model": "~5.3.2",
|
|
68
68
|
"@xyo-network/manifest-wrapper": "~5.3.2",
|
|
69
69
|
"@xyo-network/module-abstract": "~5.3.2",
|
|
@@ -78,9 +78,9 @@
|
|
|
78
78
|
"@xyo-network/typechain": "~4.1.1",
|
|
79
79
|
"@xyo-network/wallet": "~5.3.2",
|
|
80
80
|
"@xyo-network/wallet-model": "~5.3.2",
|
|
81
|
-
"@xyo-network/xl1-sdk": "~1.23.
|
|
81
|
+
"@xyo-network/xl1-sdk": "~1.23.21",
|
|
82
82
|
"async-mutex": "~0.5.0",
|
|
83
|
-
"bullmq": "~5.
|
|
83
|
+
"bullmq": "~5.68.0",
|
|
84
84
|
"compression": "~1.8.1",
|
|
85
85
|
"cors": "~2.8.6",
|
|
86
86
|
"ethers": "^6.16.0",
|
|
@@ -112,9 +112,9 @@
|
|
|
112
112
|
"@xyo-network/bios": "~7.2.1",
|
|
113
113
|
"@xyo-network/bios-model": "~7.2.1",
|
|
114
114
|
"@xyo-network/boundwitness-builder": "~5.3.2",
|
|
115
|
-
"@xyo-network/chain-protocol": "~1.19.
|
|
116
|
-
"@xyo-network/chain-services": "~1.19.
|
|
117
|
-
"@xyo-network/chain-telemetry": "~1.19.
|
|
115
|
+
"@xyo-network/chain-protocol": "~1.19.11",
|
|
116
|
+
"@xyo-network/chain-services": "~1.19.11",
|
|
117
|
+
"@xyo-network/chain-telemetry": "~1.19.11",
|
|
118
118
|
"@xyo-network/manifest-wrapper": "~5.3.2",
|
|
119
119
|
"@xyo-network/module-abstract": "~5.3.2",
|
|
120
120
|
"@xyo-network/module-abstract-mongodb": "~5.3.2",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"@xyo-network/payload-builder": "~5.3.2",
|
|
124
124
|
"@xyo-network/sentinel-memory": "~5.3.2",
|
|
125
125
|
"@xyo-network/wallet": "~5.3.2",
|
|
126
|
-
"@xyo-network/xl1-sdk": "~1.23.
|
|
126
|
+
"@xyo-network/xl1-sdk": "~1.23.21",
|
|
127
127
|
"async-mutex": "~0.5.0",
|
|
128
128
|
"axios": "~1.13.5",
|
|
129
129
|
"dotenv": "~17.2.4",
|
package/src/config/getGateway.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isDefined } from '@xylabs/sdk-js'
|
|
1
|
+
import { assertEx, isDefined } from '@xylabs/sdk-js'
|
|
2
2
|
import { HDWallet } from '@xyo-network/wallet'
|
|
3
3
|
import type {
|
|
4
4
|
Config, RpcSchemaMap, TransportFactory, XyoGatewayRunner,
|
|
@@ -11,7 +11,8 @@ let gatewayInstance: XyoGatewayRunner | undefined
|
|
|
11
11
|
|
|
12
12
|
export const getGateway = async (config: Config): Promise<XyoGatewayRunner> => {
|
|
13
13
|
if (isDefined(gatewayInstance)) return gatewayInstance
|
|
14
|
-
const { mnemonic
|
|
14
|
+
const { mnemonic } = config.actors.bridge
|
|
15
|
+
const endpoint = assertEx(config.actors.bridge.remote?.rpc?.url ?? config.remote?.rpc?.url, () => 'RPC URL is required for gateway')
|
|
15
16
|
const walletPhrase = isDefined(mnemonic) ? mnemonic : HDWallet.generateMnemonic()
|
|
16
17
|
const wallet = await generateXyoBaseWalletFromPhrase(walletPhrase)
|
|
17
18
|
const signerAccount = await wallet.derivePath(ADDRESS_INDEX.XYO)
|
package/src/manifest/getNode.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { assertEx, type Logger } from '@xylabs/sdk-js'
|
|
2
2
|
import { ManifestWrapper } from '@xyo-network/manifest-wrapper'
|
|
3
3
|
import type { WalletInstance } from '@xyo-network/wallet-model'
|
|
4
4
|
import type {
|
|
@@ -23,7 +23,7 @@ export interface GetNodeContext {
|
|
|
23
23
|
*/
|
|
24
24
|
export const getNode = async (context: GetNodeContext) => {
|
|
25
25
|
const { config, wallet } = context
|
|
26
|
-
const
|
|
26
|
+
const endpoint = assertEx(config.actors.bridge.remote?.rpc?.url ?? config.remote?.rpc?.url, () => 'RPC URL is required for Node')
|
|
27
27
|
const transportFactory: TransportFactory = (schemas: RpcSchemaMap) => new HttpRpcTransport(endpoint, schemas)
|
|
28
28
|
const signerAccount = await getBridgeWalletAccount(config)
|
|
29
29
|
const locator = await buildJsonRpcProviderLocator({ signerAccount, transportFactory })
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type BrandedHash } from '@xylabs/sdk-js'
|
|
2
|
+
import {
|
|
3
|
+
isAllowedBlockPayload, type SignedHydratedTransaction, type XyoGatewayRunner,
|
|
4
|
+
} from '@xyo-network/xl1-sdk'
|
|
3
5
|
|
|
4
6
|
export const submitXl1Transaction = async (
|
|
5
7
|
preparedTx: SignedHydratedTransaction,
|
|
@@ -14,12 +16,12 @@ export const submitXl1Transaction = async (
|
|
|
14
16
|
|
|
15
17
|
// Option 2: Add transaction to chain with addTransactionToChain
|
|
16
18
|
// Fails due to resigning of transaction in addTransactionToChain, which causes `from` to be invalid
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
const offChainPayloads = preparedTx[1].filter(p => !isAllowedBlockPayload(p))
|
|
20
|
+
const result = await gateway.addTransactionToChain(preparedTx, offChainPayloads)
|
|
21
|
+
return result
|
|
20
22
|
|
|
21
23
|
// Option 3: Add transaction to chain with addTransactionToChain, but bypass resigning by passing the preparedTx as an unsigned transaction
|
|
22
|
-
const runner = assertEx(gateway.connection.runner, () => 'No runner available on gateway connection')
|
|
23
|
-
const result = await runner.broadcastTransaction(preparedTx)
|
|
24
|
-
return [result, preparedTx]
|
|
24
|
+
// const runner = assertEx(gateway.connection.runner, () => 'No runner available on gateway connection')
|
|
25
|
+
// const result = await runner.broadcastTransaction(preparedTx)
|
|
26
|
+
// return [result, preparedTx]
|
|
25
27
|
}
|