@lucid-evolution/provider 0.1.7 → 0.1.9
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.cjs +17 -16
- package/dist/index.js +17 -16
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -37,15 +37,17 @@ __export(src_exports, {
|
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(src_exports);
|
|
39
39
|
|
|
40
|
-
// src/
|
|
40
|
+
// src/core.ts
|
|
41
41
|
var CML = __toESM(require("@dcspark/cardano-multiplatform-lib-nodejs"), 1);
|
|
42
|
+
|
|
43
|
+
// src/blockfrost.ts
|
|
42
44
|
var import_core_utils = require("@lucid-evolution/core-utils");
|
|
43
45
|
var import_utils = require("@lucid-evolution/utils");
|
|
44
46
|
|
|
45
47
|
// package.json
|
|
46
48
|
var package_default = {
|
|
47
49
|
name: "@lucid-evolution/provider",
|
|
48
|
-
version: "0.1.
|
|
50
|
+
version: "0.1.9",
|
|
49
51
|
description: "",
|
|
50
52
|
main: "./dist/index.js",
|
|
51
53
|
types: "./dist/index.d.ts",
|
|
@@ -71,15 +73,15 @@ var package_default = {
|
|
|
71
73
|
author: "",
|
|
72
74
|
license: "MIT",
|
|
73
75
|
dependencies: {
|
|
74
|
-
"@dcspark/cardano-multiplatform-lib-nodejs": "^5.
|
|
76
|
+
"@dcspark/cardano-multiplatform-lib-nodejs": "^5.3.0",
|
|
75
77
|
"@lucid-evolution/core-types": "workspace:*",
|
|
76
78
|
"@lucid-evolution/core-utils": "workspace:*",
|
|
77
79
|
"@lucid-evolution/utils": "workspace:*"
|
|
78
80
|
},
|
|
79
81
|
devDependencies: {
|
|
80
|
-
"@types/node": "^20.
|
|
82
|
+
"@types/node": "^20.12.8",
|
|
81
83
|
tsup: "^8.0.2",
|
|
82
|
-
typescript: "^5.
|
|
84
|
+
typescript: "^5.4.5"
|
|
83
85
|
}
|
|
84
86
|
};
|
|
85
87
|
|
|
@@ -346,7 +348,6 @@ var lucid = package_default.version;
|
|
|
346
348
|
|
|
347
349
|
// src/kupmios.ts
|
|
348
350
|
var import_utils2 = require("@lucid-evolution/utils");
|
|
349
|
-
var CML2 = __toESM(require("@dcspark/cardano-multiplatform-lib-nodejs"), 1);
|
|
350
351
|
var Kupmios = class {
|
|
351
352
|
kupoUrl;
|
|
352
353
|
ogmiosUrl;
|
|
@@ -449,9 +450,10 @@ var Kupmios = class {
|
|
|
449
450
|
);
|
|
450
451
|
}
|
|
451
452
|
async getDelegation(rewardAddress) {
|
|
452
|
-
const client = await this.ogmiosWsp(
|
|
453
|
-
|
|
454
|
-
|
|
453
|
+
const client = await this.ogmiosWsp(
|
|
454
|
+
"queryLedgerState/rewardAccountSummaries",
|
|
455
|
+
{ keys: [rewardAddress] }
|
|
456
|
+
);
|
|
455
457
|
return new Promise((res, rej) => {
|
|
456
458
|
client.addEventListener(
|
|
457
459
|
"message",
|
|
@@ -460,8 +462,8 @@ var Kupmios = class {
|
|
|
460
462
|
const { result } = JSON.parse(msg.data);
|
|
461
463
|
const delegation = result ? Object.values(result)[0] : {};
|
|
462
464
|
res({
|
|
463
|
-
poolId: delegation?.delegate || null,
|
|
464
|
-
rewards: BigInt(delegation?.rewards || 0)
|
|
465
|
+
poolId: delegation?.delegate?.id || null,
|
|
466
|
+
rewards: BigInt(delegation?.rewards?.ada?.lovelace || 0)
|
|
465
467
|
});
|
|
466
468
|
client.close();
|
|
467
469
|
} catch (e) {
|
|
@@ -543,12 +545,12 @@ var Kupmios = class {
|
|
|
543
545
|
} else if (language === "plutus:v1") {
|
|
544
546
|
return {
|
|
545
547
|
type: "PlutusV1",
|
|
546
|
-
script:
|
|
548
|
+
script: CML.PlutusV1Script.from_cbor_hex(script).to_cbor_hex()
|
|
547
549
|
};
|
|
548
550
|
} else if (language === "plutus:v2") {
|
|
549
551
|
return {
|
|
550
552
|
type: "PlutusV2",
|
|
551
|
-
script:
|
|
553
|
+
script: CML.PlutusV2Script.from_cbor_hex(script).to_cbor_hex()
|
|
552
554
|
};
|
|
553
555
|
}
|
|
554
556
|
})()
|
|
@@ -574,7 +576,6 @@ var Kupmios = class {
|
|
|
574
576
|
};
|
|
575
577
|
|
|
576
578
|
// src/maestro.ts
|
|
577
|
-
var CML3 = __toESM(require("@dcspark/cardano-multiplatform-lib-nodejs"), 1);
|
|
578
579
|
var import_utils3 = require("@lucid-evolution/utils");
|
|
579
580
|
var import_core_utils2 = require("@lucid-evolution/core-utils");
|
|
580
581
|
var Maestro = class {
|
|
@@ -634,9 +635,9 @@ var Maestro = class {
|
|
|
634
635
|
return "/addresses/" + addressOrCredential;
|
|
635
636
|
}
|
|
636
637
|
let credentialBech32Query = "/addresses/cred/";
|
|
637
|
-
credentialBech32Query += addressOrCredential.type === "Key" ?
|
|
638
|
+
credentialBech32Query += addressOrCredential.type === "Key" ? CML.Ed25519KeyHash.from_hex(addressOrCredential.hash).to_bech32(
|
|
638
639
|
"addr_vkh"
|
|
639
|
-
) :
|
|
640
|
+
) : CML.ScriptHash.from_hex(addressOrCredential.hash).to_bech32(
|
|
640
641
|
"addr_shared_vkh"
|
|
641
642
|
);
|
|
642
643
|
return credentialBech32Query;
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/core.ts
|
|
2
2
|
import * as CML from "@dcspark/cardano-multiplatform-lib-nodejs";
|
|
3
|
+
|
|
4
|
+
// src/blockfrost.ts
|
|
3
5
|
import { fromHex } from "@lucid-evolution/core-utils";
|
|
4
6
|
import { applyDoubleCborEncoding } from "@lucid-evolution/utils";
|
|
5
7
|
|
|
6
8
|
// package.json
|
|
7
9
|
var package_default = {
|
|
8
10
|
name: "@lucid-evolution/provider",
|
|
9
|
-
version: "0.1.
|
|
11
|
+
version: "0.1.9",
|
|
10
12
|
description: "",
|
|
11
13
|
main: "./dist/index.js",
|
|
12
14
|
types: "./dist/index.d.ts",
|
|
@@ -32,15 +34,15 @@ var package_default = {
|
|
|
32
34
|
author: "",
|
|
33
35
|
license: "MIT",
|
|
34
36
|
dependencies: {
|
|
35
|
-
"@dcspark/cardano-multiplatform-lib-nodejs": "^5.
|
|
37
|
+
"@dcspark/cardano-multiplatform-lib-nodejs": "^5.3.0",
|
|
36
38
|
"@lucid-evolution/core-types": "workspace:*",
|
|
37
39
|
"@lucid-evolution/core-utils": "workspace:*",
|
|
38
40
|
"@lucid-evolution/utils": "workspace:*"
|
|
39
41
|
},
|
|
40
42
|
devDependencies: {
|
|
41
|
-
"@types/node": "^20.
|
|
43
|
+
"@types/node": "^20.12.8",
|
|
42
44
|
tsup: "^8.0.2",
|
|
43
|
-
typescript: "^5.
|
|
45
|
+
typescript: "^5.4.5"
|
|
44
46
|
}
|
|
45
47
|
};
|
|
46
48
|
|
|
@@ -307,7 +309,6 @@ var lucid = package_default.version;
|
|
|
307
309
|
|
|
308
310
|
// src/kupmios.ts
|
|
309
311
|
import { fromUnit } from "@lucid-evolution/utils";
|
|
310
|
-
import * as CML2 from "@dcspark/cardano-multiplatform-lib-nodejs";
|
|
311
312
|
var Kupmios = class {
|
|
312
313
|
kupoUrl;
|
|
313
314
|
ogmiosUrl;
|
|
@@ -410,9 +411,10 @@ var Kupmios = class {
|
|
|
410
411
|
);
|
|
411
412
|
}
|
|
412
413
|
async getDelegation(rewardAddress) {
|
|
413
|
-
const client = await this.ogmiosWsp(
|
|
414
|
-
|
|
415
|
-
|
|
414
|
+
const client = await this.ogmiosWsp(
|
|
415
|
+
"queryLedgerState/rewardAccountSummaries",
|
|
416
|
+
{ keys: [rewardAddress] }
|
|
417
|
+
);
|
|
416
418
|
return new Promise((res, rej) => {
|
|
417
419
|
client.addEventListener(
|
|
418
420
|
"message",
|
|
@@ -421,8 +423,8 @@ var Kupmios = class {
|
|
|
421
423
|
const { result } = JSON.parse(msg.data);
|
|
422
424
|
const delegation = result ? Object.values(result)[0] : {};
|
|
423
425
|
res({
|
|
424
|
-
poolId: delegation?.delegate || null,
|
|
425
|
-
rewards: BigInt(delegation?.rewards || 0)
|
|
426
|
+
poolId: delegation?.delegate?.id || null,
|
|
427
|
+
rewards: BigInt(delegation?.rewards?.ada?.lovelace || 0)
|
|
426
428
|
});
|
|
427
429
|
client.close();
|
|
428
430
|
} catch (e) {
|
|
@@ -504,12 +506,12 @@ var Kupmios = class {
|
|
|
504
506
|
} else if (language === "plutus:v1") {
|
|
505
507
|
return {
|
|
506
508
|
type: "PlutusV1",
|
|
507
|
-
script:
|
|
509
|
+
script: CML.PlutusV1Script.from_cbor_hex(script).to_cbor_hex()
|
|
508
510
|
};
|
|
509
511
|
} else if (language === "plutus:v2") {
|
|
510
512
|
return {
|
|
511
513
|
type: "PlutusV2",
|
|
512
|
-
script:
|
|
514
|
+
script: CML.PlutusV2Script.from_cbor_hex(script).to_cbor_hex()
|
|
513
515
|
};
|
|
514
516
|
}
|
|
515
517
|
})()
|
|
@@ -535,7 +537,6 @@ var Kupmios = class {
|
|
|
535
537
|
};
|
|
536
538
|
|
|
537
539
|
// src/maestro.ts
|
|
538
|
-
import * as CML3 from "@dcspark/cardano-multiplatform-lib-nodejs";
|
|
539
540
|
import { applyDoubleCborEncoding as applyDoubleCborEncoding2 } from "@lucid-evolution/utils";
|
|
540
541
|
import { fromHex as fromHex2 } from "@lucid-evolution/core-utils";
|
|
541
542
|
var Maestro = class {
|
|
@@ -595,9 +596,9 @@ var Maestro = class {
|
|
|
595
596
|
return "/addresses/" + addressOrCredential;
|
|
596
597
|
}
|
|
597
598
|
let credentialBech32Query = "/addresses/cred/";
|
|
598
|
-
credentialBech32Query += addressOrCredential.type === "Key" ?
|
|
599
|
+
credentialBech32Query += addressOrCredential.type === "Key" ? CML.Ed25519KeyHash.from_hex(addressOrCredential.hash).to_bech32(
|
|
599
600
|
"addr_vkh"
|
|
600
|
-
) :
|
|
601
|
+
) : CML.ScriptHash.from_hex(addressOrCredential.hash).to_bech32(
|
|
601
602
|
"addr_shared_vkh"
|
|
602
603
|
);
|
|
603
604
|
return credentialBech32Query;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucid-evolution/provider",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"author": "",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@dcspark/cardano-multiplatform-lib-nodejs": "^5.
|
|
26
|
-
"@lucid-evolution/core-types": "0.1.
|
|
27
|
-
"@lucid-evolution/core-utils": "0.1.
|
|
28
|
-
"@lucid-evolution/utils": "0.1.
|
|
25
|
+
"@dcspark/cardano-multiplatform-lib-nodejs": "^5.3.0",
|
|
26
|
+
"@lucid-evolution/core-types": "0.1.5",
|
|
27
|
+
"@lucid-evolution/core-utils": "0.1.5",
|
|
28
|
+
"@lucid-evolution/utils": "0.1.7"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@types/node": "^20.
|
|
31
|
+
"@types/node": "^20.12.8",
|
|
32
32
|
"tsup": "^8.0.2",
|
|
33
|
-
"typescript": "^5.
|
|
33
|
+
"typescript": "^5.4.5"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "tsup-node src/index.ts --format esm,cjs --dts --clean",
|