@keystonehq/bc-ur-registry-avalanche 0.0.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.
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # BC-UR-Registry-Avalanche
2
+
3
+ This repository is the Avalanche extension of [bc-ur-registry](https://github.com/KeystoneHQ/ur-registry)
4
+
5
+ ## Installing
6
+
7
+ To install, run:
8
+
9
+ ```bash
10
+ yarn add @keystonehq/bc-ur-registry-avalanche
11
+ ```
12
+
13
+ ```bash
14
+ npm install --save @keystonehq/bc-ur-registry-avalanche
15
+ ```
@@ -0,0 +1,17 @@
1
+ /// <reference types="node" />
2
+ import { DataItem, RegistryItem } from "@keystonehq/bc-ur-registry";
3
+ declare type signRequestProps = {
4
+ requestId?: Buffer;
5
+ data: Buffer;
6
+ };
7
+ export declare class AvalancheSignRequest extends RegistryItem {
8
+ private requestId?;
9
+ private data;
10
+ getRegistryType: () => import("@keystonehq/bc-ur-registry").RegistryType;
11
+ constructor(args: signRequestProps);
12
+ getRequestId: () => Buffer | undefined;
13
+ getSignData: () => Buffer;
14
+ toDataItem: () => DataItem;
15
+ static constructAvalancheRequest(data: Buffer, uuidString?: string): AvalancheSignRequest;
16
+ }
17
+ export {};
@@ -0,0 +1,4 @@
1
+ import { RegistryType } from "@keystonehq/bc-ur-registry";
2
+ export declare const ExtendedRegistryTypes: {
3
+ AVALANCHE_SIGN_REQUEST: RegistryType;
4
+ };
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var bcUrRegistry = require('@keystonehq/bc-ur-registry');
6
+ var uuid = require('uuid');
7
+
8
+ const ExtendedRegistryTypes = {
9
+ AVALANCHE_SIGN_REQUEST: /*#__PURE__*/new bcUrRegistry.RegistryType("avax-sign-request", 8301)
10
+ };
11
+
12
+ class AvalancheSignRequest extends bcUrRegistry.RegistryItem {
13
+ constructor(args) {
14
+ super();
15
+ this.getRegistryType = () => ExtendedRegistryTypes.AVALANCHE_SIGN_REQUEST;
16
+ this.getRequestId = () => this.requestId;
17
+ this.getSignData = () => this.data;
18
+ this.toDataItem = () => {
19
+ return new bcUrRegistry.DataItem(this.data);
20
+ };
21
+ this.requestId = args.requestId;
22
+ this.data = args.data;
23
+ }
24
+ static constructAvalancheRequest(data, uuidString) {
25
+ return new AvalancheSignRequest({
26
+ data,
27
+ requestId: uuidString ? Buffer.from(uuid.parse(uuidString)) : undefined
28
+ });
29
+ }
30
+ }
31
+
32
+ bcUrRegistry.patchTags(Object.values(ExtendedRegistryTypes).filter(rt => !!rt.getTag()).map(rt => rt.getTag()));
33
+
34
+ Object.keys(bcUrRegistry).forEach(function (k) {
35
+ if (k !== 'default') Object.defineProperty(exports, k, {
36
+ enumerable: true,
37
+ get: function () {
38
+ return bcUrRegistry[k];
39
+ }
40
+ });
41
+ });
42
+ exports.AvalancheSignRequest = AvalancheSignRequest;
43
+ //# sourceMappingURL=bc-ur-registry-avalanche.cjs.development.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bc-ur-registry-avalanche.cjs.development.js","sources":["../src/RegistryType.ts","../src/AvalancheSignRequest.ts","../src/index.ts"],"sourcesContent":["import { RegistryType } from \"@keystonehq/bc-ur-registry\";\n\nexport const ExtendedRegistryTypes = {\n AVALANCHE_SIGN_REQUEST: new RegistryType(\"avax-sign-request\", 8301),\n};\n","import { DataItem, RegistryItem } from \"@keystonehq/bc-ur-registry\";\nimport { ExtendedRegistryTypes } from \"./RegistryType\";\nimport * as uuid from \"uuid\";\n\ntype signRequestProps = {\n requestId?: Buffer;\n data: Buffer;\n};\n\nexport class AvalancheSignRequest extends RegistryItem {\n private requestId?: Buffer;\n private data: Buffer;\n\n getRegistryType = () => ExtendedRegistryTypes.AVALANCHE_SIGN_REQUEST;\n\n constructor(args: signRequestProps) {\n super();\n this.requestId = args.requestId;\n this.data = args.data;\n }\n\n public getRequestId = () => this.requestId;\n public getSignData = () => this.data;\n\n public toDataItem = () => {\n return new DataItem(this.data);\n };\n\n public static constructAvalancheRequest(data: Buffer, uuidString?: string) {\n return new AvalancheSignRequest({\n data,\n requestId: uuidString\n ? Buffer.from(uuid.parse(uuidString) as Uint8Array)\n : undefined,\n });\n }\n}\n","import { patchTags } from \"@keystonehq/bc-ur-registry\";\nimport { ExtendedRegistryTypes } from \"./RegistryType\";\nexport * from \"@keystonehq/bc-ur-registry\";\n\npatchTags(\n Object.values(ExtendedRegistryTypes)\n .filter((rt) => !!rt.getTag())\n .map((rt) => rt.getTag()) as number[]\n);\n\nexport { AvalancheSignRequest } from \"./AvalancheSignRequest\";\n"],"names":["ExtendedRegistryTypes","AVALANCHE_SIGN_REQUEST","RegistryType","AvalancheSignRequest","RegistryItem","constructor","args","requestId","data","DataItem","constructAvalancheRequest","uuidString","Buffer","from","uuid","undefined","patchTags","Object","values","filter","rt","getTag","map"],"mappings":";;;;;;;AAEO,MAAMA,qBAAqB,GAAG;EACnCC,sBAAsB,eAAE,IAAIC,yBAAY,CAAC,mBAAmB,EAAE,IAAI;CACnE;;MCKYC,oBAAqB,SAAQC,yBAAY;EAMpDC,YAAYC,IAAsB;IAChC,KAAK,EAAE;IAHT,oBAAe,GAAG,MAAMN,qBAAqB,CAACC,sBAAsB;IAQ7D,iBAAY,GAAG,MAAM,IAAI,CAACM,SAAS;IACnC,gBAAW,GAAG,MAAM,IAAI,CAACC,IAAI;IAE7B,eAAU,GAAG;MAClB,OAAO,IAAIC,qBAAQ,CAAC,IAAI,CAACD,IAAI,CAAC;KAC/B;IATC,IAAI,CAACD,SAAS,GAAGD,IAAI,CAACC,SAAS;IAC/B,IAAI,CAACC,IAAI,GAAGF,IAAI,CAACE,IAAI;;EAUhB,OAAOE,yBAAyBA,CAACF,IAAY,EAAEG,UAAmB;IACvE,OAAO,IAAIR,oBAAoB,CAAC;MAC9BK,IAAI;MACJD,SAAS,EAAEI,UAAU,GACjBC,MAAM,CAACC,IAAI,CAACC,UAAU,CAACH,UAAU,CAAe,CAAC,GACjDI;KACL,CAAC;;;;AC9BNC,sBAAS,CACPC,MAAM,CAACC,MAAM,CAAClB,qBAAqB,CAAC,CACjCmB,MAAM,CAAEC,EAAE,IAAK,CAAC,CAACA,EAAE,CAACC,MAAM,EAAE,CAAC,CAC7BC,GAAG,CAAEF,EAAE,IAAKA,EAAE,CAACC,MAAM,EAAE,CAAa,CACxC;;;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@keystonehq/bc-ur-registry"),t=require("uuid");const s={AVALANCHE_SIGN_REQUEST:new e.RegistryType("avax-sign-request",8301)};class r extends e.RegistryItem{constructor(t){super(),this.getRegistryType=()=>s.AVALANCHE_SIGN_REQUEST,this.getRequestId=()=>this.requestId,this.getSignData=()=>this.data,this.toDataItem=()=>new e.DataItem(this.data),this.requestId=t.requestId,this.data=t.data}static constructAvalancheRequest(e,s){return new r({data:e,requestId:s?Buffer.from(t.parse(s)):void 0})}}e.patchTags(Object.values(s).filter(e=>!!e.getTag()).map(e=>e.getTag())),Object.keys(e).forEach((function(t){"default"!==t&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})})),exports.AvalancheSignRequest=r;
2
+ //# sourceMappingURL=bc-ur-registry-avalanche.cjs.production.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bc-ur-registry-avalanche.cjs.production.min.js","sources":["../src/RegistryType.ts","../src/AvalancheSignRequest.ts","../src/index.ts"],"sourcesContent":["import { RegistryType } from \"@keystonehq/bc-ur-registry\";\n\nexport const ExtendedRegistryTypes = {\n AVALANCHE_SIGN_REQUEST: new RegistryType(\"avax-sign-request\", 8301),\n};\n","import { DataItem, RegistryItem } from \"@keystonehq/bc-ur-registry\";\nimport { ExtendedRegistryTypes } from \"./RegistryType\";\nimport * as uuid from \"uuid\";\n\ntype signRequestProps = {\n requestId?: Buffer;\n data: Buffer;\n};\n\nexport class AvalancheSignRequest extends RegistryItem {\n private requestId?: Buffer;\n private data: Buffer;\n\n getRegistryType = () => ExtendedRegistryTypes.AVALANCHE_SIGN_REQUEST;\n\n constructor(args: signRequestProps) {\n super();\n this.requestId = args.requestId;\n this.data = args.data;\n }\n\n public getRequestId = () => this.requestId;\n public getSignData = () => this.data;\n\n public toDataItem = () => {\n return new DataItem(this.data);\n };\n\n public static constructAvalancheRequest(data: Buffer, uuidString?: string) {\n return new AvalancheSignRequest({\n data,\n requestId: uuidString\n ? Buffer.from(uuid.parse(uuidString) as Uint8Array)\n : undefined,\n });\n }\n}\n","import { patchTags } from \"@keystonehq/bc-ur-registry\";\nimport { ExtendedRegistryTypes } from \"./RegistryType\";\nexport * from \"@keystonehq/bc-ur-registry\";\n\npatchTags(\n Object.values(ExtendedRegistryTypes)\n .filter((rt) => !!rt.getTag())\n .map((rt) => rt.getTag()) as number[]\n);\n\nexport { AvalancheSignRequest } from \"./AvalancheSignRequest\";\n"],"names":["ExtendedRegistryTypes","AVALANCHE_SIGN_REQUEST","RegistryType","AvalancheSignRequest","RegistryItem","constructor","args","super","this","requestId","data","DataItem","[object Object]","uuidString","Buffer","from","uuid","undefined","patchTags","Object","values","filter","rt","getTag","map"],"mappings":"kIAEO,MAAMA,EAAwB,CACnCC,uBAAwB,IAAIC,eAAa,oBAAqB,aCMnDC,UAA6BC,eAMxCC,YAAYC,GACVC,QAHFC,qBAAkB,IAAMR,EAAsBC,uBAQvCO,kBAAe,IAAMA,KAAKC,UAC1BD,iBAAc,IAAMA,KAAKE,KAEzBF,gBAAa,IACX,IAAIG,WAASH,KAAKE,MARzBF,KAAKC,UAAYH,EAAKG,UACtBD,KAAKE,KAAOJ,EAAKI,KAUZE,iCAAiCF,EAAcG,GACpD,OAAO,IAAIV,EAAqB,CAC9BO,KAAAA,EACAD,UAAWI,EACPC,OAAOC,KAAKC,QAAWH,SACvBI,KC7BVC,YACEC,OAAOC,OAAOpB,GACXqB,OAAQC,KAASA,EAAGC,UACpBC,IAAKF,GAAOA,EAAGC"}
@@ -0,0 +1,32 @@
1
+ import { RegistryType, RegistryItem, DataItem, patchTags } from '@keystonehq/bc-ur-registry';
2
+ export * from '@keystonehq/bc-ur-registry';
3
+ import { parse } from 'uuid';
4
+
5
+ const ExtendedRegistryTypes = {
6
+ AVALANCHE_SIGN_REQUEST: /*#__PURE__*/new RegistryType("avax-sign-request", 8301)
7
+ };
8
+
9
+ class AvalancheSignRequest extends RegistryItem {
10
+ constructor(args) {
11
+ super();
12
+ this.getRegistryType = () => ExtendedRegistryTypes.AVALANCHE_SIGN_REQUEST;
13
+ this.getRequestId = () => this.requestId;
14
+ this.getSignData = () => this.data;
15
+ this.toDataItem = () => {
16
+ return new DataItem(this.data);
17
+ };
18
+ this.requestId = args.requestId;
19
+ this.data = args.data;
20
+ }
21
+ static constructAvalancheRequest(data, uuidString) {
22
+ return new AvalancheSignRequest({
23
+ data,
24
+ requestId: uuidString ? Buffer.from(parse(uuidString)) : undefined
25
+ });
26
+ }
27
+ }
28
+
29
+ patchTags(Object.values(ExtendedRegistryTypes).filter(rt => !!rt.getTag()).map(rt => rt.getTag()));
30
+
31
+ export { AvalancheSignRequest };
32
+ //# sourceMappingURL=bc-ur-registry-avalanche.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bc-ur-registry-avalanche.esm.js","sources":["../src/RegistryType.ts","../src/AvalancheSignRequest.ts","../src/index.ts"],"sourcesContent":["import { RegistryType } from \"@keystonehq/bc-ur-registry\";\n\nexport const ExtendedRegistryTypes = {\n AVALANCHE_SIGN_REQUEST: new RegistryType(\"avax-sign-request\", 8301),\n};\n","import { DataItem, RegistryItem } from \"@keystonehq/bc-ur-registry\";\nimport { ExtendedRegistryTypes } from \"./RegistryType\";\nimport * as uuid from \"uuid\";\n\ntype signRequestProps = {\n requestId?: Buffer;\n data: Buffer;\n};\n\nexport class AvalancheSignRequest extends RegistryItem {\n private requestId?: Buffer;\n private data: Buffer;\n\n getRegistryType = () => ExtendedRegistryTypes.AVALANCHE_SIGN_REQUEST;\n\n constructor(args: signRequestProps) {\n super();\n this.requestId = args.requestId;\n this.data = args.data;\n }\n\n public getRequestId = () => this.requestId;\n public getSignData = () => this.data;\n\n public toDataItem = () => {\n return new DataItem(this.data);\n };\n\n public static constructAvalancheRequest(data: Buffer, uuidString?: string) {\n return new AvalancheSignRequest({\n data,\n requestId: uuidString\n ? Buffer.from(uuid.parse(uuidString) as Uint8Array)\n : undefined,\n });\n }\n}\n","import { patchTags } from \"@keystonehq/bc-ur-registry\";\nimport { ExtendedRegistryTypes } from \"./RegistryType\";\nexport * from \"@keystonehq/bc-ur-registry\";\n\npatchTags(\n Object.values(ExtendedRegistryTypes)\n .filter((rt) => !!rt.getTag())\n .map((rt) => rt.getTag()) as number[]\n);\n\nexport { AvalancheSignRequest } from \"./AvalancheSignRequest\";\n"],"names":["ExtendedRegistryTypes","AVALANCHE_SIGN_REQUEST","RegistryType","AvalancheSignRequest","RegistryItem","constructor","args","requestId","data","DataItem","constructAvalancheRequest","uuidString","Buffer","from","uuid","undefined","patchTags","Object","values","filter","rt","getTag","map"],"mappings":";;;;AAEO,MAAMA,qBAAqB,GAAG;EACnCC,sBAAsB,eAAE,IAAIC,YAAY,CAAC,mBAAmB,EAAE,IAAI;CACnE;;MCKYC,oBAAqB,SAAQC,YAAY;EAMpDC,YAAYC,IAAsB;IAChC,KAAK,EAAE;IAHT,oBAAe,GAAG,MAAMN,qBAAqB,CAACC,sBAAsB;IAQ7D,iBAAY,GAAG,MAAM,IAAI,CAACM,SAAS;IACnC,gBAAW,GAAG,MAAM,IAAI,CAACC,IAAI;IAE7B,eAAU,GAAG;MAClB,OAAO,IAAIC,QAAQ,CAAC,IAAI,CAACD,IAAI,CAAC;KAC/B;IATC,IAAI,CAACD,SAAS,GAAGD,IAAI,CAACC,SAAS;IAC/B,IAAI,CAACC,IAAI,GAAGF,IAAI,CAACE,IAAI;;EAUhB,OAAOE,yBAAyBA,CAACF,IAAY,EAAEG,UAAmB;IACvE,OAAO,IAAIR,oBAAoB,CAAC;MAC9BK,IAAI;MACJD,SAAS,EAAEI,UAAU,GACjBC,MAAM,CAACC,IAAI,CAACC,KAAU,CAACH,UAAU,CAAe,CAAC,GACjDI;KACL,CAAC;;;;AC9BNC,SAAS,CACPC,MAAM,CAACC,MAAM,CAAClB,qBAAqB,CAAC,CACjCmB,MAAM,CAAEC,EAAE,IAAK,CAAC,CAACA,EAAE,CAACC,MAAM,EAAE,CAAC,CAC7BC,GAAG,CAAEF,EAAE,IAAKA,EAAE,CAACC,MAAM,EAAE,CAAa,CACxC;;;;"}
@@ -0,0 +1,2 @@
1
+ export * from "@keystonehq/bc-ur-registry";
2
+ export { AvalancheSignRequest } from "./AvalancheSignRequest";
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+
2
+ 'use strict'
3
+
4
+ if (process.env.NODE_ENV === 'production') {
5
+ module.exports = require('./bc-ur-registry-avalanche.cjs.production.min.js')
6
+ } else {
7
+ module.exports = require('./bc-ur-registry-avalanche.cjs.development.js')
8
+ }
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@keystonehq/bc-ur-registry-avalanche",
3
+ "version": "0.0.1",
4
+ "description": "bc-ur-registry extension for Avalanche",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "directories": {
8
+ "lib": "src",
9
+ "test": "__tests__"
10
+ },
11
+ "files": [
12
+ "src",
13
+ "dist"
14
+ ],
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "author": "xi@keyst.com",
19
+ "license": "ISC",
20
+ "dependencies": {
21
+ "@keystonehq/bc-ur-registry": "^0.6.4",
22
+ "uuid": "^8.3.2"
23
+ },
24
+ "devDependencies": {
25
+ "@babel/preset-typescript": "^7.15.0",
26
+ "@types/uuid": "^8.3.1",
27
+ "tsdx": "^0.14.1",
28
+ "typescript": "^4.6.2"
29
+ },
30
+ "scripts": {
31
+ "clean": "rm -rf ./dist",
32
+ "start": "tsdx watch",
33
+ "build": "tsdx build",
34
+ "test": "jest --passWithNoTests"
35
+ }
36
+ }
@@ -0,0 +1,37 @@
1
+ import { DataItem, RegistryItem } from "@keystonehq/bc-ur-registry";
2
+ import { ExtendedRegistryTypes } from "./RegistryType";
3
+ import * as uuid from "uuid";
4
+
5
+ type signRequestProps = {
6
+ requestId?: Buffer;
7
+ data: Buffer;
8
+ };
9
+
10
+ export class AvalancheSignRequest extends RegistryItem {
11
+ private requestId?: Buffer;
12
+ private data: Buffer;
13
+
14
+ getRegistryType = () => ExtendedRegistryTypes.AVALANCHE_SIGN_REQUEST;
15
+
16
+ constructor(args: signRequestProps) {
17
+ super();
18
+ this.requestId = args.requestId;
19
+ this.data = args.data;
20
+ }
21
+
22
+ public getRequestId = () => this.requestId;
23
+ public getSignData = () => this.data;
24
+
25
+ public toDataItem = () => {
26
+ return new DataItem(this.data);
27
+ };
28
+
29
+ public static constructAvalancheRequest(data: Buffer, uuidString?: string) {
30
+ return new AvalancheSignRequest({
31
+ data,
32
+ requestId: uuidString
33
+ ? Buffer.from(uuid.parse(uuidString) as Uint8Array)
34
+ : undefined,
35
+ });
36
+ }
37
+ }
@@ -0,0 +1,5 @@
1
+ import { RegistryType } from "@keystonehq/bc-ur-registry";
2
+
3
+ export const ExtendedRegistryTypes = {
4
+ AVALANCHE_SIGN_REQUEST: new RegistryType("avax-sign-request", 8301),
5
+ };
package/src/index.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { patchTags } from "@keystonehq/bc-ur-registry";
2
+ import { ExtendedRegistryTypes } from "./RegistryType";
3
+ export * from "@keystonehq/bc-ur-registry";
4
+
5
+ patchTags(
6
+ Object.values(ExtendedRegistryTypes)
7
+ .filter((rt) => !!rt.getTag())
8
+ .map((rt) => rt.getTag()) as number[]
9
+ );
10
+
11
+ export { AvalancheSignRequest } from "./AvalancheSignRequest";