@triadxyz/triad-protocol 2.5.2-beta → 2.5.3-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.d.ts +1 -1
- package/dist/stake.js +4 -3
- package/dist/types/stake.d.ts +1 -0
- package/dist/utils/helpers.d.ts +1 -1
- package/dist/utils/helpers.js +2 -1
- package/package.json +1 -1
package/dist/stake.d.ts
CHANGED
|
@@ -70,7 +70,7 @@ export default class Stake {
|
|
|
70
70
|
* @param options - RPC options
|
|
71
71
|
*
|
|
72
72
|
*/
|
|
73
|
-
unstakeToken(options?: RpcOptions): Promise<string>;
|
|
73
|
+
unstakeToken(unstakePDA: PublicKey, options?: RpcOptions): Promise<string>;
|
|
74
74
|
/**
|
|
75
75
|
* Claim Stake Rewards
|
|
76
76
|
* @param options - RPC options
|
package/dist/stake.js
CHANGED
|
@@ -80,7 +80,7 @@ class Stake {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
]);
|
|
83
|
-
return stake.map((stake) => (0, helpers_1.formatUnstake)(stake.account));
|
|
83
|
+
return stake.map((stake) => (0, helpers_1.formatUnstake)(stake.account, stake.publicKey));
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
@@ -155,13 +155,14 @@ class Stake {
|
|
|
155
155
|
* @param options - RPC options
|
|
156
156
|
*
|
|
157
157
|
*/
|
|
158
|
-
unstakeToken(options) {
|
|
158
|
+
unstakeToken(unstakePDA, options) {
|
|
159
159
|
return __awaiter(this, void 0, void 0, function* () {
|
|
160
160
|
const ixs = [];
|
|
161
161
|
ixs.push(yield this.program.methods
|
|
162
162
|
.unstakeToken()
|
|
163
163
|
.accounts({
|
|
164
|
-
signer: this.program.provider.publicKey
|
|
164
|
+
signer: this.program.provider.publicKey,
|
|
165
|
+
unstake: unstakePDA
|
|
165
166
|
})
|
|
166
167
|
.instruction());
|
|
167
168
|
return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
|
package/dist/types/stake.d.ts
CHANGED
package/dist/utils/helpers.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const decodeString: (bytes: number[]) => string;
|
|
|
8
8
|
export declare const formatStakeVault: (stakeVault: IdlAccounts<TriadProtocol>['stakeVault']) => StakeVault;
|
|
9
9
|
export declare const formatStakeV2: (stake: IdlAccounts<TriadProtocol>['stakeV2']) => StakeV2;
|
|
10
10
|
export declare const formatStake: (stake: IdlAccounts<TriadProtocol>['stakeV3']) => StakeV3;
|
|
11
|
-
export declare const formatUnstake: (unstake: IdlAccounts<TriadProtocol>['unstake']) => Unstake;
|
|
11
|
+
export declare const formatUnstake: (unstake: IdlAccounts<TriadProtocol>['unstake'], address: PublicKey) => Unstake;
|
|
12
12
|
export declare const formatPool: (account: IdlAccounts<TriadProtocol>['pool'], address: PublicKey) => Pool;
|
|
13
13
|
export declare const formatMarket: (account: IdlAccounts<TriadProtocol>['marketV2'], address: PublicKey) => Market;
|
|
14
14
|
export declare const formatUserTrade: (account: IdlAccounts<TriadProtocol>['userTrade'], publicKey: PublicKey) => UserTrade;
|
package/dist/utils/helpers.js
CHANGED
|
@@ -63,8 +63,9 @@ const formatStake = (stake) => {
|
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
65
|
exports.formatStake = formatStake;
|
|
66
|
-
const formatUnstake = (unstake) => {
|
|
66
|
+
const formatUnstake = (unstake, address) => {
|
|
67
67
|
return {
|
|
68
|
+
address: address.toBase58(),
|
|
68
69
|
authority: unstake.authority.toBase58(),
|
|
69
70
|
amount: unstake.amount.toNumber() / Math.pow(10, 6),
|
|
70
71
|
withdrawTs: unstake.withdrawTs.toNumber()
|