@onekeyfe/onekey-ton-provider 2.2.41 → 2.2.43
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/dist/OnekeyTonProvider.js +14 -3
- package/dist/cjs/OnekeyTonProvider.js +14 -3
- package/dist/cjs/types.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/package.json +6 -6
|
@@ -18,6 +18,8 @@ const PROVIDER_EVENTS = {
|
|
|
18
18
|
};
|
|
19
19
|
const TonResponseError = {
|
|
20
20
|
ParameterError: 1,
|
|
21
|
+
InvalidManifestUrl: 2,
|
|
22
|
+
ContentManifest: 3,
|
|
21
23
|
};
|
|
22
24
|
function isWalletEventMethodMatch({ method, name }) {
|
|
23
25
|
return method === `wallet_events_${name}`;
|
|
@@ -56,7 +58,7 @@ export class ProviderTon extends ProviderTonBase {
|
|
|
56
58
|
appName: 'onekey',
|
|
57
59
|
appVersion: this.version,
|
|
58
60
|
maxProtocolVersion: 2,
|
|
59
|
-
features: [{ name: 'SendTransaction', maxMessages: 4 }],
|
|
61
|
+
features: ["SendTransaction", { name: 'SendTransaction', maxMessages: 4 }],
|
|
60
62
|
};
|
|
61
63
|
this.walletInfo = {
|
|
62
64
|
name: 'OneKey',
|
|
@@ -176,7 +178,7 @@ export class ProviderTon extends ProviderTonBase {
|
|
|
176
178
|
});
|
|
177
179
|
}
|
|
178
180
|
catch (error) {
|
|
179
|
-
const { code } = error;
|
|
181
|
+
const { code, message } = error;
|
|
180
182
|
if (code === 4001) {
|
|
181
183
|
return {
|
|
182
184
|
event: 'connect_error',
|
|
@@ -187,8 +189,17 @@ export class ProviderTon extends ProviderTonBase {
|
|
|
187
189
|
},
|
|
188
190
|
};
|
|
189
191
|
}
|
|
192
|
+
else if (code === TonResponseError.InvalidManifestUrl || code === TonResponseError.ContentManifest) {
|
|
193
|
+
return {
|
|
194
|
+
event: 'connect_error',
|
|
195
|
+
id,
|
|
196
|
+
payload: {
|
|
197
|
+
code,
|
|
198
|
+
message: message !== null && message !== void 0 ? message : "",
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
}
|
|
190
202
|
}
|
|
191
|
-
console.log('=====>>>>> connect result', result);
|
|
192
203
|
if (!result) {
|
|
193
204
|
return {
|
|
194
205
|
event: 'connect_error',
|
|
@@ -23,6 +23,8 @@ const PROVIDER_EVENTS = {
|
|
|
23
23
|
};
|
|
24
24
|
const TonResponseError = {
|
|
25
25
|
ParameterError: 1,
|
|
26
|
+
InvalidManifestUrl: 2,
|
|
27
|
+
ContentManifest: 3,
|
|
26
28
|
};
|
|
27
29
|
function isWalletEventMethodMatch({ method, name }) {
|
|
28
30
|
return method === `wallet_events_${name}`;
|
|
@@ -61,7 +63,7 @@ class ProviderTon extends ProviderTonBase_1.ProviderTonBase {
|
|
|
61
63
|
appName: 'onekey',
|
|
62
64
|
appVersion: this.version,
|
|
63
65
|
maxProtocolVersion: 2,
|
|
64
|
-
features: [{ name: 'SendTransaction', maxMessages: 4 }],
|
|
66
|
+
features: ["SendTransaction", { name: 'SendTransaction', maxMessages: 4 }],
|
|
65
67
|
};
|
|
66
68
|
this.walletInfo = {
|
|
67
69
|
name: 'OneKey',
|
|
@@ -181,7 +183,7 @@ class ProviderTon extends ProviderTonBase_1.ProviderTonBase {
|
|
|
181
183
|
});
|
|
182
184
|
}
|
|
183
185
|
catch (error) {
|
|
184
|
-
const { code } = error;
|
|
186
|
+
const { code, message } = error;
|
|
185
187
|
if (code === 4001) {
|
|
186
188
|
return {
|
|
187
189
|
event: 'connect_error',
|
|
@@ -192,8 +194,17 @@ class ProviderTon extends ProviderTonBase_1.ProviderTonBase {
|
|
|
192
194
|
},
|
|
193
195
|
};
|
|
194
196
|
}
|
|
197
|
+
else if (code === TonResponseError.InvalidManifestUrl || code === TonResponseError.ContentManifest) {
|
|
198
|
+
return {
|
|
199
|
+
event: 'connect_error',
|
|
200
|
+
id,
|
|
201
|
+
payload: {
|
|
202
|
+
code,
|
|
203
|
+
message: message !== null && message !== void 0 ? message : "",
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
}
|
|
195
207
|
}
|
|
196
|
-
console.log('=====>>>>> connect result', result);
|
|
197
208
|
if (!result) {
|
|
198
209
|
return {
|
|
199
210
|
event: 'connect_error',
|
package/dist/cjs/types.js
CHANGED
|
@@ -15,6 +15,6 @@ var SendTransactionErrorMessage;
|
|
|
15
15
|
SendTransactionErrorMessage["UNKNOWN_ERROR"] = "Unknown error";
|
|
16
16
|
SendTransactionErrorMessage["BAD_REQUEST_ERROR"] = "Bad request";
|
|
17
17
|
SendTransactionErrorMessage["UNKNOWN_APP_ERROR"] = "Unknown app";
|
|
18
|
-
SendTransactionErrorMessage["USER_REJECTS_ERROR"] = "User
|
|
18
|
+
SendTransactionErrorMessage["USER_REJECTS_ERROR"] = "User declined the transaction";
|
|
19
19
|
SendTransactionErrorMessage["METHOD_NOT_SUPPORTED"] = "Method is not supported";
|
|
20
20
|
})(SendTransactionErrorMessage || (exports.SendTransactionErrorMessage = SendTransactionErrorMessage = {}));
|
package/dist/types.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare enum SendTransactionErrorMessage {
|
|
|
17
17
|
UNKNOWN_ERROR = "Unknown error",
|
|
18
18
|
BAD_REQUEST_ERROR = "Bad request",
|
|
19
19
|
UNKNOWN_APP_ERROR = "Unknown app",
|
|
20
|
-
USER_REJECTS_ERROR = "User
|
|
20
|
+
USER_REJECTS_ERROR = "User declined the transaction",
|
|
21
21
|
METHOD_NOT_SUPPORTED = "Method is not supported"
|
|
22
22
|
}
|
|
23
23
|
export interface AccountInfo {
|
package/dist/types.js
CHANGED
|
@@ -12,6 +12,6 @@ export var SendTransactionErrorMessage;
|
|
|
12
12
|
SendTransactionErrorMessage["UNKNOWN_ERROR"] = "Unknown error";
|
|
13
13
|
SendTransactionErrorMessage["BAD_REQUEST_ERROR"] = "Bad request";
|
|
14
14
|
SendTransactionErrorMessage["UNKNOWN_APP_ERROR"] = "Unknown app";
|
|
15
|
-
SendTransactionErrorMessage["USER_REJECTS_ERROR"] = "User
|
|
15
|
+
SendTransactionErrorMessage["USER_REJECTS_ERROR"] = "User declined the transaction";
|
|
16
16
|
SendTransactionErrorMessage["METHOD_NOT_SUPPORTED"] = "Method is not supported";
|
|
17
17
|
})(SendTransactionErrorMessage || (SendTransactionErrorMessage = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/onekey-ton-provider",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.43",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"cross-inpage-provider"
|
|
6
6
|
],
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"start": "tsc --watch"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@onekeyfe/cross-inpage-provider-core": "2.2.
|
|
31
|
-
"@onekeyfe/cross-inpage-provider-errors": "2.2.
|
|
32
|
-
"@onekeyfe/cross-inpage-provider-types": "2.2.
|
|
33
|
-
"@onekeyfe/extension-bridge-injected": "2.2.
|
|
30
|
+
"@onekeyfe/cross-inpage-provider-core": "2.2.43",
|
|
31
|
+
"@onekeyfe/cross-inpage-provider-errors": "2.2.43",
|
|
32
|
+
"@onekeyfe/cross-inpage-provider-types": "2.2.43",
|
|
33
|
+
"@onekeyfe/extension-bridge-injected": "2.2.43",
|
|
34
34
|
"@tonconnect/protocol": "^2.3.0"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "c0402a33d082e18d93f59c8c1d7bee969ad480d6"
|
|
37
37
|
}
|