@triadxyz/triad-protocol 1.6.9-beta → 1.7.0-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
@@ -39,13 +39,6 @@ export default class TriadProtocolClient {
39
39
  * @param options - RPC options
40
40
  */
41
41
  collectRoyalty(collection: string, options?: RpcOptions): Promise<string>;
42
- /**
43
- * Add Default Poseidon
44
- * @param users - Users
45
- *
46
- * @param options - RPC options
47
- */
48
- addDefaultPoseidon(users: PublicKey[], options?: RpcOptions): Promise<string>;
49
42
  /**
50
43
  * Add Trader Poseidon
51
44
  * @param user - User
package/dist/index.js CHANGED
@@ -100,28 +100,6 @@ class TriadProtocolClient {
100
100
  }), options);
101
101
  });
102
102
  }
103
- /**
104
- * Add Default Poseidon
105
- * @param users - Users
106
- *
107
- * @param options - RPC options
108
- */
109
- addDefaultPoseidon(users, options) {
110
- return __awaiter(this, void 0, void 0, function* () {
111
- const ixs = [];
112
- for (const user of users) {
113
- const UserTradePDA = (0, trade_2.getUserTradePDA)(this.program.programId, user);
114
- ixs.push(yield this.program.methods
115
- .addDefaultPoseidon()
116
- .accounts({
117
- signer: this.provider.wallet.publicKey,
118
- userTrade: UserTradePDA
119
- })
120
- .instruction());
121
- }
122
- return (0, sendVersionedTransaction_1.default)(this.provider, ixs, options);
123
- });
124
- }
125
103
  /**
126
104
  * Add Trader Poseidon
127
105
  * @param user - User
@@ -7,26 +7,6 @@
7
7
  "description": "Triad protocol, trade solana projects"
8
8
  },
9
9
  "instructions": [
10
- {
11
- "name": "add_default_poseidon",
12
- "discriminator": [121, 129, 69, 151, 102, 241, 191, 34],
13
- "accounts": [
14
- {
15
- "name": "signer",
16
- "writable": true,
17
- "signer": true
18
- },
19
- {
20
- "name": "user_trade",
21
- "writable": true
22
- },
23
- {
24
- "name": "system_program",
25
- "address": "11111111111111111111111111111111"
26
- }
27
- ],
28
- "args": []
29
- },
30
10
  {
31
11
  "name": "add_trader_poseidon",
32
12
  "discriminator": [34, 241, 88, 67, 66, 83, 83, 134],
@@ -1791,6 +1771,10 @@
1791
1771
  "type": {
1792
1772
  "kind": "struct",
1793
1773
  "fields": [
1774
+ {
1775
+ "name": "authority",
1776
+ "type": "pubkey"
1777
+ },
1794
1778
  {
1795
1779
  "name": "market_id",
1796
1780
  "type": "u64"
@@ -1823,6 +1807,10 @@
1823
1807
  "name": "volume",
1824
1808
  "type": "u64"
1825
1809
  },
1810
+ {
1811
+ "name": "mint",
1812
+ "type": "pubkey"
1813
+ },
1826
1814
  {
1827
1815
  "name": "update_ts",
1828
1816
  "type": "i64"
@@ -1835,6 +1823,28 @@
1835
1823
  "name": "next_order_id",
1836
1824
  "type": "u64"
1837
1825
  },
1826
+ {
1827
+ "name": "fee_bps",
1828
+ "type": "u16"
1829
+ },
1830
+ {
1831
+ "name": "is_allowed_to_payout",
1832
+ "type": "bool"
1833
+ },
1834
+ {
1835
+ "name": "market_start",
1836
+ "type": "i64"
1837
+ },
1838
+ {
1839
+ "name": "market_end",
1840
+ "type": "i64"
1841
+ },
1842
+ {
1843
+ "name": "question",
1844
+ "type": {
1845
+ "array": ["u8", 80]
1846
+ }
1847
+ },
1838
1848
  {
1839
1849
  "name": "winning_direction",
1840
1850
  "type": {
@@ -1844,19 +1854,23 @@
1844
1854
  }
1845
1855
  },
1846
1856
  {
1847
- "name": "market_start",
1848
- "type": "i64"
1857
+ "name": "market_liquidity_at_start",
1858
+ "type": "u64"
1849
1859
  },
1850
1860
  {
1851
- "name": "market_end",
1852
- "type": "i64"
1861
+ "name": "creator_fee_available",
1862
+ "type": "u64"
1853
1863
  },
1854
1864
  {
1855
- "name": "is_allowed_to_payout",
1856
- "type": "bool"
1865
+ "name": "creator_fee_claimed",
1866
+ "type": "u64"
1857
1867
  },
1858
1868
  {
1859
- "name": "market_liquidity_at_start",
1869
+ "name": "market_fee_available",
1870
+ "type": "u64"
1871
+ },
1872
+ {
1873
+ "name": "market_fee_claimed",
1860
1874
  "type": "u64"
1861
1875
  }
1862
1876
  ]
@@ -1928,11 +1942,11 @@
1928
1942
  "type": "u16"
1929
1943
  },
1930
1944
  {
1931
- "name": "nft_holders_fee_available",
1945
+ "name": "creator_fee_available",
1932
1946
  "type": "u64"
1933
1947
  },
1934
1948
  {
1935
- "name": "nft_holders_fee_claimed",
1949
+ "name": "creator_fee_claimed",
1936
1950
  "type": "u64"
1937
1951
  },
1938
1952
  {
@@ -17,8 +17,8 @@ export type Market = {
17
17
  nextOrderId: string;
18
18
  feeBps: number;
19
19
  isAllowedToPayout: boolean;
20
- nftHoldersFeeAvailable: string;
21
- nftHoldersFeeClaimed: string;
20
+ creatorFeeAvailable: string;
21
+ creatorFeeClaimed: string;
22
22
  marketFeeAvailable: string;
23
23
  marketFeeClaimed: string;
24
24
  marketStart: string;
@@ -26,6 +26,7 @@ export type Market = {
26
26
  question: string;
27
27
  winningDirection: WinningDirection;
28
28
  marketLiquidityAtStart: string;
29
+ customer: string;
29
30
  };
30
31
  export type UserTrade = {
31
32
  user: string;
@@ -13,26 +13,6 @@ export type TriadProtocol = {
13
13
  description: 'Triad protocol, trade solana projects';
14
14
  };
15
15
  instructions: [
16
- {
17
- name: 'addDefaultPoseidon';
18
- discriminator: [121, 129, 69, 151, 102, 241, 191, 34];
19
- accounts: [
20
- {
21
- name: 'signer';
22
- writable: true;
23
- signer: true;
24
- },
25
- {
26
- name: 'userTrade';
27
- writable: true;
28
- },
29
- {
30
- name: 'systemProgram';
31
- address: '11111111111111111111111111111111';
32
- }
33
- ];
34
- args: [];
35
- },
36
16
  {
37
17
  name: 'addTraderPoseidon';
38
18
  discriminator: [34, 241, 88, 67, 66, 83, 83, 134];
@@ -2290,6 +2270,10 @@ export type TriadProtocol = {
2290
2270
  type: {
2291
2271
  kind: 'struct';
2292
2272
  fields: [
2273
+ {
2274
+ name: 'authority';
2275
+ type: 'pubkey';
2276
+ },
2293
2277
  {
2294
2278
  name: 'marketId';
2295
2279
  type: 'u64';
@@ -2322,6 +2306,10 @@ export type TriadProtocol = {
2322
2306
  name: 'volume';
2323
2307
  type: 'u64';
2324
2308
  },
2309
+ {
2310
+ name: 'mint';
2311
+ type: 'pubkey';
2312
+ },
2325
2313
  {
2326
2314
  name: 'updateTs';
2327
2315
  type: 'i64';
@@ -2334,6 +2322,28 @@ export type TriadProtocol = {
2334
2322
  name: 'nextOrderId';
2335
2323
  type: 'u64';
2336
2324
  },
2325
+ {
2326
+ name: 'feeBps';
2327
+ type: 'u16';
2328
+ },
2329
+ {
2330
+ name: 'isAllowedToPayout';
2331
+ type: 'bool';
2332
+ },
2333
+ {
2334
+ name: 'marketStart';
2335
+ type: 'i64';
2336
+ },
2337
+ {
2338
+ name: 'marketEnd';
2339
+ type: 'i64';
2340
+ },
2341
+ {
2342
+ name: 'question';
2343
+ type: {
2344
+ array: ['u8', 80];
2345
+ };
2346
+ },
2337
2347
  {
2338
2348
  name: 'winningDirection';
2339
2349
  type: {
@@ -2343,19 +2353,23 @@ export type TriadProtocol = {
2343
2353
  };
2344
2354
  },
2345
2355
  {
2346
- name: 'marketStart';
2347
- type: 'i64';
2356
+ name: 'marketLiquidityAtStart';
2357
+ type: 'u64';
2348
2358
  },
2349
2359
  {
2350
- name: 'marketEnd';
2351
- type: 'i64';
2360
+ name: 'creatorFeeAvailable';
2361
+ type: 'u64';
2352
2362
  },
2353
2363
  {
2354
- name: 'isAllowedToPayout';
2355
- type: 'bool';
2364
+ name: 'creatorFeeClaimed';
2365
+ type: 'u64';
2356
2366
  },
2357
2367
  {
2358
- name: 'marketLiquidityAtStart';
2368
+ name: 'marketFeeAvailable';
2369
+ type: 'u64';
2370
+ },
2371
+ {
2372
+ name: 'marketFeeClaimed';
2359
2373
  type: 'u64';
2360
2374
  }
2361
2375
  ];
@@ -2427,11 +2441,11 @@ export type TriadProtocol = {
2427
2441
  type: 'u16';
2428
2442
  },
2429
2443
  {
2430
- name: 'nftHoldersFeeAvailable';
2444
+ name: 'creatorFeeAvailable';
2431
2445
  type: 'u64';
2432
2446
  },
2433
2447
  {
2434
- name: 'nftHoldersFeeClaimed';
2448
+ name: 'creatorFeeClaimed';
2435
2449
  type: 'u64';
2436
2450
  },
2437
2451
  {
@@ -74,14 +74,15 @@ const formatMarket = (account, address) => {
74
74
  marketStart: account.marketStart.toString(),
75
75
  marketEnd: account.marketEnd.toString(),
76
76
  question: Buffer.from(account.question).toString().replace(/\0+$/, ''),
77
- nftHoldersFeeAvailable: account.nftHoldersFeeAvailable.toString(),
78
- nftHoldersFeeClaimed: account.nftHoldersFeeClaimed.toString(),
77
+ creatorFeeAvailable: account.creatorFeeAvailable.toString(),
78
+ creatorFeeClaimed: account.creatorFeeClaimed.toString(),
79
79
  marketFeeAvailable: account.marketFeeAvailable.toString(),
80
80
  marketFeeClaimed: account.marketFeeClaimed.toString(),
81
81
  winningDirection: trade_1.WinningDirection[Object.keys(account.winningDirection)[0].toUpperCase()],
82
82
  marketLiquidityAtStart: account.marketLiquidityAtStart.toString() > 0
83
83
  ? account.marketLiquidityAtStart.toString()
84
- : '500000000'
84
+ : '500000000',
85
+ customer: account.customer ? account.customer.toString() : 'Triad'
85
86
  };
86
87
  };
87
88
  exports.formatMarket = formatMarket;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "1.6.9-beta",
3
+ "version": "1.7.0-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",