@indigo-labs/indigo-sdk 0.5.3 → 0.5.4
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/README.md +2 -5
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -6
- package/dist/index.mjs +9 -6
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -12,10 +12,7 @@ npm install @indigo-labs/indigo-sdk
|
|
|
12
12
|
|
|
13
13
|
## Deployment to npmjs
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
`pnpm run build`
|
|
17
|
-
|
|
18
|
-
Then update the version with either of the following:
|
|
15
|
+
Update the version with either of the following:
|
|
19
16
|
|
|
20
17
|
```
|
|
21
18
|
pnpm version patch # 1.0.0 → 1.0.1
|
|
@@ -23,7 +20,7 @@ pnpm version minor # 1.0.0 → 1.1.0
|
|
|
23
20
|
pnpm version major # 1.0.0 → 2.0.0
|
|
24
21
|
```
|
|
25
22
|
|
|
26
|
-
Publish:
|
|
23
|
+
Publish (builds thanks to prepublish hook):
|
|
27
24
|
`pnpm publish --access public`
|
|
28
25
|
|
|
29
26
|
## Development
|
package/dist/index.d.mts
CHANGED
|
@@ -3648,7 +3648,7 @@ declare function processSpRequest(stabilityPoolUtxo: UTxO, accountUtxo: UTxO, iA
|
|
|
3648
3648
|
/**
|
|
3649
3649
|
* For performance provide only the ones related to the pool's iAsset.
|
|
3650
3650
|
*/
|
|
3651
|
-
allE2s2sSnapshotOrefs: OutRef[], sysParams: SystemParams, lucid: LucidEvolution): Promise<TxBuilder>;
|
|
3651
|
+
allE2s2sSnapshotOrefs: OutRef[], sysParams: SystemParams, lucid: LucidEvolution, currentSlot?: number): Promise<TxBuilder>;
|
|
3652
3652
|
declare function createE2s2sSnapshots(stabilityPoolOref: OutRef, sysParams: SystemParams, lucid: LucidEvolution): Promise<TxBuilder>;
|
|
3653
3653
|
declare function annulRequest(accountUtxo: UTxO, params: SystemParams, lucid: LucidEvolution): Promise<TxBuilder>;
|
|
3654
3654
|
|
package/dist/index.d.ts
CHANGED
|
@@ -3648,7 +3648,7 @@ declare function processSpRequest(stabilityPoolUtxo: UTxO, accountUtxo: UTxO, iA
|
|
|
3648
3648
|
/**
|
|
3649
3649
|
* For performance provide only the ones related to the pool's iAsset.
|
|
3650
3650
|
*/
|
|
3651
|
-
allE2s2sSnapshotOrefs: OutRef[], sysParams: SystemParams, lucid: LucidEvolution): Promise<TxBuilder>;
|
|
3651
|
+
allE2s2sSnapshotOrefs: OutRef[], sysParams: SystemParams, lucid: LucidEvolution, currentSlot?: number): Promise<TxBuilder>;
|
|
3652
3652
|
declare function createE2s2sSnapshots(stabilityPoolOref: OutRef, sysParams: SystemParams, lucid: LucidEvolution): Promise<TxBuilder>;
|
|
3653
3653
|
declare function annulRequest(accountUtxo: UTxO, params: SystemParams, lucid: LucidEvolution): Promise<TxBuilder>;
|
|
3654
3654
|
|
package/dist/index.js
CHANGED
|
@@ -8310,8 +8310,9 @@ async function requestSpAccountClosure(accountUtxo, sysParams, lucid, maxTxFee =
|
|
|
8310
8310
|
)
|
|
8311
8311
|
).addSignerKey((0, import_lucid47.toHex)(oldAccountDatum.owner));
|
|
8312
8312
|
}
|
|
8313
|
-
async function processSpRequestAuxiliary(stabilityPoolUtxo, accountUtxo, iAssetUtxo, allE2s2sSnapshotOrefs, sysParams, lucid, txFee) {
|
|
8314
|
-
const
|
|
8313
|
+
async function processSpRequestAuxiliary(stabilityPoolUtxo, accountUtxo, iAssetUtxo, allE2s2sSnapshotOrefs, sysParams, lucid, txFee, currentSlot) {
|
|
8314
|
+
const slot = currentSlot !== void 0 ? currentSlot : lucid.currentSlot();
|
|
8315
|
+
const currentTime = BigInt(lucid.slotToUnixTime(slot));
|
|
8315
8316
|
const stabilityPoolScriptRef = (0, import_cardano_offchain_common24.matchSingle)(
|
|
8316
8317
|
await lucid.utxosByOutRef([
|
|
8317
8318
|
fromSystemParamsScriptRef(
|
|
@@ -8327,7 +8328,7 @@ async function processSpRequestAuxiliary(stabilityPoolUtxo, accountUtxo, iAssetU
|
|
|
8327
8328
|
getInlineDatumOrThrow(stabilityPoolUtxo)
|
|
8328
8329
|
);
|
|
8329
8330
|
const baseRefInputs = [iAssetUtxo, stabilityPoolScriptRef];
|
|
8330
|
-
const validFrom = lucid.slotToUnixTime(
|
|
8331
|
+
const validFrom = lucid.slotToUnixTime(slot - 1);
|
|
8331
8332
|
const tx = lucid.newTx().validFrom(validFrom).validTo(validFrom + sysParams.stabilityPoolParams.accountProcessingBiasMs).readFrom(baseRefInputs).collectFrom([stabilityPoolUtxo], {
|
|
8332
8333
|
kind: "selected",
|
|
8333
8334
|
inputs: [stabilityPoolUtxo, accountUtxo],
|
|
@@ -8699,7 +8700,7 @@ async function processSpRequestAuxiliary(stabilityPoolUtxo, accountUtxo, iAssetU
|
|
|
8699
8700
|
}).exhaustive();
|
|
8700
8701
|
return tx;
|
|
8701
8702
|
}
|
|
8702
|
-
async function processSpRequest(stabilityPoolUtxo, accountUtxo, iAssetUtxo, allE2s2sSnapshotOrefs, sysParams, lucid) {
|
|
8703
|
+
async function processSpRequest(stabilityPoolUtxo, accountUtxo, iAssetUtxo, allE2s2sSnapshotOrefs, sysParams, lucid, currentSlot) {
|
|
8703
8704
|
const draftTx = processSpRequestAuxiliary(
|
|
8704
8705
|
stabilityPoolUtxo,
|
|
8705
8706
|
accountUtxo,
|
|
@@ -8708,7 +8709,8 @@ async function processSpRequest(stabilityPoolUtxo, accountUtxo, iAssetUtxo, allE
|
|
|
8708
8709
|
sysParams,
|
|
8709
8710
|
lucid,
|
|
8710
8711
|
// Placeholder transation fee
|
|
8711
|
-
1n
|
|
8712
|
+
1n,
|
|
8713
|
+
currentSlot
|
|
8712
8714
|
);
|
|
8713
8715
|
const fee = (await (await draftTx).complete()).toTransaction().body().fee();
|
|
8714
8716
|
return processSpRequestAuxiliary(
|
|
@@ -8718,7 +8720,8 @@ async function processSpRequest(stabilityPoolUtxo, accountUtxo, iAssetUtxo, allE
|
|
|
8718
8720
|
allE2s2sSnapshotOrefs,
|
|
8719
8721
|
sysParams,
|
|
8720
8722
|
lucid,
|
|
8721
|
-
fee
|
|
8723
|
+
fee,
|
|
8724
|
+
currentSlot
|
|
8722
8725
|
);
|
|
8723
8726
|
}
|
|
8724
8727
|
async function createE2s2sSnapshots(stabilityPoolOref, sysParams, lucid) {
|
package/dist/index.mjs
CHANGED
|
@@ -8098,8 +8098,9 @@ async function requestSpAccountClosure(accountUtxo, sysParams, lucid, maxTxFee =
|
|
|
8098
8098
|
)
|
|
8099
8099
|
).addSignerKey(toHex12(oldAccountDatum.owner));
|
|
8100
8100
|
}
|
|
8101
|
-
async function processSpRequestAuxiliary(stabilityPoolUtxo, accountUtxo, iAssetUtxo, allE2s2sSnapshotOrefs, sysParams, lucid, txFee) {
|
|
8102
|
-
const
|
|
8101
|
+
async function processSpRequestAuxiliary(stabilityPoolUtxo, accountUtxo, iAssetUtxo, allE2s2sSnapshotOrefs, sysParams, lucid, txFee, currentSlot) {
|
|
8102
|
+
const slot = currentSlot !== void 0 ? currentSlot : lucid.currentSlot();
|
|
8103
|
+
const currentTime = BigInt(lucid.slotToUnixTime(slot));
|
|
8103
8104
|
const stabilityPoolScriptRef = matchSingle5(
|
|
8104
8105
|
await lucid.utxosByOutRef([
|
|
8105
8106
|
fromSystemParamsScriptRef(
|
|
@@ -8115,7 +8116,7 @@ async function processSpRequestAuxiliary(stabilityPoolUtxo, accountUtxo, iAssetU
|
|
|
8115
8116
|
getInlineDatumOrThrow(stabilityPoolUtxo)
|
|
8116
8117
|
);
|
|
8117
8118
|
const baseRefInputs = [iAssetUtxo, stabilityPoolScriptRef];
|
|
8118
|
-
const validFrom = lucid.slotToUnixTime(
|
|
8119
|
+
const validFrom = lucid.slotToUnixTime(slot - 1);
|
|
8119
8120
|
const tx = lucid.newTx().validFrom(validFrom).validTo(validFrom + sysParams.stabilityPoolParams.accountProcessingBiasMs).readFrom(baseRefInputs).collectFrom([stabilityPoolUtxo], {
|
|
8120
8121
|
kind: "selected",
|
|
8121
8122
|
inputs: [stabilityPoolUtxo, accountUtxo],
|
|
@@ -8487,7 +8488,7 @@ async function processSpRequestAuxiliary(stabilityPoolUtxo, accountUtxo, iAssetU
|
|
|
8487
8488
|
}).exhaustive();
|
|
8488
8489
|
return tx;
|
|
8489
8490
|
}
|
|
8490
|
-
async function processSpRequest(stabilityPoolUtxo, accountUtxo, iAssetUtxo, allE2s2sSnapshotOrefs, sysParams, lucid) {
|
|
8491
|
+
async function processSpRequest(stabilityPoolUtxo, accountUtxo, iAssetUtxo, allE2s2sSnapshotOrefs, sysParams, lucid, currentSlot) {
|
|
8491
8492
|
const draftTx = processSpRequestAuxiliary(
|
|
8492
8493
|
stabilityPoolUtxo,
|
|
8493
8494
|
accountUtxo,
|
|
@@ -8496,7 +8497,8 @@ async function processSpRequest(stabilityPoolUtxo, accountUtxo, iAssetUtxo, allE
|
|
|
8496
8497
|
sysParams,
|
|
8497
8498
|
lucid,
|
|
8498
8499
|
// Placeholder transation fee
|
|
8499
|
-
1n
|
|
8500
|
+
1n,
|
|
8501
|
+
currentSlot
|
|
8500
8502
|
);
|
|
8501
8503
|
const fee = (await (await draftTx).complete()).toTransaction().body().fee();
|
|
8502
8504
|
return processSpRequestAuxiliary(
|
|
@@ -8506,7 +8508,8 @@ async function processSpRequest(stabilityPoolUtxo, accountUtxo, iAssetUtxo, allE
|
|
|
8506
8508
|
allE2s2sSnapshotOrefs,
|
|
8507
8509
|
sysParams,
|
|
8508
8510
|
lucid,
|
|
8509
|
-
fee
|
|
8511
|
+
fee,
|
|
8512
|
+
currentSlot
|
|
8510
8513
|
);
|
|
8511
8514
|
}
|
|
8512
8515
|
async function createE2s2sSnapshots(stabilityPoolOref, sysParams, lucid) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indigo-labs/indigo-sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
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",
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"format": "npx prettier --write src/ tests/",
|
|
68
68
|
"format:check": "npx prettier --check src/ tests/",
|
|
69
69
|
"test": "vitest run",
|
|
70
|
-
"lint-staged": "lint-staged"
|
|
70
|
+
"lint-staged": "lint-staged",
|
|
71
|
+
"release": "pnpm build && pnpm publish --access public"
|
|
71
72
|
}
|
|
72
73
|
}
|