@onekeyfe/onekey-sui-provider 2.2.26 → 2.2.28
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/OnekeySuiProvider.d.ts +13 -4
- package/dist/OnekeySuiProvider.js +29 -5
- package/dist/OnekeySuiStandardWallet.d.ts +2 -2
- package/dist/OnekeySuiStandardWallet.js +21 -3
- package/dist/ProviderSuiBase.d.ts +2 -1
- package/dist/ProviderSuiBase.js +1 -1
- package/dist/cjs/OnekeySuiProvider.js +31 -7
- package/dist/cjs/OnekeySuiStandardWallet.js +22 -4
- package/dist/cjs/ProviderSuiBase.js +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +7 -7
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { IInpageProviderConfig } from '@onekeyfe/cross-inpage-provider-core';
|
|
2
|
-
import { ProviderSuiBase } from './ProviderSuiBase';
|
|
3
2
|
import type { IJsonRpcRequest } from '@onekeyfe/cross-inpage-provider-types';
|
|
4
|
-
import {
|
|
5
|
-
import type { PermissionType } from './types';
|
|
6
|
-
import { IdentifierString, SuiSignAndExecuteTransactionBlockInput, SuiSignAndExecuteTransactionBlockOutput, SuiSignMessageInput, SuiSignMessageOutput, SuiSignPersonalMessageInput, SuiSignPersonalMessageOutput, SuiSignTransactionBlockInput, SuiSignTransactionBlockOutput } from '@mysten/wallet-standard';
|
|
3
|
+
import { ProviderSuiBase } from './ProviderSuiBase';
|
|
4
|
+
import type { AccountInfo, PermissionType } from './types';
|
|
5
|
+
import type { IdentifierString, SignedTransaction, SuiSignAndExecuteTransactionBlockInput, SuiSignAndExecuteTransactionBlockOutput, SuiSignAndExecuteTransactionInput, SuiSignAndExecuteTransactionOutput, SuiSignMessageInput, SuiSignMessageOutput, SuiSignPersonalMessageInput, SuiSignPersonalMessageOutput, SuiSignTransactionBlockInput, SuiSignTransactionBlockOutput, SuiSignTransactionInput } from '@mysten/wallet-standard';
|
|
7
6
|
declare const PROVIDER_EVENTS: {
|
|
8
7
|
readonly connect: "connect";
|
|
9
8
|
readonly disconnect: "disconnect";
|
|
@@ -37,6 +36,12 @@ type SignPersonalMessageInput = SuiSignPersonalMessageInput & {
|
|
|
37
36
|
messageSerialize: string;
|
|
38
37
|
walletSerialize: string;
|
|
39
38
|
};
|
|
39
|
+
type OneKeySuiSignTransactionInput = Omit<SuiSignTransactionInput, 'transaction' | 'signal'> & {
|
|
40
|
+
transaction: string;
|
|
41
|
+
};
|
|
42
|
+
type OneKeySuiSignAndExecuteTransactionInput = Omit<SuiSignAndExecuteTransactionInput, 'transaction' | 'signal'> & {
|
|
43
|
+
transaction: string;
|
|
44
|
+
};
|
|
40
45
|
export type SuiRequest = {
|
|
41
46
|
'hasPermissions': (permissions: readonly PermissionType[]) => Promise<boolean>;
|
|
42
47
|
'requestPermissions': (permissions: readonly PermissionType[]) => Promise<boolean>;
|
|
@@ -47,6 +52,8 @@ export type SuiRequest = {
|
|
|
47
52
|
'signTransactionBlock': (input: SignTransactionBlockInput) => Promise<SuiSignTransactionBlockOutput>;
|
|
48
53
|
'signMessage': (input: SignMessageInput) => Promise<SuiSignMessageOutput>;
|
|
49
54
|
'signPersonalMessage': (input: SignPersonalMessageInput) => Promise<SuiSignPersonalMessageOutput>;
|
|
55
|
+
'signTransaction': (input: OneKeySuiSignTransactionInput) => Promise<SignedTransaction>;
|
|
56
|
+
'signAndExecuteTransaction': (input: OneKeySuiSignAndExecuteTransactionInput) => Promise<SuiSignAndExecuteTransactionOutput>;
|
|
50
57
|
};
|
|
51
58
|
export type PROVIDER_EVENTS_STRINGS = keyof typeof PROVIDER_EVENTS;
|
|
52
59
|
export interface IProviderSui {
|
|
@@ -89,6 +96,8 @@ declare class ProviderSui extends ProviderSuiBase implements IProviderSui {
|
|
|
89
96
|
signTransactionBlock(input: SuiSignTransactionBlockInput): Promise<SuiSignTransactionBlockOutput>;
|
|
90
97
|
signMessage(input: SuiSignMessageInput): Promise<SuiSignMessageOutput>;
|
|
91
98
|
signPersonalMessage(input: SuiSignPersonalMessageInput): Promise<SuiSignPersonalMessageOutput>;
|
|
99
|
+
signTransaction(input: SuiSignTransactionInput): Promise<SignedTransaction>;
|
|
100
|
+
signAndExecuteTransaction(input: SuiSignAndExecuteTransactionInput): Promise<SuiSignAndExecuteTransactionOutput>;
|
|
92
101
|
isConnected(): boolean;
|
|
93
102
|
onNetworkChange(listener: SuiProviderEventsMap['networkChange']): this;
|
|
94
103
|
onAccountChange(listener: SuiProviderEventsMap['accountChanged']): this;
|
|
@@ -7,11 +7,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
10
|
+
import { Transaction } from '@mysten/sui/transactions';
|
|
11
|
+
import { bytesToHex } from '@onekeyfe/cross-inpage-provider-core';
|
|
12
|
+
import { web3Errors } from '@onekeyfe/cross-inpage-provider-errors';
|
|
11
13
|
import { getOrCreateExtInjectedJsBridge } from '@onekeyfe/extension-bridge-injected';
|
|
12
14
|
import { ProviderSuiBase } from './ProviderSuiBase';
|
|
13
|
-
import { web3Errors } from '@onekeyfe/cross-inpage-provider-errors';
|
|
14
|
-
import { TransactionBlock } from '@mysten/sui.js/transactions';
|
|
15
15
|
import { ALL_PERMISSION_TYPES } from './types';
|
|
16
16
|
const PROVIDER_EVENTS = {
|
|
17
17
|
'connect': 'connect',
|
|
@@ -140,7 +140,7 @@ class ProviderSui extends ProviderSuiBase {
|
|
|
140
140
|
params: Object.assign(Object.assign({}, input), {
|
|
141
141
|
// https://github.com/MystenLabs/sui/blob/ace69fa8404eb704b504082d324ebc355a3d2948/sdk/typescript/src/transactions/object.ts#L6-L17
|
|
142
142
|
// With a few more objects, other wallets have steps for tojson.
|
|
143
|
-
transactionBlock:
|
|
143
|
+
transactionBlock: Transaction.from(input.transactionBlock.serialize()), walletSerialize: JSON.stringify(input.account), blockSerialize: input.transactionBlock.serialize() }),
|
|
144
144
|
});
|
|
145
145
|
});
|
|
146
146
|
}
|
|
@@ -148,7 +148,7 @@ class ProviderSui extends ProviderSuiBase {
|
|
|
148
148
|
return __awaiter(this, void 0, void 0, function* () {
|
|
149
149
|
return this._callBridge({
|
|
150
150
|
method: 'signTransactionBlock',
|
|
151
|
-
params: Object.assign(Object.assign({}, input), { transactionBlock:
|
|
151
|
+
params: Object.assign(Object.assign({}, input), { transactionBlock: Transaction.from(input.transactionBlock.serialize()), walletSerialize: JSON.stringify(input.account), blockSerialize: input.transactionBlock.serialize() }),
|
|
152
152
|
});
|
|
153
153
|
});
|
|
154
154
|
}
|
|
@@ -168,6 +168,30 @@ class ProviderSui extends ProviderSuiBase {
|
|
|
168
168
|
});
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
|
+
signTransaction(input) {
|
|
172
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
173
|
+
return this._callBridge({
|
|
174
|
+
method: 'signTransaction',
|
|
175
|
+
params: {
|
|
176
|
+
transaction: yield input.transaction.toJSON(),
|
|
177
|
+
account: input.account,
|
|
178
|
+
chain: input.chain,
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
signAndExecuteTransaction(input) {
|
|
184
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
+
return this._callBridge({
|
|
186
|
+
method: 'signAndExecuteTransaction',
|
|
187
|
+
params: {
|
|
188
|
+
transaction: yield input.transaction.toJSON(),
|
|
189
|
+
account: input.account,
|
|
190
|
+
chain: input.chain,
|
|
191
|
+
},
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
}
|
|
171
195
|
isConnected() {
|
|
172
196
|
return this._account !== null;
|
|
173
197
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ProviderSui } from './OnekeySuiProvider';
|
|
2
|
-
import { WalletInfo } from './types';
|
|
1
|
+
import type { ProviderSui } from './OnekeySuiProvider';
|
|
2
|
+
import type { WalletInfo } from './types';
|
|
3
3
|
export declare function registerSuiWallet(provider: ProviderSui, options?: WalletInfo): void;
|
|
@@ -7,9 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
10
|
+
import { ReadonlyWalletAccount, SUI_DEVNET_CHAIN, SUI_TESTNET_CHAIN, registerWallet, } from '@mysten/wallet-standard';
|
|
11
11
|
import mitt from 'mitt';
|
|
12
|
-
import {
|
|
12
|
+
import { hexToBytes } from '@onekeyfe/cross-inpage-provider-core';
|
|
13
13
|
import { ALL_PERMISSION_TYPES } from './types';
|
|
14
14
|
var Feature;
|
|
15
15
|
(function (Feature) {
|
|
@@ -20,6 +20,8 @@ var Feature;
|
|
|
20
20
|
Feature["SUI__SIGN_TRANSACTION_BLOCK"] = "sui:signTransactionBlock";
|
|
21
21
|
Feature["SUI__SIGN_MESSAGE"] = "sui:signMessage";
|
|
22
22
|
Feature["SUI__SIGN_PERSONAL_MESSAGE"] = "sui:signPersonalMessage";
|
|
23
|
+
Feature["SUI__SIGN_AND_EXECUTE_TRANSACTION"] = "sui:signAndExecuteTransaction";
|
|
24
|
+
Feature["SUI__SIGN_TRANSACTION"] = "sui:signTransaction";
|
|
23
25
|
})(Feature || (Feature = {}));
|
|
24
26
|
class OnekeySuiStandardWallet {
|
|
25
27
|
get name() {
|
|
@@ -64,9 +66,17 @@ class OnekeySuiStandardWallet {
|
|
|
64
66
|
signMessage: this.$signMessage,
|
|
65
67
|
},
|
|
66
68
|
[Feature.SUI__SIGN_PERSONAL_MESSAGE]: {
|
|
67
|
-
version: '1.
|
|
69
|
+
version: '1.1.0',
|
|
68
70
|
signPersonalMessage: this.$signPersonalMessage,
|
|
69
71
|
},
|
|
72
|
+
[Feature.SUI__SIGN_AND_EXECUTE_TRANSACTION]: {
|
|
73
|
+
version: '2.0.0',
|
|
74
|
+
signAndExecuteTransaction: this.$signAndExecuteTransaction,
|
|
75
|
+
},
|
|
76
|
+
[Feature.SUI__SIGN_TRANSACTION]: {
|
|
77
|
+
version: '2.0.0',
|
|
78
|
+
signTransaction: this.$signTransaction,
|
|
79
|
+
},
|
|
70
80
|
};
|
|
71
81
|
}
|
|
72
82
|
constructor(provider, options) {
|
|
@@ -115,6 +125,12 @@ class OnekeySuiStandardWallet {
|
|
|
115
125
|
this.$signPersonalMessage = (input) => __awaiter(this, void 0, void 0, function* () {
|
|
116
126
|
return this.provider.signPersonalMessage(input);
|
|
117
127
|
});
|
|
128
|
+
this.$signAndExecuteTransaction = (input) => __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
return this.provider.signAndExecuteTransaction(input);
|
|
130
|
+
});
|
|
131
|
+
this.$signTransaction = (input) => __awaiter(this, void 0, void 0, function* () {
|
|
132
|
+
return this.provider.signTransaction(input);
|
|
133
|
+
});
|
|
118
134
|
this.handleAccountSwitch = (payload) => __awaiter(this, void 0, void 0, function* () {
|
|
119
135
|
const { address, publicKey } = payload;
|
|
120
136
|
const activateChain = yield this.getActiveChain();
|
|
@@ -128,6 +144,8 @@ class OnekeySuiStandardWallet {
|
|
|
128
144
|
Feature.SUI__SIGN_TRANSACTION_BLOCK,
|
|
129
145
|
Feature.SUI__SIGN_MESSAGE,
|
|
130
146
|
Feature.SUI__SIGN_PERSONAL_MESSAGE,
|
|
147
|
+
Feature.SUI__SIGN_AND_EXECUTE_TRANSACTION,
|
|
148
|
+
Feature.SUI__SIGN_TRANSACTION,
|
|
131
149
|
],
|
|
132
150
|
});
|
|
133
151
|
this._events.emit('change', {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { IInpageProviderConfig } from '@onekeyfe/cross-inpage-provider-core';
|
|
2
|
+
import { ProviderBase } from '@onekeyfe/cross-inpage-provider-core';
|
|
1
3
|
import { IInjectedProviderNames } from '@onekeyfe/cross-inpage-provider-types';
|
|
2
|
-
import { ProviderBase, IInpageProviderConfig } from '@onekeyfe/cross-inpage-provider-core';
|
|
3
4
|
declare class ProviderSuiBase extends ProviderBase {
|
|
4
5
|
constructor(props: IInpageProviderConfig);
|
|
5
6
|
protected providerName: IInjectedProviderNames;
|
package/dist/ProviderSuiBase.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IInjectedProviderNames } from '@onekeyfe/cross-inpage-provider-types';
|
|
2
1
|
import { ProviderBase } from '@onekeyfe/cross-inpage-provider-core';
|
|
2
|
+
import { IInjectedProviderNames } from '@onekeyfe/cross-inpage-provider-types';
|
|
3
3
|
class ProviderSuiBase extends ProviderBase {
|
|
4
4
|
constructor(props) {
|
|
5
5
|
super(props);
|
|
@@ -10,11 +10,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ProviderSui = void 0;
|
|
13
|
-
const
|
|
13
|
+
const transactions_1 = require("@mysten/sui/transactions");
|
|
14
|
+
const cross_inpage_provider_core_1 = require("@onekeyfe/cross-inpage-provider-core");
|
|
15
|
+
const cross_inpage_provider_errors_1 = require("@onekeyfe/cross-inpage-provider-errors");
|
|
14
16
|
const extension_bridge_injected_1 = require("@onekeyfe/extension-bridge-injected");
|
|
15
17
|
const ProviderSuiBase_1 = require("./ProviderSuiBase");
|
|
16
|
-
const cross_inpage_provider_errors_1 = require("@onekeyfe/cross-inpage-provider-errors");
|
|
17
|
-
const transactions_1 = require("@mysten/sui.js/transactions");
|
|
18
18
|
const types_1 = require("./types");
|
|
19
19
|
const PROVIDER_EVENTS = {
|
|
20
20
|
'connect': 'connect',
|
|
@@ -143,7 +143,7 @@ class ProviderSui extends ProviderSuiBase_1.ProviderSuiBase {
|
|
|
143
143
|
params: Object.assign(Object.assign({}, input), {
|
|
144
144
|
// https://github.com/MystenLabs/sui/blob/ace69fa8404eb704b504082d324ebc355a3d2948/sdk/typescript/src/transactions/object.ts#L6-L17
|
|
145
145
|
// With a few more objects, other wallets have steps for tojson.
|
|
146
|
-
transactionBlock: transactions_1.
|
|
146
|
+
transactionBlock: transactions_1.Transaction.from(input.transactionBlock.serialize()), walletSerialize: JSON.stringify(input.account), blockSerialize: input.transactionBlock.serialize() }),
|
|
147
147
|
});
|
|
148
148
|
});
|
|
149
149
|
}
|
|
@@ -151,7 +151,7 @@ class ProviderSui extends ProviderSuiBase_1.ProviderSuiBase {
|
|
|
151
151
|
return __awaiter(this, void 0, void 0, function* () {
|
|
152
152
|
return this._callBridge({
|
|
153
153
|
method: 'signTransactionBlock',
|
|
154
|
-
params: Object.assign(Object.assign({}, input), { transactionBlock: transactions_1.
|
|
154
|
+
params: Object.assign(Object.assign({}, input), { transactionBlock: transactions_1.Transaction.from(input.transactionBlock.serialize()), walletSerialize: JSON.stringify(input.account), blockSerialize: input.transactionBlock.serialize() }),
|
|
155
155
|
});
|
|
156
156
|
});
|
|
157
157
|
}
|
|
@@ -159,7 +159,7 @@ class ProviderSui extends ProviderSuiBase_1.ProviderSuiBase {
|
|
|
159
159
|
return __awaiter(this, void 0, void 0, function* () {
|
|
160
160
|
return this._callBridge({
|
|
161
161
|
method: 'signMessage',
|
|
162
|
-
params: Object.assign(Object.assign({}, input), { walletSerialize: JSON.stringify(input.account), messageSerialize: (0,
|
|
162
|
+
params: Object.assign(Object.assign({}, input), { walletSerialize: JSON.stringify(input.account), messageSerialize: (0, cross_inpage_provider_core_1.bytesToHex)(input.message) }),
|
|
163
163
|
});
|
|
164
164
|
});
|
|
165
165
|
}
|
|
@@ -167,7 +167,31 @@ class ProviderSui extends ProviderSuiBase_1.ProviderSuiBase {
|
|
|
167
167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
168
168
|
return this._callBridge({
|
|
169
169
|
method: 'signPersonalMessage',
|
|
170
|
-
params: Object.assign(Object.assign({}, input), { walletSerialize: JSON.stringify(input.account), messageSerialize: (0,
|
|
170
|
+
params: Object.assign(Object.assign({}, input), { walletSerialize: JSON.stringify(input.account), messageSerialize: (0, cross_inpage_provider_core_1.bytesToHex)(input.message) }),
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
signTransaction(input) {
|
|
175
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
176
|
+
return this._callBridge({
|
|
177
|
+
method: 'signTransaction',
|
|
178
|
+
params: {
|
|
179
|
+
transaction: yield input.transaction.toJSON(),
|
|
180
|
+
account: input.account,
|
|
181
|
+
chain: input.chain,
|
|
182
|
+
},
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
signAndExecuteTransaction(input) {
|
|
187
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
188
|
+
return this._callBridge({
|
|
189
|
+
method: 'signAndExecuteTransaction',
|
|
190
|
+
params: {
|
|
191
|
+
transaction: yield input.transaction.toJSON(),
|
|
192
|
+
account: input.account,
|
|
193
|
+
chain: input.chain,
|
|
194
|
+
},
|
|
171
195
|
});
|
|
172
196
|
});
|
|
173
197
|
}
|
|
@@ -13,9 +13,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.registerSuiWallet = registerSuiWallet;
|
|
16
|
-
const utils_1 = require("@noble/hashes/utils");
|
|
17
|
-
const mitt_1 = __importDefault(require("mitt"));
|
|
18
16
|
const wallet_standard_1 = require("@mysten/wallet-standard");
|
|
17
|
+
const mitt_1 = __importDefault(require("mitt"));
|
|
18
|
+
const cross_inpage_provider_core_1 = require("@onekeyfe/cross-inpage-provider-core");
|
|
19
19
|
const types_1 = require("./types");
|
|
20
20
|
var Feature;
|
|
21
21
|
(function (Feature) {
|
|
@@ -26,6 +26,8 @@ var Feature;
|
|
|
26
26
|
Feature["SUI__SIGN_TRANSACTION_BLOCK"] = "sui:signTransactionBlock";
|
|
27
27
|
Feature["SUI__SIGN_MESSAGE"] = "sui:signMessage";
|
|
28
28
|
Feature["SUI__SIGN_PERSONAL_MESSAGE"] = "sui:signPersonalMessage";
|
|
29
|
+
Feature["SUI__SIGN_AND_EXECUTE_TRANSACTION"] = "sui:signAndExecuteTransaction";
|
|
30
|
+
Feature["SUI__SIGN_TRANSACTION"] = "sui:signTransaction";
|
|
29
31
|
})(Feature || (Feature = {}));
|
|
30
32
|
class OnekeySuiStandardWallet {
|
|
31
33
|
get name() {
|
|
@@ -70,9 +72,17 @@ class OnekeySuiStandardWallet {
|
|
|
70
72
|
signMessage: this.$signMessage,
|
|
71
73
|
},
|
|
72
74
|
[Feature.SUI__SIGN_PERSONAL_MESSAGE]: {
|
|
73
|
-
version: '1.
|
|
75
|
+
version: '1.1.0',
|
|
74
76
|
signPersonalMessage: this.$signPersonalMessage,
|
|
75
77
|
},
|
|
78
|
+
[Feature.SUI__SIGN_AND_EXECUTE_TRANSACTION]: {
|
|
79
|
+
version: '2.0.0',
|
|
80
|
+
signAndExecuteTransaction: this.$signAndExecuteTransaction,
|
|
81
|
+
},
|
|
82
|
+
[Feature.SUI__SIGN_TRANSACTION]: {
|
|
83
|
+
version: '2.0.0',
|
|
84
|
+
signTransaction: this.$signTransaction,
|
|
85
|
+
},
|
|
76
86
|
};
|
|
77
87
|
}
|
|
78
88
|
constructor(provider, options) {
|
|
@@ -121,12 +131,18 @@ class OnekeySuiStandardWallet {
|
|
|
121
131
|
this.$signPersonalMessage = (input) => __awaiter(this, void 0, void 0, function* () {
|
|
122
132
|
return this.provider.signPersonalMessage(input);
|
|
123
133
|
});
|
|
134
|
+
this.$signAndExecuteTransaction = (input) => __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
return this.provider.signAndExecuteTransaction(input);
|
|
136
|
+
});
|
|
137
|
+
this.$signTransaction = (input) => __awaiter(this, void 0, void 0, function* () {
|
|
138
|
+
return this.provider.signTransaction(input);
|
|
139
|
+
});
|
|
124
140
|
this.handleAccountSwitch = (payload) => __awaiter(this, void 0, void 0, function* () {
|
|
125
141
|
const { address, publicKey } = payload;
|
|
126
142
|
const activateChain = yield this.getActiveChain();
|
|
127
143
|
this._account = new wallet_standard_1.ReadonlyWalletAccount({
|
|
128
144
|
address: address,
|
|
129
|
-
publicKey: (0,
|
|
145
|
+
publicKey: (0, cross_inpage_provider_core_1.hexToBytes)(publicKey),
|
|
130
146
|
chains: activateChain ? [activateChain] : [],
|
|
131
147
|
features: [
|
|
132
148
|
Feature.STANDARD__CONNECT,
|
|
@@ -134,6 +150,8 @@ class OnekeySuiStandardWallet {
|
|
|
134
150
|
Feature.SUI__SIGN_TRANSACTION_BLOCK,
|
|
135
151
|
Feature.SUI__SIGN_MESSAGE,
|
|
136
152
|
Feature.SUI__SIGN_PERSONAL_MESSAGE,
|
|
153
|
+
Feature.SUI__SIGN_AND_EXECUTE_TRANSACTION,
|
|
154
|
+
Feature.SUI__SIGN_TRANSACTION,
|
|
137
155
|
],
|
|
138
156
|
});
|
|
139
157
|
this._events.emit('change', {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProviderSuiBase = void 0;
|
|
4
|
-
const cross_inpage_provider_types_1 = require("@onekeyfe/cross-inpage-provider-types");
|
|
5
4
|
const cross_inpage_provider_core_1 = require("@onekeyfe/cross-inpage-provider-core");
|
|
5
|
+
const cross_inpage_provider_types_1 = require("@onekeyfe/cross-inpage-provider-types");
|
|
6
6
|
class ProviderSuiBase extends cross_inpage_provider_core_1.ProviderBase {
|
|
7
7
|
constructor(props) {
|
|
8
8
|
super(props);
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SuiChain } from '@mysten/wallet-standard';
|
|
1
|
+
import type { SuiChain } from '@mysten/wallet-standard';
|
|
2
2
|
export declare const ALL_PERMISSION_TYPES: readonly ["viewAccount", "suggestTransactions"];
|
|
3
3
|
type AllPermissionsType = typeof ALL_PERMISSION_TYPES;
|
|
4
4
|
export type PermissionType = AllPermissionsType[number];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/onekey-sui-provider",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.28",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"cross-inpage-provider"
|
|
6
6
|
],
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"start": "tsc --watch"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@mysten/wallet-standard": "^0.
|
|
32
|
-
"@onekeyfe/cross-inpage-provider-core": "2.2.
|
|
33
|
-
"@onekeyfe/cross-inpage-provider-errors": "2.2.
|
|
34
|
-
"@onekeyfe/cross-inpage-provider-types": "2.2.
|
|
35
|
-
"@onekeyfe/extension-bridge-injected": "2.2.
|
|
31
|
+
"@mysten/wallet-standard": "^0.14.0",
|
|
32
|
+
"@onekeyfe/cross-inpage-provider-core": "2.2.28",
|
|
33
|
+
"@onekeyfe/cross-inpage-provider-errors": "2.2.28",
|
|
34
|
+
"@onekeyfe/cross-inpage-provider-types": "2.2.28",
|
|
35
|
+
"@onekeyfe/extension-bridge-injected": "2.2.28",
|
|
36
36
|
"eth-rpc-errors": "^4.0.3",
|
|
37
37
|
"mitt": "^3.0.0"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "473ece52d08eeb9eed490a3172fad5f954338800"
|
|
40
40
|
}
|