@indigo-labs/indigo-sdk 0.1.22 → 0.1.23
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/index.js +9 -4
- package/dist/index.mjs +9 -4
- package/package.json +1 -1
- package/src/helpers/asset-helpers.ts +10 -4
package/dist/index.js
CHANGED
|
@@ -368,17 +368,22 @@ var IAssetHelpers = class {
|
|
|
368
368
|
});
|
|
369
369
|
}
|
|
370
370
|
static async findIAssetByName(assetName, params, lucid) {
|
|
371
|
+
console.log(
|
|
372
|
+
CDPContract.address(params.cdpParams, lucid),
|
|
373
|
+
params.cdpParams.iAssetAuthToken[0].unCurrencySymbol + (0, import_lucid5.fromText)(params.cdpParams.iAssetAuthToken[1].unTokenName)
|
|
374
|
+
);
|
|
371
375
|
return lucid.utxosAtWithUnit(
|
|
372
376
|
CDPContract.address(params.cdpParams, lucid),
|
|
373
377
|
params.cdpParams.iAssetAuthToken[0].unCurrencySymbol + (0, import_lucid5.fromText)(params.cdpParams.iAssetAuthToken[1].unTokenName)
|
|
374
|
-
).then(
|
|
375
|
-
(utxos
|
|
378
|
+
).then((utxos) => {
|
|
379
|
+
console.log("iasset utxos", utxos);
|
|
380
|
+
return utxos.map((utxo) => {
|
|
376
381
|
if (!utxo.datum) return void 0;
|
|
377
382
|
const datum = parseIAssetDatum(utxo.datum);
|
|
378
383
|
if (datum.assetName !== (0, import_lucid5.fromText)(assetName)) return void 0;
|
|
379
384
|
return { utxo, datum };
|
|
380
|
-
}).find((utxo) => utxo !== void 0)
|
|
381
|
-
).then((result) => {
|
|
385
|
+
}).find((utxo) => utxo !== void 0);
|
|
386
|
+
}).then((result) => {
|
|
382
387
|
if (!result) throw new Error("Unable to locate IAsset by name.");
|
|
383
388
|
return result;
|
|
384
389
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -216,17 +216,22 @@ var IAssetHelpers = class {
|
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
218
|
static async findIAssetByName(assetName, params, lucid) {
|
|
219
|
+
console.log(
|
|
220
|
+
CDPContract.address(params.cdpParams, lucid),
|
|
221
|
+
params.cdpParams.iAssetAuthToken[0].unCurrencySymbol + fromText(params.cdpParams.iAssetAuthToken[1].unTokenName)
|
|
222
|
+
);
|
|
219
223
|
return lucid.utxosAtWithUnit(
|
|
220
224
|
CDPContract.address(params.cdpParams, lucid),
|
|
221
225
|
params.cdpParams.iAssetAuthToken[0].unCurrencySymbol + fromText(params.cdpParams.iAssetAuthToken[1].unTokenName)
|
|
222
|
-
).then(
|
|
223
|
-
(utxos
|
|
226
|
+
).then((utxos) => {
|
|
227
|
+
console.log("iasset utxos", utxos);
|
|
228
|
+
return utxos.map((utxo) => {
|
|
224
229
|
if (!utxo.datum) return void 0;
|
|
225
230
|
const datum = parseIAssetDatum(utxo.datum);
|
|
226
231
|
if (datum.assetName !== fromText(assetName)) return void 0;
|
|
227
232
|
return { utxo, datum };
|
|
228
|
-
}).find((utxo) => utxo !== void 0)
|
|
229
|
-
).then((result) => {
|
|
233
|
+
}).find((utxo) => utxo !== void 0);
|
|
234
|
+
}).then((result) => {
|
|
230
235
|
if (!result) throw new Error("Unable to locate IAsset by name.");
|
|
231
236
|
return result;
|
|
232
237
|
});
|
package/package.json
CHANGED
|
@@ -33,22 +33,28 @@ export class IAssetHelpers {
|
|
|
33
33
|
params: SystemParams,
|
|
34
34
|
lucid: LucidEvolution,
|
|
35
35
|
): Promise<IAssetOutput> {
|
|
36
|
+
console.log(
|
|
37
|
+
CDPContract.address(params.cdpParams, lucid),
|
|
38
|
+
params.cdpParams.iAssetAuthToken[0].unCurrencySymbol +
|
|
39
|
+
fromText(params.cdpParams.iAssetAuthToken[1].unTokenName),
|
|
40
|
+
);
|
|
36
41
|
return lucid
|
|
37
42
|
.utxosAtWithUnit(
|
|
38
43
|
CDPContract.address(params.cdpParams, lucid),
|
|
39
44
|
params.cdpParams.iAssetAuthToken[0].unCurrencySymbol +
|
|
40
45
|
fromText(params.cdpParams.iAssetAuthToken[1].unTokenName),
|
|
41
46
|
)
|
|
42
|
-
.then((utxos) =>
|
|
43
|
-
utxos
|
|
47
|
+
.then((utxos) => {
|
|
48
|
+
console.log('iasset utxos', utxos);
|
|
49
|
+
return utxos
|
|
44
50
|
.map((utxo) => {
|
|
45
51
|
if (!utxo.datum) return undefined;
|
|
46
52
|
const datum = parseIAssetDatum(utxo.datum);
|
|
47
53
|
if (datum.assetName !== fromText(assetName)) return undefined;
|
|
48
54
|
return { utxo, datum };
|
|
49
55
|
})
|
|
50
|
-
.find((utxo) => utxo !== undefined)
|
|
51
|
-
)
|
|
56
|
+
.find((utxo) => utxo !== undefined);
|
|
57
|
+
})
|
|
52
58
|
.then((result) => {
|
|
53
59
|
if (!result) throw new Error('Unable to locate IAsset by name.');
|
|
54
60
|
return result;
|