@onekeyfe/onekey-ton-provider 2.2.52 → 2.2.53
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.
|
@@ -58,7 +58,11 @@ export class ProviderTon extends ProviderTonBase {
|
|
|
58
58
|
appName: 'onekey',
|
|
59
59
|
appVersion: this.version,
|
|
60
60
|
maxProtocolVersion: 2,
|
|
61
|
-
features: [
|
|
61
|
+
features: [
|
|
62
|
+
'SendTransaction',
|
|
63
|
+
{ name: 'SendTransaction', maxMessages: 4 },
|
|
64
|
+
{ name: 'SignData', types: ['text', 'binary', 'cell'] },
|
|
65
|
+
],
|
|
62
66
|
};
|
|
63
67
|
this.walletInfo = {
|
|
64
68
|
name: 'OneKey',
|
|
@@ -189,13 +193,14 @@ export class ProviderTon extends ProviderTonBase {
|
|
|
189
193
|
},
|
|
190
194
|
};
|
|
191
195
|
}
|
|
192
|
-
else if (code === TonResponseError.InvalidManifestUrl ||
|
|
196
|
+
else if (code === TonResponseError.InvalidManifestUrl ||
|
|
197
|
+
code === TonResponseError.ContentManifest) {
|
|
193
198
|
return {
|
|
194
199
|
event: 'connect_error',
|
|
195
200
|
id,
|
|
196
201
|
payload: {
|
|
197
202
|
code,
|
|
198
|
-
message: message !== null && message !== void 0 ? message :
|
|
203
|
+
message: message !== null && message !== void 0 ? message : '',
|
|
199
204
|
},
|
|
200
205
|
};
|
|
201
206
|
}
|
|
@@ -321,6 +326,7 @@ export class ProviderTon extends ProviderTonBase {
|
|
|
321
326
|
}
|
|
322
327
|
return p;
|
|
323
328
|
});
|
|
329
|
+
console.log('=====>>>>> send params', message);
|
|
324
330
|
if (message.method === 'sendTransaction') {
|
|
325
331
|
res = yield this._sendTransaction(params[0]);
|
|
326
332
|
}
|
|
@@ -63,7 +63,11 @@ class ProviderTon extends ProviderTonBase_1.ProviderTonBase {
|
|
|
63
63
|
appName: 'onekey',
|
|
64
64
|
appVersion: this.version,
|
|
65
65
|
maxProtocolVersion: 2,
|
|
66
|
-
features: [
|
|
66
|
+
features: [
|
|
67
|
+
'SendTransaction',
|
|
68
|
+
{ name: 'SendTransaction', maxMessages: 4 },
|
|
69
|
+
{ name: 'SignData', types: ['text', 'binary', 'cell'] },
|
|
70
|
+
],
|
|
67
71
|
};
|
|
68
72
|
this.walletInfo = {
|
|
69
73
|
name: 'OneKey',
|
|
@@ -194,13 +198,14 @@ class ProviderTon extends ProviderTonBase_1.ProviderTonBase {
|
|
|
194
198
|
},
|
|
195
199
|
};
|
|
196
200
|
}
|
|
197
|
-
else if (code === TonResponseError.InvalidManifestUrl ||
|
|
201
|
+
else if (code === TonResponseError.InvalidManifestUrl ||
|
|
202
|
+
code === TonResponseError.ContentManifest) {
|
|
198
203
|
return {
|
|
199
204
|
event: 'connect_error',
|
|
200
205
|
id,
|
|
201
206
|
payload: {
|
|
202
207
|
code,
|
|
203
|
-
message: message !== null && message !== void 0 ? message :
|
|
208
|
+
message: message !== null && message !== void 0 ? message : '',
|
|
204
209
|
},
|
|
205
210
|
};
|
|
206
211
|
}
|
|
@@ -326,6 +331,7 @@ class ProviderTon extends ProviderTonBase_1.ProviderTonBase {
|
|
|
326
331
|
}
|
|
327
332
|
return p;
|
|
328
333
|
});
|
|
334
|
+
console.log('=====>>>>> send params', message);
|
|
329
335
|
if (message.method === 'sendTransaction') {
|
|
330
336
|
res = yield this._sendTransaction(params[0]);
|
|
331
337
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CHAIN } from
|
|
1
|
+
import { CHAIN } from '@tonconnect/protocol';
|
|
2
2
|
export declare enum ConnectEventErrorMessage {
|
|
3
3
|
UNKNOWN_ERROR = "Unknown error",
|
|
4
4
|
BAD_REQUEST = "Bad request",
|
|
@@ -38,15 +38,35 @@ export interface TransactionRequest {
|
|
|
38
38
|
from?: string;
|
|
39
39
|
messages: Message[];
|
|
40
40
|
}
|
|
41
|
-
export
|
|
41
|
+
export type SignDataPayloadText = {
|
|
42
|
+
type: 'text';
|
|
43
|
+
text: string;
|
|
44
|
+
};
|
|
45
|
+
export type SignDataPayloadBinary = {
|
|
46
|
+
type: 'binary';
|
|
47
|
+
bytes: string;
|
|
48
|
+
};
|
|
49
|
+
export type SignDataPayloadCell = {
|
|
50
|
+
type: 'cell';
|
|
51
|
+
schema: string;
|
|
52
|
+
cell: string;
|
|
53
|
+
};
|
|
54
|
+
export interface SignDataPayloadLegacy {
|
|
42
55
|
schema_crc: number;
|
|
43
56
|
cell: string;
|
|
44
57
|
publicKey?: string;
|
|
45
58
|
}
|
|
46
|
-
export
|
|
59
|
+
export type SignDataRequest = SignDataPayloadLegacy | SignDataPayloadText | SignDataPayloadBinary | SignDataPayloadCell;
|
|
60
|
+
export type SignDataResult = {
|
|
47
61
|
signature: string;
|
|
48
62
|
timestamp: number;
|
|
49
|
-
}
|
|
63
|
+
} & {
|
|
64
|
+
signature: string;
|
|
65
|
+
address: string;
|
|
66
|
+
timestamp: number;
|
|
67
|
+
domain: string;
|
|
68
|
+
payload: SignDataRequest;
|
|
69
|
+
};
|
|
50
70
|
export interface SignProofRequest {
|
|
51
71
|
payload: string;
|
|
52
72
|
}
|
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.53",
|
|
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.53",
|
|
31
|
+
"@onekeyfe/cross-inpage-provider-errors": "2.2.53",
|
|
32
|
+
"@onekeyfe/cross-inpage-provider-types": "2.2.53",
|
|
33
|
+
"@onekeyfe/extension-bridge-injected": "2.2.53",
|
|
34
34
|
"@tonconnect/protocol": "^2.3.0"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "e29547b5b3e20346bb0567e4029687bfb962ffc2"
|
|
37
37
|
}
|