@onekeyfe/onekey-aptos-provider 1.1.52 → 1.1.54-alpha.0

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.
@@ -83,6 +83,11 @@ declare class ProviderAptos extends ProviderAptosBase implements IProviderAptos
83
83
  signTransaction(transactions: any): Promise<any>;
84
84
  signMessage(payload: SignMessagePayload): Promise<SignMessageResponse>;
85
85
  network(): Promise<string>;
86
+ getNetwork(): Promise<{
87
+ name: string;
88
+ url: string;
89
+ chainId: number;
90
+ }>;
86
91
  getNetworkURL(): Promise<string>;
87
92
  disconnect(): Promise<void>;
88
93
  onNetworkChange(listener: AptosProviderEventsMap['networkChange']): this;
@@ -159,6 +159,25 @@ class ProviderAptos extends ProviderAptosBase {
159
159
  params: undefined,
160
160
  });
161
161
  }
162
+ getNetwork() {
163
+ return __awaiter(this, void 0, void 0, function* () {
164
+ const name = yield this._callBridge({
165
+ method: 'network',
166
+ params: undefined,
167
+ });
168
+ const url = yield this._callBridge({
169
+ method: 'getNetworkURL',
170
+ params: undefined,
171
+ });
172
+ // see more chainID https://aptos.dev/nodes/networks
173
+ const chainId = name === 'Mainnet' ? 1 : 2;
174
+ return {
175
+ name,
176
+ url,
177
+ chainId,
178
+ };
179
+ });
180
+ }
162
181
  getNetworkURL() {
163
182
  return this._callBridge({
164
183
  method: 'getNetworkURL',
@@ -162,6 +162,25 @@ class ProviderAptos extends ProviderAptosBase_1.ProviderAptosBase {
162
162
  params: undefined,
163
163
  });
164
164
  }
165
+ getNetwork() {
166
+ return __awaiter(this, void 0, void 0, function* () {
167
+ const name = yield this._callBridge({
168
+ method: 'network',
169
+ params: undefined,
170
+ });
171
+ const url = yield this._callBridge({
172
+ method: 'getNetworkURL',
173
+ params: undefined,
174
+ });
175
+ // see more chainID https://aptos.dev/nodes/networks
176
+ const chainId = name === 'Mainnet' ? 1 : 2;
177
+ return {
178
+ name,
179
+ url,
180
+ chainId,
181
+ };
182
+ });
183
+ }
165
184
  getNetworkURL() {
166
185
  return this._callBridge({
167
186
  method: 'getNetworkURL',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/onekey-aptos-provider",
3
- "version": "1.1.52",
3
+ "version": "1.1.54-alpha.0",
4
4
  "keywords": [
5
5
  "cross-inpage-provider"
6
6
  ],
@@ -28,12 +28,12 @@
28
28
  "start": "tsc --watch"
29
29
  },
30
30
  "dependencies": {
31
- "@onekeyfe/cross-inpage-provider-core": "1.1.52",
32
- "@onekeyfe/cross-inpage-provider-errors": "1.1.52",
33
- "@onekeyfe/cross-inpage-provider-types": "1.1.52",
34
- "@onekeyfe/extension-bridge-injected": "1.1.52",
31
+ "@onekeyfe/cross-inpage-provider-core": "1.1.54-alpha.0",
32
+ "@onekeyfe/cross-inpage-provider-errors": "1.1.54-alpha.0",
33
+ "@onekeyfe/cross-inpage-provider-types": "1.1.54-alpha.0",
34
+ "@onekeyfe/extension-bridge-injected": "1.1.54-alpha.0",
35
35
  "aptos": "^1.3.17",
36
36
  "eth-rpc-errors": "^4.0.3"
37
37
  },
38
- "gitHead": "795ee2fb501fbd6fc88f1a91d77d8d6b33db3c30"
38
+ "gitHead": "7fe9da03f0f492b2c4b2bec151c6b7804eee5d08"
39
39
  }