@ckb-ccc/joy-id 0.0.5-alpha.10 → 0.0.5-alpha.12

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/ckb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAIpC,OAAO,EAEL,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAE/B,qBAAa,SAAU,SAAQ,GAAG,CAAC,MAAM;IAqBrC,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;IAChC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAxBlC,IAAI,IAAI,IAAI,GAAG,CAAC,UAAU,CAEzB;IAED,IAAI,QAAQ,IAAI,GAAG,CAAC,cAAc,CAEjC;IAED,OAAO,CAAC,UAAU,CAAC,CAAa;YAElB,gBAAgB;gBAS5B,MAAM,EAAE,GAAG,CAAC,MAAM,EACD,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,oBAAQ,EAChB,cAAc,CAAC,oBAAQ,EACvB,eAAe,GAAE,eAAmD;IAKvF,OAAO,CAAC,SAAS;IAYjB,OAAO,CAAC,gBAAgB;IAUlB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAK3B,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAQ/B,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAIrC,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAQ9B,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;IAOrC,cAAc,IAAI,OAAO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AAC,IAAI,CAAC;IAK3B,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAQ/B,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAIrC,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAQ9B,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;IAOrC,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAIxC,kBAAkB,CACtB,MAAM,EAAE,GAAG,CAAC,eAAe,GAC1B,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;YAkBb,2BAA2B;IAuCnC,mBAAmB,CACvB,MAAM,EAAE,GAAG,CAAC,eAAe,GAC1B,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;IAwCrB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;YA2BxD,cAAc;YAUd,iBAAiB;CAMhC"}
package/dist/ckb/index.js CHANGED
@@ -126,11 +126,21 @@ export class CkbSigner extends ccc.Signer {
126
126
  const tx = ccc.Transaction.from(txLike);
127
127
  const { script } = await this.getAddressObj();
128
128
  const config = this.getConfig();
129
+ const witnessIndexes = await Promise.all(tx.inputs.map(async (input, i) => {
130
+ await input.completeExtraInfos(this.client);
131
+ if (!input.cellOutput) {
132
+ throw Error("Unable to resolve inputs info");
133
+ }
134
+ if (!script.eq(input.cellOutput.lock)) {
135
+ return;
136
+ }
137
+ return i;
138
+ }));
129
139
  const res = await createPopup(buildJoyIDURL({
130
140
  ...config,
131
141
  tx: JSON.parse(tx.stringify()),
132
142
  signerAddress: (await this.assertConnection()).address,
133
- witnessIndex: await tx.findInputIndexByLock(script, this.client),
143
+ witnessIndexes: witnessIndexes.filter((i) => i !== undefined),
134
144
  }, "popup", "/sign-ckb-raw-tx"), {
135
145
  ...config,
136
146
  type: DappRequestType.SignCkbRawTx,
@@ -1,2 +1,2 @@
1
1
  export * as JoyIdA from "./advancedBarrel";
2
- //# sourceMappingURL=advanced.d.ts.map
2
+ //# sourceMappingURL=advanced.d.ts.map
@@ -1,48 +1,27 @@
1
1
  "use strict";
2
- var __createBinding =
3
- (this && this.__createBinding) ||
4
- (Object.create
5
- ? function (o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (
9
- !desc ||
10
- ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
11
- ) {
12
- desc = {
13
- enumerable: true,
14
- get: function () {
15
- return m[k];
16
- },
17
- };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }
21
- : function (o, m, k, k2) {
22
- if (k2 === undefined) k2 = k;
23
- o[k2] = m[k];
24
- });
25
- var __setModuleDefault =
26
- (this && this.__setModuleDefault) ||
27
- (Object.create
28
- ? function (o, v) {
29
- Object.defineProperty(o, "default", { enumerable: true, value: v });
30
- }
31
- : function (o, v) {
32
- o["default"] = v;
33
- });
34
- var __importStar =
35
- (this && this.__importStar) ||
36
- function (mod) {
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) {
37
19
  if (mod && mod.__esModule) return mod;
38
20
  var result = {};
39
- if (mod != null)
40
- for (var k in mod)
41
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
42
- __createBinding(result, mod, k);
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
43
22
  __setModuleDefault(result, mod);
44
23
  return result;
45
- };
24
+ };
46
25
  Object.defineProperty(exports, "__esModule", { value: true });
47
26
  exports.JoyIdA = void 0;
48
27
  exports.JoyIdA = __importStar(require("./advancedBarrel"));
@@ -1,3 +1,3 @@
1
1
  export * from "./common";
2
2
  export * from "./connectionsStorage";
3
- //# sourceMappingURL=advancedBarrel.d.ts.map
3
+ //# sourceMappingURL=advancedBarrel.d.ts.map
@@ -1,34 +1,18 @@
1
1
  "use strict";
2
- var __createBinding =
3
- (this && this.__createBinding) ||
4
- (Object.create
5
- ? function (o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (
9
- !desc ||
10
- ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
11
- ) {
12
- desc = {
13
- enumerable: true,
14
- get: function () {
15
- return m[k];
16
- },
17
- };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }
21
- : function (o, m, k, k2) {
22
- if (k2 === undefined) k2 = k;
23
- o[k2] = m[k];
24
- });
25
- var __exportStar =
26
- (this && this.__exportStar) ||
27
- function (m, exports) {
28
- for (var p in m)
29
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p))
30
- __createBinding(exports, m, p);
31
- };
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
32
16
  Object.defineProperty(exports, "__esModule", { value: true });
33
17
  __exportStar(require("./common"), exports);
34
18
  __exportStar(require("./connectionsStorage"), exports);
@@ -2,4 +2,4 @@ export * from "./btc";
2
2
  export * from "./ckb";
3
3
  export * from "./evm";
4
4
  export * from "./signerFactory";
5
- //# sourceMappingURL=barrel.d.ts.map
5
+ //# sourceMappingURL=barrel.d.ts.map
@@ -1,34 +1,18 @@
1
1
  "use strict";
2
- var __createBinding =
3
- (this && this.__createBinding) ||
4
- (Object.create
5
- ? function (o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (
9
- !desc ||
10
- ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
11
- ) {
12
- desc = {
13
- enumerable: true,
14
- get: function () {
15
- return m[k];
16
- },
17
- };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }
21
- : function (o, m, k, k2) {
22
- if (k2 === undefined) k2 = k;
23
- o[k2] = m[k];
24
- });
25
- var __exportStar =
26
- (this && this.__exportStar) ||
27
- function (m, exports) {
28
- for (var p in m)
29
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p))
30
- __createBinding(exports, m, p);
31
- };
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
32
16
  Object.defineProperty(exports, "__esModule", { value: true });
33
17
  __exportStar(require("./btc"), exports);
34
18
  __exportStar(require("./ckb"), exports);
@@ -1,26 +1,19 @@
1
1
  import { ccc } from "@ckb-ccc/core";
2
2
  import { ConnectionsRepo } from "../connectionsStorage";
3
3
  export declare class BitcoinSigner extends ccc.SignerBtc {
4
- private readonly name;
5
- private readonly icon;
6
- private readonly addressType;
7
- private readonly appUri;
8
- private readonly connectionsRepo;
9
- private connection?;
10
- private assertConnection;
11
- constructor(
12
- client: ccc.Client,
13
- name: string,
14
- icon: string,
15
- addressType?: "auto" | "p2wpkh" | "p2tr",
16
- appUri?: string,
17
- connectionsRepo?: ConnectionsRepo,
18
- );
19
- private getConfig;
20
- getBtcAccount(): Promise<string>;
21
- getBtcPublicKey(): Promise<ccc.Hex>;
22
- connect(): Promise<void>;
23
- isConnected(): Promise<boolean>;
24
- signMessageRaw(message: string | ccc.BytesLike): Promise<string>;
4
+ private readonly name;
5
+ private readonly icon;
6
+ private readonly addressType;
7
+ private readonly appUri;
8
+ private readonly connectionsRepo;
9
+ private connection?;
10
+ private assertConnection;
11
+ constructor(client: ccc.Client, name: string, icon: string, addressType?: "auto" | "p2wpkh" | "p2tr", appUri?: string, connectionsRepo?: ConnectionsRepo);
12
+ private getConfig;
13
+ getBtcAccount(): Promise<string>;
14
+ getBtcPublicKey(): Promise<ccc.Hex>;
15
+ connect(): Promise<void>;
16
+ isConnected(): Promise<boolean>;
17
+ signMessageRaw(message: string | ccc.BytesLike): Promise<string>;
25
18
  }
26
- //# sourceMappingURL=index.d.ts.map
19
+ //# sourceMappingURL=index.d.ts.map
@@ -6,106 +6,80 @@ const common_1 = require("@joyid/common");
6
6
  const common_2 = require("../common");
7
7
  const connectionsStorage_1 = require("../connectionsStorage");
8
8
  class BitcoinSigner extends core_1.ccc.SignerBtc {
9
- assertConnection() {
10
- if (!this.isConnected() || !this.connection) {
11
- throw new Error("Not connected");
9
+ assertConnection() {
10
+ if (!this.isConnected() || !this.connection) {
11
+ throw new Error("Not connected");
12
+ }
13
+ return this.connection;
12
14
  }
13
- return this.connection;
14
- }
15
- constructor(
16
- client,
17
- name,
18
- icon,
19
- addressType = "auto",
20
- appUri = "https://app.joy.id",
21
- connectionsRepo = new connectionsStorage_1.ConnectionsRepoLocalStorage(),
22
- ) {
23
- super(client);
24
- this.name = name;
25
- this.icon = icon;
26
- this.addressType = addressType;
27
- this.appUri = appUri;
28
- this.connectionsRepo = connectionsRepo;
29
- }
30
- getConfig() {
31
- return {
32
- redirectURL: location.href,
33
- joyidAppURL: this.appUri,
34
- requestNetwork: `btc-${this.addressType}`,
35
- name: this.name,
36
- logo: this.icon,
37
- };
38
- }
39
- async getBtcAccount() {
40
- const { address } = this.assertConnection();
41
- return address;
42
- }
43
- async getBtcPublicKey() {
44
- const { publicKey } = this.assertConnection();
45
- return publicKey;
46
- }
47
- async connect() {
48
- const config = this.getConfig();
49
- const res = await (0, common_2.createPopup)(
50
- (0, common_1.buildJoyIDURL)(config, "popup", "/auth"),
51
- {
52
- ...config,
53
- type: common_1.DappRequestType.Auth,
54
- },
55
- );
56
- const { address, pubkey } = (() => {
57
- if (this.addressType === "auto") {
58
- return res.btcAddressType === "p2wpkh" ? res.nativeSegwit : res.taproot;
59
- }
60
- return res.btcAddressType === "p2wpkh" ? res.nativeSegwit : res.taproot;
61
- })();
62
- this.connection = {
63
- address,
64
- publicKey: core_1.ccc.hexFrom(pubkey),
65
- keyType: res.keyType,
66
- };
67
- await Promise.all([
68
- this.connectionsRepo.set(
69
- { uri: this.appUri, addressType: `btc-${res.btcAddressType}` },
70
- this.connection,
71
- ),
72
- this.connectionsRepo.set(
73
- { uri: this.appUri, addressType: "btc-auto" },
74
- this.connection,
75
- ),
76
- ]);
77
- }
78
- async isConnected() {
79
- if (this.connection) {
80
- return true;
15
+ constructor(client, name, icon, addressType = "auto", appUri = "https://app.joy.id", connectionsRepo = new connectionsStorage_1.ConnectionsRepoLocalStorage()) {
16
+ super(client);
17
+ this.name = name;
18
+ this.icon = icon;
19
+ this.addressType = addressType;
20
+ this.appUri = appUri;
21
+ this.connectionsRepo = connectionsRepo;
22
+ }
23
+ getConfig() {
24
+ return {
25
+ redirectURL: location.href,
26
+ joyidAppURL: this.appUri,
27
+ requestNetwork: `btc-${this.addressType}`,
28
+ name: this.name,
29
+ logo: this.icon,
30
+ };
31
+ }
32
+ async getBtcAccount() {
33
+ const { address } = this.assertConnection();
34
+ return address;
35
+ }
36
+ async getBtcPublicKey() {
37
+ const { publicKey } = this.assertConnection();
38
+ return publicKey;
39
+ }
40
+ async connect() {
41
+ const config = this.getConfig();
42
+ const res = await (0, common_2.createPopup)((0, common_1.buildJoyIDURL)(config, "popup", "/auth"), {
43
+ ...config,
44
+ type: common_1.DappRequestType.Auth,
45
+ });
46
+ const { address, pubkey } = (() => {
47
+ if (this.addressType === "auto") {
48
+ return res.btcAddressType === "p2wpkh" ? res.nativeSegwit : res.taproot;
49
+ }
50
+ return res.btcAddressType === "p2wpkh" ? res.nativeSegwit : res.taproot;
51
+ })();
52
+ this.connection = {
53
+ address,
54
+ publicKey: core_1.ccc.hexFrom(pubkey),
55
+ keyType: res.keyType,
56
+ };
57
+ await Promise.all([
58
+ this.connectionsRepo.set({ uri: this.appUri, addressType: `btc-${res.btcAddressType}` }, this.connection),
59
+ this.connectionsRepo.set({ uri: this.appUri, addressType: "btc-auto" }, this.connection),
60
+ ]);
61
+ }
62
+ async isConnected() {
63
+ if (this.connection) {
64
+ return true;
65
+ }
66
+ this.connection = await this.connectionsRepo.get({
67
+ uri: this.appUri,
68
+ addressType: `btc-${this.addressType}`,
69
+ });
70
+ return this.connection !== undefined;
71
+ }
72
+ async signMessageRaw(message) {
73
+ const { address } = this.assertConnection();
74
+ const challenge = typeof message === "string" ? message : core_1.ccc.hexFrom(message).slice(2);
75
+ const config = this.getConfig();
76
+ const { signature } = await (0, common_2.createPopup)((0, common_1.buildJoyIDURL)({
77
+ ...config,
78
+ challenge,
79
+ address,
80
+ signMessageType: "ecdsa",
81
+ }, "popup", "/sign-message"), { ...config, type: common_1.DappRequestType.SignMessage });
82
+ return signature;
81
83
  }
82
- this.connection = await this.connectionsRepo.get({
83
- uri: this.appUri,
84
- addressType: `btc-${this.addressType}`,
85
- });
86
- return this.connection !== undefined;
87
- }
88
- async signMessageRaw(message) {
89
- const { address } = this.assertConnection();
90
- const challenge =
91
- typeof message === "string"
92
- ? message
93
- : core_1.ccc.hexFrom(message).slice(2);
94
- const config = this.getConfig();
95
- const { signature } = await (0, common_2.createPopup)(
96
- (0, common_1.buildJoyIDURL)(
97
- {
98
- ...config,
99
- challenge,
100
- address,
101
- signMessageType: "ecdsa",
102
- },
103
- "popup",
104
- "/sign-message",
105
- ),
106
- { ...config, type: common_1.DappRequestType.SignMessage },
107
- );
108
- return signature;
109
- }
110
84
  }
111
85
  exports.BitcoinSigner = BitcoinSigner;
@@ -1,37 +1,30 @@
1
1
  import { ccc } from "@ckb-ccc/core";
2
2
  import { ConnectionsRepo } from "../connectionsStorage";
3
3
  export declare class CkbSigner extends ccc.Signer {
4
- private readonly name;
5
- private readonly icon;
6
- private readonly _appUri?;
7
- private readonly _aggregatorUri?;
8
- private readonly connectionsRepo;
9
- get type(): ccc.SignerType;
10
- get signType(): ccc.SignerSignType;
11
- private connection?;
12
- private assertConnection;
13
- constructor(
14
- client: ccc.Client,
15
- name: string,
16
- icon: string,
17
- _appUri?: string | undefined,
18
- _aggregatorUri?: string | undefined,
19
- connectionsRepo?: ConnectionsRepo,
20
- );
21
- private getConfig;
22
- private getAggregatorUri;
23
- connect(): Promise<void>;
24
- disconnect(): Promise<void>;
25
- isConnected(): Promise<boolean>;
26
- getInternalAddress(): Promise<string>;
27
- getIdentity(): Promise<string>;
28
- getAddressObj(): Promise<ccc.Address>;
29
- getAddressObjs(): Promise<ccc.Address[]>;
30
- prepareTransaction(txLike: ccc.TransactionLike): Promise<ccc.Transaction>;
31
- private prepareTransactionForSubKey;
32
- signOnlyTransaction(txLike: ccc.TransactionLike): Promise<ccc.Transaction>;
33
- signMessageRaw(message: string | ccc.BytesLike): Promise<string>;
34
- private saveConnection;
35
- private restoreConnection;
4
+ private readonly name;
5
+ private readonly icon;
6
+ private readonly _appUri?;
7
+ private readonly _aggregatorUri?;
8
+ private readonly connectionsRepo;
9
+ get type(): ccc.SignerType;
10
+ get signType(): ccc.SignerSignType;
11
+ private connection?;
12
+ private assertConnection;
13
+ constructor(client: ccc.Client, name: string, icon: string, _appUri?: string | undefined, _aggregatorUri?: string | undefined, connectionsRepo?: ConnectionsRepo);
14
+ private getConfig;
15
+ private getAggregatorUri;
16
+ connect(): Promise<void>;
17
+ disconnect(): Promise<void>;
18
+ isConnected(): Promise<boolean>;
19
+ getInternalAddress(): Promise<string>;
20
+ getIdentity(): Promise<string>;
21
+ getAddressObj(): Promise<ccc.Address>;
22
+ getAddressObjs(): Promise<ccc.Address[]>;
23
+ prepareTransaction(txLike: ccc.TransactionLike): Promise<ccc.Transaction>;
24
+ private prepareTransactionForSubKey;
25
+ signOnlyTransaction(txLike: ccc.TransactionLike): Promise<ccc.Transaction>;
26
+ signMessageRaw(message: string | ccc.BytesLike): Promise<string>;
27
+ private saveConnection;
28
+ private restoreConnection;
36
29
  }
37
- //# sourceMappingURL=index.d.ts.map
30
+ //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ckb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAIpC,OAAO,EAEL,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAE/B,qBAAa,SAAU,SAAQ,GAAG,CAAC,MAAM;IAqBrC,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ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