@triadxyz/triad-protocol 0.5.0-beta → 0.5.2-beta.devnet
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 +1 -4
- package/dist/index.js +0 -107
- package/dist/stake.d.ts +13 -46
- package/dist/stake.js +26 -104
- package/dist/test.js +7 -57
- package/dist/ticker.d.ts +1 -12
- package/dist/ticker.js +2 -36
- package/dist/types/idl_triad_protocol.json +521 -491
- package/dist/types/stake.d.ts +0 -17
- package/dist/types/triad_protocol.d.ts +594 -507
- package/dist/utils/constants.d.ts +1 -1
- package/dist/utils/constants.js +2 -2
- package/dist/vault.d.ts +0 -31
- package/dist/vault.js +0 -143
- package/package.json +1 -1
- package/dist/utils/stake-season-1/rarity.json +0 -8832
package/dist/ticker.d.ts
CHANGED
|
@@ -22,23 +22,12 @@ export default class Ticker {
|
|
|
22
22
|
/**
|
|
23
23
|
* Create a new ticker
|
|
24
24
|
* @param name - The ticker's name
|
|
25
|
-
* @param protocolProgramId - The program ID of the protocol
|
|
26
25
|
* @param token mint - Token mint for the ticker (e.g. USDC)
|
|
27
26
|
*
|
|
28
27
|
*/
|
|
29
|
-
createTicker({ name,
|
|
28
|
+
createTicker({ name, tokenMint }: {
|
|
30
29
|
name: string;
|
|
31
30
|
protocolProgramId: PublicKey;
|
|
32
31
|
tokenMint: PublicKey;
|
|
33
32
|
}): Promise<string>;
|
|
34
|
-
/**
|
|
35
|
-
* Update a ticker's price
|
|
36
|
-
* @param name - The ticker's name
|
|
37
|
-
* @param price - The ticker's price
|
|
38
|
-
*
|
|
39
|
-
*/
|
|
40
|
-
updateTickerPrice({ name, price }: {
|
|
41
|
-
name: string;
|
|
42
|
-
price: string;
|
|
43
|
-
}): Promise<string>;
|
|
44
33
|
}
|
package/dist/ticker.js
CHANGED
|
@@ -9,9 +9,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
13
|
-
const helpers_1 = require("./utils/helpers");
|
|
14
|
-
const bn_js_1 = require("bn.js");
|
|
15
12
|
class Ticker {
|
|
16
13
|
constructor(program, provider) {
|
|
17
14
|
this.provider = provider;
|
|
@@ -28,14 +25,13 @@ class Ticker {
|
|
|
28
25
|
/**
|
|
29
26
|
* Create a new ticker
|
|
30
27
|
* @param name - The ticker's name
|
|
31
|
-
* @param protocolProgramId - The program ID of the protocol
|
|
32
28
|
* @param token mint - Token mint for the ticker (e.g. USDC)
|
|
33
29
|
*
|
|
34
30
|
*/
|
|
35
|
-
createTicker({ name,
|
|
31
|
+
createTicker({ name, tokenMint }) {
|
|
36
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37
33
|
return this.program.methods
|
|
38
|
-
.createTicker({ name
|
|
34
|
+
.createTicker({ name })
|
|
39
35
|
.accounts({
|
|
40
36
|
signer: this.provider.wallet.publicKey,
|
|
41
37
|
payerTokenMint: tokenMint
|
|
@@ -43,35 +39,5 @@ class Ticker {
|
|
|
43
39
|
.rpc();
|
|
44
40
|
});
|
|
45
41
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Update a ticker's price
|
|
48
|
-
* @param name - The ticker's name
|
|
49
|
-
* @param price - The ticker's price
|
|
50
|
-
*
|
|
51
|
-
*/
|
|
52
|
-
updateTickerPrice({ name, price }) {
|
|
53
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
const TickerPDA = (0, helpers_1.getTickerAddressSync)(this.program.programId, name);
|
|
55
|
-
const instructions = [
|
|
56
|
-
web3_js_1.ComputeBudgetProgram.setComputeUnitPrice({
|
|
57
|
-
microLamports: 12000
|
|
58
|
-
})
|
|
59
|
-
];
|
|
60
|
-
instructions.push(yield this.program.methods
|
|
61
|
-
.updateTickerPrice({ price: new bn_js_1.BN(price) })
|
|
62
|
-
.accounts({
|
|
63
|
-
signer: this.provider.wallet.publicKey,
|
|
64
|
-
ticker: TickerPDA
|
|
65
|
-
})
|
|
66
|
-
.instruction());
|
|
67
|
-
const { blockhash } = yield this.provider.connection.getLatestBlockhash();
|
|
68
|
-
const message = new web3_js_1.TransactionMessage({
|
|
69
|
-
payerKey: this.provider.wallet.publicKey,
|
|
70
|
-
recentBlockhash: blockhash,
|
|
71
|
-
instructions
|
|
72
|
-
}).compileToV0Message();
|
|
73
|
-
return this.provider.sendAndConfirm(new web3_js_1.VersionedTransaction(message));
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
42
|
}
|
|
77
43
|
exports.default = Ticker;
|