@cardano-sdk/core 0.35.0 → 0.35.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.
@@ -0,0 +1,9 @@
1
+ import { Bip32PublicKeyHex } from '@cardano-sdk/crypto';
2
+ import { OpaqueString } from '@cardano-sdk/util';
3
+ export declare type Cip1854ExtendedAccountPublicKey = OpaqueString<'Cip1854PublicKey'>;
4
+ export declare const Cip1854ExtendedAccountPublicKey: {
5
+ (value: string): Cip1854ExtendedAccountPublicKey;
6
+ fromBip32PublicKeyHex(value: Bip32PublicKeyHex): Cip1854ExtendedAccountPublicKey;
7
+ toBip32PublicKeyHex(value: Cip1854ExtendedAccountPublicKey): Bip32PublicKeyHex;
8
+ };
9
+ //# sourceMappingURL=Cip1854ExtendedAccountPublicKey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cip1854ExtendedAccountPublicKey.d.ts","sourceRoot":"","sources":["../../../../src/Cardano/types/Cip1854ExtendedAccountPublicKey.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAsB,YAAY,EAA4B,MAAM,mBAAmB,CAAC;AAM/F,oBAAY,+BAA+B,GAAG,YAAY,CAAC,kBAAkB,CAAC,CAAC;AAE/E,eAAO,MAAM,+BAA+B;YAAW,MAAM,GAAG,+BAA+B;iCAU/B,iBAAiB,GAAG,+BAA+B;+BAOrD,+BAA+B,GAAG,iBAAiB;CAThH,CAAC"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.Cip1854ExtendedAccountPublicKey = void 0;
27
+ const BaseEncoding = __importStar(require("@scure/base"));
28
+ const crypto_1 = require("@cardano-sdk/crypto");
29
+ const util_1 = require("@cardano-sdk/util");
30
+ const MAX_BECH32_LENGTH_LIMIT = 1023;
31
+ const bip32PublicKeyPrefix = 'acct_shared_xvk';
32
+ const Cip1854ExtendedAccountPublicKey = (value) => {
33
+ try {
34
+ (0, util_1.assertIsBech32WithPrefix)(value, [bip32PublicKeyPrefix]);
35
+ }
36
+ catch {
37
+ throw new util_1.InvalidStringError(value, 'Expected key to be a bech32 encoded string');
38
+ }
39
+ return value;
40
+ };
41
+ exports.Cip1854ExtendedAccountPublicKey = Cip1854ExtendedAccountPublicKey;
42
+ exports.Cip1854ExtendedAccountPublicKey.fromBip32PublicKeyHex = (value) => {
43
+ const words = BaseEncoding.bech32.toWords(Buffer.from(value, 'hex'));
44
+ return (0, exports.Cip1854ExtendedAccountPublicKey)(BaseEncoding.bech32.encode(bip32PublicKeyPrefix, words, MAX_BECH32_LENGTH_LIMIT));
45
+ };
46
+ exports.Cip1854ExtendedAccountPublicKey.toBip32PublicKeyHex = (value) => {
47
+ const { words } = BaseEncoding.bech32.decode(value, MAX_BECH32_LENGTH_LIMIT);
48
+ return (0, crypto_1.Bip32PublicKeyHex)(Buffer.from(BaseEncoding.bech32.fromWords(words)).toString('hex'));
49
+ };
50
+ //# sourceMappingURL=Cip1854ExtendedAccountPublicKey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cip1854ExtendedAccountPublicKey.js","sourceRoot":"","sources":["../../../../src/Cardano/types/Cip1854ExtendedAccountPublicKey.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAC5C,gDAAwD;AACxD,4CAA+F;AAE/F,MAAM,uBAAuB,GAAG,IAAI,CAAC;AACrC,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AAKxC,MAAM,+BAA+B,GAAG,CAAC,KAAa,EAAmC,EAAE;IAChG,IAAI;QACF,IAAA,+BAAwB,EAAC,KAAK,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;KACzD;IAAC,MAAM;QACN,MAAM,IAAI,yBAAkB,CAAC,KAAK,EAAE,4CAA4C,CAAC,CAAC;KACnF;IAED,OAAO,KAAwC,CAAC;AAClD,CAAC,CAAC;AARW,QAAA,+BAA+B,mCAQ1C;AAEF,uCAA+B,CAAC,qBAAqB,GAAG,CAAC,KAAwB,EAAmC,EAAE;IACpH,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IACrE,OAAO,IAAA,uCAA+B,EACpC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE,KAAK,EAAE,uBAAuB,CAAC,CACjF,CAAC;AACJ,CAAC,CAAC;AAEF,uCAA+B,CAAC,mBAAmB,GAAG,CAAC,KAAsC,EAAqB,EAAE;IAClH,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,uBAAuB,CAAC,CAAC;IAC7E,OAAO,IAAA,0BAAiB,EAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9F,CAAC,CAAC"}
@@ -13,4 +13,5 @@ export * from './ProtocolParameters';
13
13
  export * from './PlutusData';
14
14
  export * from './UtilityTypes';
15
15
  export * from './Governance';
16
+ export * from './Cip1854ExtendedAccountPublicKey';
16
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Cardano/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Cardano/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,mCAAmC,CAAC"}
@@ -29,4 +29,5 @@ __exportStar(require("./ProtocolParameters"), exports);
29
29
  __exportStar(require("./PlutusData"), exports);
30
30
  __exportStar(require("./UtilityTypes"), exports);
31
31
  __exportStar(require("./Governance"), exports);
32
+ __exportStar(require("./Cip1854ExtendedAccountPublicKey"), exports);
32
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Cardano/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,yCAAuB;AACvB,0CAAwB;AACxB,0DAAwC;AACxC,gDAA8B;AAC9B,gDAA8B;AAC9B,4CAA0B;AAC1B,0CAAwB;AACxB,0CAAwB;AACxB,kDAAgC;AAChC,2CAAyB;AACzB,uDAAqC;AACrC,+CAA6B;AAC7B,iDAA+B;AAC/B,+CAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Cardano/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,yCAAuB;AACvB,0CAAwB;AACxB,0DAAwC;AACxC,gDAA8B;AAC9B,gDAA8B;AAC9B,4CAA0B;AAC1B,0CAAwB;AACxB,0CAAwB;AACxB,kDAAgC;AAChC,2CAAyB;AACzB,uDAAqC;AACrC,+CAA6B;AAC7B,iDAA+B;AAC/B,+CAA6B;AAC7B,oEAAkD"}