@aptos-labs/wallet-adapter-core 7.0.0 → 7.1.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.
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gCAAgC,EAAE,KAAK,CAAC,4BAA4B,CAuC9E,CAAC;AAEJ,eAAO,MAAM,qCAAqC,EAAE,KAAK,CAAC,4BAA4B,CAkCnF,CAAC"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gCAAgC,EAAE,KAAK,CAAC,4BAA4B,CAgC9E,CAAC;AAEJ,eAAO,MAAM,qCAAqC,EAAE,KAAK,CAAC,4BAA4B,CAkCnF,CAAC"}
@@ -10,7 +10,7 @@ export interface AptosStandardSupportedWallet {
10
10
  deeplinkProvider?: string;
11
11
  isAptosNativeWallet?: boolean;
12
12
  }
13
- export type AvailableWallets = "Continue with Apple" | "Continue with Google" | "OKX Wallet" | "Petra" | "Nightly" | "Pontem Wallet" | "MSafe" | "Rimosafe";
13
+ export type AvailableWallets = "Continue with Apple" | "Continue with Google" | "OKX Wallet" | "Petra" | "Nightly" | "Pontem Wallet" | "MSafe";
14
14
  type InputTransactionDataInner = {
15
15
  sender?: AccountAddressInput;
16
16
  data: InputGenerateTransactionPayloadData;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,0BAA0B,EAC3B,MAAM,oBAAoB,CAAC;AAC5B,O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B,OAAO,EAAE,mCAAmC,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,WAAW,4BAA4B;IAE3C,IAAI,EAAE,MAAM,CAAC;IAEb,GAAG,EAAE,MAAM,CAAC;IAEZ,IAAI,EAAE,cAAc,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,WAAW,MAAM,EAAE,CAAC;IAG1E,UAAU,EAAE,gBAAgB,CAAC,WAAW,CAAC;IAGzC,eAAe,EAAE,IAAI,CAAC;IAGtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAGD,MAAM,MAAM,gBAAgB,GACxB,qBAAqB,GACrB,sBAAsB,GACtB,YAAY,GACZ,OAAO,GACP,SAAS,GACT,eAAe,GACf,OAAO,CAAC;AAEZ,KAAK,yBAAyB,GAAG;IAC/B,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,IAAI,EAAE,mCAAmC,CAAC;IAC1C,OAAO,CAAC,EAAE,+BAA+B,GAAG;QAC1C,wBAAwB,CAAC,EAAE,MAAM,CAAC;QAClC,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;IACF,qFAAqF;IACrF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,GAC1D,0BAA0B,CAAC;AAE7B,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const WALLET_ADAPTER_CORE_VERSION = "7.0.0";
1
+ export declare const WALLET_ADAPTER_CORE_VERSION = "7.1.0";
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": "7.0.0",
3
+ "version": "7.1.0",
4
4
  "description": "Aptos Wallet Adapter Core",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
package/src/WalletCore.ts CHANGED
@@ -192,7 +192,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
192
192
  constructor(
193
193
  optInWallets?: ReadonlyArray<AvailableWallets>,
194
194
  dappConfig?: DappConfig,
195
- disableTelemetry?: boolean,
195
+ disableTelemetry?: boolean
196
196
  ) {
197
197
  super();
198
198
  this._optInWallets = optInWallets || [];
@@ -239,19 +239,24 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
239
239
  * @param extensionwWallets
240
240
  */
241
241
  private setExtensionAIP62Wallets(
242
- extensionwWallets: readonly AptosWallet[],
242
+ extensionwWallets: readonly AptosWallet[]
243
243
  ): void {
244
244
  extensionwWallets.map((wallet: AdapterWallet) => {
245
245
  if (this.excludeWallet(wallet)) {
246
246
  return;
247
247
  }
248
248
 
249
+ // Rimosafe is not supported anymore, so hiding it
250
+ if (wallet.name === "Rimosafe") {
251
+ return;
252
+ }
253
+
249
254
  const isValid = isWalletWithRequiredFeatureSet(wallet);
250
255
 
251
256
  if (isValid) {
252
257
  // check if we already have this wallet as a not detected wallet
253
258
  const index = this._standard_not_detected_wallets.findIndex(
254
- (notDetctedWallet) => notDetctedWallet.name == wallet.name,
259
+ (notDetctedWallet) => notDetctedWallet.name == wallet.name
255
260
  );
256
261
  // if we do, remove it from the not detected wallets array as it is now become detected
257
262
  if (index !== -1) {
@@ -260,7 +265,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
260
265
 
261
266
  // ✅ Check if wallet already exists in _standard_wallets
262
267
  const alreadyExists = this._standard_wallets.some(
263
- (w) => w.name === wallet.name,
268
+ (w) => w.name === wallet.name
264
269
  );
265
270
  if (!alreadyExists) {
266
271
  wallet.readyState = WalletReadyState.Installed;
@@ -310,7 +315,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
310
315
  walletRegistry.map((supportedWallet: AptosStandardSupportedWallet) => {
311
316
  // Check if we already have this wallet as a detected AIP-62 wallet standard
312
317
  const existingStandardWallet = this._standard_wallets.find(
313
- (wallet) => wallet.name == supportedWallet.name,
318
+ (wallet) => wallet.name == supportedWallet.name
314
319
  );
315
320
  // If it is detected, it means the user has the wallet installed, so dont add it to the wallets array
316
321
  if (existingStandardWallet) {
@@ -368,7 +373,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
368
373
  * @param wallet A wallet
369
374
  */
370
375
  private ensureWalletExists(
371
- wallet: AdapterWallet | null,
376
+ wallet: AdapterWallet | null
372
377
  ): asserts wallet is AdapterWallet {
373
378
  if (!wallet) {
374
379
  throw new WalletNotConnectedError().name;
@@ -383,7 +388,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
383
388
  * @param account An account
384
389
  */
385
390
  private ensureAccountExists(
386
- account: AccountInfo | null,
391
+ account: AccountInfo | null
387
392
  ): asserts account is AccountInfo {
388
393
  if (!account) {
389
394
  throw new WalletAccountError("Account is not set").name;
@@ -534,7 +539,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
534
539
  // Check if we are in a redirectable view (i.e on mobile AND not in an in-app browser)
535
540
  if (isRedirectable()) {
536
541
  const selectedWallet = this._standard_not_detected_wallets.find(
537
- (wallet: AdapterNotDetectedWallet) => wallet.name === walletName,
542
+ (wallet: AdapterNotDetectedWallet) => wallet.name === walletName
538
543
  );
539
544
 
540
545
  if (selectedWallet) {
@@ -562,7 +567,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
562
567
  const allDetectedWallets = this._standard_wallets;
563
568
 
564
569
  const selectedWallet = allDetectedWallets.find(
565
- (wallet: AdapterWallet) => wallet.name === walletName,
570
+ (wallet: AdapterWallet) => wallet.name === walletName
566
571
  );
567
572
 
568
573
  if (!selectedWallet) return;
@@ -572,7 +577,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
572
577
  // if the selected wallet is already connected, we don't need to connect again
573
578
  if (this._wallet?.name === walletName)
574
579
  throw new WalletConnectionError(
575
- `${walletName} wallet is already connected`,
580
+ `${walletName} wallet is already connected`
576
581
  ).message;
577
582
  }
578
583
 
@@ -605,7 +610,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
605
610
 
606
611
  const allDetectedWallets = this._standard_wallets;
607
612
  const selectedWallet = allDetectedWallets.find(
608
- (wallet: AdapterWallet) => wallet.name === walletName,
613
+ (wallet: AdapterWallet) => wallet.name === walletName
609
614
  );
610
615
 
611
616
  if (!selectedWallet) {
@@ -614,14 +619,14 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
614
619
 
615
620
  if (!selectedWallet.features["aptos:signIn"]) {
616
621
  throw new WalletNotSupportedMethod(
617
- `aptos:signIn is not supported by ${walletName}`,
622
+ `aptos:signIn is not supported by ${walletName}`
618
623
  ).message;
619
624
  }
620
625
 
621
626
  return await this.connectWallet(selectedWallet, async () => {
622
627
  if (!selectedWallet.features["aptos:signIn"]) {
623
628
  throw new WalletNotSupportedMethod(
624
- `aptos:signIn is not supported by ${selectedWallet.name}`,
629
+ `aptos:signIn is not supported by ${selectedWallet.name}`
625
630
  ).message;
626
631
  }
627
632
 
@@ -647,7 +652,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
647
652
  */
648
653
  private async connectWallet<T>(
649
654
  selectedWallet: AdapterWallet,
650
- onConnect: () => Promise<{ account: AccountInfo; output: T }>,
655
+ onConnect: () => Promise<{ account: AccountInfo; output: T }>
651
656
  ): Promise<T> {
652
657
  try {
653
658
  this._connecting = true;
@@ -698,7 +703,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
698
703
  * @returns AptosSignAndSubmitTransactionOutput
699
704
  */
700
705
  async signAndSubmitTransaction(
701
- transactionInput: InputTransactionData,
706
+ transactionInput: InputTransactionData
702
707
  ): Promise<AptosSignAndSubmitTransactionOutput> {
703
708
  try {
704
709
  if ("function" in transactionInput.data) {
@@ -748,7 +753,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
748
753
  });
749
754
 
750
755
  type AptosSignAndSubmitTransactionV1Method = (
751
- transaction: AnyRawTransaction,
756
+ transaction: AnyRawTransaction
752
757
  ) => Promise<UserResponse<AptosSignAndSubmitTransactionOutput>>;
753
758
 
754
759
  const signAndSubmitTransactionMethod = this._wallet.features[
@@ -757,7 +762,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
757
762
  .signAndSubmitTransaction as unknown as AptosSignAndSubmitTransactionV1Method;
758
763
 
759
764
  const response = (await signAndSubmitTransactionMethod(
760
- transaction,
765
+ transaction
761
766
  )) as UserResponse<AptosSignAndSubmitTransactionOutput>;
762
767
 
763
768
  if (response.status === UserResponseStatus.REJECTED) {
@@ -853,7 +858,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
853
858
  "aptos:signTransaction"
854
859
  ].signTransaction(
855
860
  transactionOrPayload,
856
- asFeePayer,
861
+ asFeePayer
857
862
  )) as UserResponse<AccountAuthenticator>;
858
863
  if (response.status === UserResponseStatus.REJECTED) {
859
864
  throw new WalletConnectionError("User has rejected the request")
@@ -889,7 +894,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
889
894
  AptosSignTransactionMethodV1_1;
890
895
 
891
896
  const response = (await walletSignTransactionMethod(
892
- signTransactionV1_1StandardInput,
897
+ signTransactionV1_1StandardInput
893
898
  )) as UserResponse<AptosSignTransactionOutputV1_1>;
894
899
  if (response.status === UserResponseStatus.REJECTED) {
895
900
  throw new WalletConnectionError("User has rejected the request")
@@ -915,7 +920,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
915
920
  "aptos:signTransaction"
916
921
  ].signTransaction(
917
922
  transaction,
918
- asFeePayer,
923
+ asFeePayer
919
924
  )) as UserResponse<AccountAuthenticator>;
920
925
  if (response.status === UserResponseStatus.REJECTED) {
921
926
  throw new WalletConnectionError("User has rejected the request")
@@ -942,7 +947,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
942
947
  * @throws WalletSignMessageError
943
948
  */
944
949
  async signMessage(
945
- message: AptosSignMessageInput,
950
+ message: AptosSignMessageInput
946
951
  ): Promise<AptosSignMessageOutput> {
947
952
  try {
948
953
  this.ensureWalletExists(this._wallet);
@@ -968,7 +973,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
968
973
  * @returns PendingTransactionResponse
969
974
  */
970
975
  async submitTransaction(
971
- transaction: InputSubmitTransactionData,
976
+ transaction: InputSubmitTransactionData
972
977
  ): Promise<PendingTransactionResponse> {
973
978
  // The standard does not support submitTransaction, so we use the adapter to submit the transaction
974
979
  try {
@@ -1014,7 +1019,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
1014
1019
  await this.setAnsName();
1015
1020
  this.recordEvent("account_change");
1016
1021
  this.emit("accountChange", this._account);
1017
- },
1022
+ }
1018
1023
  );
1019
1024
  } catch (error: any) {
1020
1025
  const errMsg = generalizedErrorMessage(error);
@@ -1035,7 +1040,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
1035
1040
  this.setNetwork(data);
1036
1041
  await this.setAnsName();
1037
1042
  this.emit("networkChange", this._network);
1038
- },
1043
+ }
1039
1044
  );
1040
1045
  } catch (error: any) {
1041
1046
  const errMsg = generalizedErrorMessage(error);
@@ -1069,7 +1074,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
1069
1074
  if (this._wallet.features["aptos:changeNetwork"]) {
1070
1075
  const response =
1071
1076
  await this._wallet.features["aptos:changeNetwork"].changeNetwork(
1072
- networkInfo,
1077
+ networkInfo
1073
1078
  );
1074
1079
  if (response.status === UserResponseStatus.REJECTED) {
1075
1080
  throw new WalletConnectionError("User has rejected the request")
@@ -1079,7 +1084,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
1079
1084
  }
1080
1085
 
1081
1086
  throw new WalletChangeNetworkError(
1082
- `${this._wallet.name} does not support changing network request`,
1087
+ `${this._wallet.name} does not support changing network request`
1083
1088
  ).message;
1084
1089
  } catch (error: any) {
1085
1090
  const errMsg = generalizedErrorMessage(error);
@@ -1109,7 +1114,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
1109
1114
 
1110
1115
  const aptosConfig = getAptosConfig(this._network, this._dappConfig);
1111
1116
  const signingMessage = new TextEncoder().encode(
1112
- response.args.fullMessage,
1117
+ response.args.fullMessage
1113
1118
  );
1114
1119
  if ("verifySignatureAsync" in (this._account.publicKey as Object)) {
1115
1120
  return await this._account.publicKey.verifySignatureAsync({
package/src/registry.ts CHANGED
@@ -47,13 +47,6 @@ export const aptosStandardSupportedWalletList: Array<AptosStandardSupportedWalle
47
47
  readyState: WalletReadyState.NotDetected,
48
48
  isAIP62Standard: true,
49
49
  },
50
- {
51
- name: "Rimosafe",
52
- url: "https://chromewebstore.google.com/detail/rimo-safe-wallet/kiicddjcakdmobjkcpppkgcjbpakcagp",
53
- icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cmVjdCB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiLz4KICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgzLCAzKSBzY2FsZSgwLjgpIj4KICAgIDxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjkuNTMxMSA5Ljg0MzY5VjBIMTkuNjg3NEwxOS42ODc3IDAuMDAwMzQwNTU1TDAgMC4wMDAzNDE0MTVMNC4zMjEzNGUtMDcgOS44NDQwM0g5Ljg0MzY5QzQuNDA3MTcgOS44NDQwMyAwIDE0LjI1MTIgMCAxOS42ODc3VjMwLjAwMDFIOS44NDM2OVYxOS42ODc5TDE5LjY4NzEgMzAuMDAwMUwxOS42ODcxIDE5LjY4NzdMMjkuNTMwOCA5Ljg0NDAzTDI5LjUzMTEgOS44NDQwM1Y5Ljg0MzY1TDI5LjUzMTEgOS44NDM2OVpNMTkuNjg3MSAxOS42ODc2TDE5LjY4NzEgOS44NDQwM0g5Ljg0MzY5VjE5LjY4NzZIMTkuNjg3MVpNMjkuNTMxMSA5Ljg0MzY1TDE5LjY4NzcgMC4wMDAzNDA1NTVMMjkuNTMxMSAwLjAwMDM0MDEyNVY5Ljg0MzY1Wk0xOS42ODc0IDE5LjY4NzZIMjkuNTMxMVYzMC4wMDAxSDE5LjY4NzRWMTkuNjg3NloiIGZpbGw9IiNGRjVDMjgiLz4KICA8L2c+Cjwvc3ZnPgo=",
54
- readyState: WalletReadyState.NotDetected,
55
- isAIP62Standard: true,
56
- },
57
50
  ];
58
51
 
59
52
  export const crossChainStandardSupportedWalletList: Array<AptosStandardSupportedWallet> =
@@ -34,8 +34,7 @@ export type AvailableWallets =
34
34
  | "Petra"
35
35
  | "Nightly"
36
36
  | "Pontem Wallet"
37
- | "MSafe"
38
- | "Rimosafe";
37
+ | "MSafe";
39
38
 
40
39
  type InputTransactionDataInner = {
41
40
  sender?: AccountAddressInput;
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const WALLET_ADAPTER_CORE_VERSION = "7.0.0";
1
+ export const WALLET_ADAPTER_CORE_VERSION = "7.1.0";