@ledgerhq/coin-evm 5.3.9 → 5.4.1

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/lib/logic/getStakes.d.ts.map +1 -1
  3. package/lib/logic/getStakes.js +6 -2
  4. package/lib/logic/getStakes.js.map +1 -1
  5. package/lib/staking/contracts.d.ts.map +1 -1
  6. package/lib/staking/contracts.js +4 -0
  7. package/lib/staking/contracts.js.map +1 -1
  8. package/lib/staking/index.d.ts +1 -0
  9. package/lib/staking/index.d.ts.map +1 -1
  10. package/lib/staking/index.js +3 -1
  11. package/lib/staking/index.js.map +1 -1
  12. package/lib/staking/unbondings.d.ts +8 -0
  13. package/lib/staking/unbondings.d.ts.map +1 -0
  14. package/lib/staking/unbondings.js +114 -0
  15. package/lib/staking/unbondings.js.map +1 -0
  16. package/lib/types/staking.d.ts +17 -0
  17. package/lib/types/staking.d.ts.map +1 -1
  18. package/lib-es/logic/getStakes.d.ts.map +1 -1
  19. package/lib-es/logic/getStakes.js +6 -2
  20. package/lib-es/logic/getStakes.js.map +1 -1
  21. package/lib-es/staking/contracts.d.ts.map +1 -1
  22. package/lib-es/staking/contracts.js +4 -0
  23. package/lib-es/staking/contracts.js.map +1 -1
  24. package/lib-es/staking/index.d.ts +1 -0
  25. package/lib-es/staking/index.d.ts.map +1 -1
  26. package/lib-es/staking/index.js +1 -0
  27. package/lib-es/staking/index.js.map +1 -1
  28. package/lib-es/staking/unbondings.d.ts +8 -0
  29. package/lib-es/staking/unbondings.d.ts.map +1 -0
  30. package/lib-es/staking/unbondings.js +108 -0
  31. package/lib-es/staking/unbondings.js.map +1 -0
  32. package/lib-es/types/staking.d.ts +17 -0
  33. package/lib-es/types/staking.d.ts.map +1 -1
  34. package/package.json +1 -1
  35. package/src/api/{index.arc_testnet.integ.test.ts → index.arc.integ.test.ts} +15 -12
  36. package/src/logic/getStakes.test.ts +84 -0
  37. package/src/logic/getStakes.ts +12 -8
  38. package/src/staking/contracts.ts +4 -0
  39. package/src/staking/index.ts +1 -0
  40. package/src/staking/unbondings.test.ts +245 -0
  41. package/src/staking/unbondings.ts +137 -0
  42. package/src/types/staking.ts +18 -0
@@ -44,6 +44,22 @@ export type RedelegationStrategy =
44
44
  }
45
45
  | { type: 'none' }
46
46
 
47
+ /**
48
+ * Per-chain strategy for fetching pending unbondings from an off-chain source.
49
+ *
50
+ * - `cosmos-rest`: Cosmos REST API, EVM address resolved via
51
+ * `apiConfig.precompileAddress`. Needed because the staking precompile
52
+ * exposes only active delegations.
53
+ * - `none`: pending unbondings are not surfaced.
54
+ */
55
+ export type UnbondingStrategy =
56
+ | {
57
+ type: 'cosmos-rest'
58
+ /** REST endpoint template; `{address}` is replaced with the resolved Cosmos address. */
59
+ endpoint: string
60
+ }
61
+ | { type: 'none' }
62
+
47
63
  /**
48
64
  * Per-chain strategy for fetching pending delegation rewards.
49
65
  *
@@ -134,6 +150,8 @@ export type StakingContractConfig = {
134
150
  }
135
151
  /** How to fetch active redelegations from an off-chain source. Defaults to `"none"` when absent. */
136
152
  redelegationStrategy?: RedelegationStrategy
153
+ /** How to fetch pending unbondings from an off-chain source. Defaults to `"none"` when absent. */
154
+ unbondingStrategy?: UnbondingStrategy
137
155
  /** How to fetch pending delegation rewards from an off-chain source. Defaults to `"none"` when absent. */
138
156
  rewardsStrategy?: RewardsStrategy
139
157
  /** How to recover a REWARD op's amount from its tx receipt logs. Absent → REWARD ops keep their native value. */