@stacks/codec 2.0.0-pox5.1 → 2.0.0-pox5.3

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/index.d.ts CHANGED
@@ -728,6 +728,7 @@ export interface Pox4EventRevokeDelegateStx extends Pox4EventBase {
728
728
  }
729
729
  export type Pox4Event = Pox4EventHandleUnlock | Pox4EventStackStx | Pox4EventStackIncrease | Pox4EventStackExtend | Pox4EventDelegateStx | Pox4EventDelegateStackStx | Pox4EventDelegateStackIncrease | Pox4EventDelegateStackExtend | Pox4EventStackAggregationCommit | Pox4EventStackAggregationCommitIndexed | Pox4EventStackAggregationIncrease | Pox4EventRevokeDelegateStx;
730
730
  export declare enum Pox5EventName {
731
+ SetBondAdmin = "set-bond-admin",
731
732
  SetupBond = "setup-bond",
732
733
  AddToAllowlist = "add-to-allowlist",
733
734
  RegisterForBond = "register-for-bond",
@@ -740,7 +741,12 @@ export declare enum Pox5EventName {
740
741
  Unstake = "unstake",
741
742
  CalculateRewards = "calculate-rewards",
742
743
  BondDistribution = "bond-distribution",
743
- ClaimRewards = "claim-rewards"
744
+ ClaimRewards = "claim-rewards",
745
+ ClaimStakerRewardsForSigner = "claim-staker-rewards-for-signer",
746
+ GrantSignerKey = "grant-signer-key",
747
+ RevokeSignerGrant = "revoke-signer-grant",
748
+ DisallowContractCaller = "disallow-contract-caller",
749
+ AllowContractCaller = "allow-contract-caller"
744
750
  }
745
751
  export interface Pox5EventBase {
746
752
  /**
@@ -750,6 +756,15 @@ export interface Pox5EventBase {
750
756
  */
751
757
  pox_version: 'pox5';
752
758
  }
759
+ export interface Pox5EventSetBondAdmin extends Pox5EventBase {
760
+ name: Pox5EventName.SetBondAdmin;
761
+ data: {
762
+ /** c32 principal of the previous bond admin. */
763
+ old_admin: string;
764
+ /** c32 principal of the new bond admin. */
765
+ new_admin: string;
766
+ };
767
+ }
753
768
  export interface Pox5EventSetupBond extends Pox5EventBase {
754
769
  name: Pox5EventName.SetupBond;
755
770
  data: {
@@ -762,12 +777,11 @@ export interface Pox5EventSetupBond extends Pox5EventBase {
762
777
  /** String-quoted unsigned integer */
763
778
  min_ustx_ratio: string;
764
779
  /**
765
- * `(buff 683)` hex string. Opaque early-unlock authorization script
766
- * (e.g. `<pubkey> OP_CHECKSIGVERIFY`, or an M-of-N multisig template).
780
+ * `(buff 683)` hex string. Bitcoin script subscript guarding the
781
+ * early-exit (`OP_ELSE`) branch of the L1 lockup (e.g. `<pubkey>
782
+ * OP_CHECKSIG`, or an M-of-N `CHECKMULTISIG` template).
767
783
  */
768
784
  early_unlock_bytes: string;
769
- /** c32 principal allowed to call `announce-l1-early-exit` for stakers in this bond. */
770
- early_unlock_admin: string;
771
785
  /** String-quoted unsigned integer */
772
786
  first_reward_cycle: string;
773
787
  /** String-quoted unsigned integer */
@@ -934,17 +948,8 @@ export interface Pox5EventUnstake extends Pox5EventBase {
934
948
  };
935
949
  }
936
950
  /**
937
- * Logged by `calculate-rewards`. The contract emits this topic **twice** per
938
- * call: a phase-1 (pre-distribution) print carrying `stranded_staker_cut`,
939
- * and a phase-2 (post-distribution) print carrying `new_reserve`. Exactly
940
- * one of those two fields is populated per event; the other is `null`.
941
- *
942
- * Phase-1 fires before reserve and accounting state are updated; useful for
943
- * inspecting whether the staker cut was folded into the reserve because no
944
- * STX was staked.
945
- *
946
- * Phase-2 fires after state is committed and matches the value returned to
947
- * the caller.
951
+ * Logged once per `calculate-rewards` call, after all per-bond distributions
952
+ * have been folded and the STX reward cycle accounting has been committed.
948
953
  */
949
954
  export interface Pox5EventCalculateRewards extends Pox5EventBase {
950
955
  name: Pox5EventName.CalculateRewards;
@@ -953,29 +958,24 @@ export interface Pox5EventCalculateRewards extends Pox5EventBase {
953
958
  bond_periods: string[];
954
959
  /** String-quoted unsigned integer */
955
960
  calculation_height: string;
956
- /** String-quoted unsigned integer */
957
- remaining_rewards: string;
958
- /** String-quoted unsigned integer */
959
- accrued_rewards: string;
960
- /**
961
- * Phase-2 only. String-quoted unsigned integer — portion of accrued
962
- * rewards retained in the reserve. `null` on the phase-1 event.
963
- */
964
- new_reserve: string | null;
965
- /**
966
- * Phase-1 only. String-quoted unsigned integer — the would-be STX
967
- * staker cut that gets folded into the reserve when no STX is staked
968
- * for the cycle. `null` on the phase-2 event.
969
- */
970
- stranded_staker_cut: string | null;
971
- /** String-quoted unsigned integer */
972
- stx_staker_rewards: string;
961
+ /** String-quoted unsigned integer — total new rewards accrued since the last calculation. */
962
+ gross_accrued_rewards: string;
963
+ /** String-quoted unsigned integer — portion of `gross_accrued_rewards` paid out to bonds. */
964
+ total_bond_rewards: string;
965
+ /** String-quoted unsigned integer — amount added to the reserve this calculation. */
966
+ reserve_deposit: string;
967
+ /** String-quoted unsigned integer reserve balance after `reserve_deposit` was applied. */
968
+ reserve_balance: string;
973
969
  /** String-quoted unsigned integer */
974
970
  stx_cycle: string;
971
+ /** String-quoted unsigned integer — rewards allocated to STX stakers for the cycle. */
972
+ total_stx_staker_rewards: string;
975
973
  /** String-quoted unsigned integer */
976
974
  cycle_staked_ustx: string;
977
- /** String-quoted unsigned integer */
978
- next_rewards_per_ustx: string;
975
+ /** String-quoted unsigned integer — per-uSTX rewards accrued this calculation (zero when no STX is staked). */
976
+ accrued_rewards_per_ustx: string;
977
+ /** String-quoted unsigned integer — running per-uSTX reward total for the cycle after this calculation. */
978
+ cumulative_rewards_per_ustx: string;
979
979
  };
980
980
  }
981
981
  export interface Pox5EventBondDistribution extends Pox5EventBase {
@@ -985,8 +985,14 @@ export interface Pox5EventBondDistribution extends Pox5EventBase {
985
985
  bond_index: string;
986
986
  /** String-quoted unsigned integer */
987
987
  target_yield: string;
988
- /** String-quoted unsigned integer */
989
- earned: string;
988
+ /** String-quoted unsigned integer — rewards earned by this bond this calculation. */
989
+ bond_rewards: string;
990
+ /** String-quoted unsigned integer */
991
+ bond_staked_sats: string;
992
+ /** String-quoted unsigned integer — per-sat rewards accrued this calculation. */
993
+ accrued_rewards_per_sat: string;
994
+ /** String-quoted unsigned integer — running per-sat reward total for the bond after this calculation. */
995
+ cumulative_rewards_per_sat: string;
990
996
  };
991
997
  }
992
998
  /** Sub-tuple emitted under `stx_rewards` in `claim-rewards` events. */
@@ -1004,6 +1010,10 @@ export interface Pox5BondRewardsInfo extends Pox5ClaimRewardsInfo {
1004
1010
  export interface Pox5EventClaimRewards extends Pox5EventBase {
1005
1011
  name: Pox5EventName.ClaimRewards;
1006
1012
  data: {
1013
+ /** c32 principal of the signer manager that claimed. */
1014
+ signer_manager: string;
1015
+ /** String-quoted unsigned integer */
1016
+ reward_cycle: string;
1007
1017
  stx_rewards: Pox5ClaimRewardsInfo;
1008
1018
  bond_rewards: Pox5BondRewardsInfo[];
1009
1019
  /** String-quoted unsigned integer */
@@ -1012,7 +1022,68 @@ export interface Pox5EventClaimRewards extends Pox5EventBase {
1012
1022
  total_rewards: string;
1013
1023
  };
1014
1024
  }
1015
- export type Pox5Event = Pox5EventSetupBond | Pox5EventAddToAllowlist | Pox5EventRegisterForBond | Pox5EventUpdateBondRegistration | Pox5EventRegisterSigner | Pox5EventStake | Pox5EventStakeUpdate | Pox5EventAnnounceL1EarlyExit | Pox5EventUnstakeSbtc | Pox5EventUnstake | Pox5EventCalculateRewards | Pox5EventBondDistribution | Pox5EventClaimRewards;
1025
+ export interface Pox5EventClaimStakerRewardsForSigner extends Pox5EventBase {
1026
+ name: Pox5EventName.ClaimStakerRewardsForSigner;
1027
+ data: {
1028
+ /** c32 principal of the signer manager. */
1029
+ signer_manager: string;
1030
+ /** c32 principal of the staker. */
1031
+ staker: string;
1032
+ /** String-quoted unsigned integer */
1033
+ reward_cycle: string;
1034
+ /**
1035
+ * String-quoted unsigned integer for bond rewards, or `null` for
1036
+ * STX-only staking rewards.
1037
+ */
1038
+ bond_index: string | null;
1039
+ /** String-quoted unsigned integer */
1040
+ rewards_claimed: string;
1041
+ };
1042
+ }
1043
+ export interface Pox5EventGrantSignerKey extends Pox5EventBase {
1044
+ name: Pox5EventName.GrantSignerKey;
1045
+ data: {
1046
+ /** `(buff 33)` hex string — compressed secp256k1 public key. */
1047
+ signer_key: string;
1048
+ /** c32 principal of the signer manager. */
1049
+ signer_manager: string;
1050
+ /** String-quoted unsigned integer */
1051
+ auth_id: string;
1052
+ };
1053
+ }
1054
+ export interface Pox5EventRevokeSignerGrant extends Pox5EventBase {
1055
+ name: Pox5EventName.RevokeSignerGrant;
1056
+ data: {
1057
+ /** `(buff 33)` hex string — compressed secp256k1 public key. */
1058
+ signer_key: string;
1059
+ /** c32 principal of the signer manager. */
1060
+ signer_manager: string;
1061
+ };
1062
+ }
1063
+ export interface Pox5EventDisallowContractCaller extends Pox5EventBase {
1064
+ name: Pox5EventName.DisallowContractCaller;
1065
+ data: {
1066
+ /** c32 principal of the tx-sender that revoked the allowance. */
1067
+ sender: string;
1068
+ /** c32 principal of the contract-caller whose allowance was removed. */
1069
+ contract_caller: string;
1070
+ };
1071
+ }
1072
+ export interface Pox5EventAllowContractCaller extends Pox5EventBase {
1073
+ name: Pox5EventName.AllowContractCaller;
1074
+ data: {
1075
+ /** c32 principal of the tx-sender that granted the allowance. */
1076
+ sender: string;
1077
+ /** c32 principal of the allowed contract-caller. */
1078
+ contract_caller: string;
1079
+ /**
1080
+ * String-quoted unsigned integer burn height at which the allowance
1081
+ * expires, or `null` if it never expires.
1082
+ */
1083
+ until_burn_ht: string | null;
1084
+ };
1085
+ }
1086
+ export type Pox5Event = Pox5EventSetBondAdmin | Pox5EventSetupBond | Pox5EventAddToAllowlist | Pox5EventRegisterForBond | Pox5EventUpdateBondRegistration | Pox5EventRegisterSigner | Pox5EventStake | Pox5EventStakeUpdate | Pox5EventAnnounceL1EarlyExit | Pox5EventUnstakeSbtc | Pox5EventUnstake | Pox5EventCalculateRewards | Pox5EventBondDistribution | Pox5EventClaimRewards | Pox5EventClaimStakerRewardsForSigner | Pox5EventGrantSignerKey | Pox5EventRevokeSignerGrant | Pox5EventDisallowContractCaller | Pox5EventAllowContractCaller;
1016
1087
  /**
1017
1088
  * Any decoded PoX synthetic event, regardless of the source contract version.
1018
1089
  *
package/index.js CHANGED
@@ -249,6 +249,7 @@ var Pox4EventName;
249
249
  // ============================================================================
250
250
  var Pox5EventName;
251
251
  (function (Pox5EventName) {
252
+ Pox5EventName["SetBondAdmin"] = "set-bond-admin";
252
253
  Pox5EventName["SetupBond"] = "setup-bond";
253
254
  Pox5EventName["AddToAllowlist"] = "add-to-allowlist";
254
255
  Pox5EventName["RegisterForBond"] = "register-for-bond";
@@ -262,4 +263,9 @@ var Pox5EventName;
262
263
  Pox5EventName["CalculateRewards"] = "calculate-rewards";
263
264
  Pox5EventName["BondDistribution"] = "bond-distribution";
264
265
  Pox5EventName["ClaimRewards"] = "claim-rewards";
266
+ Pox5EventName["ClaimStakerRewardsForSigner"] = "claim-staker-rewards-for-signer";
267
+ Pox5EventName["GrantSignerKey"] = "grant-signer-key";
268
+ Pox5EventName["RevokeSignerGrant"] = "revoke-signer-grant";
269
+ Pox5EventName["DisallowContractCaller"] = "disallow-contract-caller";
270
+ Pox5EventName["AllowContractCaller"] = "allow-contract-caller";
265
271
  })(Pox5EventName || (exports.Pox5EventName = Pox5EventName = {}));
package/index.mjs CHANGED
@@ -158,6 +158,7 @@ var Pox4EventName = /* @__PURE__ */ ((Pox4EventName2) => {
158
158
  return Pox4EventName2;
159
159
  })(Pox4EventName || {});
160
160
  var Pox5EventName = /* @__PURE__ */ ((Pox5EventName2) => {
161
+ Pox5EventName2["SetBondAdmin"] = "set-bond-admin";
161
162
  Pox5EventName2["SetupBond"] = "setup-bond";
162
163
  Pox5EventName2["AddToAllowlist"] = "add-to-allowlist";
163
164
  Pox5EventName2["RegisterForBond"] = "register-for-bond";
@@ -171,6 +172,11 @@ var Pox5EventName = /* @__PURE__ */ ((Pox5EventName2) => {
171
172
  Pox5EventName2["CalculateRewards"] = "calculate-rewards";
172
173
  Pox5EventName2["BondDistribution"] = "bond-distribution";
173
174
  Pox5EventName2["ClaimRewards"] = "claim-rewards";
175
+ Pox5EventName2["ClaimStakerRewardsForSigner"] = "claim-staker-rewards-for-signer";
176
+ Pox5EventName2["GrantSignerKey"] = "grant-signer-key";
177
+ Pox5EventName2["RevokeSignerGrant"] = "revoke-signer-grant";
178
+ Pox5EventName2["DisallowContractCaller"] = "disallow-contract-caller";
179
+ Pox5EventName2["AllowContractCaller"] = "allow-contract-caller";
174
180
  return Pox5EventName2;
175
181
  })(Pox5EventName || {});
176
182
  export {
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stacks/codec",
3
- "version": "2.0.0-pox5.1",
3
+ "version": "2.0.0-pox5.3",
4
4
  "author": "Stacks Labs",
5
5
  "license": "GPL-3.0",
6
6
  "description": "Encoding & decoding functions for the Stacks blockchain exposed as a fast native Node.js addon",