@aptos-labs/wallet-adapter-core 8.5.0 → 8.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/dist/WalletCore.d.ts +8 -8
- package/dist/WalletCore.d.ts.map +1 -1
- package/dist/ga/index.d.ts +1 -1
- package/dist/ga/index.d.ts.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1390 -2536
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1351 -2348
- package/dist/index.mjs.map +1 -1
- package/dist/registry.d.ts +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/sdkWallets.d.ts +1 -1
- package/dist/sdkWallets.d.ts.map +1 -1
- package/dist/utils/helpers.d.ts +4 -4
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/types.d.ts +2 -3
- package/dist/utils/types.d.ts.map +1 -1
- package/dist/utils/walletSelector.d.ts +2 -2
- package/dist/utils/walletSelector.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +4 -8
- package/src/WalletCore.ts +65 -67
- package/src/ga/index.ts +6 -7
- package/src/index.ts +6 -6
- package/src/registry.ts +1 -1
- package/src/sdkWallets.ts +1 -1
- package/src/utils/helpers.ts +4 -5
- package/src/utils/index.ts +1 -1
- package/src/utils/types.ts +3 -3
- package/src/utils/walletSelector.ts +2 -2
- package/src/version.ts +1 -1
package/dist/registry.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AptosStandardSupportedWallet } from "./utils/types";
|
|
1
|
+
import type { AptosStandardSupportedWallet } from "./utils/types";
|
|
2
2
|
/**
|
|
3
3
|
* Registry of AIP-62 wallet standard supported wallets.
|
|
4
4
|
* This list is used to show supported wallets even if they are not installed on the user machine.
|
package/dist/registry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAElE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gCAAgC,EAAE,KAAK,CAAC,4BAA4B,CA8D9E,CAAC;AAEJ,eAAO,MAAM,iCAAiC,EAAE,KAAK,CAAC,4BAA4B,CA6E/E,CAAC;AAEJ,eAAO,MAAM,mCAAmC,EAAE,KAAK,CAAC,4BAA4B,CAoFjF,CAAC;AAEJ,eAAO,MAAM,8BAA8B,EAAE,KAAK,CAAC,4BAA4B,CA+D5E,CAAC"}
|
package/dist/sdkWallets.d.ts
CHANGED
package/dist/sdkWallets.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdkWallets.d.ts","sourceRoot":"","sources":["../src/sdkWallets.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sdkWallets.d.ts","sourceRoot":"","sources":["../src/sdkWallets.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE9D,wBAAgB,aAAa,CAAC,UAAU,CAAC,EAAE,UAAU,mBA4BpD"}
|
package/dist/utils/helpers.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
2
|
-
import { NetworkInfo, NetworkInfo as StandardNetworkInfo } from "@aptos-labs/wallet-standard";
|
|
3
|
-
import { DappConfig } from "../WalletCore";
|
|
4
|
-
import { InputTransactionData } from "./types";
|
|
2
|
+
import type { NetworkInfo, NetworkInfo as StandardNetworkInfo } from "@aptos-labs/wallet-standard";
|
|
3
|
+
import type { DappConfig } from "../WalletCore";
|
|
4
|
+
import type { InputTransactionData } from "./types";
|
|
5
5
|
export declare function isMobile(): boolean;
|
|
6
6
|
export declare function isInAppBrowser(): boolean;
|
|
7
7
|
export declare function isRedirectable(): boolean;
|
|
@@ -32,7 +32,7 @@ export declare const fetchDevnetChainId: () => Promise<number>;
|
|
|
32
32
|
* as a string, this function converts the string to Uint8Array.
|
|
33
33
|
*/
|
|
34
34
|
export declare const handlePublishPackageTransaction: (transactionInput: InputTransactionData) => {
|
|
35
|
-
metadataBytes: number | bigint | boolean | import("@aptos-labs/ts-sdk").AccountAddress | import("@aptos-labs/ts-sdk").Bool | import("@aptos-labs/ts-sdk").U8 | import("@aptos-labs/ts-sdk").U16 | import("@aptos-labs/ts-sdk").U32 | import("@aptos-labs/ts-sdk").U64 | import("@aptos-labs/ts-sdk").U128 | import("@aptos-labs/ts-sdk").U256 | import("@aptos-labs/ts-sdk").MoveVector<import("@aptos-labs/ts-sdk").EntryFunctionArgumentTypes> | import("@aptos-labs/ts-sdk").MoveOption<import("@aptos-labs/ts-sdk").EntryFunctionArgumentTypes> | import("@aptos-labs/ts-sdk").MoveString | import("@aptos-labs/ts-sdk").FixedBytes | Uint8Array<ArrayBufferLike> |
|
|
35
|
+
metadataBytes: number | bigint | boolean | import("@aptos-labs/ts-sdk").AccountAddress | ArrayBuffer | import("@aptos-labs/ts-sdk").Bool | import("@aptos-labs/ts-sdk").U8 | import("@aptos-labs/ts-sdk").U16 | import("@aptos-labs/ts-sdk").U32 | import("@aptos-labs/ts-sdk").U64 | import("@aptos-labs/ts-sdk").U128 | import("@aptos-labs/ts-sdk").U256 | import("@aptos-labs/ts-sdk").MoveVector<import("@aptos-labs/ts-sdk").EntryFunctionArgumentTypes> | import("@aptos-labs/ts-sdk").MoveOption<import("@aptos-labs/ts-sdk").EntryFunctionArgumentTypes> | import("@aptos-labs/ts-sdk").MoveString | import("@aptos-labs/ts-sdk").FixedBytes | Uint8Array<ArrayBufferLike> | (import("@aptos-labs/ts-sdk").EntryFunctionArgumentTypes | import("@aptos-labs/ts-sdk").SimpleEntryFunctionArgumentTypes)[] | import("@aptos-labs/ts-sdk").MoveVector<import("@aptos-labs/ts-sdk").ScriptFunctionArgumentTypes> | import("@aptos-labs/ts-sdk").Serialized | null | undefined;
|
|
36
36
|
byteCode: (import("@aptos-labs/ts-sdk").EntryFunctionArgumentTypes | import("@aptos-labs/ts-sdk").SimpleEntryFunctionArgumentTypes)[];
|
|
37
37
|
};
|
|
38
38
|
export declare function convertNetwork(networkInfo: NetworkInfo | null): Network;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EAEX,OAAO,EAGR,MAAM,oBAAoB,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EAEX,OAAO,EAGR,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,WAAW,EACX,WAAW,IAAI,mBAAmB,EACnC,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,wBAAgB,QAAQ,IAAI,OAAO,CAIlC;AAED,wBAAgB,cAAc,IAAI,OAAO,CAUxC;AAED,wBAAgB,cAAc,IAAI,OAAO,CAOxC;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAI1D;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GACzB,aAAa,WAAW,GAAG,IAAI,EAC/B,YAAY,UAAU,GAAG,SAAS,KACjC,WAiDF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GACzB,aAAa,WAAW,GAAG,mBAAmB,GAAG,IAAI,KACpD,OAKF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,aAAa,OAAO,KAAG,OAMzD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,QAAa,OAAO,CAAC,MAAM,CAGzD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,GAC1C,kBAAkB,oBAAoB;;;CAwBvC,CAAC;AAGF,wBAAgB,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAevE"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AccountAddressInput, InputGenerateTransactionOptions, InputTransactionPluginData } from "@aptos-labs/ts-sdk";
|
|
2
|
-
import {
|
|
3
|
-
import { WalletReadyState } from "../constants";
|
|
1
|
+
import type { AccountAddressInput, InputGenerateTransactionOptions, InputGenerateTransactionPayloadData, InputTransactionPluginData } from "@aptos-labs/ts-sdk";
|
|
2
|
+
import type { WalletReadyState } from "../constants";
|
|
4
3
|
export interface AptosStandardSupportedWallet {
|
|
5
4
|
name: string;
|
|
6
5
|
url: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA,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GAAG,EAAE,MAAM,CAAC;CACb,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { AdapterNotDetectedWallet, AdapterWallet } from "../WalletCore";
|
|
2
|
+
import type { AvailableWallets, WalletInfo } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* A function that will partition the provided wallets into two list — `defaultWallets` and `moreWallets`.
|
|
5
5
|
* By default, the wallets will be partitioned by whether or not they are installed or loadable.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walletSelector.d.ts","sourceRoot":"","sources":["../../src/utils/walletSelector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"walletSelector.d.ts","sourceRoot":"","sources":["../../src/utils/walletSelector.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,aAAa,CAAC,aAAa,GAAG,wBAAwB,CAAC,EAChE,iBAAiB,GAAE,CACjB,MAAM,EAAE,aAAa,GAAG,wBAAwB,KAC7C,OAA+B;;;EAcrC;AAED,2DAA2D;AAC3D,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,aAAa,GAAG,wBAAwB,GAC/C,MAAM,IAAI,aAAa,CAEzB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,aAAa,GAAG,wBAAwB,WAMjD;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,aAAa,GAAG,wBAAwB,GAC/C,OAAO,CAMT;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,sBAG1D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,UAAU,GA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jC,OAAO,EAAE,aAAa,CAAC,aAAa,GAAG,wBAAwB,CAAC,EAChE,OAAO,CAAC,EAAE,oBAAoB;IA8D5B,uDAAuD;;IAEvD,2EAA2E;;IAE3E,wDAAwD;;IAExD,0EAA0E;;IAE1E,4DAA4D;;EAG/D"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const WALLET_ADAPTER_CORE_VERSION = "8.5.
|
|
1
|
+
export declare const WALLET_ADAPTER_CORE_VERSION = "8.5.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aptos-labs/wallet-adapter-core",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.1",
|
|
4
4
|
"description": "Aptos Wallet Adapter Core",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -30,20 +30,16 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@swc/core": "^1.11.16",
|
|
32
32
|
"@types/node": "^20.10.4",
|
|
33
|
-
"eslint": "^8.57.1",
|
|
34
33
|
"happy-dom": "^20.0.2",
|
|
35
34
|
"tsup": "^8.4.0",
|
|
36
35
|
"typescript": "^5.8.3",
|
|
37
36
|
"vitest": "^2.1.8",
|
|
38
|
-
"@aptos-labs/eslint-config-adapter": "0.0.2",
|
|
39
37
|
"@aptos-labs/wallet-adapter-tsconfig": "0.0.2"
|
|
40
38
|
},
|
|
41
39
|
"dependencies": {
|
|
42
|
-
"@aptos-connect/wallet-adapter-plugin": "^3.0.
|
|
40
|
+
"@aptos-connect/wallet-adapter-plugin": "^3.0.4",
|
|
43
41
|
"@aptos-labs/wallet-standard": "^0.5.2",
|
|
44
|
-
"
|
|
45
|
-
"eventemitter3": "^4.0.7",
|
|
46
|
-
"tweetnacl": "^1.0.3"
|
|
42
|
+
"eventemitter3": "^5.0.1"
|
|
47
43
|
},
|
|
48
44
|
"peerDependencies": {
|
|
49
45
|
"@aptos-labs/ts-sdk": "^5.1.1"
|
|
@@ -62,7 +58,7 @@
|
|
|
62
58
|
"build": "pnpm run update-version && pnpm run build-package",
|
|
63
59
|
"dev": "export $(cat .env | xargs) && tsup src/index.ts --format esm,cjs --watch --dts --env.GAID $GAID",
|
|
64
60
|
"test": "vitest run",
|
|
65
|
-
"lint": "
|
|
61
|
+
"lint": "biome lint src",
|
|
66
62
|
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
|
|
67
63
|
}
|
|
68
64
|
}
|
package/src/WalletCore.ts
CHANGED
|
@@ -1,79 +1,85 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { AptosConnectWalletConfig } from "@aptos-connect/wallet-adapter-plugin";
|
|
2
2
|
import {
|
|
3
3
|
AccountAddress,
|
|
4
|
-
AccountAuthenticator,
|
|
5
|
-
AnyRawTransaction,
|
|
4
|
+
type AccountAuthenticator,
|
|
5
|
+
type AnyRawTransaction,
|
|
6
6
|
Aptos,
|
|
7
|
-
InputSubmitTransactionData,
|
|
7
|
+
type InputSubmitTransactionData,
|
|
8
8
|
Network,
|
|
9
9
|
NetworkToChainId,
|
|
10
|
-
PendingTransactionResponse,
|
|
11
|
-
TransactionSubmitter,
|
|
10
|
+
type PendingTransactionResponse,
|
|
11
|
+
type TransactionSubmitter,
|
|
12
12
|
} from "@aptos-labs/ts-sdk";
|
|
13
13
|
import {
|
|
14
|
-
|
|
14
|
+
type AccountInfo,
|
|
15
|
+
type AptosChangeNetworkOutput,
|
|
16
|
+
type AptosSignAndSubmitTransactionOutput,
|
|
17
|
+
type AptosSignInInput,
|
|
18
|
+
type AptosSignInOutput,
|
|
19
|
+
type AptosSignMessageInput,
|
|
20
|
+
type AptosSignMessageOutput,
|
|
21
|
+
type AptosSignTransactionInputV1_1,
|
|
22
|
+
type AptosSignTransactionMethod,
|
|
23
|
+
type AptosSignTransactionMethodV1_1,
|
|
24
|
+
type AptosSignTransactionOutputV1_1,
|
|
25
|
+
type AptosWallet,
|
|
15
26
|
getAptosWallets,
|
|
16
27
|
isWalletWithRequiredFeatureSet,
|
|
28
|
+
type NetworkInfo,
|
|
29
|
+
type UserResponse,
|
|
17
30
|
UserResponseStatus,
|
|
18
|
-
AptosSignAndSubmitTransactionOutput,
|
|
19
|
-
UserResponse,
|
|
20
|
-
AptosSignTransactionOutputV1_1,
|
|
21
|
-
AptosSignTransactionInputV1_1,
|
|
22
|
-
AptosSignTransactionMethod,
|
|
23
|
-
AptosSignTransactionMethodV1_1,
|
|
24
|
-
NetworkInfo,
|
|
25
|
-
AccountInfo,
|
|
26
|
-
AptosSignMessageInput,
|
|
27
|
-
AptosSignMessageOutput,
|
|
28
|
-
AptosChangeNetworkOutput,
|
|
29
|
-
AptosSignInInput,
|
|
30
|
-
AptosSignInOutput,
|
|
31
31
|
} from "@aptos-labs/wallet-standard";
|
|
32
|
-
import
|
|
32
|
+
import EventEmitter from "eventemitter3";
|
|
33
33
|
|
|
34
34
|
export type {
|
|
35
|
-
|
|
36
|
-
AccountInfo,
|
|
37
|
-
AptosSignAndSubmitTransactionOutput,
|
|
38
|
-
AptosSignTransactionOutputV1_1,
|
|
39
|
-
AptosSignMessageInput,
|
|
40
|
-
AptosSignMessageOutput,
|
|
41
|
-
AptosChangeNetworkOutput,
|
|
42
|
-
} from "@aptos-labs/wallet-standard";
|
|
43
|
-
export type {
|
|
35
|
+
AccountAddress,
|
|
44
36
|
AccountAuthenticator,
|
|
37
|
+
AnyPublicKey,
|
|
45
38
|
AnyRawTransaction,
|
|
46
39
|
InputGenerateTransactionOptions,
|
|
47
|
-
PendingTransactionResponse,
|
|
48
40
|
InputSubmitTransactionData,
|
|
49
41
|
Network,
|
|
50
|
-
|
|
51
|
-
AccountAddress,
|
|
42
|
+
PendingTransactionResponse,
|
|
52
43
|
TransactionSubmitter,
|
|
53
44
|
} from "@aptos-labs/ts-sdk";
|
|
45
|
+
export type {
|
|
46
|
+
AccountInfo,
|
|
47
|
+
AptosChangeNetworkOutput,
|
|
48
|
+
AptosSignAndSubmitTransactionOutput,
|
|
49
|
+
AptosSignMessageInput,
|
|
50
|
+
AptosSignMessageOutput,
|
|
51
|
+
AptosSignTransactionOutputV1_1,
|
|
52
|
+
NetworkInfo,
|
|
53
|
+
} from "@aptos-labs/wallet-standard";
|
|
54
54
|
|
|
55
|
-
import {
|
|
55
|
+
import { ChainIdToAnsSupportedNetworkMap, WalletReadyState } from "./constants";
|
|
56
56
|
import {
|
|
57
|
-
WalletChangeNetworkError,
|
|
58
57
|
WalletAccountChangeError,
|
|
59
58
|
WalletAccountError,
|
|
59
|
+
WalletChangeNetworkError,
|
|
60
60
|
WalletConnectionError,
|
|
61
|
+
WalletDisconnectionError,
|
|
61
62
|
WalletGetNetworkError,
|
|
62
63
|
WalletNetworkChangeError,
|
|
63
64
|
WalletNotConnectedError,
|
|
65
|
+
WalletNotFoundError,
|
|
64
66
|
WalletNotReadyError,
|
|
65
67
|
WalletNotSelectedError,
|
|
68
|
+
WalletNotSupportedMethod,
|
|
66
69
|
WalletSignAndSubmitMessageError,
|
|
70
|
+
WalletSignMessageAndVerifyError,
|
|
67
71
|
WalletSignMessageError,
|
|
68
72
|
WalletSignTransactionError,
|
|
69
|
-
WalletSignMessageAndVerifyError,
|
|
70
|
-
WalletDisconnectionError,
|
|
71
73
|
WalletSubmitTransactionError,
|
|
72
|
-
WalletNotSupportedMethod,
|
|
73
|
-
WalletNotFoundError,
|
|
74
74
|
} from "./error";
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
75
|
+
import { GA4 } from "./ga";
|
|
76
|
+
import {
|
|
77
|
+
aptosStandardSupportedWalletList,
|
|
78
|
+
ethereumStandardSupportedWalletList,
|
|
79
|
+
solanaStandardSupportedWalletList,
|
|
80
|
+
suiStandardSupportedWalletList,
|
|
81
|
+
} from "./registry";
|
|
82
|
+
import { getSDKWallets } from "./sdkWallets";
|
|
77
83
|
import {
|
|
78
84
|
fetchDevnetChainId,
|
|
79
85
|
generalizedErrorMessage,
|
|
@@ -84,18 +90,12 @@ import {
|
|
|
84
90
|
removeLocalStorage,
|
|
85
91
|
setLocalStorage,
|
|
86
92
|
} from "./utils";
|
|
87
|
-
import {
|
|
88
|
-
aptosStandardSupportedWalletList,
|
|
89
|
-
ethereumStandardSupportedWalletList,
|
|
90
|
-
solanaStandardSupportedWalletList,
|
|
91
|
-
suiStandardSupportedWalletList,
|
|
92
|
-
} from "./registry";
|
|
93
|
-
import { getSDKWallets } from "./sdkWallets";
|
|
94
|
-
import {
|
|
95
|
-
AvailableWallets,
|
|
93
|
+
import type {
|
|
96
94
|
AptosStandardSupportedWallet,
|
|
95
|
+
AvailableWallets,
|
|
97
96
|
InputTransactionData,
|
|
98
97
|
} from "./utils/types";
|
|
98
|
+
import { WALLET_ADAPTER_CORE_VERSION } from "./version";
|
|
99
99
|
|
|
100
100
|
// An adapter wallet types is a wallet that is compatible with the wallet standard and the wallet adapter properties
|
|
101
101
|
export type AdapterWallet = AptosWallet & {
|
|
@@ -174,12 +174,12 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
|
|
|
174
174
|
// Local private variable to hold the network that is currently connected
|
|
175
175
|
private _network: NetworkInfo | null = null;
|
|
176
176
|
|
|
177
|
-
// Local private variable to hold the wallet connected state
|
|
178
|
-
private _connected: boolean = false;
|
|
179
|
-
|
|
180
177
|
// Local private variable to hold the connecting state
|
|
181
178
|
private _connecting: boolean = false;
|
|
182
179
|
|
|
180
|
+
// Local private variable to hold the wallet connected state
|
|
181
|
+
private _connected: boolean = false;
|
|
182
|
+
|
|
183
183
|
// Local private variable to hold the account that is currently connected
|
|
184
184
|
private _account: AdapterAccountInfo | null = null;
|
|
185
185
|
|
|
@@ -226,21 +226,19 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
|
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
private fetchExtensionAIP62AptosWallets(): void {
|
|
229
|
-
|
|
229
|
+
const { aptosWallets, on } = getAptosWallets();
|
|
230
230
|
this.setExtensionAIP62Wallets(aptosWallets);
|
|
231
231
|
|
|
232
232
|
if (typeof window === "undefined") return;
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
let { aptosWallets } = getAptosWallets();
|
|
238
|
-
that.setExtensionAIP62Wallets(aptosWallets);
|
|
233
|
+
|
|
234
|
+
const _removeRegisterListener = on("register", () => {
|
|
235
|
+
const { aptosWallets } = getAptosWallets();
|
|
236
|
+
this.setExtensionAIP62Wallets(aptosWallets);
|
|
239
237
|
});
|
|
240
238
|
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
239
|
+
const _removeUnregisterListener = on("unregister", () => {
|
|
240
|
+
const { aptosWallets } = getAptosWallets();
|
|
241
|
+
this.setExtensionAIP62Wallets(aptosWallets);
|
|
244
242
|
});
|
|
245
243
|
}
|
|
246
244
|
|
|
@@ -267,7 +265,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
|
|
|
267
265
|
if (isValid) {
|
|
268
266
|
// check if we already have this wallet as a not detected wallet
|
|
269
267
|
const index = this._standard_not_detected_wallets.findIndex(
|
|
270
|
-
(notDetctedWallet) => notDetctedWallet.name
|
|
268
|
+
(notDetctedWallet) => notDetctedWallet.name === wallet.name,
|
|
271
269
|
);
|
|
272
270
|
// if we do, remove it from the not detected wallets array as it is now become detected
|
|
273
271
|
if (index !== -1) {
|
|
@@ -580,7 +578,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
|
|
|
580
578
|
*
|
|
581
579
|
* @param walletName. The wallet name we want to connect with.
|
|
582
580
|
*/
|
|
583
|
-
async connect(walletName: string): Promise<
|
|
581
|
+
async connect(walletName: string): Promise<undefined | string> {
|
|
584
582
|
// First, handle mobile case
|
|
585
583
|
// Check if we are in a redirectable view (i.e on mobile AND not in an in-app browser)
|
|
586
584
|
if (isRedirectable()) {
|
|
@@ -596,8 +594,8 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
|
|
|
596
594
|
let parameter = "";
|
|
597
595
|
if (uninstalledWallet.name.includes("Phantom")) {
|
|
598
596
|
// Phantom required parameters https://docs.phantom.com/phantom-deeplinks/other-methods/browse#parameters
|
|
599
|
-
|
|
600
|
-
|
|
597
|
+
const url = encodeURIComponent(window.location.href);
|
|
598
|
+
const ref = encodeURIComponent(window.location.origin);
|
|
601
599
|
parameter = `${url}?ref=${ref}`;
|
|
602
600
|
} else if (uninstalledWallet.name.includes("MetaMask")) {
|
|
603
601
|
// MetaMask expects the raw URL as a path parameter
|
package/src/ga/index.ts
CHANGED
|
@@ -6,9 +6,9 @@ export class GA4 {
|
|
|
6
6
|
this.injectGA(this.aptosGAID);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
gtag(
|
|
10
|
-
|
|
11
|
-
dataLayer.push(
|
|
9
|
+
gtag(...args: [string, string | object, object?]) {
|
|
10
|
+
const dataLayer = (window as any).dataLayer || [];
|
|
11
|
+
dataLayer.push(...args);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
private injectGA(gaID?: string) {
|
|
@@ -24,10 +24,9 @@ export class GA4 {
|
|
|
24
24
|
`https://www.googletagmanager.com/gtag/js?id=${gaID}`,
|
|
25
25
|
);
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
that.gtag("config", `${gaID}`, {
|
|
27
|
+
myScript.onload = () => {
|
|
28
|
+
this.gtag("js", new Date());
|
|
29
|
+
this.gtag("config", `${gaID}`, {
|
|
31
30
|
send_page_view: false,
|
|
32
31
|
});
|
|
33
32
|
};
|
package/src/index.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { AptosSignInBoundFields } from "@aptos-labs/wallet-standard";
|
|
1
|
+
import type { AptosSignInBoundFields } from "@aptos-labs/wallet-standard";
|
|
2
2
|
import { WALLET_ADAPTER_CORE_VERSION } from "./version";
|
|
3
3
|
|
|
4
4
|
export type {
|
|
5
|
-
AptosSignInOutput,
|
|
6
|
-
AptosSignInInput,
|
|
7
5
|
AptosSignInBoundFields,
|
|
6
|
+
AptosSignInInput,
|
|
7
|
+
AptosSignInOutput,
|
|
8
8
|
} from "@aptos-labs/wallet-standard";
|
|
9
9
|
/**
|
|
10
10
|
* @deprecated Use `AptosSignInBoundFields` instead. This will be removed in future versions.
|
|
11
11
|
*/
|
|
12
12
|
export type AptosSignInRequiredFields = AptosSignInBoundFields;
|
|
13
13
|
|
|
14
|
-
export * from "./WalletCore";
|
|
15
14
|
export * from "./constants";
|
|
16
|
-
export * from "./utils";
|
|
17
|
-
export * from "./sdkWallets";
|
|
18
15
|
export * from "./registry";
|
|
16
|
+
export * from "./sdkWallets";
|
|
17
|
+
export * from "./utils";
|
|
18
|
+
export * from "./WalletCore";
|
|
19
19
|
|
|
20
20
|
// inject adapter core version to the window
|
|
21
21
|
if (typeof window !== "undefined") {
|
package/src/registry.ts
CHANGED
package/src/sdkWallets.ts
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
AptosConnectGenericWallet,
|
|
4
4
|
AptosConnectGoogleWallet,
|
|
5
5
|
} from "@aptos-connect/wallet-adapter-plugin";
|
|
6
|
-
import {
|
|
6
|
+
import type { AdapterWallet, DappConfig } from "./WalletCore";
|
|
7
7
|
|
|
8
8
|
export function getSDKWallets(dappConfig?: DappConfig) {
|
|
9
9
|
const sdkWallets: AdapterWallet[] = [];
|
package/src/utils/helpers.ts
CHANGED
|
@@ -4,16 +4,15 @@ import {
|
|
|
4
4
|
Hex,
|
|
5
5
|
Network,
|
|
6
6
|
NetworkToNodeAPI,
|
|
7
|
-
PluginSettings,
|
|
7
|
+
type PluginSettings,
|
|
8
8
|
} from "@aptos-labs/ts-sdk";
|
|
9
|
-
import {
|
|
9
|
+
import type {
|
|
10
10
|
NetworkInfo,
|
|
11
11
|
NetworkInfo as StandardNetworkInfo,
|
|
12
12
|
} from "@aptos-labs/wallet-standard";
|
|
13
|
-
|
|
14
|
-
import { DappConfig } from "../WalletCore";
|
|
15
13
|
import { WalletSignAndSubmitMessageError } from "../error";
|
|
16
|
-
import {
|
|
14
|
+
import type { DappConfig } from "../WalletCore";
|
|
15
|
+
import type { InputTransactionData } from "./types";
|
|
17
16
|
|
|
18
17
|
export function isMobile(): boolean {
|
|
19
18
|
return /Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/i.test(
|
package/src/utils/index.ts
CHANGED
package/src/utils/types.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
AccountAddressInput,
|
|
3
3
|
InputGenerateTransactionOptions,
|
|
4
|
+
InputGenerateTransactionPayloadData,
|
|
4
5
|
InputTransactionPluginData,
|
|
5
6
|
} from "@aptos-labs/ts-sdk";
|
|
6
|
-
import {
|
|
7
|
-
import { WalletReadyState } from "../constants";
|
|
7
|
+
import type { WalletReadyState } from "../constants";
|
|
8
8
|
|
|
9
9
|
export interface AptosStandardSupportedWallet {
|
|
10
10
|
// The name of your wallet cast to WalletName (Ex. "Petra" as WalletName<"Petra">)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { AvailableWallets, WalletInfo } from "./types";
|
|
2
|
-
import { AdapterNotDetectedWallet, AdapterWallet } from "../WalletCore";
|
|
3
1
|
import {
|
|
4
2
|
APTOS_CONNECT_BASE_URL,
|
|
5
3
|
PETRA_WEB_BASE_URL,
|
|
6
4
|
PETRA_WEB_GENERIC_WALLET_NAME,
|
|
7
5
|
WalletReadyState,
|
|
8
6
|
} from "../constants";
|
|
7
|
+
import type { AdapterNotDetectedWallet, AdapterWallet } from "../WalletCore";
|
|
9
8
|
import { isRedirectable } from "./helpers";
|
|
9
|
+
import type { AvailableWallets, WalletInfo } from "./types";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* A function that will partition the provided wallets into two list — `defaultWallets` and `moreWallets`.
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const WALLET_ADAPTER_CORE_VERSION = "8.5.
|
|
1
|
+
export const WALLET_ADAPTER_CORE_VERSION = "8.5.1";
|