@triadxyz/triad-protocol 2.7.0-beta → 2.7.2-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/index.d.ts CHANGED
@@ -328,7 +328,7 @@ export default class TriadProtocolClient {
328
328
  * @param options - RPC options
329
329
  *
330
330
  */
331
- createCustomer({ id, name, authority, feeRecipient, isStaked }: CreateCustomerArgs, options?: RpcOptions): Promise<string>;
331
+ createCustomer({ id, name, authority, feeRecipient }: CreateCustomerArgs, options?: RpcOptions): Promise<string>;
332
332
  /**
333
333
  * Get User Trade Nonce With Slots
334
334
  * @param userTrades - User Trades
package/dist/index.js CHANGED
@@ -38,7 +38,6 @@ const sendVersionedTransaction_1 = __importDefault(require("./utils/sendVersione
38
38
  const swap_1 = require("./utils/swap");
39
39
  const stake_1 = __importDefault(require("./stake"));
40
40
  const poseidon_1 = __importDefault(require("./poseidon"));
41
- const stake_2 = require("./utils/pda/stake");
42
41
  __exportStar(require("./types"), exports);
43
42
  __exportStar(require("./types/stake"), exports);
44
43
  __exportStar(require("./types/poseidon"), exports);
@@ -576,18 +575,13 @@ class TriadProtocolClient {
576
575
  * @param options - RPC options
577
576
  *
578
577
  */
579
- createCustomer({ id, name, authority, feeRecipient, isStaked }, options) {
578
+ createCustomer({ id, name, authority, feeRecipient }, options) {
580
579
  return __awaiter(this, void 0, void 0, function* () {
581
580
  const ixs = [];
582
- let stakePDA = null;
583
- if (isStaked) {
584
- stakePDA = (0, stake_2.getStakePDA)(this.program.programId, this.program.provider.publicKey);
585
- }
586
581
  ixs.push(yield this.program.methods
587
582
  .createCustomer({ id, name, authority, feeRecipient })
588
583
  .accounts({
589
- signer: this.program.provider.publicKey,
590
- stake: stakePDA
584
+ signer: this.program.provider.publicKey
591
585
  })
592
586
  .instruction());
593
587
  return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
package/dist/stake.js CHANGED
@@ -132,7 +132,7 @@ class Stake {
132
132
  ts: new anchor_1.BN(Date.now())
133
133
  })
134
134
  .accounts({
135
- stake: (0, stake_1.getStakePDA)(this.program.programId, this.program.provider.publicKey),
135
+ signer: this.program.provider.publicKey,
136
136
  mint: constants_1.TRD_MINT
137
137
  })
138
138
  .instruction());
@@ -169,8 +169,8 @@ class Stake {
169
169
  ixs.push(yield this.program.methods
170
170
  .claimStakeRewards()
171
171
  .accounts({
172
- mint: constants_1.TRD_MINT,
173
- stake: (0, stake_1.getStakePDA)(this.program.programId, this.program.provider.publicKey)
172
+ signer: this.program.provider.publicKey,
173
+ mint: constants_1.TRD_MINT
174
174
  })
175
175
  .instruction());
176
176
  return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
@@ -214,7 +214,19 @@
214
214
  },
215
215
  {
216
216
  "name": "stake",
217
- "writable": true
217
+ "writable": true,
218
+ "pda": {
219
+ "seeds": [
220
+ {
221
+ "kind": "const",
222
+ "value": [115, 116, 97, 107, 101, 95, 118, 51]
223
+ },
224
+ {
225
+ "kind": "account",
226
+ "path": "signer"
227
+ }
228
+ ]
229
+ }
218
230
  },
219
231
  {
220
232
  "name": "mint",
@@ -660,7 +672,19 @@
660
672
  {
661
673
  "name": "stake",
662
674
  "writable": true,
663
- "optional": true
675
+ "optional": true,
676
+ "pda": {
677
+ "seeds": [
678
+ {
679
+ "kind": "const",
680
+ "value": [115, 116, 97, 107, 101, 95, 118, 51]
681
+ },
682
+ {
683
+ "kind": "account",
684
+ "path": "signer"
685
+ }
686
+ ]
687
+ }
664
688
  },
665
689
  {
666
690
  "name": "system_program",
@@ -1597,7 +1621,19 @@
1597
1621
  },
1598
1622
  {
1599
1623
  "name": "stake",
1600
- "writable": true
1624
+ "writable": true,
1625
+ "pda": {
1626
+ "seeds": [
1627
+ {
1628
+ "kind": "const",
1629
+ "value": [115, 116, 97, 107, 101, 95, 118, 51]
1630
+ },
1631
+ {
1632
+ "kind": "account",
1633
+ "path": "signer"
1634
+ }
1635
+ ]
1636
+ }
1601
1637
  },
1602
1638
  {
1603
1639
  "name": "unstake",
@@ -1610,8 +1646,7 @@
1610
1646
  },
1611
1647
  {
1612
1648
  "kind": "account",
1613
- "path": "stake.authority",
1614
- "account": "StakeV3"
1649
+ "path": "signer"
1615
1650
  },
1616
1651
  {
1617
1652
  "kind": "arg",
@@ -291,6 +291,18 @@ export type TriadProtocol = {
291
291
  {
292
292
  name: 'stake';
293
293
  writable: true;
294
+ pda: {
295
+ seeds: [
296
+ {
297
+ kind: 'const';
298
+ value: [115, 116, 97, 107, 101, 95, 118, 51];
299
+ },
300
+ {
301
+ kind: 'account';
302
+ path: 'signer';
303
+ }
304
+ ];
305
+ };
294
306
  },
295
307
  {
296
308
  name: 'mint';
@@ -969,6 +981,18 @@ export type TriadProtocol = {
969
981
  name: 'stake';
970
982
  writable: true;
971
983
  optional: true;
984
+ pda: {
985
+ seeds: [
986
+ {
987
+ kind: 'const';
988
+ value: [115, 116, 97, 107, 101, 95, 118, 51];
989
+ },
990
+ {
991
+ kind: 'account';
992
+ path: 'signer';
993
+ }
994
+ ];
995
+ };
972
996
  },
973
997
  {
974
998
  name: 'systemProgram';
@@ -2179,6 +2203,18 @@ export type TriadProtocol = {
2179
2203
  {
2180
2204
  name: 'stake';
2181
2205
  writable: true;
2206
+ pda: {
2207
+ seeds: [
2208
+ {
2209
+ kind: 'const';
2210
+ value: [115, 116, 97, 107, 101, 95, 118, 51];
2211
+ },
2212
+ {
2213
+ kind: 'account';
2214
+ path: 'signer';
2215
+ }
2216
+ ];
2217
+ };
2182
2218
  },
2183
2219
  {
2184
2220
  name: 'unstake';
@@ -2191,8 +2227,7 @@ export type TriadProtocol = {
2191
2227
  },
2192
2228
  {
2193
2229
  kind: 'account';
2194
- path: 'stake.authority';
2195
- account: 'stakeV3';
2230
+ path: 'signer';
2196
2231
  },
2197
2232
  {
2198
2233
  kind: 'arg';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "2.7.0-beta",
3
+ "version": "2.7.2-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",