@taquito/remote-signer 11.2.0-beta-RC.0 → 11.2.0
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 +24 -5
- package/dist/lib/version.js +2 -2
- package/dist/lib/version.js.map +1 -1
- package/dist/taquito-remote-signer.es6.js +2 -2
- package/dist/taquito-remote-signer.es6.js.map +1 -1
- package/dist/taquito-remote-signer.umd.js +2 -2
- package/dist/taquito-remote-signer.umd.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,21 +1,40 @@
|
|
|
1
1
|
# Taquito Remote Signer package
|
|
2
|
+
*TypeDoc style documentation is available on-line [here](https://tezostaquito.io/typedoc/modules/_taquito_remote_signer.html)*
|
|
2
3
|
|
|
3
|
-
`@taquito/remote-signer` is an npm package that provides developers with remote signing functionality for Taquito.
|
|
4
|
+
`@taquito/remote-signer` is an npm package that provides developers with remote signing functionality for Taquito.
|
|
5
|
+
|
|
6
|
+
## General Information
|
|
7
|
+
|
|
8
|
+
If you require the server-side signing of operations on the mainnet, we recommend exploring the use of the Remote Signer package in conjunction with an HSM remote signer such as [Signatory](https://signatory.io/) or [TacoInfra's Remote Signer](https://github.com/tacoinfra/remote-signer).
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
npm i --save @taquito/taquito
|
|
14
|
+
npm i --save @taquito/remote-signer
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
When the `RemoteSigner` is configured on the `TezosToolkit`, Taquito features that require signing support can be used. The Contract API operations will be signed using the signer. Validation of the signature will be conducted before the operation is injected. The `RemoteSigner` can be injected into the `TezosToolkit` as follows:
|
|
4
20
|
|
|
5
21
|
```ts
|
|
6
22
|
import { TezosToolkit } from '@taquito/taquito';
|
|
7
23
|
import { RemoteSigner } from '@taquito/remote-signer';
|
|
8
24
|
|
|
9
25
|
const Tezos = new TezosToolkit('https://YOUR_PREFERRED_RPC_URL');
|
|
10
|
-
const signer = new RemoteSigner(pkh, rootUrl
|
|
26
|
+
const signer = new RemoteSigner(pkh, rootUrl);
|
|
11
27
|
Tezos.setSignerProvider(signer);
|
|
28
|
+
|
|
29
|
+
// Taquito will send a request to the configured Remote Signer to sign the transfer operation:
|
|
30
|
+
await Tezos.contract.transfer({ to: publicKeyHash, amount: 2 });
|
|
12
31
|
```
|
|
13
32
|
|
|
14
|
-
|
|
33
|
+
The constructor of the `RemoteSigner` class requires the public key hash and the URL of the remote signer as parameters. It also takes optional headers (i.e., Authorization) and an optional `HttpBackend` to override the default one if needed.
|
|
15
34
|
|
|
16
|
-
##
|
|
35
|
+
## Additional info
|
|
17
36
|
|
|
18
|
-
|
|
37
|
+
See the top-level [https://github.com/ecadlabs/taquito](https://github.com/ecadlabs/taquito) file for details on reporting issues, contributing, and versioning.
|
|
19
38
|
|
|
20
39
|
## Disclaimer
|
|
21
40
|
|
package/dist/lib/version.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
4
|
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
|
|
5
5
|
exports.VERSION = {
|
|
6
|
-
"commitHash": "
|
|
7
|
-
"version": "11.2.0
|
|
6
|
+
"commitHash": "81f0a5b103f867f57fbe5d526315c375a3788346",
|
|
7
|
+
"version": "11.2.0"
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=version.js.map
|
package/dist/lib/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AACA,2EAA2E;AAC9D,QAAA,OAAO,GAAG;IACnB,YAAY,EAAE,0CAA0C;IACxD,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AACA,2EAA2E;AAC9D,QAAA,OAAO,GAAG;IACnB,YAAY,EAAE,0CAA0C;IACxD,SAAS,EAAE,QAAQ;CACtB,CAAC"}
|
|
@@ -56,8 +56,8 @@ class BadSigningDataError extends Error {
|
|
|
56
56
|
|
|
57
57
|
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
|
|
58
58
|
const VERSION = {
|
|
59
|
-
"commitHash": "
|
|
60
|
-
"version": "11.2.0
|
|
59
|
+
"commitHash": "81f0a5b103f867f57fbe5d526315c375a3788346",
|
|
60
|
+
"version": "11.2.0"
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
const pref = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taquito-remote-signer.es6.js","sources":["../src/errors.ts","../src/version.ts","../src/taquito-remote-signer.ts"],"sourcesContent":["export class KeyNotFoundError extends Error {\n public name = 'KeyNotFoundError';\n constructor(public message: string, public innerException: any) {\n super(message);\n }\n}\n\nexport class OperationNotAuthorizedError extends Error {\n public name = 'OperationNotAuthorized';\n constructor(public message: string, public innerException: any) {\n super(message);\n }\n}\n\nexport class BadSigningDataError extends Error {\n public name = 'BadSigningData';\n constructor(public message: string, public innerException: any, public readonly data: any) {\n super(message);\n }\n}\n","\n// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!\nexport const VERSION = {\n \"commitHash\": \"e03d983c780c7f96d8291ddd1251ea82f4581858\",\n \"version\": \"11.2.0-beta-RC.0\"\n};\n","/**\n * @packageDocumentation\n * @module @taquito/remote-signer\n */\nimport { HttpBackend, HttpResponseError, STATUS_CODE } from '@taquito/http-utils';\nimport {\n b58cdecode,\n b58cencode,\n buf2hex,\n hex2buf,\n isValidPrefix,\n mergebuf,\n prefix,\n verifySignature,\n validateKeyHash,\n ValidationResult,\n InvalidKeyHashError\n} from '@taquito/utils';\n\nimport sodium from 'libsodium-wrappers';\nimport toBuffer from 'typedarray-to-buffer';\nimport { BadSigningDataError, KeyNotFoundError, OperationNotAuthorizedError } from './errors';\nimport { Signer } from '@taquito/taquito';\n\ninterface PublicKeyResponse {\n public_key: string;\n}\n\ninterface SignResponse {\n signature: string;\n}\n\ntype curves = 'ed' | 'p2' | 'sp';\n\nexport interface RemoteSignerOptions {\n headers?: { [key: string]: string };\n}\n\nexport { VERSION } from './version';\n\nconst pref = {\n ed: {\n pk: prefix['edpk'],\n sk: prefix['edsk'],\n pkh: prefix.tz1,\n sig: prefix.edsig,\n },\n p2: {\n pk: prefix['p2pk'],\n sk: prefix['p2sk'],\n pkh: prefix.tz3,\n sig: prefix.p2sig,\n },\n sp: {\n pk: prefix['sppk'],\n sk: prefix['spsk'],\n pkh: prefix.tz2,\n sig: prefix.spsig,\n },\n};\n\nexport class RemoteSigner implements Signer {\n constructor(\n private pkh: string,\n private rootUrl: string,\n private options: RemoteSignerOptions = {},\n private http = new HttpBackend()\n ) {\n if (validateKeyHash(this.pkh) !== ValidationResult.VALID) {\n throw new InvalidKeyHashError(`Invalid Public Key Hash: ${this.pkh}`);\n }\n }\n\n async publicKeyHash(): Promise<string> {\n return this.pkh;\n }\n\n private createURL(path: string) {\n // Trim trailing slashes because it is assumed to be included in path\n return `${this.rootUrl.replace(/\\/+$/g, '')}${path}`;\n }\n\n async publicKey(): Promise<string> {\n try {\n const { public_key } = await this.http.createRequest<PublicKeyResponse>({\n url: this.createURL(`/keys/${this.pkh}`),\n method: 'GET',\n headers: this.options.headers,\n });\n return public_key;\n } catch (ex) {\n if (ex instanceof HttpResponseError) {\n if (ex.status === STATUS_CODE.NOT_FOUND) {\n throw new KeyNotFoundError(`Key not found: ${this.pkh}`, ex);\n }\n }\n throw ex;\n }\n }\n\n async secretKey(): Promise<string> {\n throw new Error('Secret key cannot be exposed');\n }\n\n async sign(bytes: string, watermark?: Uint8Array) {\n try {\n let bb = hex2buf(bytes);\n if (typeof watermark !== 'undefined') {\n bb = mergebuf(watermark, bb);\n }\n const watermarkedBytes = buf2hex(toBuffer(bb));\n const { signature } = await this.http.createRequest<SignResponse>(\n {\n url: this.createURL(`/keys/${this.pkh}`),\n method: 'POST',\n headers: this.options.headers,\n },\n watermarkedBytes\n );\n const pref = signature.startsWith('sig')\n ? signature.substring(0, 3)\n : signature.substring(0, 5);\n\n if (!isValidPrefix(pref)) {\n throw new Error(`Unsupported signature given by remote signer: ${signature}`);\n }\n\n const decoded = b58cdecode(signature, prefix[pref]);\n\n const pk = await this.publicKey();\n await this.verifyPublicKey(pk);\n const signatureVerified = verifySignature(watermarkedBytes, pk, signature);\n if (!signatureVerified) {\n throw new Error(\n `Signature failed verification against public key:\n {\n bytes: ${watermarkedBytes},\n signature: ${signature}\n }`\n );\n }\n\n return {\n bytes,\n sig: b58cencode(decoded, prefix.sig),\n prefixSig: signature,\n sbytes: bytes + buf2hex(toBuffer(decoded)),\n };\n } catch (ex) {\n if (ex instanceof HttpResponseError) {\n if (ex.status === STATUS_CODE.NOT_FOUND) {\n throw new KeyNotFoundError(`Key not found: ${this.pkh}`, ex);\n } else if (ex.status === STATUS_CODE.FORBIDDEN) {\n throw new OperationNotAuthorizedError('Signing Operation not authorized', ex);\n } else if (ex.status === STATUS_CODE.BAD_REQUEST) {\n throw new BadSigningDataError('Invalid data', ex, {\n bytes,\n watermark,\n });\n }\n }\n throw ex;\n }\n }\n\n async verifyPublicKey(publicKey: string) {\n await sodium.ready;\n const curve = publicKey.substring(0, 2) as curves;\n const _publicKey = toBuffer(b58cdecode(publicKey, pref[curve].pk));\n\n const publicKeyHash = b58cencode(sodium.crypto_generichash(20, _publicKey), pref[curve].pkh);\n if (publicKeyHash !== this.pkh) {\n throw new Error(\n `Requested public key does not match the initialized public key hash: {\n publicKey: ${publicKey},\n publicKeyHash: ${this.pkh}\n }`\n );\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAa,gBAAiB,SAAQ,KAAK;IAEzC,YAAmB,OAAe,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AAC;YAC7F,IAAI,aAAa,KAAK,IAAI,CAAC,GAAG,EAAE;gBAC9B,MAAM,IAAI,KAAK,CACb;uBACe,SAAS;2BACL,IAAI,CAAC,GAAG;UACzB,CACH,CAAC;aACH;SACF;KAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"taquito-remote-signer.es6.js","sources":["../src/errors.ts","../src/version.ts","../src/taquito-remote-signer.ts"],"sourcesContent":["export class KeyNotFoundError extends Error {\n public name = 'KeyNotFoundError';\n constructor(public message: string, public innerException: any) {\n super(message);\n }\n}\n\nexport class OperationNotAuthorizedError extends Error {\n public name = 'OperationNotAuthorized';\n constructor(public message: string, public innerException: any) {\n super(message);\n }\n}\n\nexport class BadSigningDataError extends Error {\n public name = 'BadSigningData';\n constructor(public message: string, public innerException: any, public readonly data: any) {\n super(message);\n }\n}\n","\n// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!\nexport const VERSION = {\n \"commitHash\": \"81f0a5b103f867f57fbe5d526315c375a3788346\",\n \"version\": \"11.2.0\"\n};\n","/**\n * @packageDocumentation\n * @module @taquito/remote-signer\n */\nimport { HttpBackend, HttpResponseError, STATUS_CODE } from '@taquito/http-utils';\nimport {\n b58cdecode,\n b58cencode,\n buf2hex,\n hex2buf,\n isValidPrefix,\n mergebuf,\n prefix,\n verifySignature,\n validateKeyHash,\n ValidationResult,\n InvalidKeyHashError\n} from '@taquito/utils';\n\nimport sodium from 'libsodium-wrappers';\nimport toBuffer from 'typedarray-to-buffer';\nimport { BadSigningDataError, KeyNotFoundError, OperationNotAuthorizedError } from './errors';\nimport { Signer } from '@taquito/taquito';\n\ninterface PublicKeyResponse {\n public_key: string;\n}\n\ninterface SignResponse {\n signature: string;\n}\n\ntype curves = 'ed' | 'p2' | 'sp';\n\nexport interface RemoteSignerOptions {\n headers?: { [key: string]: string };\n}\n\nexport { VERSION } from './version';\n\nconst pref = {\n ed: {\n pk: prefix['edpk'],\n sk: prefix['edsk'],\n pkh: prefix.tz1,\n sig: prefix.edsig,\n },\n p2: {\n pk: prefix['p2pk'],\n sk: prefix['p2sk'],\n pkh: prefix.tz3,\n sig: prefix.p2sig,\n },\n sp: {\n pk: prefix['sppk'],\n sk: prefix['spsk'],\n pkh: prefix.tz2,\n sig: prefix.spsig,\n },\n};\n\nexport class RemoteSigner implements Signer {\n constructor(\n private pkh: string,\n private rootUrl: string,\n private options: RemoteSignerOptions = {},\n private http = new HttpBackend()\n ) {\n if (validateKeyHash(this.pkh) !== ValidationResult.VALID) {\n throw new InvalidKeyHashError(`Invalid Public Key Hash: ${this.pkh}`);\n }\n }\n\n async publicKeyHash(): Promise<string> {\n return this.pkh;\n }\n\n private createURL(path: string) {\n // Trim trailing slashes because it is assumed to be included in path\n return `${this.rootUrl.replace(/\\/+$/g, '')}${path}`;\n }\n\n async publicKey(): Promise<string> {\n try {\n const { public_key } = await this.http.createRequest<PublicKeyResponse>({\n url: this.createURL(`/keys/${this.pkh}`),\n method: 'GET',\n headers: this.options.headers,\n });\n return public_key;\n } catch (ex) {\n if (ex instanceof HttpResponseError) {\n if (ex.status === STATUS_CODE.NOT_FOUND) {\n throw new KeyNotFoundError(`Key not found: ${this.pkh}`, ex);\n }\n }\n throw ex;\n }\n }\n\n async secretKey(): Promise<string> {\n throw new Error('Secret key cannot be exposed');\n }\n\n async sign(bytes: string, watermark?: Uint8Array) {\n try {\n let bb = hex2buf(bytes);\n if (typeof watermark !== 'undefined') {\n bb = mergebuf(watermark, bb);\n }\n const watermarkedBytes = buf2hex(toBuffer(bb));\n const { signature } = await this.http.createRequest<SignResponse>(\n {\n url: this.createURL(`/keys/${this.pkh}`),\n method: 'POST',\n headers: this.options.headers,\n },\n watermarkedBytes\n );\n const pref = signature.startsWith('sig')\n ? signature.substring(0, 3)\n : signature.substring(0, 5);\n\n if (!isValidPrefix(pref)) {\n throw new Error(`Unsupported signature given by remote signer: ${signature}`);\n }\n\n const decoded = b58cdecode(signature, prefix[pref]);\n\n const pk = await this.publicKey();\n await this.verifyPublicKey(pk);\n const signatureVerified = verifySignature(watermarkedBytes, pk, signature);\n if (!signatureVerified) {\n throw new Error(\n `Signature failed verification against public key:\n {\n bytes: ${watermarkedBytes},\n signature: ${signature}\n }`\n );\n }\n\n return {\n bytes,\n sig: b58cencode(decoded, prefix.sig),\n prefixSig: signature,\n sbytes: bytes + buf2hex(toBuffer(decoded)),\n };\n } catch (ex) {\n if (ex instanceof HttpResponseError) {\n if (ex.status === STATUS_CODE.NOT_FOUND) {\n throw new KeyNotFoundError(`Key not found: ${this.pkh}`, ex);\n } else if (ex.status === STATUS_CODE.FORBIDDEN) {\n throw new OperationNotAuthorizedError('Signing Operation not authorized', ex);\n } else if (ex.status === STATUS_CODE.BAD_REQUEST) {\n throw new BadSigningDataError('Invalid data', ex, {\n bytes,\n watermark,\n });\n }\n }\n throw ex;\n }\n }\n\n async verifyPublicKey(publicKey: string) {\n await sodium.ready;\n const curve = publicKey.substring(0, 2) as curves;\n const _publicKey = toBuffer(b58cdecode(publicKey, pref[curve].pk));\n\n const publicKeyHash = b58cencode(sodium.crypto_generichash(20, _publicKey), pref[curve].pkh);\n if (publicKeyHash !== this.pkh) {\n throw new Error(\n `Requested public key does not match the initialized public key hash: {\n publicKey: ${publicKey},\n publicKeyHash: ${this.pkh}\n }`\n );\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAa,gBAAiB,SAAQ,KAAK;IAEzC,YAAmB,OAAe,EAAS,cAAmB;QAC5D,KAAK,CAAC,OAAO,CAAC,CAAC;QADE,YAAO,GAAP,OAAO,CAAQ;QAAS,mBAAc,GAAd,cAAc,CAAK;QADvD,SAAI,GAAG,kBAAkB,CAAC;KAGhC;CACF;MAEY,2BAA4B,SAAQ,KAAK;IAEpD,YAAmB,OAAe,EAAS,cAAmB;QAC5D,KAAK,CAAC,OAAO,CAAC,CAAC;QADE,YAAO,GAAP,OAAO,CAAQ;QAAS,mBAAc,GAAd,cAAc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commitHash": "
|
|
66
|
-
"version": "11.2.0
|
|
65
|
+
"commitHash": "81f0a5b103f867f57fbe5d526315c375a3788346",
|
|
66
|
+
"version": "11.2.0"
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
const pref = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taquito-remote-signer.umd.js","sources":["../src/errors.ts","../src/version.ts","../src/taquito-remote-signer.ts"],"sourcesContent":["export class KeyNotFoundError extends Error {\n public name = 'KeyNotFoundError';\n constructor(public message: string, public innerException: any) {\n super(message);\n }\n}\n\nexport class OperationNotAuthorizedError extends Error {\n public name = 'OperationNotAuthorized';\n constructor(public message: string, public innerException: any) {\n super(message);\n }\n}\n\nexport class BadSigningDataError extends Error {\n public name = 'BadSigningData';\n constructor(public message: string, public innerException: any, public readonly data: any) {\n super(message);\n }\n}\n","\n// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!\nexport const VERSION = {\n \"commitHash\": \"e03d983c780c7f96d8291ddd1251ea82f4581858\",\n \"version\": \"11.2.0-beta-RC.0\"\n};\n","/**\n * @packageDocumentation\n * @module @taquito/remote-signer\n */\nimport { HttpBackend, HttpResponseError, STATUS_CODE } from '@taquito/http-utils';\nimport {\n b58cdecode,\n b58cencode,\n buf2hex,\n hex2buf,\n isValidPrefix,\n mergebuf,\n prefix,\n verifySignature,\n validateKeyHash,\n ValidationResult,\n InvalidKeyHashError\n} from '@taquito/utils';\n\nimport sodium from 'libsodium-wrappers';\nimport toBuffer from 'typedarray-to-buffer';\nimport { BadSigningDataError, KeyNotFoundError, OperationNotAuthorizedError } from './errors';\nimport { Signer } from '@taquito/taquito';\n\ninterface PublicKeyResponse {\n public_key: string;\n}\n\ninterface SignResponse {\n signature: string;\n}\n\ntype curves = 'ed' | 'p2' | 'sp';\n\nexport interface RemoteSignerOptions {\n headers?: { [key: string]: string };\n}\n\nexport { VERSION } from './version';\n\nconst pref = {\n ed: {\n pk: prefix['edpk'],\n sk: prefix['edsk'],\n pkh: prefix.tz1,\n sig: prefix.edsig,\n },\n p2: {\n pk: prefix['p2pk'],\n sk: prefix['p2sk'],\n pkh: prefix.tz3,\n sig: prefix.p2sig,\n },\n sp: {\n pk: prefix['sppk'],\n sk: prefix['spsk'],\n pkh: prefix.tz2,\n sig: prefix.spsig,\n },\n};\n\nexport class RemoteSigner implements Signer {\n constructor(\n private pkh: string,\n private rootUrl: string,\n private options: RemoteSignerOptions = {},\n private http = new HttpBackend()\n ) {\n if (validateKeyHash(this.pkh) !== ValidationResult.VALID) {\n throw new InvalidKeyHashError(`Invalid Public Key Hash: ${this.pkh}`);\n }\n }\n\n async publicKeyHash(): Promise<string> {\n return this.pkh;\n }\n\n private createURL(path: string) {\n // Trim trailing slashes because it is assumed to be included in path\n return `${this.rootUrl.replace(/\\/+$/g, '')}${path}`;\n }\n\n async publicKey(): Promise<string> {\n try {\n const { public_key } = await this.http.createRequest<PublicKeyResponse>({\n url: this.createURL(`/keys/${this.pkh}`),\n method: 'GET',\n headers: this.options.headers,\n });\n return public_key;\n } catch (ex) {\n if (ex instanceof HttpResponseError) {\n if (ex.status === STATUS_CODE.NOT_FOUND) {\n throw new KeyNotFoundError(`Key not found: ${this.pkh}`, ex);\n }\n }\n throw ex;\n }\n }\n\n async secretKey(): Promise<string> {\n throw new Error('Secret key cannot be exposed');\n }\n\n async sign(bytes: string, watermark?: Uint8Array) {\n try {\n let bb = hex2buf(bytes);\n if (typeof watermark !== 'undefined') {\n bb = mergebuf(watermark, bb);\n }\n const watermarkedBytes = buf2hex(toBuffer(bb));\n const { signature } = await this.http.createRequest<SignResponse>(\n {\n url: this.createURL(`/keys/${this.pkh}`),\n method: 'POST',\n headers: this.options.headers,\n },\n watermarkedBytes\n );\n const pref = signature.startsWith('sig')\n ? signature.substring(0, 3)\n : signature.substring(0, 5);\n\n if (!isValidPrefix(pref)) {\n throw new Error(`Unsupported signature given by remote signer: ${signature}`);\n }\n\n const decoded = b58cdecode(signature, prefix[pref]);\n\n const pk = await this.publicKey();\n await this.verifyPublicKey(pk);\n const signatureVerified = verifySignature(watermarkedBytes, pk, signature);\n if (!signatureVerified) {\n throw new Error(\n `Signature failed verification against public key:\n {\n bytes: ${watermarkedBytes},\n signature: ${signature}\n }`\n );\n }\n\n return {\n bytes,\n sig: b58cencode(decoded, prefix.sig),\n prefixSig: signature,\n sbytes: bytes + buf2hex(toBuffer(decoded)),\n };\n } catch (ex) {\n if (ex instanceof HttpResponseError) {\n if (ex.status === STATUS_CODE.NOT_FOUND) {\n throw new KeyNotFoundError(`Key not found: ${this.pkh}`, ex);\n } else if (ex.status === STATUS_CODE.FORBIDDEN) {\n throw new OperationNotAuthorizedError('Signing Operation not authorized', ex);\n } else if (ex.status === STATUS_CODE.BAD_REQUEST) {\n throw new BadSigningDataError('Invalid data', ex, {\n bytes,\n watermark,\n });\n }\n }\n throw ex;\n }\n }\n\n async verifyPublicKey(publicKey: string) {\n await sodium.ready;\n const curve = publicKey.substring(0, 2) as curves;\n const _publicKey = toBuffer(b58cdecode(publicKey, pref[curve].pk));\n\n const publicKeyHash = b58cencode(sodium.crypto_generichash(20, _publicKey), pref[curve].pkh);\n if (publicKeyHash !== this.pkh) {\n throw new Error(\n `Requested public key does not match the initialized public key hash: {\n publicKey: ${publicKey},\n publicKeyHash: ${this.pkh}\n }`\n );\n }\n }\n}\n"],"names":["prefix","HttpBackend","validateKeyHash","ValidationResult","InvalidKeyHashError","HttpResponseError","STATUS_CODE","hex2buf","mergebuf","buf2hex","toBuffer","isValidPrefix","b58cdecode","verifySignature","b58cencode","sodium"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAAa,gBAAiB,SAAQ,KAAK;QAEzC,YAAmB,OAAe,EAAS,cAAmB;YAC5D,KAAK,CAAC,OAAO,CAAC,CAAC;YADE,YAAO,GAAP,OAAO,CAAQ;YAAS,mBAAc,GAAd,cAAc,CAAK;YADvD,SAAI,GAAG,kBAAkB,CAAC;S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AAM,IAAI,KAAK,CACb;uBACe,SAAS;2BACL,IAAI,CAAC,GAAG;UACzB,CACH,CAAC;iBACH;aACF;SAAA;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taquito-remote-signer.umd.js","sources":["../src/errors.ts","../src/version.ts","../src/taquito-remote-signer.ts"],"sourcesContent":["export class KeyNotFoundError extends Error {\n public name = 'KeyNotFoundError';\n constructor(public message: string, public innerException: any) {\n super(message);\n }\n}\n\nexport class OperationNotAuthorizedError extends Error {\n public name = 'OperationNotAuthorized';\n constructor(public message: string, public innerException: any) {\n super(message);\n }\n}\n\nexport class BadSigningDataError extends Error {\n public name = 'BadSigningData';\n constructor(public message: string, public innerException: any, public readonly data: any) {\n super(message);\n }\n}\n","\n// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!\nexport const VERSION = {\n \"commitHash\": \"81f0a5b103f867f57fbe5d526315c375a3788346\",\n \"version\": \"11.2.0\"\n};\n","/**\n * @packageDocumentation\n * @module @taquito/remote-signer\n */\nimport { HttpBackend, HttpResponseError, STATUS_CODE } from '@taquito/http-utils';\nimport {\n b58cdecode,\n b58cencode,\n buf2hex,\n hex2buf,\n isValidPrefix,\n mergebuf,\n prefix,\n verifySignature,\n validateKeyHash,\n ValidationResult,\n InvalidKeyHashError\n} from '@taquito/utils';\n\nimport sodium from 'libsodium-wrappers';\nimport toBuffer from 'typedarray-to-buffer';\nimport { BadSigningDataError, KeyNotFoundError, OperationNotAuthorizedError } from './errors';\nimport { Signer } from '@taquito/taquito';\n\ninterface PublicKeyResponse {\n public_key: string;\n}\n\ninterface SignResponse {\n signature: string;\n}\n\ntype curves = 'ed' | 'p2' | 'sp';\n\nexport interface RemoteSignerOptions {\n headers?: { [key: string]: string };\n}\n\nexport { VERSION } from './version';\n\nconst pref = {\n ed: {\n pk: prefix['edpk'],\n sk: prefix['edsk'],\n pkh: prefix.tz1,\n sig: prefix.edsig,\n },\n p2: {\n pk: prefix['p2pk'],\n sk: prefix['p2sk'],\n pkh: prefix.tz3,\n sig: prefix.p2sig,\n },\n sp: {\n pk: prefix['sppk'],\n sk: prefix['spsk'],\n pkh: prefix.tz2,\n sig: prefix.spsig,\n },\n};\n\nexport class RemoteSigner implements Signer {\n constructor(\n private pkh: string,\n private rootUrl: string,\n private options: RemoteSignerOptions = {},\n private http = new HttpBackend()\n ) {\n if (validateKeyHash(this.pkh) !== ValidationResult.VALID) {\n throw new InvalidKeyHashError(`Invalid Public Key Hash: ${this.pkh}`);\n }\n }\n\n async publicKeyHash(): Promise<string> {\n return this.pkh;\n }\n\n private createURL(path: string) {\n // Trim trailing slashes because it is assumed to be included in path\n return `${this.rootUrl.replace(/\\/+$/g, '')}${path}`;\n }\n\n async publicKey(): Promise<string> {\n try {\n const { public_key } = await this.http.createRequest<PublicKeyResponse>({\n url: this.createURL(`/keys/${this.pkh}`),\n method: 'GET',\n headers: this.options.headers,\n });\n return public_key;\n } catch (ex) {\n if (ex instanceof HttpResponseError) {\n if (ex.status === STATUS_CODE.NOT_FOUND) {\n throw new KeyNotFoundError(`Key not found: ${this.pkh}`, ex);\n }\n }\n throw ex;\n }\n }\n\n async secretKey(): Promise<string> {\n throw new Error('Secret key cannot be exposed');\n }\n\n async sign(bytes: string, watermark?: Uint8Array) {\n try {\n let bb = hex2buf(bytes);\n if (typeof watermark !== 'undefined') {\n bb = mergebuf(watermark, bb);\n }\n const watermarkedBytes = buf2hex(toBuffer(bb));\n const { signature } = await this.http.createRequest<SignResponse>(\n {\n url: this.createURL(`/keys/${this.pkh}`),\n method: 'POST',\n headers: this.options.headers,\n },\n watermarkedBytes\n );\n const pref = signature.startsWith('sig')\n ? signature.substring(0, 3)\n : signature.substring(0, 5);\n\n if (!isValidPrefix(pref)) {\n throw new Error(`Unsupported signature given by remote signer: ${signature}`);\n }\n\n const decoded = b58cdecode(signature, prefix[pref]);\n\n const pk = await this.publicKey();\n await this.verifyPublicKey(pk);\n const signatureVerified = verifySignature(watermarkedBytes, pk, signature);\n if (!signatureVerified) {\n throw new Error(\n `Signature failed verification against public key:\n {\n bytes: ${watermarkedBytes},\n signature: ${signature}\n }`\n );\n }\n\n return {\n bytes,\n sig: b58cencode(decoded, prefix.sig),\n prefixSig: signature,\n sbytes: bytes + buf2hex(toBuffer(decoded)),\n };\n } catch (ex) {\n if (ex instanceof HttpResponseError) {\n if (ex.status === STATUS_CODE.NOT_FOUND) {\n throw new KeyNotFoundError(`Key not found: ${this.pkh}`, ex);\n } else if (ex.status === STATUS_CODE.FORBIDDEN) {\n throw new OperationNotAuthorizedError('Signing Operation not authorized', ex);\n } else if (ex.status === STATUS_CODE.BAD_REQUEST) {\n throw new BadSigningDataError('Invalid data', ex, {\n bytes,\n watermark,\n });\n }\n }\n throw ex;\n }\n }\n\n async verifyPublicKey(publicKey: string) {\n await sodium.ready;\n const curve = publicKey.substring(0, 2) as curves;\n const _publicKey = toBuffer(b58cdecode(publicKey, pref[curve].pk));\n\n const publicKeyHash = b58cencode(sodium.crypto_generichash(20, _publicKey), pref[curve].pkh);\n if (publicKeyHash !== this.pkh) {\n throw new Error(\n `Requested public key does not match the initialized public key hash: {\n publicKey: ${publicKey},\n publicKeyHash: ${this.pkh}\n }`\n );\n }\n }\n}\n"],"names":["prefix","HttpBackend","validateKeyHash","ValidationResult","InvalidKeyHashError","HttpResponseError","STATUS_CODE","hex2buf","mergebuf","buf2hex","toBuffer","isValidPrefix","b58cdecode","verifySignature","b58cencode","sodium"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAAa,gBAAiB,SAAQ,KAAK;QAEzC,YAAmB,OAAe,EAAS,cAAmB;YAC5D,KAAK,CAAC,OAAO,CAAC,CAAC;YADE,YAAO,GAAP,OAAO,CAAQ;YAAS,mBAAc,GAAd,cAAc,CAAK;YADvD,SAAI,GAAG,kBAAkB,CAAC;SAGhC;KACF;UAEY,2BAA4B,SAAQ,KAAK;QAEpD,YAAmB,OAAe,EAAS,cAAmB;YAC5D,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aACF;SAAA;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taquito/remote-signer",
|
|
3
|
-
"version": "11.2.0
|
|
3
|
+
"version": "11.2.0",
|
|
4
4
|
"description": "Remote signer provider",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tezos",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@taquito/http-utils": "^11.2.0
|
|
65
|
-
"@taquito/taquito": "^11.2.0
|
|
66
|
-
"@taquito/utils": "^11.2.0
|
|
64
|
+
"@taquito/http-utils": "^11.2.0",
|
|
65
|
+
"@taquito/taquito": "^11.2.0",
|
|
66
|
+
"@taquito/utils": "^11.2.0",
|
|
67
67
|
"libsodium-wrappers": "0.7.8",
|
|
68
68
|
"typedarray-to-buffer": "^4.0.0"
|
|
69
69
|
},
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"ts-toolbelt": "^9.6.0",
|
|
98
98
|
"typescript": "~4.1.5"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "7323157124742e8f2fdb11642f6b779cfb15df43"
|
|
101
101
|
}
|