@soltracer/nft-staking 0.3.1 → 0.5.0
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/INTEGRATION.md +203 -112
- package/dist/client.d.ts +17 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +32 -6
- package/dist/client.js.map +1 -1
- package/dist/idl.d.ts +45 -14
- package/dist/idl.d.ts.map +1 -1
- package/dist/idl.json +65 -33
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/traitProof.d.ts +170 -244
- package/dist/traitProof.d.ts.map +1 -1
- package/dist/traitProof.js +108 -174
- package/dist/traitProof.js.map +1 -1
- package/package.json +10 -10
package/dist/traitProof.js
CHANGED
|
@@ -1,21 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Trait-bonus proof builder for NFT-staking `claim_rewards`.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Design summary
|
|
5
|
+
* --------------
|
|
6
|
+
* The on-chain `claim_rewards` instruction accepts a SINGLE u64
|
|
7
|
+
* `traitBonusRate` per claim. When `pool.reward_config.trait_bonus_enabled`
|
|
8
|
+
* is `true`, that rate is added directly to the staker's effective rate for
|
|
9
|
+
* the accrual window. The chain has zero per-NFT or per-trait awareness —
|
|
10
|
+
* ALL bonus math (trait lookups, per-NFT multipliers, caps, etc.) happens
|
|
11
|
+
* off-chain in the project's trait-authority server, which signs the final
|
|
12
|
+
* aggregated rate.
|
|
7
13
|
*
|
|
8
|
-
*
|
|
14
|
+
* Why per-NFT (not per-staker) multipliers
|
|
15
|
+
* ----------------------------------------
|
|
16
|
+
* An older design exposed a `BaseMultiplier` mode on-chain that multiplied
|
|
17
|
+
* the staker's ENTIRE effective rate (all NFTs combined). That meant a
|
|
18
|
+
* single "Mythic 2x" NFT doubled rewards for every plain NFT in the same
|
|
19
|
+
* claim — cross-contamination across NFTs. The new model evaluates each
|
|
20
|
+
* NFT's bonuses independently, applies its own optional multiplier to its
|
|
21
|
+
* own bonus sum, then sums those isolated per-NFT bonuses into the single
|
|
22
|
+
* signed `u64`. One NFT's multiplier never touches another NFT's reward.
|
|
23
|
+
*
|
|
24
|
+
* Ed25519 message layout — 80 bytes (LE where applicable):
|
|
9
25
|
*
|
|
10
26
|
* [0..32] pool (PublicKey bytes)
|
|
11
27
|
* [32..64] staker wallet (PublicKey bytes)
|
|
12
|
-
* [64..72]
|
|
13
|
-
* [72..80]
|
|
28
|
+
* [64..72] traitBonusRate u64 (LE)
|
|
29
|
+
* [72..80] totalClaimed u64 (LE — strictly monotonic replay nonce)
|
|
14
30
|
*
|
|
15
|
-
* Sign
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* invokes `claimRewards(..., traitBonusRate)`.
|
|
31
|
+
* Sign with the pool's trait-authority Ed25519 keypair (or the global
|
|
32
|
+
* `stakeConfig.authority` when the pool has no override) and prepend the
|
|
33
|
+
* Ed25519 precompile instruction in the same transaction as `claimRewards`.
|
|
19
34
|
*/
|
|
20
35
|
import { toPk } from "@soltracer/core";
|
|
21
36
|
/** Fixed message length consumed by the on-chain Ed25519 verifier. */
|
|
@@ -33,8 +48,8 @@ function u64LE(value) {
|
|
|
33
48
|
/**
|
|
34
49
|
* Build the 80-byte trait-proof message exactly as the on-chain handler
|
|
35
50
|
* reconstructs it. `totalClaimed` must be the LIVE value of
|
|
36
|
-
* `StakerAccount.totalClaimed` (
|
|
37
|
-
*
|
|
51
|
+
* `StakerAccount.totalClaimed` (fetched within the same tx prep window —
|
|
52
|
+
* otherwise the signature is rejected once the nonce advances).
|
|
38
53
|
*/
|
|
39
54
|
export function buildTraitProofMessage(params) {
|
|
40
55
|
const msg = Buffer.alloc(TRAIT_PROOF_MSG_LEN);
|
|
@@ -44,196 +59,115 @@ export function buildTraitProofMessage(params) {
|
|
|
44
59
|
u64LE(params.totalClaimed).copy(msg, 72);
|
|
45
60
|
return msg;
|
|
46
61
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
62
|
+
/**
|
|
63
|
+
* In-memory catalog suitable for tests and small static configurations.
|
|
64
|
+
* Keys are collection mints (base58).
|
|
65
|
+
*/
|
|
66
|
+
export class InMemoryTraitBonusStore {
|
|
67
|
+
entriesByCollection;
|
|
68
|
+
constructor(entriesByCollection) {
|
|
69
|
+
this.entriesByCollection = entriesByCollection;
|
|
55
70
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return
|
|
71
|
+
static from(entries) {
|
|
72
|
+
const map = new Map();
|
|
73
|
+
for (const [k, v] of Object.entries(entries))
|
|
74
|
+
map.set(k, v);
|
|
75
|
+
return new InMemoryTraitBonusStore(map);
|
|
61
76
|
}
|
|
62
|
-
|
|
63
|
-
|
|
77
|
+
async listForCollection(collectionMint) {
|
|
78
|
+
return this.entriesByCollection.get(collectionMint) ?? [];
|
|
64
79
|
}
|
|
65
|
-
return bps;
|
|
66
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Aggregate trait bonuses into a single absolute `u64` rate.
|
|
83
|
+
*
|
|
84
|
+
* Algorithm (per NFT, independently):
|
|
85
|
+
* 1. For every `(traitType, value)` on the NFT, look it up in `catalog`.
|
|
86
|
+
* 2. Sum every matched `bonus`. Unmatched traits contribute 0.
|
|
87
|
+
* 3. If `multiplierBps` is set, multiply the NFT's bonus sum by it / 10_000.
|
|
88
|
+
* (Floor division — bonuses are integer raw units.)
|
|
89
|
+
*
|
|
90
|
+
* Final result = sum of per-NFT bonuses. A multiplier on one NFT cannot
|
|
91
|
+
* touch another NFT's contribution, eliminating the cross-contamination bug
|
|
92
|
+
* present in the old on-chain `BaseMultiplier` mode.
|
|
93
|
+
*/
|
|
67
94
|
export function computeTraitBonusRate(params) {
|
|
68
|
-
|
|
69
|
-
return { traitBonusRate: 0n, perNft: [] };
|
|
70
|
-
}
|
|
71
|
-
const mode = params.traitBonusMode;
|
|
72
|
-
// Build a lookup keyed by normalized "type::value".
|
|
73
|
-
// Validates every catalog entry up-front so misconfigured entries are
|
|
74
|
-
// surfaced even if no NFT references them.
|
|
95
|
+
// Build an O(1) lookup map.
|
|
75
96
|
const lookup = new Map();
|
|
76
|
-
for (const
|
|
77
|
-
|
|
78
|
-
if (lookup.has(key)) {
|
|
79
|
-
throw new Error(`computeTraitBonusRate: duplicate catalog entry for "${entry.traitType}=${entry.value}".`);
|
|
80
|
-
}
|
|
81
|
-
lookup.set(key, bonusFromCatalogEntry(entry, mode));
|
|
97
|
+
for (const e of params.catalog) {
|
|
98
|
+
lookup.set(`${e.traitType}\u0000${e.value}`, e.bonus);
|
|
82
99
|
}
|
|
83
|
-
let total = 0n;
|
|
84
100
|
const perNft = [];
|
|
101
|
+
let total = 0n;
|
|
85
102
|
for (const nft of params.nfts) {
|
|
86
103
|
let nftBonus = 0n;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
continue;
|
|
92
|
-
nftBonus += hit;
|
|
93
|
-
matched += 1;
|
|
104
|
+
for (const t of nft.traits) {
|
|
105
|
+
const hit = lookup.get(`${t.traitType}\u0000${t.value}`);
|
|
106
|
+
if (hit !== undefined)
|
|
107
|
+
nftBonus += hit;
|
|
94
108
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
bonus: nftBonus,
|
|
99
|
-
matchedTraits: matched,
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
return { traitBonusRate: total, perNft };
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* @deprecated Use `computeTraitBonusRate` instead — it accepts the real per-NFT
|
|
106
|
-
* trait input and a bonus catalog, mirroring the backend flow. Retained for
|
|
107
|
-
* call sites that already pre-resolved a flat bonus array.
|
|
108
|
-
*/
|
|
109
|
-
export function aggregateTraitBonusRate(traits, traitBonusMode) {
|
|
110
|
-
if (traitBonusMode === 0) {
|
|
111
|
-
if (traits.some((t) => (t.bonusBps ?? 0) !== 0 || (t.fixedExtra ?? 0) !== 0)) {
|
|
112
|
-
throw new Error("aggregateTraitBonusRate: pool.traitBonusMode === None — non-zero trait bonuses are rejected on-chain.");
|
|
113
|
-
}
|
|
114
|
-
return 0n;
|
|
115
|
-
}
|
|
116
|
-
let sum = 0n;
|
|
117
|
-
for (const t of traits) {
|
|
118
|
-
const bps = BigInt(t.bonusBps ?? 0);
|
|
119
|
-
const extra = BigInt(t.fixedExtra ?? 0);
|
|
120
|
-
if (bps !== 0n && extra !== 0n) {
|
|
121
|
-
throw new Error("aggregateTraitBonusRate: a single trait must set bonusBps OR fixedExtra, not both.");
|
|
122
|
-
}
|
|
123
|
-
if (traitBonusMode === 1) {
|
|
124
|
-
if (bps !== 0n) {
|
|
125
|
-
throw new Error("aggregateTraitBonusRate: traitBonusMode = FixedExtra expects fixedExtra (per-interval reward), not bonusBps.");
|
|
126
|
-
}
|
|
127
|
-
sum += extra;
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
if (extra !== 0n) {
|
|
131
|
-
throw new Error("aggregateTraitBonusRate: traitBonusMode = BaseMultiplier expects bonusBps (10_000 = +100%), not fixedExtra.");
|
|
109
|
+
if (nft.multiplierBps !== undefined && nft.multiplierBps !== 10_000) {
|
|
110
|
+
if (nft.multiplierBps < 0) {
|
|
111
|
+
throw new Error(`multiplierBps must be >= 0 for mint ${nft.mint}`);
|
|
132
112
|
}
|
|
133
|
-
|
|
113
|
+
nftBonus = (nftBonus * BigInt(nft.multiplierBps)) / 10000n;
|
|
134
114
|
}
|
|
115
|
+
perNft.push({ mint: nft.mint, bonus: nftBonus });
|
|
116
|
+
total += nftBonus;
|
|
117
|
+
}
|
|
118
|
+
// Guard the u64 upper bound — the on-chain field is `u64` and Anchor will
|
|
119
|
+
// reject anything that does not fit.
|
|
120
|
+
const U64_MAX = 18446744073709551615n;
|
|
121
|
+
if (total > U64_MAX) {
|
|
122
|
+
throw new Error(`aggregated trait bonus rate ${total} exceeds u64::MAX — cap your catalog or multipliers`);
|
|
135
123
|
}
|
|
136
|
-
return
|
|
124
|
+
return { traitBonusRate: total, perNft };
|
|
137
125
|
}
|
|
138
126
|
/**
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* Combines the four user-supplied dependencies — ownership validation, trait
|
|
142
|
-
* resolution, the bonus-catalog store, and the on-chain staker nonce — into
|
|
143
|
-
* the single signable payload the on-chain claim instruction expects.
|
|
127
|
+
* Full backend orchestration: ownership-verify each mint, resolve traits,
|
|
128
|
+
* aggregate via `computeTraitBonusRate`, and build the signed message.
|
|
144
129
|
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* prepareTraitProof,
|
|
149
|
-
* type TraitBonusStore,
|
|
150
|
-
* } from "@soltracer/nft-staking"
|
|
151
|
-
*
|
|
152
|
-
* // 1) Implement the store against your DB once (any DB works).
|
|
153
|
-
* const traitBonusStore: TraitBonusStore = {
|
|
154
|
-
* async list({ poolId, projectId }) {
|
|
155
|
-
* const rows = await prisma.traitBonusConfig.findMany({
|
|
156
|
-
* where: { poolId, ...(projectId ? { projectId: String(projectId) } : {}) },
|
|
157
|
-
* })
|
|
158
|
-
* return rows.map((r) => ({
|
|
159
|
-
* traitType: r.traitType,
|
|
160
|
-
* value: r.traitValue,
|
|
161
|
-
* // pool is BaseMultiplier? use bonusBps. FixedExtra? use fixedExtra.
|
|
162
|
-
* bonusBps: r.bonusAmount,
|
|
163
|
-
* }))
|
|
164
|
-
* },
|
|
165
|
-
* }
|
|
166
|
-
*
|
|
167
|
-
* // 2) Prepare the proof on each claim request.
|
|
168
|
-
* const prepared = await prepareTraitProof({
|
|
169
|
-
* client, // NftStakingClient
|
|
170
|
-
* pool, // already-fetched StakePool (has rewardConfig + address)
|
|
171
|
-
* wallet: req.wallet,
|
|
172
|
-
* requestedMints: req.mints,
|
|
173
|
-
* store: traitBonusStore,
|
|
174
|
-
* resolveTraits: (mint) => catalog.getTraits(mint),
|
|
175
|
-
* })
|
|
176
|
-
*
|
|
177
|
-
* // 3) Sign and respond.
|
|
178
|
-
* const signature = nacl.sign.detached(prepared.message, traitAuthority.secretKey)
|
|
179
|
-
* return {
|
|
180
|
-
* traitBonusRate: prepared.traitBonusRate.toString(),
|
|
181
|
-
* signature: Buffer.from(signature).toString("base64"),
|
|
182
|
-
* perNft: prepared.perNft,
|
|
183
|
-
* rejectedMints: prepared.rejectedMints,
|
|
184
|
-
* }
|
|
185
|
-
* ```
|
|
130
|
+
* The server is expected to sign `result.message` with the trait-authority
|
|
131
|
+
* Ed25519 keypair, return both the signature and `traitBonusRate` to the
|
|
132
|
+
* client, and the client forwards both into the `claimRewards` tx.
|
|
186
133
|
*/
|
|
187
|
-
export async function prepareTraitProof(
|
|
188
|
-
const
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
// 2 + 3. Resolve traits for each validated mint and load the bonus catalog.
|
|
201
|
-
const [nftTraits, catalog] = await Promise.all([
|
|
202
|
-
Promise.all(validatedMints.map(async (mint) => ({
|
|
203
|
-
mint,
|
|
204
|
-
traits: await params.resolveTraits(mint),
|
|
205
|
-
}))),
|
|
206
|
-
params.store.list({
|
|
207
|
-
poolId: params.poolId ?? 0,
|
|
208
|
-
projectId: params.projectId,
|
|
209
|
-
}),
|
|
210
|
-
]);
|
|
211
|
-
// 4. Mode-aware aggregation.
|
|
134
|
+
export async function prepareTraitProof(input) {
|
|
135
|
+
const walletStr = toPk(input.wallet).toBase58();
|
|
136
|
+
const ownershipChecks = await Promise.all(input.mints.map(async (mint) => ({
|
|
137
|
+
mint,
|
|
138
|
+
owned: await input.isStakedBy({ wallet: walletStr, poolId: input.poolId, mint }),
|
|
139
|
+
})));
|
|
140
|
+
const ownedMints = ownershipChecks.filter((c) => c.owned).map((c) => c.mint);
|
|
141
|
+
const rejectedMints = ownershipChecks.filter((c) => !c.owned).map((c) => c.mint);
|
|
142
|
+
const traitsByMint = await Promise.all(ownedMints.map(async (mint) => {
|
|
143
|
+
const r = await input.resolveTraits(mint);
|
|
144
|
+
return { mint, traits: r.traits, multiplierBps: r.multiplierBps };
|
|
145
|
+
}));
|
|
146
|
+
const catalog = await input.store.listForCollection(input.collectionMint);
|
|
212
147
|
const { traitBonusRate, perNft } = computeTraitBonusRate({
|
|
213
|
-
traitBonusMode: mode,
|
|
214
148
|
catalog,
|
|
215
|
-
nfts:
|
|
149
|
+
nfts: traitsByMint,
|
|
216
150
|
});
|
|
217
|
-
// 5. Build the signable 80-byte message.
|
|
218
151
|
const message = buildTraitProofMessage({
|
|
219
|
-
pool:
|
|
220
|
-
wallet,
|
|
152
|
+
pool: input.pool,
|
|
153
|
+
wallet: input.wallet,
|
|
221
154
|
traitBonusRate,
|
|
222
|
-
totalClaimed:
|
|
155
|
+
totalClaimed: input.totalClaimed,
|
|
223
156
|
});
|
|
224
|
-
return {
|
|
157
|
+
return { message, traitBonusRate, perNft, rejectedMints };
|
|
225
158
|
}
|
|
226
159
|
/**
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
160
|
+
* Adapter — turn an `NftStakingClient.fetchStakeEntriesByOwner` style call
|
|
161
|
+
* into a `StakedOwnershipResolver`. Pass in your already-constructed client.
|
|
162
|
+
*
|
|
163
|
+
* ```ts
|
|
164
|
+
* const isStakedBy = ownershipFromClient(client)
|
|
165
|
+
* ```
|
|
231
166
|
*/
|
|
232
167
|
export function ownershipFromClient(client) {
|
|
233
|
-
return async ({ wallet, poolId,
|
|
234
|
-
const entries = await client.fetchStakeEntriesByOwner(
|
|
235
|
-
|
|
236
|
-
return requestedMints.filter((m) => staked.has(m));
|
|
168
|
+
return async ({ wallet, poolId, mint }) => {
|
|
169
|
+
const entries = await client.fetchStakeEntriesByOwner(wallet, Number(poolId));
|
|
170
|
+
return entries.some((e) => Number(e.poolId) === Number(poolId) && e.nftMint.toBase58() === mint);
|
|
237
171
|
};
|
|
238
172
|
}
|
|
239
173
|
//# sourceMappingURL=traitProof.js.map
|
package/dist/traitProof.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traitProof.js","sourceRoot":"","sources":["../src/traitProof.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"traitProof.js","sourceRoot":"","sources":["../src/traitProof.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,IAAI,EAA8B,MAAM,iBAAiB,CAAA;AAElE,sEAAsE;AACtE,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAA;AAErC,SAAS,KAAK,CAAC,KAAc;IAC3B,MAAM,EAAE,GACN,OAAO,KAAK,KAAK,QAAQ;QACvB,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ;YACzB,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;YACf,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IAChC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC3B,GAAG,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAA;IACxB,OAAO,GAAG,CAAA;AACZ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAMtC;IACC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;IAC7C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;IACzC,IAAI,CAAC,MAAM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,EAAE,YAAY;KACnB,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,sBAAsB,CAAC;QACrC,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,cAAc;QACd,YAAY,EAAE,KAAK,CAAC,YAAY;KACjC,CAAC,CAAA;IAEF,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,CAAA;AAC3D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAKnC;IACC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;QACxC,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;QAC7E,OAAO,OAAO,CAAC,IAAI,CACjB,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,IAAI,CAC5E,CAAA;IACH,CAAC,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soltracer/nft-staking",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,10 +10,15 @@
|
|
|
10
10
|
"import": "./dist/index.js"
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc -p tsconfig.build.json",
|
|
15
|
+
"clean": "rm -rf dist",
|
|
16
|
+
"type-check": "tsc --noEmit"
|
|
17
|
+
},
|
|
13
18
|
"dependencies": {
|
|
14
19
|
"@noble/hashes": "^1.8.0",
|
|
15
|
-
"@soltracer/core": "
|
|
16
|
-
"@soltracer/cpi-accounts": "
|
|
20
|
+
"@soltracer/core": "workspace:*",
|
|
21
|
+
"@soltracer/cpi-accounts": "workspace:*"
|
|
17
22
|
},
|
|
18
23
|
"devDependencies": {
|
|
19
24
|
"typescript": "^5.7.0"
|
|
@@ -26,10 +31,5 @@
|
|
|
26
31
|
"@coral-xyz/anchor": "^0.32.1",
|
|
27
32
|
"@solana/web3.js": "^1.98.4"
|
|
28
33
|
},
|
|
29
|
-
"license": "MIT"
|
|
30
|
-
|
|
31
|
-
"build": "tsc -p tsconfig.build.json",
|
|
32
|
-
"clean": "rm -rf dist",
|
|
33
|
-
"type-check": "tsc --noEmit"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
34
|
+
"license": "MIT"
|
|
35
|
+
}
|