@onekeyfe/onekey-aptos-provider 1.0.3 → 1.0.4
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.
|
@@ -3,6 +3,7 @@ import { ProviderAptosBase } from './ProviderAptosBase';
|
|
|
3
3
|
import { AptosAccountInfo, SignMessagePayload, SignMessageResponse } from './types';
|
|
4
4
|
import { IJsonRpcRequest } from '@onekeyfe/cross-inpage-provider-types';
|
|
5
5
|
import { Types } from 'aptos';
|
|
6
|
+
export declare type AptosProviderType = 'petra' | 'martian';
|
|
6
7
|
declare const PROVIDER_EVENTS: {
|
|
7
8
|
readonly connect: "connect";
|
|
8
9
|
readonly disconnect: "disconnect";
|
|
@@ -63,6 +64,7 @@ declare type OneKeyAptosProviderProps = IInpageProviderConfig & {
|
|
|
63
64
|
};
|
|
64
65
|
declare class ProviderAptos extends ProviderAptosBase implements IProviderAptos {
|
|
65
66
|
protected _account: AptosAccountInfo | null;
|
|
67
|
+
protected aptosProviderType: AptosProviderType;
|
|
66
68
|
get publicKey(): string | null;
|
|
67
69
|
constructor(props: OneKeyAptosProviderProps);
|
|
68
70
|
private _registerEvents;
|
|
@@ -24,6 +24,7 @@ class ProviderAptos extends ProviderAptosBase {
|
|
|
24
24
|
constructor(props) {
|
|
25
25
|
super(Object.assign(Object.assign({}, props), { bridge: props.bridge || getOrCreateExtInjectedJsBridge({ timeout: props.timeout }) }));
|
|
26
26
|
this._account = null;
|
|
27
|
+
this.aptosProviderType = 'petra';
|
|
27
28
|
this._registerEvents();
|
|
28
29
|
}
|
|
29
30
|
get publicKey() {
|
|
@@ -45,6 +46,7 @@ class ProviderAptos extends ProviderAptosBase {
|
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
48
|
_callBridge(params) {
|
|
49
|
+
params.aptosProviderType = this.aptosProviderType;
|
|
48
50
|
return this.bridgeRequest(params);
|
|
49
51
|
}
|
|
50
52
|
_handleConnected(account, options = { emit: true }) {
|
|
@@ -27,6 +27,7 @@ class ProviderAptos extends ProviderAptosBase_1.ProviderAptosBase {
|
|
|
27
27
|
constructor(props) {
|
|
28
28
|
super(Object.assign(Object.assign({}, props), { bridge: props.bridge || (0, extension_bridge_injected_1.getOrCreateExtInjectedJsBridge)({ timeout: props.timeout }) }));
|
|
29
29
|
this._account = null;
|
|
30
|
+
this.aptosProviderType = 'petra';
|
|
30
31
|
this._registerEvents();
|
|
31
32
|
}
|
|
32
33
|
get publicKey() {
|
|
@@ -48,6 +49,7 @@ class ProviderAptos extends ProviderAptosBase_1.ProviderAptosBase {
|
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
_callBridge(params) {
|
|
52
|
+
params.aptosProviderType = this.aptosProviderType;
|
|
51
53
|
return this.bridgeRequest(params);
|
|
52
54
|
}
|
|
53
55
|
_handleConnected(account, options = { emit: true }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/onekey-aptos-provider",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
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.0.
|
|
32
|
-
"@onekeyfe/cross-inpage-provider-errors": "1.0.
|
|
33
|
-
"@onekeyfe/cross-inpage-provider-types": "1.0.
|
|
34
|
-
"@onekeyfe/extension-bridge-injected": "1.0.
|
|
31
|
+
"@onekeyfe/cross-inpage-provider-core": "1.0.4",
|
|
32
|
+
"@onekeyfe/cross-inpage-provider-errors": "1.0.4",
|
|
33
|
+
"@onekeyfe/cross-inpage-provider-types": "1.0.4",
|
|
34
|
+
"@onekeyfe/extension-bridge-injected": "1.0.4",
|
|
35
35
|
"aptos": "^1.3.13",
|
|
36
36
|
"eth-rpc-errors": "^4.0.3"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "181eadaef7b895a89080f26991170c6ec835ae35"
|
|
39
39
|
}
|