@aptos-labs/wallet-adapter-core 3.2.0 → 3.3.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.
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -1
- package/dist/index.mjs +8 -2
- package/package.json +2 -2
- package/src/utils/helpers.ts +15 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @aptos-labs/wallet-adapter-core
|
|
2
2
|
|
|
3
|
+
## 3.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 570cbda: Update @aptos-labs/ts-sdk package version to 1.3.0
|
|
8
|
+
|
|
9
|
+
## 3.2.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 3f38c51: Return false from areBCSArguments function if array is empty
|
|
14
|
+
|
|
3
15
|
## 3.2.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Types } from 'aptos';
|
|
2
2
|
export { TxnBuilderTypes, Types } from 'aptos';
|
|
3
|
-
import { Network, InputGenerateTransactionData, InputGenerateTransactionOptions, PendingTransactionResponse, InputSubmitTransactionData, AccountAddressInput, InputGenerateTransactionPayloadData, AnyRawTransaction, AccountAuthenticator } from '@aptos-labs/ts-sdk';
|
|
3
|
+
import { Network, InputGenerateTransactionData, InputGenerateTransactionOptions, PendingTransactionResponse, InputSubmitTransactionData, AccountAddressInput, InputGenerateTransactionPayloadData, AnyRawTransaction, AccountAuthenticator, EntryFunctionArgumentTypes, SimpleEntryFunctionArgumentTypes } from '@aptos-labs/ts-sdk';
|
|
4
4
|
export { AccountAuthenticator, AnyRawTransaction, InputGenerateTransactionData, InputGenerateTransactionOptions, InputSubmitTransactionData, PendingTransactionResponse } from '@aptos-labs/ts-sdk';
|
|
5
5
|
import EventEmitter from 'eventemitter3';
|
|
6
6
|
|
|
@@ -237,6 +237,6 @@ declare function isMobile(): boolean;
|
|
|
237
237
|
declare function isInAppBrowser(): boolean;
|
|
238
238
|
declare function isRedirectable(): boolean;
|
|
239
239
|
declare function generalizedErrorMessage(error: any): string;
|
|
240
|
-
declare const areBCSArguments: (args:
|
|
240
|
+
declare const areBCSArguments: (args: Array<EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes>) => boolean;
|
|
241
241
|
|
|
242
242
|
export { AccountInfo, AdapterPlugin, AdapterPluginEvents, AdapterPluginProps, AptosWalletErrorResult, InputTransactionData, NetworkInfo, NetworkName, OnAccountChange, OnNetworkChange, SignMessagePayload, SignMessageResponse, TransactionOptions, Wallet, WalletCore, WalletCoreEvents, WalletInfo, WalletName, WalletReadyState, areBCSArguments, generalizedErrorMessage, getLocalStorage, isInAppBrowser, isMobile, isRedirectable, removeLocalStorage, scopePollingDetectionStrategy, setLocalStorage };
|
package/dist/index.js
CHANGED
|
@@ -224,7 +224,11 @@ function generalizedErrorMessage(error) {
|
|
|
224
224
|
return typeof error === "object" && "message" in error ? error.message : error;
|
|
225
225
|
}
|
|
226
226
|
var areBCSArguments = (args) => {
|
|
227
|
-
|
|
227
|
+
if (args.length === 0)
|
|
228
|
+
return false;
|
|
229
|
+
return args.every(
|
|
230
|
+
(arg) => arg instanceof import_ts_sdk.Serializable
|
|
231
|
+
);
|
|
228
232
|
};
|
|
229
233
|
|
|
230
234
|
// src/ans.ts
|
package/dist/index.mjs
CHANGED
|
@@ -161,7 +161,9 @@ function getLocalStorage() {
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
// src/utils/helpers.ts
|
|
164
|
-
import {
|
|
164
|
+
import {
|
|
165
|
+
Serializable
|
|
166
|
+
} from "@aptos-labs/ts-sdk";
|
|
165
167
|
function isMobile() {
|
|
166
168
|
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(
|
|
167
169
|
navigator.userAgent
|
|
@@ -185,7 +187,11 @@ function generalizedErrorMessage(error) {
|
|
|
185
187
|
return typeof error === "object" && "message" in error ? error.message : error;
|
|
186
188
|
}
|
|
187
189
|
var areBCSArguments = (args) => {
|
|
188
|
-
|
|
190
|
+
if (args.length === 0)
|
|
191
|
+
return false;
|
|
192
|
+
return args.every(
|
|
193
|
+
(arg) => arg instanceof Serializable
|
|
194
|
+
);
|
|
189
195
|
};
|
|
190
196
|
|
|
191
197
|
// src/ans.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aptos-labs/wallet-adapter-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "Aptos Wallet Adapter Core",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"aptos": "^1.21.0",
|
|
47
|
-
"@aptos-labs/ts-sdk": "^1.
|
|
47
|
+
"@aptos-labs/ts-sdk": "^1.3.0"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/utils/helpers.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
EntryFunctionArgumentTypes,
|
|
3
|
+
Serializable,
|
|
4
|
+
SimpleEntryFunctionArgumentTypes,
|
|
5
|
+
} from "@aptos-labs/ts-sdk";
|
|
2
6
|
|
|
3
7
|
export function isMobile(): boolean {
|
|
4
8
|
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(
|
|
@@ -37,6 +41,14 @@ export function generalizedErrorMessage(error: any): string {
|
|
|
37
41
|
// In @aptos-labs/ts-sdk each move representative class extends
|
|
38
42
|
// Serializable, so if each argument is of an instance of a class
|
|
39
43
|
// the extends Serializable - we know these are BCS arguments
|
|
40
|
-
export const areBCSArguments = (
|
|
41
|
-
|
|
44
|
+
export const areBCSArguments = (
|
|
45
|
+
args: Array<EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes>
|
|
46
|
+
): boolean => {
|
|
47
|
+
// `every` returns true if the array is empty, so
|
|
48
|
+
// first check the array length
|
|
49
|
+
if (args.length === 0) return false;
|
|
50
|
+
return args.every(
|
|
51
|
+
(arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes) =>
|
|
52
|
+
arg instanceof Serializable
|
|
53
|
+
);
|
|
42
54
|
};
|