@triadxyz/triad-protocol 0.3.0-beta → 0.3.1-beta

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/stake.js CHANGED
@@ -263,9 +263,11 @@ class Stake {
263
263
  return __awaiter(this, void 0, void 0, function* () {
264
264
  const stakeVaultPDA = (0, helpers_1.getStakeVaultAddressSync)(this.program.programId, stakeVault);
265
265
  const stakePDA = (0, helpers_1.getStakeAddressSync)(this.program.programId, wallet, name);
266
+ const userPAD = (0, helpers_1.getUserAddressSync)(this.program.programId, wallet);
266
267
  const method = this.program.methods.requestWithdrawStake().accounts({
267
268
  signer: wallet,
268
269
  mint: mint,
270
+ user: userPAD,
269
271
  stake: stakePDA,
270
272
  stakeVault: stakeVaultPDA
271
273
  });
@@ -328,7 +330,8 @@ class Stake {
328
330
  const method = this.program.methods
329
331
  .updateStakeVaultStatus({
330
332
  isLocked,
331
- initTs: new anchor_1.BN(initTs)
333
+ initTs: new anchor_1.BN(initTs),
334
+ slots: new anchor_1.BN(1839)
332
335
  })
333
336
  .accounts({
334
337
  signer: wallet,
package/dist/test.js CHANGED
@@ -48,6 +48,10 @@ const getUsers = () => __awaiter(void 0, void 0, void 0, function* () {
48
48
  const response = yield triadProtocol.getUsers();
49
49
  console.log(response);
50
50
  });
51
+ const getUser = () => __awaiter(void 0, void 0, void 0, function* () {
52
+ const response = yield triadProtocol.getUser(new web3_js_1.PublicKey('6mGxYSJzJxTHwY43aafsSnSPM3QqXKbNUsnCRj4fMo5q'));
53
+ console.log(response);
54
+ });
51
55
  const getReferral = () => __awaiter(void 0, void 0, void 0, function* () {
52
56
  const response = yield triadProtocol.hasUser(new web3_js_1.PublicKey('6MuTdUhc4LDHDW3fiTemyns4NgR99oAWvHM2SwCSTcau'));
53
57
  console.log(response);
@@ -61,4 +65,4 @@ const createUser = () => __awaiter(void 0, void 0, void 0, function* () {
61
65
  microLamports: 10000
62
66
  });
63
67
  });
64
- getStake();
68
+ getUser();
@@ -2,8 +2,9 @@
2
2
  "address": "TRDwq3BN4mP3m9KsuNUWSN6QDff93VKGSwE95Jbr9Ss",
3
3
  "metadata": {
4
4
  "name": "triad_protocol",
5
- "version": "0.1.0",
6
- "spec": "0.1.0"
5
+ "version": "0.1.4",
6
+ "spec": "0.1.0",
7
+ "description": "Triad protocol, trade solana projects"
7
8
  },
8
9
  "instructions": [
9
10
  {
@@ -508,6 +509,10 @@
508
509
  "name": "stake_vault",
509
510
  "writable": true
510
511
  },
512
+ {
513
+ "name": "user",
514
+ "writable": true
515
+ },
511
516
  {
512
517
  "name": "stake",
513
518
  "writable": true
@@ -749,6 +754,38 @@
749
754
  }
750
755
  ]
751
756
  },
757
+ {
758
+ "name": "swap_404",
759
+ "discriminator": [227, 249, 224, 136, 128, 95, 255, 239],
760
+ "accounts": [
761
+ {
762
+ "name": "signer",
763
+ "writable": true,
764
+ "signer": true
765
+ },
766
+ {
767
+ "name": "user",
768
+ "writable": true,
769
+ "pda": {
770
+ "seeds": [
771
+ {
772
+ "kind": "const",
773
+ "value": [117, 115, 101, 114]
774
+ },
775
+ {
776
+ "kind": "account",
777
+ "path": "signer"
778
+ }
779
+ ]
780
+ }
781
+ },
782
+ {
783
+ "name": "system_program",
784
+ "address": "11111111111111111111111111111111"
785
+ }
786
+ ],
787
+ "args": []
788
+ },
752
789
  {
753
790
  "name": "update_stake_vault_status",
754
791
  "discriminator": [71, 64, 188, 150, 86, 254, 221, 65],
@@ -1033,6 +1070,11 @@
1033
1070
  "code": 6020,
1034
1071
  "name": "StakeOverflow",
1035
1072
  "msg": "Stake overflow"
1073
+ },
1074
+ {
1075
+ "code": 6021,
1076
+ "name": "SwapsReachedLimit",
1077
+ "msg": "Swaps reached limit"
1036
1078
  }
1037
1079
  ],
1038
1080
  "types": [
@@ -1474,6 +1516,10 @@
1474
1516
  {
1475
1517
  "name": "init_ts",
1476
1518
  "type": "i64"
1519
+ },
1520
+ {
1521
+ "name": "slots",
1522
+ "type": "u64"
1477
1523
  }
1478
1524
  ]
1479
1525
  }
@@ -1531,10 +1577,14 @@
1531
1577
  "name": "staked",
1532
1578
  "type": "u64"
1533
1579
  },
1580
+ {
1581
+ "name": "first_swap",
1582
+ "type": "i64"
1583
+ },
1534
1584
  {
1535
1585
  "name": "padding",
1536
1586
  "type": {
1537
- "array": ["u8", 40]
1587
+ "array": ["u8", 32]
1538
1588
  }
1539
1589
  }
1540
1590
  ]
@@ -8,8 +8,9 @@ export type TriadProtocol = {
8
8
  address: 'TRDwq3BN4mP3m9KsuNUWSN6QDff93VKGSwE95Jbr9Ss';
9
9
  metadata: {
10
10
  name: 'triadProtocol';
11
- version: '0.1.0';
11
+ version: '0.1.4';
12
12
  spec: '0.1.0';
13
+ description: 'Triad protocol, trade solana projects';
13
14
  };
14
15
  instructions: [
15
16
  {
@@ -340,92 +341,6 @@ export type TriadProtocol = {
340
341
  {
341
342
  name: 'toAta';
342
343
  writable: true;
343
- pda: {
344
- seeds: [
345
- {
346
- kind: 'account';
347
- path: 'stakeVault';
348
- },
349
- {
350
- kind: 'const';
351
- value: [
352
- 6,
353
- 221,
354
- 246,
355
- 225,
356
- 215,
357
- 101,
358
- 161,
359
- 147,
360
- 217,
361
- 203,
362
- 225,
363
- 70,
364
- 206,
365
- 235,
366
- 121,
367
- 172,
368
- 28,
369
- 180,
370
- 133,
371
- 237,
372
- 95,
373
- 91,
374
- 55,
375
- 145,
376
- 58,
377
- 140,
378
- 245,
379
- 133,
380
- 126,
381
- 255,
382
- 0,
383
- 169
384
- ];
385
- },
386
- {
387
- kind: 'account';
388
- path: 'mint';
389
- }
390
- ];
391
- program: {
392
- kind: 'const';
393
- value: [
394
- 140,
395
- 151,
396
- 37,
397
- 143,
398
- 78,
399
- 36,
400
- 137,
401
- 241,
402
- 187,
403
- 61,
404
- 16,
405
- 41,
406
- 20,
407
- 142,
408
- 13,
409
- 131,
410
- 11,
411
- 90,
412
- 19,
413
- 153,
414
- 218,
415
- 255,
416
- 16,
417
- 132,
418
- 4,
419
- 142,
420
- 123,
421
- 216,
422
- 219,
423
- 233,
424
- 248,
425
- 89
426
- ];
427
- };
428
- };
429
344
  },
430
345
  {
431
346
  name: 'tokenProgram';
@@ -590,6 +505,10 @@ export type TriadProtocol = {
590
505
  name: 'stakeVault';
591
506
  writable: true;
592
507
  },
508
+ {
509
+ name: 'user';
510
+ writable: true;
511
+ },
593
512
  {
594
513
  name: 'stake';
595
514
  writable: true;
@@ -775,6 +694,38 @@ export type TriadProtocol = {
775
694
  }
776
695
  ];
777
696
  },
697
+ {
698
+ name: 'swap404';
699
+ discriminator: [227, 249, 224, 136, 128, 95, 255, 239];
700
+ accounts: [
701
+ {
702
+ name: 'signer';
703
+ writable: true;
704
+ signer: true;
705
+ },
706
+ {
707
+ name: 'user';
708
+ writable: true;
709
+ pda: {
710
+ seeds: [
711
+ {
712
+ kind: 'const';
713
+ value: [117, 115, 101, 114];
714
+ },
715
+ {
716
+ kind: 'account';
717
+ path: 'signer';
718
+ }
719
+ ];
720
+ };
721
+ },
722
+ {
723
+ name: 'systemProgram';
724
+ address: '11111111111111111111111111111111';
725
+ }
726
+ ];
727
+ args: [];
728
+ },
778
729
  {
779
730
  name: 'updateStakeVaultStatus';
780
731
  discriminator: [71, 64, 188, 150, 86, 254, 221, 65];
@@ -1031,6 +982,11 @@ export type TriadProtocol = {
1031
982
  code: 6020;
1032
983
  name: 'stakeOverflow';
1033
984
  msg: 'Stake overflow';
985
+ },
986
+ {
987
+ code: 6021;
988
+ name: 'swapsReachedLimit';
989
+ msg: 'Swaps reached limit';
1034
990
  }
1035
991
  ];
1036
992
  types: [
@@ -1472,6 +1428,10 @@ export type TriadProtocol = {
1472
1428
  {
1473
1429
  name: 'initTs';
1474
1430
  type: 'i64';
1431
+ },
1432
+ {
1433
+ name: 'slots';
1434
+ type: 'u64';
1475
1435
  }
1476
1436
  ];
1477
1437
  };
@@ -1529,10 +1489,14 @@ export type TriadProtocol = {
1529
1489
  name: 'staked';
1530
1490
  type: 'u64';
1531
1491
  },
1492
+ {
1493
+ name: 'firstSwap';
1494
+ type: 'i64';
1495
+ },
1532
1496
  {
1533
1497
  name: 'padding';
1534
1498
  type: {
1535
- array: ['u8', 40];
1499
+ array: ['u8', 32];
1536
1500
  };
1537
1501
  }
1538
1502
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "0.3.0-beta",
3
+ "version": "0.3.1-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",