@manahippo/aptos-wallet-adapter 0.2.0 → 0.3.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.
Files changed (84) hide show
  1. package/README.md +21 -19
  2. package/dist/WalletAdapters/AptosWallet.d.ts +18 -7
  3. package/dist/WalletAdapters/AptosWallet.d.ts.map +1 -1
  4. package/dist/WalletAdapters/AptosWallet.js +47 -32
  5. package/dist/WalletAdapters/AptosWallet.js.map +1 -1
  6. package/dist/WalletAdapters/BaseAdapter.d.ts +10 -6
  7. package/dist/WalletAdapters/BaseAdapter.d.ts.map +1 -1
  8. package/dist/WalletAdapters/BaseAdapter.js.map +1 -1
  9. package/dist/WalletAdapters/FewchaWallet.d.ts +7 -4
  10. package/dist/WalletAdapters/FewchaWallet.d.ts.map +1 -1
  11. package/dist/WalletAdapters/FewchaWallet.js +90 -88
  12. package/dist/WalletAdapters/FewchaWallet.js.map +1 -1
  13. package/dist/WalletAdapters/HippoExtensionWallet.d.ts +8 -4
  14. package/dist/WalletAdapters/HippoExtensionWallet.d.ts.map +1 -1
  15. package/dist/WalletAdapters/HippoExtensionWallet.js +27 -5
  16. package/dist/WalletAdapters/HippoExtensionWallet.js.map +1 -1
  17. package/dist/WalletAdapters/HippoWallet.d.ts +7 -4
  18. package/dist/WalletAdapters/HippoWallet.d.ts.map +1 -1
  19. package/dist/WalletAdapters/HippoWallet.js +28 -2
  20. package/dist/WalletAdapters/HippoWallet.js.map +1 -1
  21. package/dist/WalletAdapters/MartianWallet.d.ts +11 -6
  22. package/dist/WalletAdapters/MartianWallet.d.ts.map +1 -1
  23. package/dist/WalletAdapters/MartianWallet.js +51 -35
  24. package/dist/WalletAdapters/MartianWallet.js.map +1 -1
  25. package/dist/WalletAdapters/NightlyWallet.d.ts +1 -41
  26. package/dist/WalletAdapters/NightlyWallet.d.ts.map +1 -1
  27. package/dist/WalletAdapters/NightlyWallet.js +232 -198
  28. package/dist/WalletAdapters/NightlyWallet.js.map +1 -1
  29. package/dist/WalletAdapters/PontemWallet.d.ts +57 -0
  30. package/dist/WalletAdapters/PontemWallet.d.ts.map +1 -0
  31. package/dist/WalletAdapters/PontemWallet.js +182 -0
  32. package/dist/WalletAdapters/PontemWallet.js.map +1 -0
  33. package/dist/WalletAdapters/SpikaWallet.d.ts +46 -0
  34. package/dist/WalletAdapters/SpikaWallet.d.ts.map +1 -0
  35. package/dist/WalletAdapters/{MultiMaskWallet.js → SpikaWallet.js} +72 -83
  36. package/dist/WalletAdapters/SpikaWallet.js.map +1 -0
  37. package/dist/WalletAdapters/index.d.ts +2 -2
  38. package/dist/WalletAdapters/index.d.ts.map +1 -1
  39. package/dist/WalletAdapters/index.js +3 -2
  40. package/dist/WalletAdapters/index.js.map +1 -1
  41. package/dist/WalletProviders/WalletProvider.d.ts +0 -1
  42. package/dist/WalletProviders/WalletProvider.d.ts.map +1 -1
  43. package/dist/WalletProviders/WalletProvider.js +10 -7
  44. package/dist/WalletProviders/WalletProvider.js.map +1 -1
  45. package/dist/WalletProviders/useWallet.d.ts +5 -3
  46. package/dist/WalletProviders/useWallet.d.ts.map +1 -1
  47. package/dist/WalletProviders/useWallet.js +1 -1
  48. package/dist/WalletProviders/useWallet.js.map +1 -1
  49. package/dist/config/aptosConstants.d.ts +2 -2
  50. package/dist/config/aptosConstants.d.ts.map +1 -1
  51. package/dist/config/aptosConstants.js +1 -1
  52. package/dist/config/aptosConstants.js.map +1 -1
  53. package/dist/hooks/useLocalStorage.d.ts.map +1 -1
  54. package/dist/hooks/useLocalStorage.js +9 -4
  55. package/dist/hooks/useLocalStorage.js.map +1 -1
  56. package/dist/hooks/useSSR.d.ts +4 -0
  57. package/dist/hooks/useSSR.d.ts.map +1 -0
  58. package/dist/hooks/useSSR.js +17 -0
  59. package/dist/hooks/useSSR.js.map +1 -0
  60. package/dist/utilities/util.d.ts +8 -0
  61. package/dist/utilities/util.d.ts.map +1 -0
  62. package/dist/utilities/util.js +14 -0
  63. package/dist/utilities/util.js.map +1 -0
  64. package/package.json +10 -10
  65. package/src/WalletAdapters/AptosWallet.ts +63 -37
  66. package/src/WalletAdapters/BaseAdapter.ts +14 -16
  67. package/src/WalletAdapters/FewchaWallet.ts +97 -81
  68. package/src/WalletAdapters/HippoExtensionWallet.ts +32 -9
  69. package/src/WalletAdapters/HippoWallet.ts +35 -7
  70. package/src/WalletAdapters/MartianWallet.ts +57 -42
  71. package/src/WalletAdapters/NightlyWallet.ts +230 -229
  72. package/src/WalletAdapters/PontemWallet.ts +250 -0
  73. package/src/WalletAdapters/SpikaWallet.ts +229 -0
  74. package/src/WalletAdapters/index.ts +3 -2
  75. package/src/WalletProviders/WalletProvider.tsx +12 -10
  76. package/src/WalletProviders/useWallet.ts +7 -14
  77. package/src/config/aptosConstants.ts +1 -1
  78. package/src/hooks/useLocalStorage.ts +9 -4
  79. package/src/hooks/useSSR.ts +15 -0
  80. package/src/utilities/util.ts +11 -0
  81. package/dist/WalletAdapters/MultiMaskWallet.d.ts +0 -39
  82. package/dist/WalletAdapters/MultiMaskWallet.d.ts.map +0 -1
  83. package/dist/WalletAdapters/MultiMaskWallet.js.map +0 -1
  84. package/src/WalletAdapters/MultiMaskWallet.ts +0 -245
@@ -1,260 +1,261 @@
1
- import { TxnBuilderTypes, BCS } from 'aptos';
2
- import {
3
- PendingTransaction,
4
- ScriptFunctionPayload,
5
- SubmitTransactionRequest,
6
- TransactionPayload
7
- } from 'aptos/dist/api/data-contracts';
8
- import {
9
- ScriptFunction,
10
- StructTag,
11
- TransactionPayloadScriptFunction,
12
- TypeTagStruct
13
- } from 'aptos/dist/transaction_builder/aptos_types';
14
- import { bcsSerializeUint64, bcsToBytes, Seq } from 'aptos/dist/transaction_builder/bcs';
15
- import { aptosClient } from '../config/aptosConstants';
16
- import {
17
- WalletDisconnectionError,
18
- WalletNotConnectedError,
19
- WalletNotReadyError,
20
- WalletSignTransactionError
21
- } from '../WalletProviders/errors';
22
- import {
23
- AccountKeys,
24
- Address,
25
- AuthKey,
26
- BaseWalletAdapter,
27
- PublicKey,
28
- scopePollingDetectionStrategy,
29
- WalletName,
30
- WalletReadyState
31
- } from './BaseAdapter';
1
+ export const NightlyWallet = () => {};
2
+ // import { TxnBuilderTypes, BCS } from 'aptos';
3
+ // import {
4
+ // PendingTransaction,
5
+ // ScriptFunctionPayload,
6
+ // SubmitTransactionRequest,
7
+ // TransactionPayload
8
+ // } from 'aptos/dist/api/data-contracts';
9
+ // import {
10
+ // ScriptFunction,
11
+ // StructTag,
12
+ // TransactionPayloadScriptFunction,
13
+ // TypeTagStruct
14
+ // } from 'aptos/dist/transaction_builder/aptos_types';
15
+ // import { bcsSerializeUint64, bcsToBytes, Seq } from 'aptos/dist/transaction_builder/bcs';
16
+ // import { aptosClient } from '../config/aptosConstants';
17
+ // import {
18
+ // WalletDisconnectionError,
19
+ // WalletNotConnectedError,
20
+ // WalletNotReadyError,
21
+ // WalletSignTransactionError
22
+ // } from '../WalletProviders/errors';
23
+ // import {
24
+ // AccountKeys,
25
+ // Address,
26
+ // AuthKey,
27
+ // BaseWalletAdapter,
28
+ // PublicKey,
29
+ // scopePollingDetectionStrategy,
30
+ // WalletName,
31
+ // WalletReadyState
32
+ // } from './BaseAdapter';
32
33
 
33
- interface INightlyWallet {
34
- requestId: number;
35
- connect: (onDisconnect?: () => void, eager?: boolean) => Promise<any>;
36
- account: () => Promise<string>;
37
- isConnected: () => Promise<boolean>;
38
- signAndSubmitTransaction(transaction: any): Promise<void>;
39
- signTransaction(transaction: any): Promise<any>;
40
- disconnect(): Promise<void>;
41
- }
34
+ // interface INightlyWallet {
35
+ // requestId: number;
36
+ // connect: (onDisconnect?: () => void, eager?: boolean) => Promise<any>;
37
+ // account: () => Promise<string>;
38
+ // isConnected: () => Promise<boolean>;
39
+ // signAndSubmitTransaction(transaction: any): Promise<void>;
40
+ // signTransaction(transaction: any): Promise<any>;
41
+ // disconnect(): Promise<void>;
42
+ // }
42
43
 
43
- interface NightlyWindow extends Window {
44
- nightly?: {
45
- aptos: INightlyWallet;
46
- };
47
- }
44
+ // interface NightlyWindow extends Window {
45
+ // nightly?: {
46
+ // aptos: INightlyWallet;
47
+ // };
48
+ // }
48
49
 
49
- declare const window: NightlyWindow;
50
+ // declare const window: NightlyWindow;
50
51
 
51
- export const NightlyWalletName = 'Nightly Wallet' as WalletName<'Nightly Wallet'>;
52
+ // export const NightlyWalletName = 'Nightly Wallet' as WalletName<'Nightly Wallet'>;
52
53
 
53
- export interface NightlyWalletAdapterConfig {
54
- provider?: INightlyWallet;
55
- // network?: WalletAdapterNetwork;
56
- timeout?: number;
57
- }
54
+ // export interface NightlyWalletAdapterConfig {
55
+ // provider?: INightlyWallet;
56
+ // // network?: WalletAdapterNetwork;
57
+ // timeout?: number;
58
+ // }
58
59
 
59
- export class NightlyWalletAdapter extends BaseWalletAdapter {
60
- name = NightlyWalletName;
60
+ // export class NightlyWalletAdapter extends BaseWalletAdapter {
61
+ // name = NightlyWalletName;
61
62
 
62
- url =
63
- 'https://chrome.google.com/webstore/detail/nightly/injggoambcadlfkkjcgdfbejanmgfgfm/related?hl=en&authuser=0';
63
+ // url =
64
+ // 'https://chrome.google.com/webstore/detail/nightly/injggoambcadlfkkjcgdfbejanmgfgfm/related?hl=en&authuser=0';
64
65
 
65
- icon =
66
- 'https://lh3.googleusercontent.com/Ha38j09tA-70EiZ17pculpj1KUKDP07ytX4DJx_fumDfod_X2nRTiUg2Y9tDwRBs5jDj-gu52hwaPYVPgq1xAuFA1Q=w128-h128-e365-rj-sc0x00ffffff';
66
+ // icon =
67
+ // 'https://lh3.googleusercontent.com/Ha38j09tA-70EiZ17pculpj1KUKDP07ytX4DJx_fumDfod_X2nRTiUg2Y9tDwRBs5jDj-gu52hwaPYVPgq1xAuFA1Q=w128-h128-e365-rj-sc0x00ffffff';
67
68
 
68
- protected _provider: INightlyWallet | undefined;
69
+ // protected _provider: INightlyWallet | undefined;
69
70
 
70
- // protected _network: WalletAdapterNetwork;
71
- protected _timeout: number;
71
+ // // protected _network: WalletAdapterNetwork;
72
+ // protected _timeout: number;
72
73
 
73
- protected _readyState: WalletReadyState =
74
- typeof window === 'undefined' || typeof document === 'undefined'
75
- ? WalletReadyState.Unsupported
76
- : WalletReadyState.NotDetected;
74
+ // protected _readyState: WalletReadyState =
75
+ // typeof window === 'undefined' || typeof document === 'undefined'
76
+ // ? WalletReadyState.Unsupported
77
+ // : WalletReadyState.NotDetected;
77
78
 
78
- protected _connecting: boolean;
79
+ // protected _connecting: boolean;
79
80
 
80
- protected _wallet: {
81
- publicKey?: string;
82
- address?: string;
83
- authKey?: string;
84
- isConnected: boolean;
85
- } | null;
81
+ // protected _wallet: {
82
+ // publicKey?: string;
83
+ // address?: string;
84
+ // authKey?: string;
85
+ // isConnected: boolean;
86
+ // } | null;
86
87
 
87
- constructor({
88
- // provider,
89
- // network = WalletAdapterNetwork.Mainnet,
90
- timeout = 10000
91
- }: NightlyWalletAdapterConfig = {}) {
92
- super();
88
+ // constructor({
89
+ // // provider,
90
+ // // network = WalletAdapterNetwork.Mainnet,
91
+ // timeout = 10000
92
+ // }: NightlyWalletAdapterConfig = {}) {
93
+ // super();
93
94
 
94
- this._provider = window.nightly?.aptos;
95
- // this._network = network;
96
- this._timeout = timeout;
97
- this._connecting = false;
98
- this._wallet = null;
95
+ // this._provider = window.nightly?.aptos;
96
+ // // this._network = network;
97
+ // this._timeout = timeout;
98
+ // this._connecting = false;
99
+ // this._wallet = null;
99
100
 
100
- if (this._readyState !== WalletReadyState.Unsupported) {
101
- scopePollingDetectionStrategy(() => {
102
- if (window.nightly?.aptos) {
103
- this._readyState = WalletReadyState.Installed;
104
- this.emit('readyStateChange', this._readyState);
105
- return true;
106
- }
107
- return false;
108
- });
109
- }
110
- }
101
+ // if (this._readyState !== WalletReadyState.Unsupported) {
102
+ // scopePollingDetectionStrategy(() => {
103
+ // if (window.nightly?.aptos) {
104
+ // this._readyState = WalletReadyState.Installed;
105
+ // this.emit('readyStateChange', this._readyState);
106
+ // return true;
107
+ // }
108
+ // return false;
109
+ // });
110
+ // }
111
+ // }
111
112
 
112
- get publicAccount(): AccountKeys {
113
- return {
114
- publicKey: this._wallet?.publicKey || null,
115
- address: this._wallet?.address || null,
116
- authKey: this._wallet?.authKey || null
117
- };
118
- }
113
+ // get publicAccount(): AccountKeys {
114
+ // return {
115
+ // publicKey: this._wallet?.publicKey || null,
116
+ // address: this._wallet?.address || null,
117
+ // authKey: this._wallet?.authKey || null
118
+ // };
119
+ // }
119
120
 
120
- get connecting(): boolean {
121
- return this._connecting;
122
- }
121
+ // get connecting(): boolean {
122
+ // return this._connecting;
123
+ // }
123
124
 
124
- get connected(): boolean {
125
- return !!this._wallet?.isConnected;
126
- }
125
+ // get connected(): boolean {
126
+ // return !!this._wallet?.isConnected;
127
+ // }
127
128
 
128
- get readyState(): WalletReadyState {
129
- return this._readyState;
130
- }
129
+ // get readyState(): WalletReadyState {
130
+ // return this._readyState;
131
+ // }
131
132
 
132
- async connect(): Promise<void> {
133
- try {
134
- if (this.connected || this.connecting) return;
135
- if (
136
- !(
137
- this._readyState === WalletReadyState.Loadable ||
138
- this._readyState === WalletReadyState.Installed
139
- )
140
- )
141
- throw new WalletNotReadyError();
142
- this._connecting = true;
133
+ // async connect(): Promise<void> {
134
+ // try {
135
+ // if (this.connected || this.connecting) return;
136
+ // if (
137
+ // !(
138
+ // this._readyState === WalletReadyState.Loadable ||
139
+ // this._readyState === WalletReadyState.Installed
140
+ // )
141
+ // )
142
+ // throw new WalletNotReadyError();
143
+ // this._connecting = true;
143
144
 
144
- const provider = this._provider || window.nightly?.aptos;
145
- const publicKey = await provider?.connect(() => {
146
- console.log('Trigger disconnect Aptos');
147
- });
148
- this._wallet = {
149
- publicKey: publicKey?.asString(),
150
- address: publicKey?.address(),
151
- isConnected: true
152
- };
145
+ // const provider = this._provider || window.nightly?.aptos;
146
+ // const publicKey = await provider?.connect(() => {
147
+ // console.log('Trigger disconnect Aptos');
148
+ // });
149
+ // this._wallet = {
150
+ // publicKey: publicKey?.asString(),
151
+ // address: publicKey?.address(),
152
+ // isConnected: true
153
+ // };
153
154
 
154
- this.emit('connect', this._wallet.publicKey || '');
155
- } catch (error: any) {
156
- this.emit('error', error);
157
- throw error;
158
- } finally {
159
- this._connecting = false;
160
- }
161
- }
155
+ // this.emit('connect', this._wallet.publicKey || '');
156
+ // } catch (error: any) {
157
+ // this.emit('error', error);
158
+ // throw error;
159
+ // } finally {
160
+ // this._connecting = false;
161
+ // }
162
+ // }
162
163
 
163
- async disconnect(): Promise<void> {
164
- const wallet = this._wallet;
165
- if (wallet) {
166
- this._wallet = null;
164
+ // async disconnect(): Promise<void> {
165
+ // const wallet = this._wallet;
166
+ // if (wallet) {
167
+ // this._wallet = null;
167
168
 
168
- try {
169
- const provider = this._provider || window.nightly?.aptos;
170
- await provider?.disconnect();
171
- } catch (error: any) {
172
- this.emit('error', new WalletDisconnectionError(error?.message, error));
173
- }
174
- }
169
+ // try {
170
+ // const provider = this._provider || window.nightly?.aptos;
171
+ // await provider?.disconnect();
172
+ // } catch (error: any) {
173
+ // this.emit('error', new WalletDisconnectionError(error?.message, error));
174
+ // }
175
+ // }
175
176
 
176
- this.emit('disconnect');
177
- }
177
+ // this.emit('disconnect');
178
+ // }
178
179
 
179
- async signTransaction(transaction: TransactionPayload): Promise<SubmitTransactionRequest> {
180
- try {
181
- const wallet = this._wallet;
182
- if (!wallet) throw new WalletNotConnectedError();
180
+ // async signTransaction(transaction: TransactionPayload): Promise<SubmitTransactionRequest> {
181
+ // try {
182
+ // const wallet = this._wallet;
183
+ // if (!wallet) throw new WalletNotConnectedError();
183
184
 
184
- try {
185
- const provider = this._provider || window.nightly?.aptos;
186
- const response = await provider?.signTransaction(transaction);
187
- if (response) {
188
- return response;
189
- } else {
190
- throw new Error('Transaction failed');
191
- }
192
- } catch (error: any) {
193
- throw new WalletSignTransactionError(error?.message, error);
194
- }
195
- } catch (error: any) {
196
- this.emit('error', error);
197
- throw error;
198
- }
199
- }
185
+ // try {
186
+ // const provider = this._provider || window.nightly?.aptos;
187
+ // const response = await provider?.signTransaction(transaction);
188
+ // if (response) {
189
+ // return response;
190
+ // } else {
191
+ // throw new Error('Transaction failed');
192
+ // }
193
+ // } catch (error: any) {
194
+ // throw new WalletSignTransactionError(error?.message, error);
195
+ // }
196
+ // } catch (error: any) {
197
+ // this.emit('error', error);
198
+ // throw error;
199
+ // }
200
+ // }
200
201
 
201
- async signAndSubmitTransaction(tempTransaction: TransactionPayload): Promise<PendingTransaction> {
202
- try {
203
- const wallet = this._wallet;
204
- if (!wallet) throw new WalletNotConnectedError();
202
+ // async signAndSubmitTransaction(tempTransaction: TransactionPayload): Promise<PendingTransaction> {
203
+ // try {
204
+ // const wallet = this._wallet;
205
+ // if (!wallet) throw new WalletNotConnectedError();
205
206
 
206
- try {
207
- const provider = this._provider || window.nightly?.aptos;
208
- const client = aptosClient;
209
- const [{ sequence_number: sequnceNumber }, chainId] = await Promise.all([
210
- client.getAccount(wallet.address || ''),
211
- client.getChainId()
212
- ]);
213
- const transaction = tempTransaction as ScriptFunctionPayload;
214
- const [txAddress, module, funcName] = transaction.function.split('::');
215
- const token = new TypeTagStruct(StructTag.fromString(transaction.type_arguments[0]));
216
- const argts = transaction.arguments.map((arg) => {
217
- if (typeof arg === 'string') {
218
- return bcsSerializeUint64(parseInt(arg));
219
- } else if (typeof arg === 'boolean') {
220
- const serializer = new BCS.Serializer();
221
- serializer.serializeBool(arg);
222
- return serializer.getBytes();
223
- } else if (typeof arg === 'number') {
224
- return bcsSerializeUint64(arg);
225
- } else {
226
- return arg;
227
- }
228
- });
229
- console.log('txnpayload>>', transaction.arguments, argts);
230
- const txnPayload = new TransactionPayloadScriptFunction(
231
- ScriptFunction.natural(`${txAddress}::${module}`, funcName, [token], [...argts])
232
- );
207
+ // try {
208
+ // const provider = this._provider || window.nightly?.aptos;
209
+ // const client = aptosClient;
210
+ // const [{ sequence_number: sequnceNumber }, chainId] = await Promise.all([
211
+ // client.getAccount(wallet.address || ''),
212
+ // client.getChainId()
213
+ // ]);
214
+ // const transaction = tempTransaction as ScriptFunctionPayload;
215
+ // const [txAddress, module, funcName] = transaction.function.split('::');
216
+ // const token = new TypeTagStruct(StructTag.fromString(transaction.type_arguments[0]));
217
+ // const argts = transaction.arguments.map((arg) => {
218
+ // if (typeof arg === 'string') {
219
+ // return bcsSerializeUint64(parseInt(arg));
220
+ // } else if (typeof arg === 'boolean') {
221
+ // const serializer = new BCS.Serializer();
222
+ // serializer.serializeBool(arg);
223
+ // return serializer.getBytes();
224
+ // } else if (typeof arg === 'number') {
225
+ // return bcsSerializeUint64(arg);
226
+ // } else {
227
+ // return arg;
228
+ // }
229
+ // });
230
+ // console.log('txnpayload>>', transaction.arguments, argts);
231
+ // const txnPayload = new TransactionPayloadScriptFunction(
232
+ // ScriptFunction.natural(`${txAddress}::${module}`, funcName, [token], [...argts])
233
+ // );
233
234
 
234
- const rawTxn = new TxnBuilderTypes.RawTransaction(
235
- TxnBuilderTypes.AccountAddress.fromHex(wallet.address || ''),
236
- BigInt(sequnceNumber),
237
- txnPayload,
238
- BigInt(1000),
239
- BigInt(1),
240
- BigInt(Math.floor(Date.now() / 1000) + 10),
241
- new TxnBuilderTypes.ChainId(chainId)
242
- );
243
- const bcsTxn = await provider?.signTransaction(rawTxn);
244
- const response = await aptosClient.submitSignedBCSTransaction(bcsTxn);
245
- if (response) {
246
- console.log('tx response>>>', response);
247
- return response;
248
- } else {
249
- throw new Error('Transaction failed');
250
- }
251
- } catch (error: any) {
252
- const errMsg = error instanceof Error ? error.message : error.response.data.message;
253
- throw new WalletSignTransactionError(errMsg);
254
- }
255
- } catch (error: any) {
256
- this.emit('error', error);
257
- throw error;
258
- }
259
- }
260
- }
235
+ // const rawTxn = new TxnBuilderTypes.RawTransaction(
236
+ // TxnBuilderTypes.AccountAddress.fromHex(wallet.address || ''),
237
+ // BigInt(sequnceNumber),
238
+ // txnPayload,
239
+ // BigInt(1000),
240
+ // BigInt(1),
241
+ // BigInt(Math.floor(Date.now() / 1000) + 10),
242
+ // new TxnBuilderTypes.ChainId(chainId)
243
+ // );
244
+ // const bcsTxn = await provider?.signTransaction(rawTxn);
245
+ // const response = await aptosClient.submitSignedBCSTransaction(bcsTxn);
246
+ // if (response) {
247
+ // console.log('tx response>>>', response);
248
+ // return response;
249
+ // } else {
250
+ // throw new Error('Transaction failed');
251
+ // }
252
+ // } catch (error: any) {
253
+ // const errMsg = error instanceof Error ? error.message : error.response.data.message;
254
+ // throw new WalletSignTransactionError(errMsg);
255
+ // }
256
+ // } catch (error: any) {
257
+ // this.emit('error', error);
258
+ // throw error;
259
+ // }
260
+ // }
261
+ // }