@triadxyz/triad-protocol 1.1.6-beta → 1.1.7-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/trade.d.ts +2 -1
- package/dist/trade.js +20 -0
- package/dist/types/trade.d.ts +15 -0
- package/package.json +1 -1
package/dist/trade.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnchorProvider, Program } from '@coral-xyz/anchor';
|
|
2
2
|
import { TriadProtocol } from './types/triad_protocol';
|
|
3
3
|
import { PublicKey } from '@solana/web3.js';
|
|
4
|
-
import { InitializeQuestionArgs, Market, OpenOrderArgs } from './types/trade';
|
|
4
|
+
import { FeeVault, InitializeQuestionArgs, Market, OpenOrderArgs } from './types/trade';
|
|
5
5
|
import { RpcOptions } from './types';
|
|
6
6
|
import BN from 'bn.js';
|
|
7
7
|
export default class Trade {
|
|
@@ -13,6 +13,7 @@ export default class Trade {
|
|
|
13
13
|
* Get all Markets
|
|
14
14
|
*/
|
|
15
15
|
getAllMarkets(): Promise<Market[]>;
|
|
16
|
+
getFeeVault(marketId: number): Promise<FeeVault>;
|
|
16
17
|
/**
|
|
17
18
|
* Get Market by ID
|
|
18
19
|
* @param marketId - The ID of the market
|
package/dist/trade.js
CHANGED
|
@@ -35,6 +35,26 @@ class Trade {
|
|
|
35
35
|
.then((markets) => markets.map(({ account, publicKey }) => (0, helpers_1.accountToMarket)(account, publicKey)));
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
+
getFeeVault(marketId) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
const feeVaultPDA = (0, trade_1.getFeeVaultPDA)(this.program.programId, marketId);
|
|
41
|
+
const response = yield this.program.account.feeVault.fetch(feeVaultPDA);
|
|
42
|
+
return {
|
|
43
|
+
bump: response.bump,
|
|
44
|
+
authority: response.authority,
|
|
45
|
+
market: response.market,
|
|
46
|
+
deposited: response.deposited.toString(),
|
|
47
|
+
withdrawn: response.withdrawn.toString(),
|
|
48
|
+
netBalance: response.netBalance.toString(),
|
|
49
|
+
projectAvailable: response.projectAvailable.toString(),
|
|
50
|
+
projectClaimed: response.projectClaimed.toString(),
|
|
51
|
+
nftHoldersAvailable: response.nftHoldersAvailable.toString(),
|
|
52
|
+
nftHoldersClaimed: response.nftHoldersClaimed.toString(),
|
|
53
|
+
marketAvailable: response.marketAvailable.toString(),
|
|
54
|
+
marketClaimed: response.marketClaimed.toString()
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
}
|
|
38
58
|
/**
|
|
39
59
|
* Get Market by ID
|
|
40
60
|
* @param marketId - The ID of the market
|
package/dist/types/trade.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
|
1
2
|
export type Market = {
|
|
2
3
|
address: string;
|
|
3
4
|
bump: number;
|
|
@@ -75,3 +76,17 @@ export type OpenOrderArgs = {
|
|
|
75
76
|
direction: OrderDirection;
|
|
76
77
|
comment?: string;
|
|
77
78
|
};
|
|
79
|
+
export type FeeVault = {
|
|
80
|
+
bump: number;
|
|
81
|
+
authority: PublicKey;
|
|
82
|
+
market: PublicKey;
|
|
83
|
+
deposited: string;
|
|
84
|
+
withdrawn: string;
|
|
85
|
+
netBalance: string;
|
|
86
|
+
projectAvailable: string;
|
|
87
|
+
projectClaimed: string;
|
|
88
|
+
nftHoldersAvailable: string;
|
|
89
|
+
nftHoldersClaimed: string;
|
|
90
|
+
marketAvailable: string;
|
|
91
|
+
marketClaimed: string;
|
|
92
|
+
};
|