@keystonehq/bc-ur-registry
Advanced tools
Comparing version 0.2.0 to 0.3.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PathComponent = exports.ScriptExpressions = exports.MultiKey = exports.CryptoPSBT = exports.CryptoOutput = exports.CryptoECKey = exports.CryptoCoinInfoNetwork = exports.CryptoCoinInfoType = exports.CryptoCoinInfo = exports.CryptoKeypath = exports.CryptoHDKey = exports.CryptoAccount = void 0; | ||
exports.PathComponent = exports.ScriptExpressions = exports.MultiKey = exports.CryptoPSBT = exports.CryptoOutput = exports.CryptoECKey = exports.CryptoCoinInfoNetwork = exports.CryptoCoinInfoType = exports.CryptoCoinInfo = exports.CryptoKeypath = exports.CryptoHDKey = exports.CryptoAccount = exports.Bytes = exports.URRegistryDecoder = void 0; | ||
require("./patchCBOR"); | ||
@@ -15,2 +15,4 @@ const CryptoHDKey_1 = require("./CryptoHDKey"); | ||
Object.defineProperty(exports, "CryptoECKey", { enumerable: true, get: function () { return CryptoECKey_1.CryptoECKey; } }); | ||
const Bytes_1 = require("./Bytes"); | ||
Object.defineProperty(exports, "Bytes", { enumerable: true, get: function () { return Bytes_1.Bytes; } }); | ||
const CryptoOutput_1 = require("./CryptoOutput"); | ||
@@ -22,2 +24,4 @@ Object.defineProperty(exports, "CryptoOutput", { enumerable: true, get: function () { return CryptoOutput_1.CryptoOutput; } }); | ||
Object.defineProperty(exports, "CryptoAccount", { enumerable: true, get: function () { return CryptoAccount_1.CryptoAccount; } }); | ||
const Decoder_1 = require("./Decoder"); | ||
Object.defineProperty(exports, "URRegistryDecoder", { enumerable: true, get: function () { return Decoder_1.URRegistryDecoder; } }); | ||
const MultiKey_1 = require("./MultiKey"); | ||
@@ -30,2 +34,4 @@ Object.defineProperty(exports, "MultiKey", { enumerable: true, get: function () { return MultiKey_1.MultiKey; } }); | ||
const URlib = { | ||
URRegistryDecoder: Decoder_1.URRegistryDecoder, | ||
Bytes: Bytes_1.Bytes, | ||
CryptoAccount: CryptoAccount_1.CryptoAccount, | ||
@@ -32,0 +38,0 @@ CryptoHDKey: CryptoHDKey_1.CryptoHDKey, |
@@ -25,5 +25,5 @@ "use strict"; | ||
}; | ||
const registryTags = Object.values(RegistryType_1.RegistryTypes).map((r) => r.getTag()); | ||
const registryTags = Object.values(RegistryType_1.RegistryTypes).filter(r => !!r.getTag()).map((r) => r.getTag()); | ||
const scriptExpressionTags = Object.values(ScriptExpression_1.ScriptExpressions).map((se) => se.getTag()); | ||
patchTags(registryTags.concat(scriptExpressionTags)); | ||
//# sourceMappingURL=patchCBOR.js.map |
@@ -5,5 +5,5 @@ "use strict"; | ||
class RegistryType { | ||
constructor(tag, type) { | ||
constructor(type, tag) { | ||
this.type = type; | ||
this.tag = tag; | ||
this.type = type; | ||
this.getTag = () => this.tag; | ||
@@ -15,10 +15,11 @@ this.getType = () => this.type; | ||
exports.RegistryTypes = { | ||
CRYPTO_HDKEY: new RegistryType(303, 'crypto-hdkey'), | ||
CRYPTO_KEYPATH: new RegistryType(304, 'crypto-keypath'), | ||
CRYPTO_COIN_INFO: new RegistryType(305, 'crypto-coin-info'), | ||
CRYPTO_ECKEY: new RegistryType(306, 'crypto-eckey'), | ||
CRYPTO_OUTPUT: new RegistryType(308, 'crypto-output'), | ||
CRYPTO_PSBT: new RegistryType(310, 'crypto-psbt'), | ||
CRYPTO_ACCOUNT: new RegistryType(311, 'crypto-account'), | ||
BYTES: new RegistryType('bytes', undefined), | ||
CRYPTO_HDKEY: new RegistryType('crypto-hdkey', 303), | ||
CRYPTO_KEYPATH: new RegistryType('crypto-keypath', 304), | ||
CRYPTO_COIN_INFO: new RegistryType('crypto-coin-info', 305), | ||
CRYPTO_ECKEY: new RegistryType('crypto-eckey', 306), | ||
CRYPTO_OUTPUT: new RegistryType('crypto-output', 308), | ||
CRYPTO_PSBT: new RegistryType('crypto-psbt', 310), | ||
CRYPTO_ACCOUNT: new RegistryType('crypto-account', 311), | ||
}; | ||
//# sourceMappingURL=RegistryType.js.map |
{ | ||
"name": "@keystonehq/bc-ur-registry", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "A JS implementation of Uniform Resources(UR) Registry specification from Blockchain Commons", | ||
@@ -5,0 +5,0 @@ "engines": { |
@@ -11,5 +11,7 @@ import './patchCBOR'; | ||
import { CryptoECKey } from './CryptoECKey'; | ||
import { Bytes } from './Bytes'; | ||
import { CryptoOutput } from './CryptoOutput'; | ||
import { CryptoPSBT } from './CryptoPSBT'; | ||
import { CryptoAccount } from './CryptoAccount'; | ||
import { URRegistryDecoder } from './Decoder'; | ||
@@ -22,2 +24,4 @@ import { MultiKey } from './MultiKey'; | ||
const URlib = { | ||
URRegistryDecoder, | ||
Bytes, | ||
CryptoAccount, | ||
@@ -38,2 +42,4 @@ CryptoHDKey, | ||
export { | ||
URRegistryDecoder, | ||
Bytes, | ||
CryptoAccount, | ||
@@ -40,0 +46,0 @@ CryptoHDKey, |
@@ -25,3 +25,3 @@ import { addSemanticDecode, addSemanticEncode } from './lib/cbor-sync'; | ||
const registryTags = Object.values(RegistryTypes).map((r) => r.getTag()); | ||
const registryTags = Object.values(RegistryTypes).filter(r => !!r.getTag()).map((r) => r.getTag()); | ||
const scriptExpressionTags = Object.values(ScriptExpressions).map((se) => | ||
@@ -28,0 +28,0 @@ se.getTag(), |
@@ -5,3 +5,3 @@ // cbor registry types: https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-006-urtypes.md | ||
export class RegistryType { | ||
constructor(private tag: number, private type: string) {} | ||
constructor(private type: string, private tag?: number) {} | ||
getTag = () => this.tag; | ||
@@ -12,9 +12,10 @@ getType = () => this.type; | ||
export const RegistryTypes = { | ||
CRYPTO_HDKEY: new RegistryType(303, 'crypto-hdkey'), | ||
CRYPTO_KEYPATH: new RegistryType(304, 'crypto-keypath'), | ||
CRYPTO_COIN_INFO: new RegistryType(305, 'crypto-coin-info'), | ||
CRYPTO_ECKEY: new RegistryType(306, 'crypto-eckey'), | ||
CRYPTO_OUTPUT: new RegistryType(308, 'crypto-output'), | ||
CRYPTO_PSBT: new RegistryType(310, 'crypto-psbt'), | ||
CRYPTO_ACCOUNT: new RegistryType(311, 'crypto-account'), | ||
BYTES: new RegistryType('bytes', undefined), | ||
CRYPTO_HDKEY: new RegistryType('crypto-hdkey', 303), | ||
CRYPTO_KEYPATH: new RegistryType('crypto-keypath', 304), | ||
CRYPTO_COIN_INFO: new RegistryType('crypto-coin-info', 305), | ||
CRYPTO_ECKEY: new RegistryType('crypto-eckey', 306), | ||
CRYPTO_OUTPUT: new RegistryType('crypto-output', 308), | ||
CRYPTO_PSBT: new RegistryType('crypto-psbt', 310), | ||
CRYPTO_ACCOUNT: new RegistryType('crypto-account', 311), | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
184963
57
3069