@triadxyz/triad-protocol 3.1.1-beta → 3.1.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.
@@ -1,49 +1,43 @@
1
1
  import { Program } from '@coral-xyz/anchor';
2
+ import { PublicKey } from '@solana/web3.js';
2
3
  import { TriadProtocol } from './types/triad_protocol';
3
4
  import { RpcOptions } from './types';
4
- import { AddTraderPoseidonArgs, RemoveTraderPoseidonArgs, TransferPoseidonArgs, WithdrawPoseidonArgs } from './types/poseidon';
5
5
  export default class Poseidon {
6
6
  private program;
7
- constructor(program: Program<TriadProtocol>);
7
+ private rpcOptions;
8
+ constructor(program: Program<TriadProtocol>, rpcOptions: RpcOptions);
8
9
  /**
9
10
  * Transfer Poseidon
10
11
  * @param args.poseidonAsset - Poseidon Asset
11
12
  * @param args.ticketAsset - Ticket Asset
12
13
  * @param args.ticketNumber - Ticket Number
13
- *
14
- * @param options - RPC options
15
- *
16
14
  */
17
- transferPoseidon(args: TransferPoseidonArgs[], options?: RpcOptions): Promise<string>;
15
+ transferPoseidon(poseidons: {
16
+ poseidonAsset: PublicKey;
17
+ ticketAsset: PublicKey;
18
+ ticketNumber: number;
19
+ }[]): Promise<string>;
18
20
  /**
19
21
  * Withdraw Poseidon
20
- * @param args.poseidonAsset - Poseidon Asset - CORE PublicKey
21
- * @param args.nft - NFT Poseidon Number
22
- *
23
- * @param options - RPC options
22
+ * @param poseidonAsset - Poseidon Asset - CORE PublicKey
23
+ * @param nft - NFT Poseidon Number
24
24
  */
25
- withdrawPoseidon({ poseidonAsset, nft }: WithdrawPoseidonArgs, options?: RpcOptions): Promise<string>;
25
+ withdrawPoseidon(poseidonAsset: PublicKey, nft: number): Promise<string>;
26
26
  /**
27
27
  * Collect Royalty
28
- * @param collection - Collection Symbol
29
- *
30
- * @param options - RPC options
28
+ * @param collectionSymbol - Collection Symbol
31
29
  */
32
- collectRoyalty(collection: string, options?: RpcOptions): Promise<string>;
30
+ collectRoyalty(collectionSymbol: string): Promise<string>;
33
31
  /**
34
32
  * Add Trader Poseidon
35
- * @param args.user - User
36
- * @param args.poseidonAsset - Poseidon Asset
37
- *
38
- * @param options - RPC options
33
+ * @param user - User Public Key
34
+ * @param poseidonAsset - Poseidon Asset
39
35
  */
40
- addTraderPoseidon({ user, poseidonAsset }: AddTraderPoseidonArgs, options?: RpcOptions): Promise<string>;
36
+ addTraderPoseidon(user: PublicKey, poseidonAsset: PublicKey): Promise<string>;
41
37
  /**
42
38
  * Remove Trader Poseidon
43
- * @param args.user - User
44
- * @param args.poseidonAsset - Poseidon Asset
45
- *
46
- * @param options - RPC options
39
+ * @param user - User Public Key
40
+ * @param poseidonAsset - Poseidon Asset
47
41
  */
48
- removeTraderPoseidon({ user, poseidonAsset }: RemoveTraderPoseidonArgs, options?: RpcOptions): Promise<string>;
42
+ removeTraderPoseidon(user: PublicKey, poseidonAsset: PublicKey): Promise<string>;
49
43
  }
package/dist/poseidon.js CHANGED
@@ -14,126 +14,120 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const constants_1 = require("./utils/constants");
16
16
  const sendVersionedTransaction_1 = __importDefault(require("./utils/sendVersionedTransaction"));
17
- const poseidon_1 = require("./utils/pda/poseidon");
18
17
  const pda_1 = require("./utils/pda");
18
+ const pda_2 = require("./utils/pda");
19
19
  class Poseidon {
20
- constructor(program) {
20
+ constructor(program, rpcOptions) {
21
21
  this.program = program;
22
+ this.rpcOptions = rpcOptions;
22
23
  }
23
24
  /**
24
25
  * Transfer Poseidon
25
26
  * @param args.poseidonAsset - Poseidon Asset
26
27
  * @param args.ticketAsset - Ticket Asset
27
28
  * @param args.ticketNumber - Ticket Number
28
- *
29
- * @param options - RPC options
30
- *
31
29
  */
32
- transferPoseidon(args, options) {
30
+ transferPoseidon(poseidons) {
33
31
  return __awaiter(this, void 0, void 0, function* () {
34
32
  const ixs = [];
35
- for (const arg of args) {
33
+ for (const poseidon of poseidons) {
36
34
  ixs.push(yield this.program.methods
37
35
  .transferPoseidon()
38
36
  .accounts({
39
37
  signer: this.program.provider.publicKey,
40
- nft: (0, poseidon_1.getNftPDA)(this.program.programId, arg.ticketNumber),
41
- poseidonAsset: arg.poseidonAsset,
42
- ticketAsset: arg.ticketAsset,
43
- poseidonCollection: (0, poseidon_1.getCollectionPDA)(this.program.programId, constants_1.POSEIDON_COLLECTION_SYMBOL),
44
- ticketCollection: (0, poseidon_1.getCollectionPDA)(this.program.programId, constants_1.TICKET_COLLECTION_SYMBOL),
38
+ nft: (0, pda_1.getNftPDA)(this.program.programId, poseidon.ticketNumber),
39
+ poseidonAsset: poseidon.poseidonAsset,
40
+ ticketAsset: poseidon.ticketAsset,
41
+ poseidonCollection: (0, pda_1.getCollectionPDA)(this.program.programId, constants_1.POSEIDON_COLLECTION_SYMBOL),
42
+ ticketCollection: (0, pda_1.getCollectionPDA)(this.program.programId, constants_1.TICKET_COLLECTION_SYMBOL),
45
43
  coreTicketCollection: constants_1.TICKET_CORE_COLLECTION,
46
44
  corePoseidonCollection: constants_1.POSEIDON_CORE_COLLECTION
47
45
  })
48
46
  .instruction());
49
47
  }
50
- return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
48
+ return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
51
49
  });
52
50
  }
53
51
  /**
54
52
  * Withdraw Poseidon
55
- * @param args.poseidonAsset - Poseidon Asset - CORE PublicKey
56
- * @param args.nft - NFT Poseidon Number
57
- *
58
- * @param options - RPC options
53
+ * @param poseidonAsset - Poseidon Asset - CORE PublicKey
54
+ * @param nft - NFT Poseidon Number
59
55
  */
60
- withdrawPoseidon({ poseidonAsset, nft }, options) {
56
+ withdrawPoseidon(poseidonAsset, nft) {
61
57
  return __awaiter(this, void 0, void 0, function* () {
62
- const ixs = [];
63
- ixs.push(yield this.program.methods
64
- .withdrawPoseidon()
65
- .accounts({
66
- signer: this.program.provider.publicKey,
67
- nft: (0, poseidon_1.getPoseidonPDA)(this.program.programId, nft),
68
- poseidonAsset,
69
- poseidonCollection: (0, poseidon_1.getCollectionPDA)(this.program.programId, constants_1.POSEIDON_COLLECTION_SYMBOL),
70
- corePoseidonCollection: constants_1.POSEIDON_CORE_COLLECTION
71
- })
72
- .instruction());
73
- return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
58
+ const ixs = [
59
+ yield this.program.methods
60
+ .withdrawPoseidon()
61
+ .accounts({
62
+ signer: this.program.provider.publicKey,
63
+ nft: (0, pda_1.getPoseidonPDA)(this.program.programId, nft),
64
+ poseidonAsset,
65
+ poseidonCollection: (0, pda_1.getCollectionPDA)(this.program.programId, constants_1.POSEIDON_COLLECTION_SYMBOL),
66
+ corePoseidonCollection: constants_1.POSEIDON_CORE_COLLECTION
67
+ })
68
+ .instruction()
69
+ ];
70
+ return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
74
71
  });
75
72
  }
76
73
  /**
77
74
  * Collect Royalty
78
- * @param collection - Collection Symbol
79
- *
80
- * @param options - RPC options
75
+ * @param collectionSymbol - Collection Symbol
81
76
  */
82
- collectRoyalty(collection, options) {
77
+ collectRoyalty(collectionSymbol) {
83
78
  return __awaiter(this, void 0, void 0, function* () {
84
- const ixs = [];
85
- ixs.push(yield this.program.methods
86
- .collectRoyalty()
87
- .accounts({
88
- signer: this.program.provider.publicKey,
89
- collection: (0, poseidon_1.getCollectionPDA)(this.program.programId, collection)
90
- })
91
- .instruction());
92
- return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
79
+ const ixs = [
80
+ yield this.program.methods
81
+ .collectRoyalty()
82
+ .accounts({
83
+ signer: this.program.provider.publicKey,
84
+ collection: (0, pda_1.getCollectionPDA)(this.program.programId, collectionSymbol)
85
+ })
86
+ .instruction()
87
+ ];
88
+ return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
93
89
  });
94
90
  }
95
91
  /**
96
92
  * Add Trader Poseidon
97
- * @param args.user - User
98
- * @param args.poseidonAsset - Poseidon Asset
99
- *
100
- * @param options - RPC options
93
+ * @param user - User Public Key
94
+ * @param poseidonAsset - Poseidon Asset
101
95
  */
102
- addTraderPoseidon({ user, poseidonAsset }, options) {
96
+ addTraderPoseidon(user, poseidonAsset) {
103
97
  return __awaiter(this, void 0, void 0, function* () {
104
- const ixs = [];
105
- ixs.push(yield this.program.methods
106
- .addTraderPoseidon()
107
- .accounts({
108
- poseidonAsset,
109
- userTrade: (0, pda_1.getUserTradePDA)(this.program.programId, user),
110
- corePoseidonCollection: constants_1.POSEIDON_CORE_COLLECTION,
111
- poseidonCollection: (0, poseidon_1.getCollectionPDA)(this.program.programId, constants_1.POSEIDON_COLLECTION_SYMBOL)
112
- })
113
- .instruction());
114
- return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
98
+ const ixs = [
99
+ yield this.program.methods
100
+ .addTraderPoseidon()
101
+ .accounts({
102
+ poseidonAsset,
103
+ userTrade: (0, pda_2.getUserTradePDA)(this.program.programId, user),
104
+ corePoseidonCollection: constants_1.POSEIDON_CORE_COLLECTION,
105
+ poseidonCollection: (0, pda_1.getCollectionPDA)(this.program.programId, constants_1.POSEIDON_COLLECTION_SYMBOL)
106
+ })
107
+ .instruction()
108
+ ];
109
+ return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
115
110
  });
116
111
  }
117
112
  /**
118
113
  * Remove Trader Poseidon
119
- * @param args.user - User
120
- * @param args.poseidonAsset - Poseidon Asset
121
- *
122
- * @param options - RPC options
114
+ * @param user - User Public Key
115
+ * @param poseidonAsset - Poseidon Asset
123
116
  */
124
- removeTraderPoseidon({ user, poseidonAsset }, options) {
117
+ removeTraderPoseidon(user, poseidonAsset) {
125
118
  return __awaiter(this, void 0, void 0, function* () {
126
- const ixs = [];
127
- ixs.push(yield this.program.methods
128
- .removeTraderPoseidon()
129
- .accounts({
130
- userTrade: (0, pda_1.getUserTradePDA)(this.program.programId, user),
131
- poseidonAsset,
132
- corePoseidonCollection: constants_1.POSEIDON_CORE_COLLECTION,
133
- poseidonCollection: (0, poseidon_1.getCollectionPDA)(this.program.programId, constants_1.POSEIDON_COLLECTION_SYMBOL)
134
- })
135
- .instruction());
136
- return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
119
+ const ixs = [
120
+ yield this.program.methods
121
+ .removeTraderPoseidon()
122
+ .accounts({
123
+ userTrade: (0, pda_2.getUserTradePDA)(this.program.programId, user),
124
+ poseidonAsset,
125
+ corePoseidonCollection: constants_1.POSEIDON_CORE_COLLECTION,
126
+ poseidonCollection: (0, pda_1.getCollectionPDA)(this.program.programId, constants_1.POSEIDON_COLLECTION_SYMBOL)
127
+ })
128
+ .instruction()
129
+ ];
130
+ return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
137
131
  });
138
132
  }
139
133
  }
package/dist/stake.d.ts CHANGED
@@ -2,24 +2,21 @@ import { Program } from '@coral-xyz/anchor';
2
2
  import { PublicKey } from '@solana/web3.js';
3
3
  import { TriadProtocol } from './types/triad_protocol';
4
4
  import { RpcOptions } from './types';
5
- import { UpdateStakeVaultArgs } from './types/stake';
6
5
  export default class Stake {
7
6
  private program;
8
- constructor(program: Program<TriadProtocol>);
7
+ private rpcOptions;
8
+ constructor(program: Program<TriadProtocol>, rpcOptions: RpcOptions);
9
9
  /**
10
10
  * Get all Stake Vaults
11
- *
12
11
  */
13
- getStakeVaults(): Promise<import("./types/stake").StakeVault[]>;
12
+ getStakeVaults(): Promise<import("./types").StakeVault[]>;
14
13
  /**
15
14
  * Get all Stakes
16
- *
17
15
  */
18
- getStakes(): Promise<import("./types/stake").Stake[]>;
16
+ getStakes(): Promise<import("./types").Stake[]>;
19
17
  /**
20
18
  * Get Stake By Wallet
21
19
  * @param wallet - User wallet
22
- *
23
20
  */
24
21
  getStakeByWallet(wallet: PublicKey): Promise<{
25
22
  available: number;
@@ -32,44 +29,35 @@ export default class Stake {
32
29
  /**
33
30
  * Get Unstake By Wallet
34
31
  * @param wallet - User wallet
35
- *
36
32
  */
37
- getUnstakeByWallet(wallet: PublicKey): Promise<import("./types/stake").Unstake[]>;
33
+ getUnstakeByWallet(wallet: PublicKey): Promise<import("./types").Unstake[]>;
38
34
  /**
39
- * Stake Token
40
- * @param amount - Amount to stake
41
- *
42
- * @param options - RPC options
43
- *
35
+ * Stake Token
36
+ * @param amount - Amount to stake
44
37
  */
45
- stakeToken(amount: number, options?: RpcOptions): Promise<string>;
38
+ stakeToken(amount: number): Promise<string>;
46
39
  /**
47
- * Update Stake Vault
48
- * @param args.amount - Reward amount to deposit (optional)
49
- * @param args.isLocked - is locked stake vault (optional)
50
- *
51
- * @param options - RPC options
52
- *
40
+ * Update Stake Vault
41
+ * @param amount - Reward amount to deposit
53
42
  */
54
- updateStakeVault({ amount, isLocked }: UpdateStakeVaultArgs, options?: RpcOptions): Promise<string>;
43
+ addStakeVaultRewards(amount: number): Promise<string>;
55
44
  /**
56
- * Request Unstake
57
- * @param amount - Amount to unstake
58
- *
59
- * @param options - RPC options
60
- *
45
+ * Update Stake Vault Is Locked
46
+ * @param isLocked - Whether the stake vault is locked
61
47
  */
62
- requestUnstake(amount: number, options?: RpcOptions): Promise<string>;
48
+ updateStakeVaultIsLocked(isLocked: boolean): Promise<string>;
63
49
  /**
64
- * Unstake Token
65
- * @param options - RPC options
66
- *
50
+ * Request Unstake
51
+ * @param amount - Amount to unstake
67
52
  */
68
- unstakeToken(unstakePDA: PublicKey, options?: RpcOptions): Promise<string>;
53
+ requestUnstake(amount: number): Promise<string>;
69
54
  /**
70
- * Claim Stake Rewards
71
- * @param options - RPC options
72
- *
55
+ * Unstake Token
56
+ * @param unstakePDA - Unstake Public Key
73
57
  */
74
- claimStakeRewards(options?: RpcOptions): Promise<string>;
58
+ unstakeToken(unstakePDA: PublicKey): Promise<string>;
59
+ /**
60
+ * Claim Stake Rewards
61
+ */
62
+ claimStakeRewards(): Promise<string>;
75
63
  }
package/dist/stake.js CHANGED
@@ -14,16 +14,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const anchor_1 = require("@coral-xyz/anchor");
16
16
  const helpers_1 = require("./utils/helpers");
17
- const stake_1 = require("./utils/pda/stake");
17
+ const pda_1 = require("./utils/pda");
18
18
  const constants_1 = require("./utils/constants");
19
19
  const sendVersionedTransaction_1 = __importDefault(require("./utils/sendVersionedTransaction"));
20
20
  class Stake {
21
- constructor(program) {
21
+ constructor(program, rpcOptions) {
22
22
  this.program = program;
23
+ this.rpcOptions = rpcOptions;
23
24
  }
24
25
  /**
25
26
  * Get all Stake Vaults
26
- *
27
27
  */
28
28
  getStakeVaults() {
29
29
  return __awaiter(this, void 0, void 0, function* () {
@@ -33,7 +33,6 @@ class Stake {
33
33
  }
34
34
  /**
35
35
  * Get all Stakes
36
- *
37
36
  */
38
37
  getStakes() {
39
38
  return __awaiter(this, void 0, void 0, function* () {
@@ -44,12 +43,11 @@ class Stake {
44
43
  /**
45
44
  * Get Stake By Wallet
46
45
  * @param wallet - User wallet
47
- *
48
46
  */
49
47
  getStakeByWallet(wallet) {
50
48
  return __awaiter(this, void 0, void 0, function* () {
51
49
  const stake = yield this.program.account.stakeV3
52
- .fetch((0, stake_1.getStakePDA)(this.program.programId, wallet))
50
+ .fetch((0, pda_1.getStakePDA)(this.program.programId, wallet))
53
51
  .then((stake) => (0, helpers_1.formatStake)(stake));
54
52
  return Object.assign(Object.assign({}, stake), { available: (0, helpers_1.calculateStakeRewards)(stake) });
55
53
  });
@@ -57,7 +55,6 @@ class Stake {
57
55
  /**
58
56
  * Get Unstake By Wallet
59
57
  * @param wallet - User wallet
60
- *
61
58
  */
62
59
  getUnstakeByWallet(wallet) {
63
60
  return __awaiter(this, void 0, void 0, function* () {
@@ -73,107 +70,110 @@ class Stake {
73
70
  });
74
71
  }
75
72
  /**
76
- * Stake Token
77
- * @param amount - Amount to stake
78
- *
79
- * @param options - RPC options
80
- *
73
+ * Stake Token
74
+ * @param amount - Amount to stake
81
75
  */
82
- stakeToken(amount, options) {
76
+ stakeToken(amount) {
83
77
  return __awaiter(this, void 0, void 0, function* () {
84
- const ixs = [];
85
- ixs.push(yield this.program.methods
86
- .stakeToken({
87
- amount: new anchor_1.BN(amount * Math.pow(10, 6))
88
- })
89
- .accounts({
90
- mint: constants_1.TRD_MINT
91
- })
92
- .instruction());
93
- return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
78
+ const ixs = [
79
+ yield this.program.methods
80
+ .stakeToken({
81
+ amount: new anchor_1.BN(amount * Math.pow(10, 6))
82
+ })
83
+ .accounts({
84
+ mint: constants_1.TRD_MINT
85
+ })
86
+ .instruction()
87
+ ];
88
+ return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
94
89
  });
95
90
  }
96
91
  /**
97
- * Update Stake Vault
98
- * @param args.amount - Reward amount to deposit (optional)
99
- * @param args.isLocked - is locked stake vault (optional)
100
- *
101
- * @param options - RPC options
102
- *
92
+ * Update Stake Vault
93
+ * @param amount - Reward amount to deposit
103
94
  */
104
- updateStakeVault({ amount, isLocked }, options) {
95
+ addStakeVaultRewards(amount) {
105
96
  return __awaiter(this, void 0, void 0, function* () {
106
- const ixs = [];
107
- ixs.push(yield this.program.methods
108
- .updateStakeVault({
109
- amount,
110
- isLocked
111
- })
112
- .accounts({
113
- mint: constants_1.TRD_MINT
114
- })
115
- .instruction());
116
- return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
97
+ const ixs = [
98
+ yield this.program.methods
99
+ .addStakeVaultRewards(new anchor_1.BN(amount * Math.pow(10, 6)))
100
+ .accounts({
101
+ mint: constants_1.TRD_MINT
102
+ })
103
+ .instruction()
104
+ ];
105
+ return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
117
106
  });
118
107
  }
119
108
  /**
120
- * Request Unstake
121
- * @param amount - Amount to unstake
122
- *
123
- * @param options - RPC options
124
- *
109
+ * Update Stake Vault Is Locked
110
+ * @param isLocked - Whether the stake vault is locked
125
111
  */
126
- requestUnstake(amount, options) {
112
+ updateStakeVaultIsLocked(isLocked) {
127
113
  return __awaiter(this, void 0, void 0, function* () {
128
- const ixs = [];
129
- ixs.push(yield this.program.methods
130
- .requestUnstake({
131
- amount: new anchor_1.BN(amount * Math.pow(10, 6)),
132
- ts: new anchor_1.BN(Date.now())
133
- })
134
- .accounts({
135
- signer: this.program.provider.publicKey,
136
- mint: constants_1.TRD_MINT
137
- })
138
- .instruction());
139
- return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
114
+ const ixs = [
115
+ yield this.program.methods
116
+ .updateStakeVaultIsLocked(isLocked)
117
+ .instruction()
118
+ ];
119
+ return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
140
120
  });
141
121
  }
142
122
  /**
143
- * Unstake Token
144
- * @param options - RPC options
145
- *
123
+ * Request Unstake
124
+ * @param amount - Amount to unstake
146
125
  */
147
- unstakeToken(unstakePDA, options) {
126
+ requestUnstake(amount) {
148
127
  return __awaiter(this, void 0, void 0, function* () {
149
- const ixs = [];
150
- ixs.push(yield this.program.methods
151
- .unstakeToken()
152
- .accounts({
153
- signer: this.program.provider.publicKey,
154
- unstake: unstakePDA,
155
- mint: constants_1.TRD_MINT
156
- })
157
- .instruction());
158
- return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
128
+ const ixs = [
129
+ yield this.program.methods
130
+ .requestUnstake({
131
+ amount: new anchor_1.BN(amount * Math.pow(10, 6)),
132
+ ts: new anchor_1.BN(Date.now())
133
+ })
134
+ .accounts({
135
+ signer: this.program.provider.publicKey,
136
+ mint: constants_1.TRD_MINT
137
+ })
138
+ .instruction()
139
+ ];
140
+ return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
159
141
  });
160
142
  }
161
143
  /**
162
- * Claim Stake Rewards
163
- * @param options - RPC options
164
- *
144
+ * Unstake Token
145
+ * @param unstakePDA - Unstake Public Key
165
146
  */
166
- claimStakeRewards(options) {
147
+ unstakeToken(unstakePDA) {
167
148
  return __awaiter(this, void 0, void 0, function* () {
168
- const ixs = [];
169
- ixs.push(yield this.program.methods
170
- .claimStakeRewards()
171
- .accounts({
172
- signer: this.program.provider.publicKey,
173
- mint: constants_1.TRD_MINT
174
- })
175
- .instruction());
176
- return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
149
+ const ixs = [
150
+ yield this.program.methods
151
+ .unstakeToken()
152
+ .accounts({
153
+ signer: this.program.provider.publicKey,
154
+ unstake: unstakePDA,
155
+ mint: constants_1.TRD_MINT
156
+ })
157
+ .instruction()
158
+ ];
159
+ return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
160
+ });
161
+ }
162
+ /**
163
+ * Claim Stake Rewards
164
+ */
165
+ claimStakeRewards() {
166
+ return __awaiter(this, void 0, void 0, function* () {
167
+ const ixs = [
168
+ yield this.program.methods
169
+ .claimStakeRewards()
170
+ .accounts({
171
+ signer: this.program.provider.publicKey,
172
+ mint: constants_1.TRD_MINT
173
+ })
174
+ .instruction()
175
+ ];
176
+ return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
177
177
  });
178
178
  }
179
179
  }