@ckb-ccc/joy-id 0.0.5-alpha.7 → 0.0.5-alpha.8
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signerFactory/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAMpC,wBAAgB,eAAe,CAC7B,MAAM,EAAE,GAAG,CAAC,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,GAAG,CAAC,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signerFactory/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAMpC,wBAAgB,eAAe,CAC7B,MAAM,EAAE,GAAG,CAAC,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,GAAG,CAAC,UAAU,EAAE,CAoClB"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { ccc } from "@ckb-ccc/core";
|
|
1
2
|
import { isStandaloneBrowser } from "@joyid/common";
|
|
2
3
|
import { BitcoinSigner } from "../btc";
|
|
3
4
|
import { CkbSigner } from "../ckb";
|
|
4
5
|
import { EvmSigner } from "../evm";
|
|
5
6
|
export function getJoyIdSigners(client, name, icon) {
|
|
6
|
-
if (isStandaloneBrowser()) {
|
|
7
|
-
return []
|
|
7
|
+
if (isStandaloneBrowser() || ccc.isWebview(window.navigator.userAgent)) {
|
|
8
|
+
return [ccc.SignerType.CKB, ccc.SignerType.EVM, ccc.SignerType.BTC].map((type) => ({
|
|
9
|
+
name: type,
|
|
10
|
+
signer: new ccc.SignerAlwaysError(client, type, "JoyID can only be used with standard browsers"),
|
|
11
|
+
}));
|
|
8
12
|
}
|
|
9
13
|
return [
|
|
10
14
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signerFactory/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAMpC,wBAAgB,eAAe,CAC7B,MAAM,EAAE,GAAG,CAAC,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,GAAG,CAAC,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signerFactory/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAMpC,wBAAgB,eAAe,CAC7B,MAAM,EAAE,GAAG,CAAC,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,GAAG,CAAC,UAAU,EAAE,CAoClB"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getJoyIdSigners = void 0;
|
|
4
|
+
const core_1 = require("@ckb-ccc/core");
|
|
4
5
|
const common_1 = require("@joyid/common");
|
|
5
6
|
const btc_1 = require("../btc");
|
|
6
7
|
const ckb_1 = require("../ckb");
|
|
7
8
|
const evm_1 = require("../evm");
|
|
8
9
|
function getJoyIdSigners(client, name, icon) {
|
|
9
|
-
if ((0, common_1.isStandaloneBrowser)()) {
|
|
10
|
-
return []
|
|
10
|
+
if ((0, common_1.isStandaloneBrowser)() || core_1.ccc.isWebview(window.navigator.userAgent)) {
|
|
11
|
+
return [core_1.ccc.SignerType.CKB, core_1.ccc.SignerType.EVM, core_1.ccc.SignerType.BTC].map((type) => ({
|
|
12
|
+
name: type,
|
|
13
|
+
signer: new core_1.ccc.SignerAlwaysError(client, type, "JoyID can only be used with standard browsers"),
|
|
14
|
+
}));
|
|
11
15
|
}
|
|
12
16
|
return [
|
|
13
17
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckb-ccc/joy-id",
|
|
3
|
-
"version": "0.0.5-alpha.
|
|
3
|
+
"version": "0.0.5-alpha.8",
|
|
4
4
|
"description": "Connector's support for JoyID",
|
|
5
5
|
"author": "Hanssen0 <hanssen0@hanssen0.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@ckb-ccc/core": "0.0.5-alpha.
|
|
41
|
+
"@ckb-ccc/core": "0.0.5-alpha.8",
|
|
42
42
|
"@joyid/ckb": "^0.0.11",
|
|
43
43
|
"@joyid/common": "^0.0.3"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "f12b8758d8581bfae0c9a00abbb5f7d2c6d03147"
|
|
46
46
|
}
|
|
@@ -9,8 +9,17 @@ export function getJoyIdSigners(
|
|
|
9
9
|
name: string,
|
|
10
10
|
icon: string,
|
|
11
11
|
): ccc.SignerInfo[] {
|
|
12
|
-
if (isStandaloneBrowser()) {
|
|
13
|
-
return []
|
|
12
|
+
if (isStandaloneBrowser() || ccc.isWebview(window.navigator.userAgent)) {
|
|
13
|
+
return [ccc.SignerType.CKB, ccc.SignerType.EVM, ccc.SignerType.BTC].map(
|
|
14
|
+
(type) => ({
|
|
15
|
+
name: type,
|
|
16
|
+
signer: new ccc.SignerAlwaysError(
|
|
17
|
+
client,
|
|
18
|
+
type,
|
|
19
|
+
"JoyID can only be used with standard browsers",
|
|
20
|
+
),
|
|
21
|
+
}),
|
|
22
|
+
);
|
|
14
23
|
}
|
|
15
24
|
|
|
16
25
|
return [
|