@n1xyz/nord-ts 0.0.10 → 0.0.12
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/bridge/client.js +2 -2
- package/dist/idl/bridge.js +33 -0
- package/package.json +1 -1
- package/src/bridge/client.ts +2 -2
- package/src/idl/bridge.ts +34 -0
package/dist/bridge/client.js
CHANGED
|
@@ -172,7 +172,7 @@ class SolanaBridgeClient {
|
|
|
172
172
|
*/
|
|
173
173
|
async depositSpl(params) {
|
|
174
174
|
const [contractStorage] = await this.findContractStoragePda();
|
|
175
|
-
const [
|
|
175
|
+
const [assetConfig] = await this.findAssetConfigPda(params.mint);
|
|
176
176
|
// Get the last deposit index from contract storage
|
|
177
177
|
const contractStorageAccount = await this.program.account.contractStorage.fetch(contractStorage);
|
|
178
178
|
const lastDepositIndex = contractStorageAccount.lastDepositIndex.toNumber();
|
|
@@ -188,7 +188,7 @@ class SolanaBridgeClient {
|
|
|
188
188
|
const accounts = {
|
|
189
189
|
depositor: this.provider.wallet.publicKey,
|
|
190
190
|
deposit,
|
|
191
|
-
|
|
191
|
+
assetConfig,
|
|
192
192
|
contractStorage,
|
|
193
193
|
fromAccount: params.fromAccount,
|
|
194
194
|
toAccount: params.toAccount,
|
package/dist/idl/bridge.js
CHANGED
|
@@ -111,6 +111,10 @@ exports.BRIDGE_IDL = {
|
|
|
111
111
|
},
|
|
112
112
|
},
|
|
113
113
|
},
|
|
114
|
+
{
|
|
115
|
+
name: "program",
|
|
116
|
+
address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
|
|
117
|
+
},
|
|
114
118
|
{
|
|
115
119
|
name: "token_program",
|
|
116
120
|
},
|
|
@@ -196,6 +200,10 @@ exports.BRIDGE_IDL = {
|
|
|
196
200
|
],
|
|
197
201
|
},
|
|
198
202
|
},
|
|
203
|
+
{
|
|
204
|
+
name: "program",
|
|
205
|
+
address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
|
|
206
|
+
},
|
|
199
207
|
{
|
|
200
208
|
name: "system_program",
|
|
201
209
|
address: "11111111111111111111111111111111",
|
|
@@ -250,6 +258,10 @@ exports.BRIDGE_IDL = {
|
|
|
250
258
|
],
|
|
251
259
|
},
|
|
252
260
|
},
|
|
261
|
+
{
|
|
262
|
+
name: "program",
|
|
263
|
+
address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
|
|
264
|
+
},
|
|
253
265
|
{
|
|
254
266
|
name: "system_program",
|
|
255
267
|
address: "11111111111111111111111111111111",
|
|
@@ -273,6 +285,11 @@ exports.BRIDGE_IDL = {
|
|
|
273
285
|
writable: true,
|
|
274
286
|
signer: true,
|
|
275
287
|
},
|
|
288
|
+
{
|
|
289
|
+
name: "program",
|
|
290
|
+
signer: true,
|
|
291
|
+
address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
|
|
292
|
+
},
|
|
276
293
|
{
|
|
277
294
|
name: "contract_storage",
|
|
278
295
|
writable: true,
|
|
@@ -360,6 +377,10 @@ exports.BRIDGE_IDL = {
|
|
|
360
377
|
],
|
|
361
378
|
},
|
|
362
379
|
},
|
|
380
|
+
{
|
|
381
|
+
name: "program",
|
|
382
|
+
address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
|
|
383
|
+
},
|
|
363
384
|
{
|
|
364
385
|
name: "system_program",
|
|
365
386
|
address: "11111111111111111111111111111111",
|
|
@@ -416,6 +437,10 @@ exports.BRIDGE_IDL = {
|
|
|
416
437
|
],
|
|
417
438
|
},
|
|
418
439
|
},
|
|
440
|
+
{
|
|
441
|
+
name: "program",
|
|
442
|
+
address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
|
|
443
|
+
},
|
|
419
444
|
],
|
|
420
445
|
args: [
|
|
421
446
|
{
|
|
@@ -469,6 +494,10 @@ exports.BRIDGE_IDL = {
|
|
|
469
494
|
],
|
|
470
495
|
},
|
|
471
496
|
},
|
|
497
|
+
{
|
|
498
|
+
name: "program",
|
|
499
|
+
address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
|
|
500
|
+
},
|
|
472
501
|
{
|
|
473
502
|
name: "system_program",
|
|
474
503
|
address: "11111111111111111111111111111111",
|
|
@@ -595,6 +624,10 @@ exports.BRIDGE_IDL = {
|
|
|
595
624
|
],
|
|
596
625
|
},
|
|
597
626
|
},
|
|
627
|
+
{
|
|
628
|
+
name: "program",
|
|
629
|
+
address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
|
|
630
|
+
},
|
|
598
631
|
{
|
|
599
632
|
name: "token_program",
|
|
600
633
|
},
|
package/package.json
CHANGED
package/src/bridge/client.ts
CHANGED
|
@@ -195,7 +195,7 @@ export class SolanaBridgeClient {
|
|
|
195
195
|
*/
|
|
196
196
|
async depositSpl(params: DepositSplParams): Promise<string> {
|
|
197
197
|
const [contractStorage] = await this.findContractStoragePda();
|
|
198
|
-
const [
|
|
198
|
+
const [assetConfig] = await this.findAssetConfigPda(params.mint);
|
|
199
199
|
|
|
200
200
|
// Get the last deposit index from contract storage
|
|
201
201
|
const contractStorageAccount =
|
|
@@ -217,7 +217,7 @@ export class SolanaBridgeClient {
|
|
|
217
217
|
const accounts: any = {
|
|
218
218
|
depositor: this.provider.wallet.publicKey,
|
|
219
219
|
deposit,
|
|
220
|
-
|
|
220
|
+
assetConfig,
|
|
221
221
|
contractStorage,
|
|
222
222
|
fromAccount: params.fromAccount,
|
|
223
223
|
toAccount: params.toAccount,
|
package/src/idl/bridge.ts
CHANGED
|
@@ -110,6 +110,10 @@ export const BRIDGE_IDL: Idl = {
|
|
|
110
110
|
},
|
|
111
111
|
},
|
|
112
112
|
},
|
|
113
|
+
{
|
|
114
|
+
name: "program",
|
|
115
|
+
address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
|
|
116
|
+
},
|
|
113
117
|
{
|
|
114
118
|
name: "token_program",
|
|
115
119
|
},
|
|
@@ -195,6 +199,10 @@ export const BRIDGE_IDL: Idl = {
|
|
|
195
199
|
],
|
|
196
200
|
},
|
|
197
201
|
},
|
|
202
|
+
{
|
|
203
|
+
name: "program",
|
|
204
|
+
address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
|
|
205
|
+
},
|
|
198
206
|
{
|
|
199
207
|
name: "system_program",
|
|
200
208
|
address: "11111111111111111111111111111111",
|
|
@@ -249,6 +257,10 @@ export const BRIDGE_IDL: Idl = {
|
|
|
249
257
|
],
|
|
250
258
|
},
|
|
251
259
|
},
|
|
260
|
+
{
|
|
261
|
+
name: "program",
|
|
262
|
+
address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
|
|
263
|
+
},
|
|
252
264
|
{
|
|
253
265
|
name: "system_program",
|
|
254
266
|
address: "11111111111111111111111111111111",
|
|
@@ -272,6 +284,11 @@ export const BRIDGE_IDL: Idl = {
|
|
|
272
284
|
writable: true,
|
|
273
285
|
signer: true,
|
|
274
286
|
},
|
|
287
|
+
{
|
|
288
|
+
name: "program",
|
|
289
|
+
signer: true,
|
|
290
|
+
address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
|
|
291
|
+
},
|
|
275
292
|
{
|
|
276
293
|
name: "contract_storage",
|
|
277
294
|
writable: true,
|
|
@@ -359,6 +376,10 @@ export const BRIDGE_IDL: Idl = {
|
|
|
359
376
|
],
|
|
360
377
|
},
|
|
361
378
|
},
|
|
379
|
+
{
|
|
380
|
+
name: "program",
|
|
381
|
+
address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
|
|
382
|
+
},
|
|
362
383
|
{
|
|
363
384
|
name: "system_program",
|
|
364
385
|
address: "11111111111111111111111111111111",
|
|
@@ -415,6 +436,10 @@ export const BRIDGE_IDL: Idl = {
|
|
|
415
436
|
],
|
|
416
437
|
},
|
|
417
438
|
},
|
|
439
|
+
{
|
|
440
|
+
name: "program",
|
|
441
|
+
address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
|
|
442
|
+
},
|
|
418
443
|
],
|
|
419
444
|
args: [
|
|
420
445
|
{
|
|
@@ -468,6 +493,10 @@ export const BRIDGE_IDL: Idl = {
|
|
|
468
493
|
],
|
|
469
494
|
},
|
|
470
495
|
},
|
|
496
|
+
{
|
|
497
|
+
name: "program",
|
|
498
|
+
address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
|
|
499
|
+
},
|
|
471
500
|
{
|
|
472
501
|
name: "system_program",
|
|
473
502
|
address: "11111111111111111111111111111111",
|
|
@@ -594,6 +623,10 @@ export const BRIDGE_IDL: Idl = {
|
|
|
594
623
|
],
|
|
595
624
|
},
|
|
596
625
|
},
|
|
626
|
+
{
|
|
627
|
+
name: "program",
|
|
628
|
+
address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
|
|
629
|
+
},
|
|
597
630
|
{
|
|
598
631
|
name: "token_program",
|
|
599
632
|
},
|
|
@@ -894,3 +927,4 @@ export const BRIDGE_IDL: Idl = {
|
|
|
894
927
|
},
|
|
895
928
|
],
|
|
896
929
|
};
|
|
930
|
+
|