@recoillink/radix-sdk 0.0.0-stage → 45.0.1
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/LICENSE.md +193 -0
- package/README.md +42 -2
- package/dist/clients/protocol.d.ts +31 -0
- package/dist/clients/protocol.d.ts.map +1 -0
- package/dist/clients/protocol.js +95 -0
- package/dist/clients/protocol.js.map +1 -0
- package/dist/clients/provider.d.ts +60 -0
- package/dist/clients/provider.d.ts.map +1 -0
- package/dist/clients/provider.js +187 -0
- package/dist/clients/provider.js.map +1 -0
- package/dist/clients/signer.d.ts +24 -0
- package/dist/clients/signer.d.ts.map +1 -0
- package/dist/clients/signer.js +86 -0
- package/dist/clients/signer.js.map +1 -0
- package/dist/hook/hook-artifact-manager.d.ts +17 -0
- package/dist/hook/hook-artifact-manager.d.ts.map +1 -0
- package/dist/hook/hook-artifact-manager.js +60 -0
- package/dist/hook/hook-artifact-manager.js.map +1 -0
- package/dist/hook/hook-query.d.ts +22 -0
- package/dist/hook/hook-query.d.ts.map +1 -0
- package/dist/hook/hook-query.js +79 -0
- package/dist/hook/hook-query.js.map +1 -0
- package/dist/hook/hook-tx.d.ts +21 -0
- package/dist/hook/hook-tx.d.ts.map +1 -0
- package/dist/hook/hook-tx.js +26 -0
- package/dist/hook/hook-tx.js.map +1 -0
- package/dist/hook/igp-hook.d.ts +24 -0
- package/dist/hook/igp-hook.d.ts.map +1 -0
- package/dist/hook/igp-hook.js +148 -0
- package/dist/hook/igp-hook.js.map +1 -0
- package/dist/hook/merkle-tree-hook.d.ts +24 -0
- package/dist/hook/merkle-tree-hook.d.ts.map +1 -0
- package/dist/hook/merkle-tree-hook.js +51 -0
- package/dist/hook/merkle-tree-hook.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/ism/ism-artifact-manager.d.ts +14 -0
- package/dist/ism/ism-artifact-manager.d.ts.map +1 -0
- package/dist/ism/ism-artifact-manager.js +67 -0
- package/dist/ism/ism-artifact-manager.js.map +1 -0
- package/dist/ism/ism-query.d.ts +23 -0
- package/dist/ism/ism-query.d.ts.map +1 -0
- package/dist/ism/ism-query.js +84 -0
- package/dist/ism/ism-query.js.map +1 -0
- package/dist/ism/ism-tx.d.ts +31 -0
- package/dist/ism/ism-tx.d.ts.map +1 -0
- package/dist/ism/ism-tx.js +43 -0
- package/dist/ism/ism-tx.js.map +1 -0
- package/dist/ism/multisig-ism.d.ts +38 -0
- package/dist/ism/multisig-ism.d.ts.map +1 -0
- package/dist/ism/multisig-ism.js +107 -0
- package/dist/ism/multisig-ism.js.map +1 -0
- package/dist/ism/routing-ism.d.ts +23 -0
- package/dist/ism/routing-ism.d.ts.map +1 -0
- package/dist/ism/routing-ism.js +129 -0
- package/dist/ism/routing-ism.js.map +1 -0
- package/dist/ism/test-ism.d.ts +23 -0
- package/dist/ism/test-ism.d.ts.map +1 -0
- package/dist/ism/test-ism.js +49 -0
- package/dist/ism/test-ism.js.map +1 -0
- package/dist/mailbox/mailbox-artifact-manager.d.ts +15 -0
- package/dist/mailbox/mailbox-artifact-manager.d.ts.map +1 -0
- package/dist/mailbox/mailbox-artifact-manager.js +29 -0
- package/dist/mailbox/mailbox-artifact-manager.js.map +1 -0
- package/dist/mailbox/mailbox-query.d.ts +12 -0
- package/dist/mailbox/mailbox-query.d.ts.map +1 -0
- package/dist/mailbox/mailbox-query.js +72 -0
- package/dist/mailbox/mailbox-query.js.map +1 -0
- package/dist/mailbox/mailbox-query.test.d.ts +2 -0
- package/dist/mailbox/mailbox-query.test.d.ts.map +1 -0
- package/dist/mailbox/mailbox-query.test.js +65 -0
- package/dist/mailbox/mailbox-query.test.js.map +1 -0
- package/dist/mailbox/mailbox-tx.d.ts +21 -0
- package/dist/mailbox/mailbox-tx.d.ts.map +1 -0
- package/dist/mailbox/mailbox-tx.js +27 -0
- package/dist/mailbox/mailbox-tx.js.map +1 -0
- package/dist/mailbox/mailbox.d.ts +24 -0
- package/dist/mailbox/mailbox.d.ts.map +1 -0
- package/dist/mailbox/mailbox.js +171 -0
- package/dist/mailbox/mailbox.js.map +1 -0
- package/dist/runtime.d.ts +7 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +6 -0
- package/dist/runtime.js.map +1 -0
- package/dist/testing/constants.d.ts +61 -0
- package/dist/testing/constants.d.ts.map +1 -0
- package/dist/testing/constants.js +65 -0
- package/dist/testing/constants.js.map +1 -0
- package/dist/testing/index.d.ts +8 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +11 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/node.d.ts +13 -0
- package/dist/testing/node.d.ts.map +1 -0
- package/dist/testing/node.js +42 -0
- package/dist/testing/node.js.map +1 -0
- package/dist/testing/setup.d.ts +20 -0
- package/dist/testing/setup.d.ts.map +1 -0
- package/dist/testing/setup.js +57 -0
- package/dist/testing/setup.js.map +1 -0
- package/dist/tests/e2e-test.setup.d.ts +3 -0
- package/dist/tests/e2e-test.setup.d.ts.map +1 -0
- package/dist/tests/e2e-test.setup.js +32 -0
- package/dist/tests/e2e-test.setup.js.map +1 -0
- package/dist/tests/hook.e2e-test.d.ts +2 -0
- package/dist/tests/hook.e2e-test.d.ts.map +1 -0
- package/dist/tests/hook.e2e-test.js +374 -0
- package/dist/tests/hook.e2e-test.js.map +1 -0
- package/dist/tests/ism.e2e-test.d.ts +2 -0
- package/dist/tests/ism.e2e-test.d.ts.map +1 -0
- package/dist/tests/ism.e2e-test.js +256 -0
- package/dist/tests/ism.e2e-test.js.map +1 -0
- package/dist/tests/mailbox.e2e-test.d.ts +2 -0
- package/dist/tests/mailbox.e2e-test.d.ts.map +1 -0
- package/dist/tests/mailbox.e2e-test.js +250 -0
- package/dist/tests/mailbox.e2e-test.js.map +1 -0
- package/dist/tests/validator-announce.e2e-test.d.ts +2 -0
- package/dist/tests/validator-announce.e2e-test.d.ts.map +1 -0
- package/dist/tests/validator-announce.e2e-test.js +107 -0
- package/dist/tests/validator-announce.e2e-test.js.map +1 -0
- package/dist/tests/warp.e2e-test.d.ts +2 -0
- package/dist/tests/warp.e2e-test.d.ts.map +1 -0
- package/dist/tests/warp.e2e-test.js +597 -0
- package/dist/tests/warp.e2e-test.js.map +1 -0
- package/dist/utils/base-query.d.ts +188 -0
- package/dist/utils/base-query.d.ts.map +1 -0
- package/dist/utils/base-query.js +209 -0
- package/dist/utils/base-query.js.map +1 -0
- package/dist/utils/base.d.ts +67 -0
- package/dist/utils/base.d.ts.map +1 -0
- package/dist/utils/base.js +355 -0
- package/dist/utils/base.js.map +1 -0
- package/dist/utils/constants.d.ts +20 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/constants.js +20 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/signer.d.ts +17 -0
- package/dist/utils/signer.d.ts.map +1 -0
- package/dist/utils/signer.js +60 -0
- package/dist/utils/signer.js.map +1 -0
- package/dist/utils/types.d.ts +141 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +39 -0
- package/dist/utils/types.js.map +1 -0
- package/dist/utils/utils.d.ts +8 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +47 -0
- package/dist/utils/utils.js.map +1 -0
- package/dist/utils/utils.test.d.ts +2 -0
- package/dist/utils/utils.test.d.ts.map +1 -0
- package/dist/utils/utils.test.js +27 -0
- package/dist/utils/utils.test.js.map +1 -0
- package/dist/validator-announce/validator-announce-artifact-manager.d.ts +14 -0
- package/dist/validator-announce/validator-announce-artifact-manager.d.ts.map +1 -0
- package/dist/validator-announce/validator-announce-artifact-manager.js +21 -0
- package/dist/validator-announce/validator-announce-artifact-manager.js.map +1 -0
- package/dist/validator-announce/validator-announce-query.d.ts +6 -0
- package/dist/validator-announce/validator-announce-query.d.ts.map +1 -0
- package/dist/validator-announce/validator-announce-query.js +10 -0
- package/dist/validator-announce/validator-announce-query.js.map +1 -0
- package/dist/validator-announce/validator-announce-tx.d.ts +4 -0
- package/dist/validator-announce/validator-announce-tx.d.ts.map +1 -0
- package/dist/validator-announce/validator-announce-tx.js +6 -0
- package/dist/validator-announce/validator-announce-tx.js.map +1 -0
- package/dist/validator-announce/validator-announce.d.ts +23 -0
- package/dist/validator-announce/validator-announce.d.ts.map +1 -0
- package/dist/validator-announce/validator-announce.js +52 -0
- package/dist/validator-announce/validator-announce.js.map +1 -0
- package/dist/warp/collateral-token.d.ts +23 -0
- package/dist/warp/collateral-token.d.ts.map +1 -0
- package/dist/warp/collateral-token.js +130 -0
- package/dist/warp/collateral-token.js.map +1 -0
- package/dist/warp/populate.d.ts +71 -0
- package/dist/warp/populate.d.ts.map +1 -0
- package/dist/warp/populate.js +110 -0
- package/dist/warp/populate.js.map +1 -0
- package/dist/warp/query.d.ts +44 -0
- package/dist/warp/query.d.ts.map +1 -0
- package/dist/warp/query.js +163 -0
- package/dist/warp/query.js.map +1 -0
- package/dist/warp/synthetic-token.d.ts +23 -0
- package/dist/warp/synthetic-token.d.ts.map +1 -0
- package/dist/warp/synthetic-token.js +131 -0
- package/dist/warp/synthetic-token.js.map +1 -0
- package/dist/warp/warp-artifact-manager.d.ts +15 -0
- package/dist/warp/warp-artifact-manager.d.ts.map +1 -0
- package/dist/warp/warp-artifact-manager.js +49 -0
- package/dist/warp/warp-artifact-manager.js.map +1 -0
- package/dist/warp/warp-query.d.ts +9 -0
- package/dist/warp/warp-query.d.ts.map +1 -0
- package/dist/warp/warp-query.js +130 -0
- package/dist/warp/warp-query.js.map +1 -0
- package/dist/warp/warp-tx.d.ts +48 -0
- package/dist/warp/warp-tx.d.ts.map +1 -0
- package/dist/warp/warp-tx.js +125 -0
- package/dist/warp/warp-tx.js.map +1 -0
- package/docker-compose.yml +139 -0
- package/package.json +74 -3
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { ArtifactState, } from '@recoillink/provider-sdk/artifact';
|
|
2
|
+
import { ZERO_ADDRESS_HEX_32, eqAddressRadix, eqOptionalAddress, isEmptyAddress, } from '@recoillink/utils';
|
|
3
|
+
import { getMailboxConfig } from './mailbox-query.js';
|
|
4
|
+
import { getCreateMailboxTx, getSetMailboxDefaultHookTx, getSetMailboxDefaultIsmTx, getSetMailboxOwnerTx, getSetMailboxRequiredHookTx, } from './mailbox-tx.js';
|
|
5
|
+
export class RadixMailboxReader {
|
|
6
|
+
gateway;
|
|
7
|
+
constructor(gateway) {
|
|
8
|
+
this.gateway = gateway;
|
|
9
|
+
}
|
|
10
|
+
async read(address) {
|
|
11
|
+
const mailboxConfig = await getMailboxConfig(this.gateway, address);
|
|
12
|
+
return {
|
|
13
|
+
artifactState: ArtifactState.DEPLOYED,
|
|
14
|
+
config: {
|
|
15
|
+
owner: mailboxConfig.owner,
|
|
16
|
+
defaultIsm: {
|
|
17
|
+
artifactState: ArtifactState.UNDERIVED,
|
|
18
|
+
deployed: {
|
|
19
|
+
address: mailboxConfig.defaultIsm || ZERO_ADDRESS_HEX_32,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultHook: {
|
|
23
|
+
artifactState: ArtifactState.UNDERIVED,
|
|
24
|
+
deployed: {
|
|
25
|
+
address: mailboxConfig.defaultHook || ZERO_ADDRESS_HEX_32,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
requiredHook: {
|
|
29
|
+
artifactState: ArtifactState.UNDERIVED,
|
|
30
|
+
deployed: {
|
|
31
|
+
address: mailboxConfig.requiredHook || ZERO_ADDRESS_HEX_32,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
deployed: {
|
|
36
|
+
address: mailboxConfig.address,
|
|
37
|
+
domainId: mailboxConfig.localDomain,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export class RadixMailboxWriter extends RadixMailboxReader {
|
|
43
|
+
signer;
|
|
44
|
+
base;
|
|
45
|
+
domainId;
|
|
46
|
+
constructor(gateway, signer, base, domainId) {
|
|
47
|
+
super(gateway);
|
|
48
|
+
this.signer = signer;
|
|
49
|
+
this.base = base;
|
|
50
|
+
this.domainId = domainId;
|
|
51
|
+
}
|
|
52
|
+
async create(artifact) {
|
|
53
|
+
const { config } = artifact;
|
|
54
|
+
const allReceipts = [];
|
|
55
|
+
// Extract addresses from artifact references
|
|
56
|
+
const defaultIsmAddress = config.defaultIsm.deployed.address;
|
|
57
|
+
const defaultHookAddress = config.defaultHook.deployed.address;
|
|
58
|
+
const requiredHookAddress = config.requiredHook.deployed.address;
|
|
59
|
+
const createTx = await getCreateMailboxTx(this.base, this.signer.getAddress(), this.domainId);
|
|
60
|
+
const createReceipt = await this.signer.signAndBroadcast(createTx);
|
|
61
|
+
const address = await this.base.getNewComponent(createReceipt);
|
|
62
|
+
allReceipts.push(createReceipt);
|
|
63
|
+
// Set default ISM (only if address is set)
|
|
64
|
+
if (!isEmptyAddress(defaultIsmAddress)) {
|
|
65
|
+
const setIsmTx = await getSetMailboxDefaultIsmTx(this.base, this.signer.getAddress(), {
|
|
66
|
+
mailboxAddress: address,
|
|
67
|
+
ismAddress: defaultIsmAddress,
|
|
68
|
+
});
|
|
69
|
+
const ismReceipt = await this.signer.signAndBroadcast(setIsmTx);
|
|
70
|
+
allReceipts.push(ismReceipt);
|
|
71
|
+
}
|
|
72
|
+
// Set default hook (only if address is set)
|
|
73
|
+
if (!isEmptyAddress(defaultHookAddress)) {
|
|
74
|
+
const setDefaultHookTx = await getSetMailboxDefaultHookTx(this.base, this.signer.getAddress(), {
|
|
75
|
+
mailboxAddress: address,
|
|
76
|
+
hookAddress: defaultHookAddress,
|
|
77
|
+
});
|
|
78
|
+
const defaultHookReceipt = await this.signer.signAndBroadcast(setDefaultHookTx);
|
|
79
|
+
allReceipts.push(defaultHookReceipt);
|
|
80
|
+
}
|
|
81
|
+
// Set required hook (only if address is set)
|
|
82
|
+
if (!isEmptyAddress(requiredHookAddress)) {
|
|
83
|
+
const setRequiredHookTx = await getSetMailboxRequiredHookTx(this.base, this.signer.getAddress(), {
|
|
84
|
+
mailboxAddress: address,
|
|
85
|
+
hookAddress: requiredHookAddress,
|
|
86
|
+
});
|
|
87
|
+
const requiredHookReceipt = await this.signer.signAndBroadcast(setRequiredHookTx);
|
|
88
|
+
allReceipts.push(requiredHookReceipt);
|
|
89
|
+
}
|
|
90
|
+
// Note: Ownership is NOT transferred during creation. The deployer retains
|
|
91
|
+
// ownership to allow setting ISM and hooks after initial deployment, which
|
|
92
|
+
// require owner permissions. Use update() to transfer ownership to the
|
|
93
|
+
// intended owner once all configuration is complete.
|
|
94
|
+
const deployedArtifact = {
|
|
95
|
+
artifactState: ArtifactState.DEPLOYED,
|
|
96
|
+
config: {
|
|
97
|
+
...artifact.config,
|
|
98
|
+
owner: this.signer.getAddress(),
|
|
99
|
+
},
|
|
100
|
+
deployed: {
|
|
101
|
+
address,
|
|
102
|
+
domainId: this.domainId,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
return [deployedArtifact, allReceipts];
|
|
106
|
+
}
|
|
107
|
+
async update(artifact) {
|
|
108
|
+
const { config, deployed } = artifact;
|
|
109
|
+
const updateTxs = [];
|
|
110
|
+
// Read current state
|
|
111
|
+
const currentState = await this.read(deployed.address);
|
|
112
|
+
// Extract addresses from artifact references
|
|
113
|
+
const expectedDefaultIsmAddress = config.defaultIsm.deployed.address;
|
|
114
|
+
const expectedDefaultHookAddress = config.defaultHook.deployed.address;
|
|
115
|
+
const expectedRequiredHookAddress = config.requiredHook.deployed.address;
|
|
116
|
+
// Extract addresses from current state
|
|
117
|
+
const currentDefaultIsmAddress = currentState.config.defaultIsm.deployed.address;
|
|
118
|
+
const currentDefaultHookAddress = currentState.config.defaultHook.deployed.address;
|
|
119
|
+
const currentRequiredHookAddress = currentState.config.requiredHook.deployed.address;
|
|
120
|
+
// Update default ISM if changed
|
|
121
|
+
if (!eqOptionalAddress(currentDefaultIsmAddress, expectedDefaultIsmAddress, eqAddressRadix)) {
|
|
122
|
+
const setIsmTx = await getSetMailboxDefaultIsmTx(this.base, this.signer.getAddress(), {
|
|
123
|
+
mailboxAddress: deployed.address,
|
|
124
|
+
ismAddress: expectedDefaultIsmAddress,
|
|
125
|
+
});
|
|
126
|
+
updateTxs.push({
|
|
127
|
+
annotation: `Update mailbox default ISM to ${expectedDefaultIsmAddress}`,
|
|
128
|
+
networkId: this.base.getNetworkId(),
|
|
129
|
+
manifest: setIsmTx,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
// Update default hook if changed
|
|
133
|
+
if (!eqOptionalAddress(currentDefaultHookAddress, expectedDefaultHookAddress, eqAddressRadix)) {
|
|
134
|
+
const setDefaultHookTx = await getSetMailboxDefaultHookTx(this.base, this.signer.getAddress(), {
|
|
135
|
+
mailboxAddress: deployed.address,
|
|
136
|
+
hookAddress: expectedDefaultHookAddress,
|
|
137
|
+
});
|
|
138
|
+
updateTxs.push({
|
|
139
|
+
annotation: `Update mailbox default hook to ${expectedDefaultHookAddress}`,
|
|
140
|
+
networkId: this.base.getNetworkId(),
|
|
141
|
+
manifest: setDefaultHookTx,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
// Update required hook if changed
|
|
145
|
+
if (!eqOptionalAddress(currentRequiredHookAddress, expectedRequiredHookAddress, eqAddressRadix)) {
|
|
146
|
+
const setRequiredHookTx = await getSetMailboxRequiredHookTx(this.base, this.signer.getAddress(), {
|
|
147
|
+
mailboxAddress: deployed.address,
|
|
148
|
+
hookAddress: expectedRequiredHookAddress,
|
|
149
|
+
});
|
|
150
|
+
updateTxs.push({
|
|
151
|
+
annotation: `Update mailbox required hook to ${expectedRequiredHookAddress}`,
|
|
152
|
+
networkId: this.base.getNetworkId(),
|
|
153
|
+
manifest: setRequiredHookTx,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
// Update owner if changed (do this last to avoid permission issues)
|
|
157
|
+
if (!eqAddressRadix(currentState.config.owner, config.owner)) {
|
|
158
|
+
const setOwnerTx = await getSetMailboxOwnerTx(this.base, this.gateway, this.signer.getAddress(), {
|
|
159
|
+
mailboxAddress: deployed.address,
|
|
160
|
+
newOwner: config.owner,
|
|
161
|
+
});
|
|
162
|
+
updateTxs.push({
|
|
163
|
+
annotation: `Transfer mailbox ownership to ${config.owner}`,
|
|
164
|
+
networkId: this.base.getNetworkId(),
|
|
165
|
+
manifest: setOwnerTx,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
return updateTxs;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=mailbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailbox.js","sourceRoot":"","sources":["../../src/mailbox/mailbox.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,aAAa,GAEd,MAAM,mCAAmC,CAAC;AAM3C,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,yBAAyB,EACzB,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,OAAO,kBAAkB;IAIE,OAAO;IAAtC,YAA+B,OAAmC;uBAAnC,OAAO;IAA+B,CAAC;IAEtE,KAAK,CAAC,IAAI,CACR,OAAe;QAEf,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAEpE,OAAO;YACL,aAAa,EAAE,aAAa,CAAC,QAAQ;YACrC,MAAM,EAAE;gBACN,KAAK,EAAE,aAAa,CAAC,KAAK;gBAC1B,UAAU,EAAE;oBACV,aAAa,EAAE,aAAa,CAAC,SAAS;oBACtC,QAAQ,EAAE;wBACR,OAAO,EAAE,aAAa,CAAC,UAAU,IAAI,mBAAmB;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gBAChC,WAAW,EAAE,2BAA2B;aACzC,CACF,CAAC;YACF,SAAS,CAAC,IAAI,CAAC;gBACb,UAAU,EAAE,mCAAmC,2BAA2B,EAAE;gBAC5E,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;gBACnC,QAAQ,EAAE,iBAAiB;aAC5B,CAAC,CAAC;QACL,CAAC;QAED,oEAAoE;QACpE,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7D,MAAM,UAAU,GAAG,MAAM,oBAAoB,CAC3C,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,EACxB;gBACE,cAAc,EAAE,QAAQ,CAAC,OAAO;gBAChC,QAAQ,EAAE,MAAM,CAAC,KAAK;aACvB,CACF,CAAC;YACF,SAAS,CAAC,IAAI,CAAC;gBACb,UAAU,EAAE,iCAAiC,MAAM,CAAC,KAAK,EAAE;gBAC3D,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;gBACnC,QAAQ,EAAE,UAAU;aACrB,CAAC,CAAC;QACL,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { RadixProtocolProvider } from './clients/protocol.js';
|
|
2
|
+
export { NetworkId } from '@radixdlt/radix-engine-toolkit';
|
|
3
|
+
export { RadixProvider } from './clients/provider.js';
|
|
4
|
+
export { RadixSigner } from './clients/signer.js';
|
|
5
|
+
export type { RadixSDKReceipt, RadixSDKTransaction } from './utils/types.js';
|
|
6
|
+
export { stringToTransactionManifest, transactionManifestToString, } from './utils/utils.js';
|
|
7
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,kBAAkB,CAAC"}
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { RadixProtocolProvider } from './clients/protocol.js';
|
|
2
|
+
export { NetworkId } from '@radixdlt/radix-engine-toolkit';
|
|
3
|
+
export { RadixProvider } from './clients/provider.js';
|
|
4
|
+
export { RadixSigner } from './clients/signer.js';
|
|
5
|
+
export { stringToTransactionManifest, transactionManifestToString, } from './utils/utils.js';
|
|
6
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ProtocolType } from '@recoillink/provider-sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Test timeout for operations that require node startup and deployment
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFAULT_E2E_TEST_TIMEOUT = 100000;
|
|
6
|
+
/**
|
|
7
|
+
* Hyperlane Radix GitHub repository and version
|
|
8
|
+
*/
|
|
9
|
+
export declare const HYPERLANE_RADIX_GIT = "https://github.com/hyperlane-xyz/hyperlane-radix";
|
|
10
|
+
export declare const HYPERLANE_RADIX_VERSION = "1.1.0";
|
|
11
|
+
/**
|
|
12
|
+
* Test private key for Radix local network
|
|
13
|
+
* This matches the key used in CLI tests
|
|
14
|
+
*/
|
|
15
|
+
export declare const TEST_RADIX_PRIVATE_KEY = "0x8ef41fc20bf963ce18494c0f13e9303f70abc4c1d1ecfdb0a329d7fd468865b8";
|
|
16
|
+
/**
|
|
17
|
+
* Test private key for Radix local network to test transactions sent
|
|
18
|
+
* from an account that is not the default signer
|
|
19
|
+
*/
|
|
20
|
+
export declare const OTHER_RADIX_PRIVATE_KEY = "0xc2c13fcb59f6ee4ed9611ce44eefc6cdf62e6a575c09fb5c4db3e205001328c4";
|
|
21
|
+
/**
|
|
22
|
+
* Test deployer address derived from TEST_RADIX_PRIVATE_KEY
|
|
23
|
+
*/
|
|
24
|
+
export declare const TEST_RADIX_DEPLOYER_ADDRESS = "account_loc12ytsy99ajzkwy7ce0444fs8avat7jy3fkj5mk64yz2z3yml6s7y7x3";
|
|
25
|
+
/**
|
|
26
|
+
* Test deployer address derived from OTHER_RADIX_PRIVATE_KEY
|
|
27
|
+
*/
|
|
28
|
+
export declare const OTHER_TEST_RADIX_DEPLOYER_ADDRESS = "account_loc129y2xw0zp9qafpas7lr2as4kt9yv0vy62yt5wfd6fw4ky4td7cl8ah";
|
|
29
|
+
/**
|
|
30
|
+
* Burn address for Radix local network
|
|
31
|
+
*/
|
|
32
|
+
export declare const TEST_RADIX_BURN_ADDRESS = "account_loc1294g56ga4ckdzhksx6vnrns2jj0v47ju87flsyscxdjxu9wrkjp5vt";
|
|
33
|
+
/**
|
|
34
|
+
* Default test chain metadata for Radix local network
|
|
35
|
+
*/
|
|
36
|
+
export declare const TEST_RADIX_CHAIN_METADATA: {
|
|
37
|
+
readonly name: 'radixtest';
|
|
38
|
+
readonly protocol: ProtocolType.Radix;
|
|
39
|
+
readonly chainId: 240;
|
|
40
|
+
readonly domainId: 1421493353;
|
|
41
|
+
readonly nativeToken: {
|
|
42
|
+
readonly decimals: 18;
|
|
43
|
+
readonly name: 'Radix';
|
|
44
|
+
readonly symbol: 'XRD';
|
|
45
|
+
readonly denom: 'resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd';
|
|
46
|
+
};
|
|
47
|
+
readonly blocks: {
|
|
48
|
+
readonly confirmations: 0;
|
|
49
|
+
readonly estimateBlockTime: 5;
|
|
50
|
+
};
|
|
51
|
+
readonly gatewayUrls: [{
|
|
52
|
+
readonly http: 'http://127.0.0.1:5308';
|
|
53
|
+
}];
|
|
54
|
+
readonly rpcUrls: [{
|
|
55
|
+
readonly http: 'http://127.0.0.1:3333/core';
|
|
56
|
+
}];
|
|
57
|
+
readonly rpcPort: 3333;
|
|
58
|
+
readonly rpcUrl: 'http://127.0.0.1:3333';
|
|
59
|
+
readonly restPort: 3333;
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/testing/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD;;GAEG;AACH,eAAO,MAAM,wBAAwB,SAAU,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,mBAAmB,qDACoB,CAAC;AACrD,eAAO,MAAM,uBAAuB,UAAU,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,sBAAsB,uEACmC,CAAC;AAEvE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,uEACkC,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,2BAA2B,uEAC8B,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,iCAAiC,uEACwB,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,uBAAuB,uEACkC,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,yBAAyB;mBAC9B,WAAW;;sBAER,GAAG;uBACF,UAAU;;iBAElB,QAAQ,EAAE,EAAE;iBACZ,IAAI,EAAE,OAAO;iBACb,MAAM,EAAE,KAAK;iBACb,KAAK,EACH,qEAAqE;;;iBAGvE,aAAa,EAAE,CAAC;iBAChB,iBAAiB,EAAE,CAAC;;;uBAIZ,uBAAuB;;;uBAKvB,4BAA4B;;sBAG7B,IAAI;qBACL,uBAAuB;uBACrB,IAAI;CACsB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ProtocolType } from '@recoillink/provider-sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Test timeout for operations that require node startup and deployment
|
|
4
|
+
*/
|
|
5
|
+
export const DEFAULT_E2E_TEST_TIMEOUT = 100_000;
|
|
6
|
+
/**
|
|
7
|
+
* Hyperlane Radix GitHub repository and version
|
|
8
|
+
*/
|
|
9
|
+
export const HYPERLANE_RADIX_GIT = 'https://github.com/hyperlane-xyz/hyperlane-radix';
|
|
10
|
+
export const HYPERLANE_RADIX_VERSION = '1.1.0';
|
|
11
|
+
/**
|
|
12
|
+
* Test private key for Radix local network
|
|
13
|
+
* This matches the key used in CLI tests
|
|
14
|
+
*/
|
|
15
|
+
export const TEST_RADIX_PRIVATE_KEY = '0x8ef41fc20bf963ce18494c0f13e9303f70abc4c1d1ecfdb0a329d7fd468865b8';
|
|
16
|
+
/**
|
|
17
|
+
* Test private key for Radix local network to test transactions sent
|
|
18
|
+
* from an account that is not the default signer
|
|
19
|
+
*/
|
|
20
|
+
export const OTHER_RADIX_PRIVATE_KEY = '0xc2c13fcb59f6ee4ed9611ce44eefc6cdf62e6a575c09fb5c4db3e205001328c4';
|
|
21
|
+
/**
|
|
22
|
+
* Test deployer address derived from TEST_RADIX_PRIVATE_KEY
|
|
23
|
+
*/
|
|
24
|
+
export const TEST_RADIX_DEPLOYER_ADDRESS = 'account_loc12ytsy99ajzkwy7ce0444fs8avat7jy3fkj5mk64yz2z3yml6s7y7x3';
|
|
25
|
+
/**
|
|
26
|
+
* Test deployer address derived from OTHER_RADIX_PRIVATE_KEY
|
|
27
|
+
*/
|
|
28
|
+
export const OTHER_TEST_RADIX_DEPLOYER_ADDRESS = 'account_loc129y2xw0zp9qafpas7lr2as4kt9yv0vy62yt5wfd6fw4ky4td7cl8ah';
|
|
29
|
+
/**
|
|
30
|
+
* Burn address for Radix local network
|
|
31
|
+
*/
|
|
32
|
+
export const TEST_RADIX_BURN_ADDRESS = 'account_loc1294g56ga4ckdzhksx6vnrns2jj0v47ju87flsyscxdjxu9wrkjp5vt';
|
|
33
|
+
/**
|
|
34
|
+
* Default test chain metadata for Radix local network
|
|
35
|
+
*/
|
|
36
|
+
export const TEST_RADIX_CHAIN_METADATA = {
|
|
37
|
+
name: 'radixtest',
|
|
38
|
+
protocol: ProtocolType.Radix,
|
|
39
|
+
chainId: 240,
|
|
40
|
+
domainId: 1421493353,
|
|
41
|
+
nativeToken: {
|
|
42
|
+
decimals: 18,
|
|
43
|
+
name: 'Radix',
|
|
44
|
+
symbol: 'XRD',
|
|
45
|
+
denom: 'resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd',
|
|
46
|
+
},
|
|
47
|
+
blocks: {
|
|
48
|
+
confirmations: 0,
|
|
49
|
+
estimateBlockTime: 5,
|
|
50
|
+
},
|
|
51
|
+
gatewayUrls: [
|
|
52
|
+
{
|
|
53
|
+
http: 'http://127.0.0.1:5308',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
rpcUrls: [
|
|
57
|
+
{
|
|
58
|
+
http: 'http://127.0.0.1:3333/core',
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
rpcPort: 3333,
|
|
62
|
+
rpcUrl: 'http://127.0.0.1:3333',
|
|
63
|
+
restPort: 3333,
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/testing/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,OAAO,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAC9B,kDAAkD,CAAC;AACrD,MAAM,CAAC,MAAM,uBAAuB,GAAG,OAAO,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GACjC,oEAAoE,CAAC;AAEvE;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAClC,oEAAoE,CAAC;AAEvE;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GACtC,oEAAoE,CAAC;AAEvE;;GAEG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAC5C,oEAAoE,CAAC;AAEvE;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAClC,oEAAoE,CAAC;AAEvE;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,YAAY,CAAC,KAAK;IAC5B,OAAO,EAAE,GAAG;IACZ,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE;QACX,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,KAAK;QACb,KAAK,EACH,qEAAqE;KACxE;IACD,MAAM,EAAE;QACN,aAAa,EAAE,CAAC;QAChB,iBAAiB,EAAE,CAAC;KACrB;IACD,WAAW,EAAE;QACX;YACE,IAAI,EAAE,uBAAuB;SAC9B;KACF;IACD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,4BAA4B;SACnC;KACF;IACD,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,uBAAuB;IAC/B,QAAQ,EAAE,IAAI;CACsB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test utilities for Radix SDK
|
|
3
|
+
* Export via @recoillink/radix-sdk/testing
|
|
4
|
+
*/
|
|
5
|
+
export { DEFAULT_E2E_TEST_TIMEOUT, HYPERLANE_RADIX_GIT, HYPERLANE_RADIX_VERSION, TEST_RADIX_BURN_ADDRESS, TEST_RADIX_CHAIN_METADATA, TEST_RADIX_DEPLOYER_ADDRESS, TEST_RADIX_PRIVATE_KEY, } from './constants.js';
|
|
6
|
+
export { runRadixNode } from './node.js';
|
|
7
|
+
export { RadixContractArtifacts, deployHyperlaneRadixPackage, downloadRadixContracts, } from './setup.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test utilities for Radix SDK
|
|
3
|
+
* Export via @recoillink/radix-sdk/testing
|
|
4
|
+
*/
|
|
5
|
+
// Constants
|
|
6
|
+
export { DEFAULT_E2E_TEST_TIMEOUT, HYPERLANE_RADIX_GIT, HYPERLANE_RADIX_VERSION, TEST_RADIX_BURN_ADDRESS, TEST_RADIX_CHAIN_METADATA, TEST_RADIX_DEPLOYER_ADDRESS, TEST_RADIX_PRIVATE_KEY, } from './constants.js';
|
|
7
|
+
// Node management
|
|
8
|
+
export { runRadixNode } from './node.js';
|
|
9
|
+
// Setup and deployment
|
|
10
|
+
export { deployHyperlaneRadixPackage, downloadRadixContracts, } from './setup.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY;AACZ,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAExB,kBAAkB;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,uBAAuB;AACvB,OAAO,EAEL,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StartedDockerComposeEnvironment } from 'testcontainers';
|
|
2
|
+
import { TestChainMetadata } from '@recoillink/provider-sdk/chain';
|
|
3
|
+
import { RadixContractArtifacts } from './setup.js';
|
|
4
|
+
/**
|
|
5
|
+
* Starts a local Radix node using Docker Compose and deploys the Hyperlane package
|
|
6
|
+
*
|
|
7
|
+
* @param chainMetadata - Test chain metadata configuration
|
|
8
|
+
* @param hyperlanePackageArtifacts - Compiled Radix contract artifacts (WASM + RPD)
|
|
9
|
+
* @param privateKey - Optional private key for deployment (defaults to test key)
|
|
10
|
+
* @returns The DockerComposeEnvironment instance
|
|
11
|
+
*/
|
|
12
|
+
export declare function runRadixNode(chainMetadata: TestChainMetadata, hyperlanePackageArtifacts: RadixContractArtifacts, privateKey?: string): Promise<StartedDockerComposeEnvironment>;
|
|
13
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/testing/node.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,+BAA+B,EAEhC,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,EACL,sBAAsB,EAEvB,MAAM,YAAY,CAAC;AAKpB;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,aAAa,EAAE,iBAAiB,EAChC,yBAAyB,EAAE,sBAAsB,EACjD,UAAU,CAAC,EAAE,MAAM,4CA8CpB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* eslint-disable import/no-nodejs-modules */
|
|
2
|
+
import { dirname, join } from 'path';
|
|
3
|
+
import { DockerComposeEnvironment, Wait, } from 'testcontainers';
|
|
4
|
+
/* eslint-disable import/no-nodejs-modules */
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
import { assert, retryAsync, rootLogger, sleep } from '@recoillink/utils';
|
|
7
|
+
import { deployHyperlaneRadixPackage, } from './setup.js';
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = dirname(__filename);
|
|
10
|
+
/**
|
|
11
|
+
* Starts a local Radix node using Docker Compose and deploys the Hyperlane package
|
|
12
|
+
*
|
|
13
|
+
* @param chainMetadata - Test chain metadata configuration
|
|
14
|
+
* @param hyperlanePackageArtifacts - Compiled Radix contract artifacts (WASM + RPD)
|
|
15
|
+
* @param privateKey - Optional private key for deployment (defaults to test key)
|
|
16
|
+
* @returns The DockerComposeEnvironment instance
|
|
17
|
+
*/
|
|
18
|
+
export async function runRadixNode(chainMetadata, hyperlanePackageArtifacts, privateKey) {
|
|
19
|
+
const gatewayUrl = chainMetadata.gatewayUrls?.[0]?.http;
|
|
20
|
+
assert(gatewayUrl, `At least one gateway url should be defined in the ${chainMetadata.name} chain metadata`);
|
|
21
|
+
const gatewayPort = new URL(gatewayUrl).port;
|
|
22
|
+
// Retry docker-compose up to handle transient Docker registry 503 errors in CI
|
|
23
|
+
const environment = await retryAsync(async () => new DockerComposeEnvironment(
|
|
24
|
+
// move back to the root of this package
|
|
25
|
+
join(__dirname, '..', '..'), 'docker-compose.yml')
|
|
26
|
+
.withEnvironment({
|
|
27
|
+
RADIX_CORE_PORT: chainMetadata.rpcPort.toString(),
|
|
28
|
+
RADIX_GATEWAY_PORT: gatewayPort,
|
|
29
|
+
})
|
|
30
|
+
.withProfiles('fullnode', 'network-gateway-image')
|
|
31
|
+
.withWaitStrategy('postgres_db-1', Wait.forHealthCheck())
|
|
32
|
+
.withWaitStrategy('fullnode-1', Wait.forHealthCheck())
|
|
33
|
+
.withWaitStrategy('gateway_api_image-1', Wait.forLogMessage(/HealthyAndSynced=1/))
|
|
34
|
+
.up(), 3, // maxRetries
|
|
35
|
+
5000);
|
|
36
|
+
// Wait 10 sec to give time to the gateway api to sync
|
|
37
|
+
rootLogger.info(`Waiting on the gateway API to sync for ${chainMetadata.name}`);
|
|
38
|
+
await sleep(10_000);
|
|
39
|
+
await deployHyperlaneRadixPackage(chainMetadata, hyperlanePackageArtifacts, privateKey);
|
|
40
|
+
return environment;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/testing/node.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EACL,wBAAwB,EAExB,IAAI,GACL,MAAM,gBAAgB,CAAC;AACxB,6CAA6C;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAGpC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1E,OAAO,EAEL,2BAA2B,GAC5B,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC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} from '@recoillink/provider-sdk/chain';
|
|
2
|
+
export interface RadixContractArtifacts {
|
|
3
|
+
code: Uint8Array;
|
|
4
|
+
packageDefinition: Uint8Array;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Downloads Radix contract artifacts (WASM and RPD files) from GitHub releases
|
|
8
|
+
*/
|
|
9
|
+
export declare function downloadRadixContracts(): Promise<RadixContractArtifacts>;
|
|
10
|
+
export interface RadixPackageDeployment {
|
|
11
|
+
packageAddress: string;
|
|
12
|
+
xrdAddress: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Deploys the Hyperlane Radix package to a test chain and adds it to the provided metadata.
|
|
16
|
+
* Also returns the XRD resource address for the network, which should be used to update
|
|
17
|
+
* the chain metadata's nativeToken.denom.
|
|
18
|
+
*/
|
|
19
|
+
export declare function deployHyperlaneRadixPackage(chainMetadata: TestChainMetadata | undefined, hyperlanePackageArtifacts: RadixContractArtifacts, privateKey?: string): Promise<RadixPackageDeployment>;
|
|
20
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/testing/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAYnE,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,UAAU,CAAC;IACjB,iBAAiB,EAAE,UAAU,CAAC;CAC/B;AAcD;;GAEG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAa9E;AAED,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAsB,2BAA2B,CAC/C,aAAa,EAAE,iBAAiB,YAA4B,EAC5D,yBAAyB,EAAE,sBAAsB,EACjD,UAAU,GAAE,MAA+B,GAC1C,OAAO,CAAC,sBAAsB,CAAC,CAmCjC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { retryAsync, rootLogger } from '@recoillink/utils';
|
|
2
|
+
import { RadixSigner } from '../clients/signer.js';
|
|
3
|
+
import { HYPERLANE_RADIX_GIT, HYPERLANE_RADIX_VERSION, TEST_RADIX_CHAIN_METADATA, TEST_RADIX_PRIVATE_KEY, } from './constants.js';
|
|
4
|
+
/**
|
|
5
|
+
* Downloads a file from a URL and returns it as a Uint8Array
|
|
6
|
+
*/
|
|
7
|
+
async function downloadFile(url) {
|
|
8
|
+
const response = await fetch(url);
|
|
9
|
+
if (!response.ok || !response.body) {
|
|
10
|
+
throw new Error(`Failed to download ${url}: ${response.statusText}`);
|
|
11
|
+
}
|
|
12
|
+
return new Uint8Array(await response.arrayBuffer());
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Downloads Radix contract artifacts (WASM and RPD files) from GitHub releases
|
|
16
|
+
*/
|
|
17
|
+
export async function downloadRadixContracts() {
|
|
18
|
+
rootLogger.info(`Downloading hyperlane-radix v${HYPERLANE_RADIX_VERSION}...`);
|
|
19
|
+
const wasmUrl = `${HYPERLANE_RADIX_GIT}/releases/download/v${HYPERLANE_RADIX_VERSION}/hyperlane_radix.wasm`;
|
|
20
|
+
const rpdUrl = `${HYPERLANE_RADIX_GIT}/releases/download/v${HYPERLANE_RADIX_VERSION}/hyperlane_radix.rpd`;
|
|
21
|
+
const [code, packageDefinition] = await Promise.all([
|
|
22
|
+
retryAsync(() => downloadFile(wasmUrl), 3, 1000),
|
|
23
|
+
retryAsync(() => downloadFile(rpdUrl), 3, 1000),
|
|
24
|
+
]);
|
|
25
|
+
rootLogger.info('Downloaded Radix contracts successfully');
|
|
26
|
+
return { code, packageDefinition };
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Deploys the Hyperlane Radix package to a test chain and adds it to the provided metadata.
|
|
30
|
+
* Also returns the XRD resource address for the network, which should be used to update
|
|
31
|
+
* the chain metadata's nativeToken.denom.
|
|
32
|
+
*/
|
|
33
|
+
export async function deployHyperlaneRadixPackage(chainMetadata = TEST_RADIX_CHAIN_METADATA, hyperlanePackageArtifacts, privateKey = TEST_RADIX_PRIVATE_KEY) {
|
|
34
|
+
// Adding dummy package address to avoid the signer crashing because
|
|
35
|
+
// no Hyperlane package is deployed on the new node
|
|
36
|
+
const metadata = {
|
|
37
|
+
...chainMetadata,
|
|
38
|
+
packageAddress: 'not-yet-deployed',
|
|
39
|
+
};
|
|
40
|
+
const signer = await RadixSigner.connectWithSigner(metadata, privateKey);
|
|
41
|
+
// Get the actual XRD resource address for this network
|
|
42
|
+
// This is dynamically derived based on the network ID and must be used
|
|
43
|
+
// in the chain metadata to ensure IGP and transfers use the correct token
|
|
44
|
+
const xrdAddress = await signer['base'].getXrdAddress();
|
|
45
|
+
// Fund the account with the internal signer
|
|
46
|
+
// Use retryAsync to handle transient errors (e.g., epoch expiry)
|
|
47
|
+
await retryAsync(() => signer['signer'].getTestnetXrd(), 3, // attempts
|
|
48
|
+
3000);
|
|
49
|
+
rootLogger.info(`Funded test account on ${metadata.name} before publishing the hyperlane package`);
|
|
50
|
+
const packageAddress = await signer.publishPackage({
|
|
51
|
+
code: hyperlanePackageArtifacts.code,
|
|
52
|
+
packageDefinition: hyperlanePackageArtifacts.packageDefinition,
|
|
53
|
+
});
|
|
54
|
+
rootLogger.info(`Deployed Hyperlane package to: ${packageAddress}`);
|
|
55
|
+
return { packageAddress, xrdAddress };
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/testing/setup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,yBAAy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AAM,QAAQ,GAAsB;QAClC,GAAG,aAAa;QAChB,cAAc,EAAE,kBAAkB;KACnC,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAEzE,uDAAuD;IACvD,uEAAuE;IACvE,0EAA0E;IAC1E,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,CAAC;IAExD,4CAA4C;IAC5C,iEAAiE;IACjE,MAAM,UAAU,CACd,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,aAAa,EAAE,EACtC,CAAC,EAAE,WAAW;IACd,IAAI,CACL,CAAC;IAEF,UAAU,CAAC,IAAI,CACb,0BAA0B,QAAQ,CAAC,IAAI,0CAA0C,CAClF,CAAC;IAEF,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC;QACjD,IAAI,EAAE,yBAAyB,CAAC,IAAI;QACpC,iBAAiB,EAAE,yBAAyB,CAAC,iBAAiB;KAC/D,CAAC,CAAC;IAEH,UAAU,CAAC,IAAI,CAAC,kCAAkC,cAAc,EAAE,CAAC,CAAC;IAEpE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2e-test.setup.d.ts","sourceRoot":"","sources":["../../src/tests/e2e-test.setup.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAgBnE,eAAO,IAAI,4BAA4B,EAAE,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { deepCopy } from '@recoillink/utils';
|
|
2
|
+
import { DEFAULT_E2E_TEST_TIMEOUT, TEST_RADIX_CHAIN_METADATA, } from '../testing/constants.js';
|
|
3
|
+
import { runRadixNode } from '../testing/node.js';
|
|
4
|
+
import { deployHyperlaneRadixPackage, downloadRadixContracts, } from '../testing/setup.js';
|
|
5
|
+
let radixNodeInstance;
|
|
6
|
+
// Global chain metadata with deployed package address
|
|
7
|
+
export let DEPLOYED_TEST_CHAIN_METADATA;
|
|
8
|
+
before(async function () {
|
|
9
|
+
// Use 3x timeout for setup since Docker container startup can be slow in CI
|
|
10
|
+
// (image pulling, postgres init, fullnode sync, gateway sync)
|
|
11
|
+
this.timeout(3 * DEFAULT_E2E_TEST_TIMEOUT);
|
|
12
|
+
// Download Radix contracts
|
|
13
|
+
const artifacts = await downloadRadixContracts();
|
|
14
|
+
// Start node
|
|
15
|
+
radixNodeInstance = await runRadixNode(TEST_RADIX_CHAIN_METADATA, artifacts);
|
|
16
|
+
// Deploy Hyperlane package and get address and XRD resource address
|
|
17
|
+
const { packageAddress, xrdAddress } = await deployHyperlaneRadixPackage(TEST_RADIX_CHAIN_METADATA, artifacts);
|
|
18
|
+
// Store metadata with package address and correct XRD denom for tests to use
|
|
19
|
+
DEPLOYED_TEST_CHAIN_METADATA = deepCopy(TEST_RADIX_CHAIN_METADATA);
|
|
20
|
+
DEPLOYED_TEST_CHAIN_METADATA.packageAddress = packageAddress;
|
|
21
|
+
if (DEPLOYED_TEST_CHAIN_METADATA.nativeToken) {
|
|
22
|
+
DEPLOYED_TEST_CHAIN_METADATA.nativeToken.denom = xrdAddress;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
after(async function () {
|
|
26
|
+
// Might take a while shutting down the compose environment
|
|
27
|
+
this.timeout(DEFAULT_E2E_TEST_TIMEOUT);
|
|
28
|
+
if (radixNodeInstance) {
|
|
29
|
+
await radixNodeInstance.down();
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=e2e-test.setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2e-test.setup.js","sourceRoot":"","sources":["../../src/tests/e2e-test.setup.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EA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