@soltracer/nft-staking 0.3.1 → 0.4.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/dist/idl.json CHANGED
@@ -1565,7 +1565,7 @@
1565
1565
  {
1566
1566
  "name": "stake_config",
1567
1567
  "docs": [
1568
- "Global stake config \u2014 holds the platform's default trait authority."
1568
+ "Global stake config holds the platform's default trait authority."
1569
1569
  ],
1570
1570
  "pda": {
1571
1571
  "seeds": [
@@ -2638,7 +2638,7 @@
2638
2638
  {
2639
2639
  "name": "reward_vault",
2640
2640
  "docs": [
2641
- "Reward vault \u2014 required for token-reward pools. Must be drained before closure.",
2641
+ "Reward vault required for token-reward pools. Must be drained before closure.",
2642
2642
  "Pass the pool_authority ATA for the reward mint. Omit for SOL-reward pools."
2643
2643
  ],
2644
2644
  "optional": true
@@ -2851,14 +2851,14 @@
2851
2851
  {
2852
2852
  "name": "reward_mint",
2853
2853
  "docs": [
2854
- "Reward mint \u2014 the token paid out as rewards (can be any SPL token).",
2854
+ "Reward mint the token paid out as rewards (can be any SPL token).",
2855
2855
  "Ignored if reward_type == Points."
2856
2856
  ]
2857
2857
  },
2858
2858
  {
2859
2859
  "name": "reward_vault",
2860
2860
  "docs": [
2861
- "Reward vault ATA owned by pool_authority \u2014 created for token rewards."
2861
+ "Reward vault ATA owned by pool_authority created for token rewards."
2862
2862
  ],
2863
2863
  "writable": true,
2864
2864
  "pda": {
@@ -6193,7 +6193,7 @@
6193
6193
  {
6194
6194
  "name": "sync_stake_entry_secondary",
6195
6195
  "docs": [
6196
- "re-sync one StakeEntry's contribution to",
6196
+ "STAKE-FRESH-2026-05-11 (F-H4): re-sync one StakeEntry's contribution to",
6197
6197
  "`pool_secondary.rewards[secondary_index]`. Permissionless. Lets",
6198
6198
  "existing stakers begin accruing on a secondary that was added",
6199
6199
  "post-stake (or pick up a rate-update) without unstaking."
@@ -6383,7 +6383,7 @@
6383
6383
  {
6384
6384
  "name": "payer",
6385
6385
  "docs": [
6386
- "Permissionless \u2014 anyone may invoke. Pays no tx fee beyond signer",
6386
+ "Permissionless anyone may invoke. Pays no tx fee beyond signer",
6387
6387
  "requirement and does not need to match the staker."
6388
6388
  ],
6389
6389
  "signer": true
@@ -7310,7 +7310,7 @@
7310
7310
  {
7311
7311
  "name": "staker_nft_account",
7312
7312
  "docs": [
7313
- "User's NFT token account \u2014 destination for unstaked NFT."
7313
+ "User's NFT token account destination for unstaked NFT."
7314
7314
  ],
7315
7315
  "writable": true
7316
7316
  },
@@ -8602,7 +8602,7 @@
8602
8602
  {
8603
8603
  "code": 6038,
8604
8604
  "name": "UtilityNotActive",
8605
- "msg": "Utility is not active for this project \u2014 check subscription status"
8605
+ "msg": "Utility is not active for this project check subscription status"
8606
8606
  },
8607
8607
  {
8608
8608
  "code": 6039,
@@ -8636,56 +8636,61 @@
8636
8636
  },
8637
8637
  {
8638
8638
  "code": 6045,
8639
+ "name": "PoolStillActive",
8640
+ "msg": "Pool must be deactivated (is_active = false) before it can be closed"
8641
+ },
8642
+ {
8643
+ "code": 6046,
8639
8644
  "name": "SecondaryRewardRetired",
8640
8645
  "msg": "Secondary reward is retired and cannot be modified"
8641
8646
  },
8642
8647
  {
8643
- "code": 6046,
8648
+ "code": 6047,
8644
8649
  "name": "SecondaryRewardAlreadyRetired",
8645
8650
  "msg": "Secondary reward is already retired"
8646
8651
  },
8647
8652
  {
8648
- "code": 6047,
8653
+ "code": 6048,
8649
8654
  "name": "SecondaryRewardMintImmutable",
8650
- "msg": "Secondary reward mint is immutable \u2014 retire and add a new slot instead"
8655
+ "msg": "Secondary reward mint is immutable retire and add a new slot instead"
8651
8656
  },
8652
8657
  {
8653
- "code": 6048,
8658
+ "code": 6049,
8654
8659
  "name": "ClaimLockedUntilExpiry",
8655
- "msg": "Mid-lock claims are disabled for this tier \u2014 rewards are paid out at unstake"
8660
+ "msg": "Mid-lock claims are disabled for this tier rewards are paid out at unstake"
8656
8661
  },
8657
8662
  {
8658
- "code": 6049,
8663
+ "code": 6050,
8659
8664
  "name": "StakerMismatch",
8660
8665
  "msg": "Caller is not the staker for this entry"
8661
8666
  },
8662
8667
  {
8663
- "code": 6050,
8668
+ "code": 6051,
8664
8669
  "name": "LockTierConfigMissing",
8665
8670
  "msg": "Lock tier config missing - pool was reconfigured with active entries"
8666
8671
  },
8667
8672
  {
8668
- "code": 6051,
8673
+ "code": 6052,
8669
8674
  "name": "NftAlreadyStaked",
8670
8675
  "msg": "NFT is already staked"
8671
8676
  },
8672
8677
  {
8673
- "code": 6052,
8678
+ "code": 6053,
8674
8679
  "name": "UserBanned",
8675
8680
  "msg": "User profile is banned"
8676
8681
  },
8677
8682
  {
8678
- "code": 6053,
8683
+ "code": 6054,
8679
8684
  "name": "UserProfileMismatch",
8680
8685
  "msg": "User profile does not match staker"
8681
8686
  },
8682
8687
  {
8683
- "code": 6054,
8688
+ "code": 6055,
8684
8689
  "name": "InvalidQuantityBonus",
8685
8690
  "msg": "Invalid quantity bonus configuration"
8686
8691
  },
8687
8692
  {
8688
- "code": 6055,
8693
+ "code": 6056,
8689
8694
  "name": "BaseStakingDisabled",
8690
8695
  "msg": "Unlocked/base staking is disabled for this pool"
8691
8696
  }
@@ -8758,7 +8763,7 @@
8758
8763
  {
8759
8764
  "name": "claim_only_at_end",
8760
8765
  "docs": [
8761
- "If true, mid-lock claims are blocked \u2014 rewards are only accessible at unstake.",
8766
+ "If true, mid-lock claims are blocked rewards are only accessible at unstake.",
8762
8767
  "Ensures the early-unstake penalty cannot be bypassed by claiming before unstaking."
8763
8768
  ],
8764
8769
  "type": "bool"
@@ -8854,7 +8859,7 @@
8854
8859
  "name": "PoolSecondaryRewards",
8855
8860
  "docs": [
8856
8861
  "Separate PDA holding secondary reward configs for a pool.",
8857
- "Exists only when the pool has secondary rewards \u2014 zero migration needed."
8862
+ "Exists only when the pool has secondary rewards zero migration needed."
8858
8863
  ],
8859
8864
  "type": {
8860
8865
  "kind": "struct",
@@ -8876,7 +8881,7 @@
8876
8881
  {
8877
8882
  "name": "is_initialized",
8878
8883
  "docs": [
8879
- "Explicit init sentinel \u2014 avoids ambiguous pool_id == 0 check for pool 0 (STAKE-H1)"
8884
+ "Explicit init sentinel avoids ambiguous pool_id == 0 check for pool 0 (STAKE-H1)"
8880
8885
  ],
8881
8886
  "type": "bool"
8882
8887
  },
@@ -8937,12 +8942,16 @@
8937
8942
  "type": "i64"
8938
8943
  },
8939
8944
  {
8940
- "name": "trait_bonus_mode",
8945
+ "name": "trait_bonus_enabled",
8941
8946
  "docs": [
8942
- "How trait bonuses are applied at claim time (None / FixedExtra / BaseMultiplier).",
8943
- "Trait config is stored off-chain; only the mode is on-chain."
8947
+ "When `true`, the pool accepts a signed `trait_bonus_rate` from the",
8948
+ "configured trait authority on every claim. The signed `u64` is added",
8949
+ "directly to the staker's effective rate for the accrual window —",
8950
+ "projects compute per-trait math (including any per-NFT multipliers)",
8951
+ "off-chain and sign the final absolute extra rate. When `false`, any",
8952
+ "non-zero `trait_bonus_rate` is rejected on-chain."
8944
8953
  ],
8945
- "type": "u8"
8954
+ "type": "bool"
8946
8955
  },
8947
8956
  {
8948
8957
  "name": "quantity_thresholds",
@@ -9025,7 +9034,7 @@
9025
9034
  {
9026
9035
  "name": "retired_at",
9027
9036
  "docs": [
9028
- "unix timestamp at which the slot was",
9037
+ "STAKE-FRESH-2026-05-11 (F-H3): unix timestamp at which the slot was",
9029
9038
  "retired. `0` while active. Used by `accrue_secondary` /",
9030
9039
  "`accrue_and_sub_secondary` to cap per-staker accrual at the moment of",
9031
9040
  "retirement so the time window between a staker's last interaction and",
@@ -9068,7 +9077,7 @@
9068
9077
  {
9069
9078
  "name": "StakeEntry",
9070
9079
  "docs": [
9071
- "Per-NFT custody and lock tracking. No reward fields \u2014 rewards are",
9080
+ "Per-NFT custody and lock tracking. No reward fields rewards are",
9072
9081
  "accumulated on the parent StakerAccount via `effective_rate`."
9073
9082
  ],
9074
9083
  "type": {
@@ -9131,7 +9140,7 @@
9131
9140
  {
9132
9141
  "name": "early_unstake_penalty_bps",
9133
9142
  "docs": [
9134
- "early-unstake penalty (bps) captured at",
9143
+ "STAKE2-M3 (audit 2026-05-05): early-unstake penalty (bps) captured at",
9135
9144
  "stake time. Read at unstake instead of `pool.lock_configs[tier].early_unstake_penalty_bps`",
9136
9145
  "so the authority cannot retroactively raise the penalty after the",
9137
9146
  "staker has committed. Zero when the entry has no lock."
@@ -9144,7 +9153,7 @@
9144
9153
  {
9145
9154
  "name": "StakeEntrySecondarySynced",
9146
9155
  "docs": [
9147
- "emitted when a StakeEntry's",
9156
+ "STAKE-FRESH-2026-05-11 (F-H4): emitted when a StakeEntry's",
9148
9157
  "secondary_rate_contributions[index] is re-synced to the pool's current",
9149
9158
  "config (e.g. after an admin added a new secondary slot post-stake)."
9150
9159
  ],
@@ -9309,7 +9318,7 @@
9309
9318
  {
9310
9319
  "name": "total_effective_rate",
9311
9320
  "docs": [
9312
- "aggregate of every active staker's",
9321
+ "STAKE-FRESH-2026-05-11 (F-H1): aggregate of every active staker's",
9313
9322
  "`effective_rate`. Maintained at every stake/unstake/burn site.",
9314
9323
  "Used by [`pool_settle`] to advance obligation for stakers who have",
9315
9324
  "not yet visited the pool since `last_pool_accrual_ts`."
@@ -9319,7 +9328,7 @@
9319
9328
  {
9320
9329
  "name": "last_pool_accrual_ts",
9321
9330
  "docs": [
9322
- "unix timestamp at which the pool's",
9331
+ "STAKE-FRESH-2026-05-11 (F-H1): unix timestamp at which the pool's",
9323
9332
  "total obligation was last advanced. Bumped by every handler that",
9324
9333
  "touches the pool (via [`pool_settle`])."
9325
9334
  ],
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  export { NftStakingClient, type FeeParams, type NftRewardAmount, type NftRewardSummary, type NftRewardSummaryOptions, } from "./client";
2
- export { NFT_STAKING_PROGRAM_ID, getStakeConfigPda, getStakePoolPda, getStakeEntryPda, getStakerAccountPda, getCollectionPda, getPoolAuthorityPda, getPoolSecondaryRewardsPda, getStakerSecondaryRewardsPda, StakingMode, NftStandard, RewardType, TraitBonusMode, } from "@soltracer/core";
2
+ export { NFT_STAKING_PROGRAM_ID, getStakeConfigPda, getStakePoolPda, getStakeEntryPda, getStakerAccountPda, getCollectionPda, getPoolAuthorityPda, getPoolSecondaryRewardsPda, getStakerSecondaryRewardsPda, StakingMode, NftStandard, RewardType, } from "@soltracer/core";
3
3
  export { type NftStaking as NftStakingIDLType } from "./idl";
4
4
  export { default as NftStakingIDL } from "./idl.json";
5
5
  export * from "./errors";
6
6
  export * from "./helpers";
7
- export { buildTraitProofMessage, TRAIT_PROOF_MSG_LEN, aggregateTraitBonusRate, computeTraitBonusRate, prepareTraitProof, ownershipFromClient, type TraitBonusCatalogEntry, type NftTraitInput, type ComputeTraitBonusResult, type TraitBonusStore, type NftTraitResolver, type StakedOwnershipResolver, type PreparedTraitProof, } from "./traitProof";
7
+ export { buildTraitProofMessage, TRAIT_PROOF_MSG_LEN, computeTraitBonusRate, prepareTraitProof, ownershipFromClient, InMemoryTraitBonusStore, type TraitBonusCatalogEntry, type NftTraitInput, type PerNftBonus, type TraitBonusComputation, type TraitBonusStore, type NftTraitResolver, type StakedOwnershipResolver, type PrepareTraitProofInput, type PrepareTraitProofResult, } from "./traitProof";
8
8
  export { GATE_TYPE_NONE, GATE_TYPE_WALLET, GATE_TYPE_TOKEN_MINT, type GateType, type MerkleTree, hashLeaf, hashPair, buildMerkleTree, getMerkleProof, proofToAnchorArg, rootToAnchorArg, } from "./merkle";
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,GAC7B,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB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AAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,YAAY,CAAA;AACrD,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,eAAe,GAChB,MAAM,UAAU,CAAA"}
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export { NftStakingClient, } from "./client";
2
- export { NFT_STAKING_PROGRAM_ID, getStakeConfigPda, getStakePoolPda, getStakeEntryPda, getStakerAccountPda, getCollectionPda, getPoolAuthorityPda, getPoolSecondaryRewardsPda, getStakerSecondaryRewardsPda, StakingMode, NftStandard, RewardType, TraitBonusMode, } from "@soltracer/core";
2
+ export { NFT_STAKING_PROGRAM_ID, getStakeConfigPda, getStakePoolPda, getStakeEntryPda, getStakerAccountPda, getCollectionPda, getPoolAuthorityPda, getPoolSecondaryRewardsPda, getStakerSecondaryRewardsPda, StakingMode, NftStandard, RewardType, } from "@soltracer/core";
3
3
  export { default as NftStakingIDL } from "./idl.json";
4
4
  export * from "./errors";
5
5
  export * from "./helpers";
6
- export { buildTraitProofMessage, TRAIT_PROOF_MSG_LEN, aggregateTraitBonusRate, computeTraitBonusRate, prepareTraitProof, ownershipFromClient, } from "./traitProof";
6
+ export { buildTraitProofMessage, TRAIT_PROOF_MSG_LEN, computeTraitBonusRate, prepareTraitProof, ownershipFromClient, InMemoryTraitBonusStore, } from "./traitProof";
7
7
  export { GATE_TYPE_NONE, GATE_TYPE_WALLET, GATE_TYPE_TOKEN_MINT, hashLeaf, hashPair, buildMerkleTree, getMerkleProof, proofToAnchorArg, rootToAnchorArg, } from "./merkle";
8
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,GAKjB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,0BAA0B,EAC1B,4BAA4B,EAC5B,WAAW,EACX,WAAW,EACX,UAAU,EACV,cAAc,GACf,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,YAAY,CAAA;AACrD,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,GAQpB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EAGpB,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,eAAe,GAChB,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,GAKjB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,0BAA0B,EAC1B,4BAA4B,EAC5B,WAAW,EACX,WAAW,EACX,UAAU,GACX,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,YAAY,CAAA;AACrD,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,GAUxB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EAGpB,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,eAAe,GAChB,MAAM,UAAU,CAAA"}