@megaeth-labs/wallet-sdk-react 0.1.11 → 0.1.13-beta.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/dist/index.cjs +16 -0
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +14 -0
- package/package.json +72 -70
package/dist/index.cjs
CHANGED
|
@@ -43,9 +43,11 @@ __export(index_exports, {
|
|
|
43
43
|
useManageAccount: () => useManageAccount,
|
|
44
44
|
usePermissions: () => usePermissions,
|
|
45
45
|
useRevokePermissions: () => useRevokePermissions,
|
|
46
|
+
useSend: () => useSend,
|
|
46
47
|
useSignData: () => useSignData,
|
|
47
48
|
useSignMessage: () => useSignMessage,
|
|
48
49
|
useStatus: () => useStatus,
|
|
50
|
+
useSwap: () => useSwap,
|
|
49
51
|
useTransfer: () => useTransfer
|
|
50
52
|
});
|
|
51
53
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -185,6 +187,18 @@ var useManageAccount = (options) => {
|
|
|
185
187
|
...options
|
|
186
188
|
});
|
|
187
189
|
};
|
|
190
|
+
var useSend = (options) => {
|
|
191
|
+
return (0, import_react_query.useMutation)({
|
|
192
|
+
mutationFn: import_wallet_sdk.mega.send,
|
|
193
|
+
...options
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
var useSwap = (options) => {
|
|
197
|
+
return (0, import_react_query.useMutation)({
|
|
198
|
+
mutationFn: import_wallet_sdk.mega.swap,
|
|
199
|
+
...options
|
|
200
|
+
});
|
|
201
|
+
};
|
|
188
202
|
// Annotate the CommonJS export names for ESM import in node:
|
|
189
203
|
0 && (module.exports = {
|
|
190
204
|
MegaProvider,
|
|
@@ -200,8 +214,10 @@ var useManageAccount = (options) => {
|
|
|
200
214
|
useManageAccount,
|
|
201
215
|
usePermissions,
|
|
202
216
|
useRevokePermissions,
|
|
217
|
+
useSend,
|
|
203
218
|
useSignData,
|
|
204
219
|
useSignMessage,
|
|
205
220
|
useStatus,
|
|
221
|
+
useSwap,
|
|
206
222
|
useTransfer
|
|
207
223
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -32,5 +32,7 @@ declare const useManageAccount: (options?: Omit<UseMutationOptions<Awaited<Retur
|
|
|
32
32
|
method: string;
|
|
33
33
|
data?: any;
|
|
34
34
|
}, unknown>;
|
|
35
|
+
declare const useSend: (options?: Omit<UseMutationOptions<Awaited<ReturnType<typeof mega.send>>, Error, Parameters<typeof mega.send>[0]>, "mutationFn">) => _tanstack_react_query.UseMutationResult<_megaeth_labs_wallet_sdk.TransactionResult, Error, _megaeth_labs_wallet_sdk.SendRequest, unknown>;
|
|
36
|
+
declare const useSwap: (options?: Omit<UseMutationOptions<Awaited<ReturnType<typeof mega.swap>>, Error, Parameters<typeof mega.swap>[0]>, "mutationFn">) => _tanstack_react_query.UseMutationResult<_megaeth_labs_wallet_sdk.TransactionResult, Error, _megaeth_labs_wallet_sdk.SwapRequest, unknown>;
|
|
35
37
|
|
|
36
|
-
export { MegaProvider, useAuthenticate, useBalances, useCallContract, useConnect, useDeposit, useDisconnect, useGetFromContract, useGrantPermissions, useManageAccount, usePermissions, useRevokePermissions, useSignData, useSignMessage, useStatus, useTransfer };
|
|
38
|
+
export { MegaProvider, useAuthenticate, useBalances, useCallContract, useConnect, useDeposit, useDisconnect, useGetFromContract, useGrantPermissions, useManageAccount, usePermissions, useRevokePermissions, useSend, useSignData, useSignMessage, useStatus, useSwap, useTransfer };
|
package/dist/index.d.ts
CHANGED
|
@@ -32,5 +32,7 @@ declare const useManageAccount: (options?: Omit<UseMutationOptions<Awaited<Retur
|
|
|
32
32
|
method: string;
|
|
33
33
|
data?: any;
|
|
34
34
|
}, unknown>;
|
|
35
|
+
declare const useSend: (options?: Omit<UseMutationOptions<Awaited<ReturnType<typeof mega.send>>, Error, Parameters<typeof mega.send>[0]>, "mutationFn">) => _tanstack_react_query.UseMutationResult<_megaeth_labs_wallet_sdk.TransactionResult, Error, _megaeth_labs_wallet_sdk.SendRequest, unknown>;
|
|
36
|
+
declare const useSwap: (options?: Omit<UseMutationOptions<Awaited<ReturnType<typeof mega.swap>>, Error, Parameters<typeof mega.swap>[0]>, "mutationFn">) => _tanstack_react_query.UseMutationResult<_megaeth_labs_wallet_sdk.TransactionResult, Error, _megaeth_labs_wallet_sdk.SwapRequest, unknown>;
|
|
35
37
|
|
|
36
|
-
export { MegaProvider, useAuthenticate, useBalances, useCallContract, useConnect, useDeposit, useDisconnect, useGetFromContract, useGrantPermissions, useManageAccount, usePermissions, useRevokePermissions, useSignData, useSignMessage, useStatus, useTransfer };
|
|
38
|
+
export { MegaProvider, useAuthenticate, useBalances, useCallContract, useConnect, useDeposit, useDisconnect, useGetFromContract, useGrantPermissions, useManageAccount, usePermissions, useRevokePermissions, useSend, useSignData, useSignMessage, useStatus, useSwap, useTransfer };
|
package/dist/index.js
CHANGED
|
@@ -146,6 +146,18 @@ var useManageAccount = (options) => {
|
|
|
146
146
|
...options
|
|
147
147
|
});
|
|
148
148
|
};
|
|
149
|
+
var useSend = (options) => {
|
|
150
|
+
return useMutation({
|
|
151
|
+
mutationFn: mega.send,
|
|
152
|
+
...options
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
var useSwap = (options) => {
|
|
156
|
+
return useMutation({
|
|
157
|
+
mutationFn: mega.swap,
|
|
158
|
+
...options
|
|
159
|
+
});
|
|
160
|
+
};
|
|
149
161
|
export {
|
|
150
162
|
MegaProvider,
|
|
151
163
|
mega2 as mega,
|
|
@@ -160,8 +172,10 @@ export {
|
|
|
160
172
|
useManageAccount,
|
|
161
173
|
usePermissions,
|
|
162
174
|
useRevokePermissions,
|
|
175
|
+
useSend,
|
|
163
176
|
useSignData,
|
|
164
177
|
useSignMessage,
|
|
165
178
|
useStatus,
|
|
179
|
+
useSwap,
|
|
166
180
|
useTransfer
|
|
167
181
|
};
|
package/package.json
CHANGED
|
@@ -1,72 +1,74 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
"name": "@megaeth-labs/wallet-sdk-react",
|
|
3
|
+
"version": "0.1.13-beta.0",
|
|
4
|
+
"description": "MegaETH Wallet SDK React Wrapper for web applications",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsup src/index.tsx --format cjs,esm --dts --clean",
|
|
21
|
+
"dev": "tsup src/index.tsx --format cjs,esm --dts --watch",
|
|
22
|
+
"dev:link": "pnpm build && pnpm link --global",
|
|
23
|
+
"dev:setup": "pnpm link --global @megaeth-labs/wallet-sdk",
|
|
24
|
+
"test": "vitest",
|
|
25
|
+
"test:ui": "vitest --ui",
|
|
26
|
+
"test:coverage": "vitest --coverage",
|
|
27
|
+
"lint": "biome lint ./src",
|
|
28
|
+
"format": "biome format --write ./src",
|
|
29
|
+
"check": "biome check ./src",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"prepare": "husky"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"megaeth",
|
|
35
|
+
"wallet",
|
|
36
|
+
"sdk",
|
|
37
|
+
"web3",
|
|
38
|
+
"react"
|
|
39
|
+
],
|
|
40
|
+
"author": "",
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"registry": "https://registry.npmjs.org/",
|
|
44
|
+
"access": "restricted"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@megaeth-labs/wallet-sdk": "0.1.15-beta.1"
|
|
48
|
+
},
|
|
49
|
+
"packageManager": "pnpm@10.29.2",
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@tanstack/react-query": "^5",
|
|
52
|
+
"react": "^19"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@biomejs/biome": "2.4.6",
|
|
56
|
+
"@tanstack/react-query": "^5",
|
|
57
|
+
"@types/node": "25.3.5",
|
|
58
|
+
"@types/react": "^19",
|
|
59
|
+
"@vitest/coverage-v8": "4.0.18",
|
|
60
|
+
"@vitest/ui": "4.0.18",
|
|
61
|
+
"husky": "^9.1.7",
|
|
62
|
+
"jsdom": "28.1.0",
|
|
63
|
+
"lint-staged": "16.4.0",
|
|
64
|
+
"react": "^19",
|
|
65
|
+
"tsup": "8.5.1",
|
|
66
|
+
"typescript": "5.9.3",
|
|
67
|
+
"vitest": "4.0.18"
|
|
68
|
+
},
|
|
69
|
+
"lint-staged": {
|
|
70
|
+
"src/**/*.{ts,tsx,js,jsx,json}": [
|
|
71
|
+
"pnpm format"
|
|
72
|
+
]
|
|
14
73
|
}
|
|
15
|
-
|
|
16
|
-
"files": [
|
|
17
|
-
"dist"
|
|
18
|
-
],
|
|
19
|
-
"keywords": [
|
|
20
|
-
"megaeth",
|
|
21
|
-
"wallet",
|
|
22
|
-
"sdk",
|
|
23
|
-
"web3",
|
|
24
|
-
"react"
|
|
25
|
-
],
|
|
26
|
-
"author": "",
|
|
27
|
-
"license": "MIT",
|
|
28
|
-
"publishConfig": {
|
|
29
|
-
"registry": "https://registry.npmjs.org/",
|
|
30
|
-
"access": "restricted"
|
|
31
|
-
},
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"@megaeth-labs/wallet-sdk": "0.1.13"
|
|
34
|
-
},
|
|
35
|
-
"peerDependencies": {
|
|
36
|
-
"@tanstack/react-query": "^5",
|
|
37
|
-
"react": "^19"
|
|
38
|
-
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"@biomejs/biome": "2.4.6",
|
|
41
|
-
"@tanstack/react-query": "^5",
|
|
42
|
-
"@types/node": "25.3.5",
|
|
43
|
-
"@types/react": "^19",
|
|
44
|
-
"@vitest/coverage-v8": "4.0.18",
|
|
45
|
-
"@vitest/ui": "4.0.18",
|
|
46
|
-
"husky": "^9.1.7",
|
|
47
|
-
"jsdom": "28.1.0",
|
|
48
|
-
"lint-staged": "16.4.0",
|
|
49
|
-
"react": "^19",
|
|
50
|
-
"tsup": "8.5.1",
|
|
51
|
-
"typescript": "5.9.3",
|
|
52
|
-
"vitest": "4.0.18"
|
|
53
|
-
},
|
|
54
|
-
"lint-staged": {
|
|
55
|
-
"src/**/*.{ts,tsx,js,jsx,json}": [
|
|
56
|
-
"pnpm format"
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
"scripts": {
|
|
60
|
-
"build": "tsup src/index.tsx --format cjs,esm --dts --clean",
|
|
61
|
-
"dev": "tsup src/index.tsx --format cjs,esm --dts --watch",
|
|
62
|
-
"dev:link": "pnpm build && pnpm link --global",
|
|
63
|
-
"dev:setup": "pnpm link --global @megaeth-labs/wallet-sdk",
|
|
64
|
-
"test": "vitest",
|
|
65
|
-
"test:ui": "vitest --ui",
|
|
66
|
-
"test:coverage": "vitest --coverage",
|
|
67
|
-
"lint": "biome lint ./src",
|
|
68
|
-
"format": "biome format --write ./src",
|
|
69
|
-
"check": "biome check ./src",
|
|
70
|
-
"typecheck": "tsc --noEmit"
|
|
71
|
-
}
|
|
72
|
-
}
|
|
74
|
+
}
|