@aptos-labs/wallet-adapter-core 2.4.0 → 2.5.1
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/CHANGELOG.md +12 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +7 -0
- package/dist/index.mjs +5 -0
- package/package.json +2 -2
- package/src/types.ts +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @aptos-labs/wallet-adapter-core
|
|
2
2
|
|
|
3
|
+
## 2.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7e314e5: Update aptos dependency
|
|
8
|
+
|
|
9
|
+
## 2.5.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- c95933a: Update the `onNetworkChange` type interface to conform with `WalletCore`'s usage of the callback
|
|
14
|
+
|
|
3
15
|
## 2.4.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Types, TxnBuilderTypes } from 'aptos';
|
|
2
|
+
export { TxnBuilderTypes, Types } from 'aptos';
|
|
2
3
|
import EventEmitter from 'eventemitter3';
|
|
3
4
|
|
|
4
5
|
declare enum WalletReadyState {
|
|
@@ -45,6 +46,7 @@ interface AptosWalletErrorResult {
|
|
|
45
46
|
name: string;
|
|
46
47
|
message: string;
|
|
47
48
|
}
|
|
49
|
+
declare type OnNetworkChange = (callBack: (networkInfo: NetworkInfo) => Promise<void>) => Promise<void>;
|
|
48
50
|
interface PluginProvider {
|
|
49
51
|
connect: () => Promise<AccountInfo>;
|
|
50
52
|
account: () => Promise<AccountInfo>;
|
|
@@ -55,12 +57,10 @@ interface PluginProvider {
|
|
|
55
57
|
signMessage: (message: SignMessagePayload) => Promise<SignMessageResponse>;
|
|
56
58
|
network: () => Promise<NetworkName>;
|
|
57
59
|
onAccountChange: (listener: (newAddress: AccountInfo) => Promise<void>) => Promise<void>;
|
|
58
|
-
onNetworkChange:
|
|
59
|
-
networkName: NetworkInfo;
|
|
60
|
-
}) => Promise<void>) => Promise<void>;
|
|
60
|
+
onNetworkChange: OnNetworkChange;
|
|
61
61
|
}
|
|
62
62
|
interface AdapterPluginEvents {
|
|
63
|
-
onNetworkChange
|
|
63
|
+
onNetworkChange: OnNetworkChange;
|
|
64
64
|
onAccountChange(callback: any): Promise<any>;
|
|
65
65
|
}
|
|
66
66
|
interface AdapterPluginProps<Name extends string = string> {
|
|
@@ -233,4 +233,4 @@ declare function isMobile(): boolean;
|
|
|
233
233
|
declare function isInAppBrowser(): boolean;
|
|
234
234
|
declare function isRedirectable(): boolean;
|
|
235
235
|
|
|
236
|
-
export { AccountInfo, AdapterPlugin, AdapterPluginEvents, AdapterPluginProps, AptosWalletErrorResult, NetworkInfo, NetworkName, PluginProvider, SignMessagePayload, SignMessageResponse, TransactionOptions, Wallet, WalletCore, WalletCoreEvents, WalletInfo, WalletName, WalletReadyState, getLocalStorage, isInAppBrowser, isMobile, isRedirectable, removeLocalStorage, scopePollingDetectionStrategy, setLocalStorage };
|
|
236
|
+
export { AccountInfo, AdapterPlugin, AdapterPluginEvents, AdapterPluginProps, AptosWalletErrorResult, NetworkInfo, NetworkName, OnNetworkChange, PluginProvider, SignMessagePayload, SignMessageResponse, TransactionOptions, Wallet, WalletCore, WalletCoreEvents, WalletInfo, WalletName, WalletReadyState, getLocalStorage, isInAppBrowser, isMobile, isRedirectable, removeLocalStorage, scopePollingDetectionStrategy, setLocalStorage };
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
27
27
|
var src_exports = {};
|
|
28
28
|
__export(src_exports, {
|
|
29
29
|
NetworkName: () => NetworkName,
|
|
30
|
+
TxnBuilderTypes: () => import_aptos2.TxnBuilderTypes,
|
|
31
|
+
Types: () => import_aptos2.Types,
|
|
30
32
|
WalletCore: () => WalletCore,
|
|
31
33
|
WalletReadyState: () => WalletReadyState,
|
|
32
34
|
getLocalStorage: () => getLocalStorage,
|
|
@@ -543,9 +545,14 @@ var WalletCore = class extends import_eventemitter3.default {
|
|
|
543
545
|
}
|
|
544
546
|
}
|
|
545
547
|
};
|
|
548
|
+
|
|
549
|
+
// src/types.ts
|
|
550
|
+
var import_aptos2 = require("aptos");
|
|
546
551
|
// Annotate the CommonJS export names for ESM import in node:
|
|
547
552
|
0 && (module.exports = {
|
|
548
553
|
NetworkName,
|
|
554
|
+
TxnBuilderTypes,
|
|
555
|
+
Types,
|
|
549
556
|
WalletCore,
|
|
550
557
|
WalletReadyState,
|
|
551
558
|
getLocalStorage,
|
package/dist/index.mjs
CHANGED
|
@@ -502,8 +502,13 @@ var WalletCore = class extends EventEmitter {
|
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
504
|
};
|
|
505
|
+
|
|
506
|
+
// src/types.ts
|
|
507
|
+
import { TxnBuilderTypes as TxnBuilderTypes2, Types as Types2 } from "aptos";
|
|
505
508
|
export {
|
|
506
509
|
NetworkName,
|
|
510
|
+
TxnBuilderTypes2 as TxnBuilderTypes,
|
|
511
|
+
Types2 as Types,
|
|
507
512
|
WalletCore,
|
|
508
513
|
WalletReadyState,
|
|
509
514
|
getLocalStorage,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aptos-labs/wallet-adapter-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "Aptos Wallet Adapter Core",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@aptos-labs/wallet-adapter-tsconfig": "0.0.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"aptos": "^1.
|
|
41
|
+
"aptos": "^1.14.0",
|
|
42
42
|
"buffer": "^6.0.3",
|
|
43
43
|
"eventemitter3": "^4.0.7",
|
|
44
44
|
"tweetnacl": "^1.0.3"
|
package/src/types.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Types } from "aptos";
|
|
2
2
|
import { NetworkName, WalletReadyState } from "./constants";
|
|
3
3
|
|
|
4
|
+
export { TxnBuilderTypes, Types } from "aptos";
|
|
4
5
|
// WalletName is a nominal type that wallet adapters should use, e.g. `'MyCryptoWallet' as WalletName<'MyCryptoWallet'>`
|
|
5
6
|
export type WalletName<T extends string = string> = T & {
|
|
6
7
|
__brand__: "WalletName";
|
|
@@ -24,6 +25,10 @@ export interface AptosWalletErrorResult {
|
|
|
24
25
|
message: string;
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
export type OnNetworkChange = (
|
|
29
|
+
callBack: (networkInfo: NetworkInfo) => Promise<void>
|
|
30
|
+
) => Promise<void>;
|
|
31
|
+
|
|
27
32
|
export interface PluginProvider {
|
|
28
33
|
connect: () => Promise<AccountInfo>;
|
|
29
34
|
account: () => Promise<AccountInfo>;
|
|
@@ -37,13 +42,11 @@ export interface PluginProvider {
|
|
|
37
42
|
onAccountChange: (
|
|
38
43
|
listener: (newAddress: AccountInfo) => Promise<void>
|
|
39
44
|
) => Promise<void>;
|
|
40
|
-
onNetworkChange:
|
|
41
|
-
listener: (network: { networkName: NetworkInfo }) => Promise<void>
|
|
42
|
-
) => Promise<void>;
|
|
45
|
+
onNetworkChange: OnNetworkChange;
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
export interface AdapterPluginEvents {
|
|
46
|
-
onNetworkChange
|
|
49
|
+
onNetworkChange: OnNetworkChange;
|
|
47
50
|
onAccountChange(callback: any): Promise<any>;
|
|
48
51
|
}
|
|
49
52
|
|
|
@@ -110,4 +113,4 @@ export interface SignMessageResponse {
|
|
|
110
113
|
export interface TransactionOptions {
|
|
111
114
|
max_gas_amount?: bigint;
|
|
112
115
|
gas_unit_price?: bigint;
|
|
113
|
-
}
|
|
116
|
+
}
|