@indigo-labs/indigo-sdk 0.2.4 → 0.2.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigo-labs/indigo-sdk",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Indigo SDK for interacting with Indigo endpoints via lucid-evolution",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -125,3 +125,11 @@ export function distributeReward(
125
125
  ): bigint {
126
126
  return snapshotAda + (adaReward * rewardSnapshotPrecision) / totalStake;
127
127
  }
128
+
129
+ export function calculateAdaReward(
130
+ currentSnapshotAda: bigint,
131
+ oldSnapshotAda: bigint,
132
+ existingIndyAmount: bigint,
133
+ ): bigint {
134
+ return ((currentSnapshotAda - oldSnapshotAda) * existingIndyAmount) / rewardSnapshotPrecision;
135
+ }