@manahippo/aptos-wallet-adapter 0.2.1 → 0.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/README.md +16 -16
- package/dist/WalletAdapters/AptosWallet.d.ts +8 -5
- package/dist/WalletAdapters/AptosWallet.d.ts.map +1 -1
- package/dist/WalletAdapters/AptosWallet.js +25 -29
- package/dist/WalletAdapters/AptosWallet.js.map +1 -1
- package/dist/WalletAdapters/BaseAdapter.d.ts +7 -5
- package/dist/WalletAdapters/BaseAdapter.d.ts.map +1 -1
- package/dist/WalletAdapters/BaseAdapter.js.map +1 -1
- package/dist/WalletAdapters/FewchaWallet.d.ts +4 -2
- package/dist/WalletAdapters/FewchaWallet.d.ts.map +1 -1
- package/dist/WalletAdapters/FewchaWallet.js +58 -57
- package/dist/WalletAdapters/FewchaWallet.js.map +1 -1
- package/dist/WalletAdapters/HippoExtensionWallet.d.ts +4 -2
- package/dist/WalletAdapters/HippoExtensionWallet.d.ts.map +1 -1
- package/dist/WalletAdapters/HippoExtensionWallet.js +3 -3
- package/dist/WalletAdapters/HippoExtensionWallet.js.map +1 -1
- package/dist/WalletAdapters/HippoWallet.d.ts +4 -2
- package/dist/WalletAdapters/HippoWallet.d.ts.map +1 -1
- package/dist/WalletAdapters/HippoWallet.js +2 -1
- package/dist/WalletAdapters/HippoWallet.js.map +1 -1
- package/dist/WalletAdapters/MartianWallet.d.ts +7 -4
- package/dist/WalletAdapters/MartianWallet.d.ts.map +1 -1
- package/dist/WalletAdapters/MartianWallet.js +24 -30
- package/dist/WalletAdapters/MartianWallet.js.map +1 -1
- package/dist/WalletAdapters/MultiMaskWallet.d.ts +4 -2
- package/dist/WalletAdapters/MultiMaskWallet.d.ts.map +1 -1
- package/dist/WalletAdapters/MultiMaskWallet.js +4 -4
- package/dist/WalletAdapters/MultiMaskWallet.js.map +1 -1
- package/dist/WalletAdapters/NightlyWallet.d.ts +1 -41
- package/dist/WalletAdapters/NightlyWallet.d.ts.map +1 -1
- package/dist/WalletAdapters/NightlyWallet.js +232 -198
- package/dist/WalletAdapters/NightlyWallet.js.map +1 -1
- package/dist/WalletAdapters/PontemWallet.d.ts +55 -0
- package/dist/WalletAdapters/PontemWallet.d.ts.map +1 -0
- package/dist/WalletAdapters/PontemWallet.js +160 -0
- package/dist/WalletAdapters/PontemWallet.js.map +1 -0
- package/dist/WalletAdapters/index.d.ts +1 -1
- package/dist/WalletAdapters/index.d.ts.map +1 -1
- package/dist/WalletAdapters/index.js +2 -1
- package/dist/WalletAdapters/index.js.map +1 -1
- package/dist/WalletProviders/WalletProvider.d.ts +0 -1
- package/dist/WalletProviders/WalletProvider.d.ts.map +1 -1
- package/dist/WalletProviders/WalletProvider.js +1 -6
- package/dist/WalletProviders/WalletProvider.js.map +1 -1
- package/dist/WalletProviders/useWallet.d.ts +4 -3
- package/dist/WalletProviders/useWallet.d.ts.map +1 -1
- package/dist/WalletProviders/useWallet.js +1 -1
- package/dist/WalletProviders/useWallet.js.map +1 -1
- package/dist/config/aptosConstants.d.ts +2 -2
- package/dist/config/aptosConstants.d.ts.map +1 -1
- package/dist/config/aptosConstants.js +1 -1
- package/dist/config/aptosConstants.js.map +1 -1
- package/dist/hooks/useLocalStorage.d.ts.map +1 -1
- package/dist/hooks/useLocalStorage.js +9 -4
- package/dist/hooks/useLocalStorage.js.map +1 -1
- package/dist/hooks/useSSR.d.ts +4 -0
- package/dist/hooks/useSSR.d.ts.map +1 -0
- package/dist/hooks/useSSR.js +17 -0
- package/dist/hooks/useSSR.js.map +1 -0
- package/dist/utilities/util.d.ts +8 -0
- package/dist/utilities/util.d.ts.map +1 -0
- package/dist/utilities/util.js +14 -0
- package/dist/utilities/util.js.map +1 -0
- package/package.json +10 -10
- package/src/WalletAdapters/AptosWallet.ts +32 -34
- package/src/WalletAdapters/BaseAdapter.ts +8 -19
- package/src/WalletAdapters/FewchaWallet.ts +69 -73
- package/src/WalletAdapters/HippoExtensionWallet.ts +9 -7
- package/src/WalletAdapters/HippoWallet.ts +8 -6
- package/src/WalletAdapters/MartianWallet.ts +31 -37
- package/src/WalletAdapters/MultiMaskWallet.ts +13 -10
- package/src/WalletAdapters/NightlyWallet.ts +230 -229
- package/src/WalletAdapters/PontemWallet.ts +225 -0
- package/src/WalletAdapters/index.ts +2 -1
- package/src/WalletProviders/WalletProvider.tsx +1 -9
- package/src/WalletProviders/useWallet.ts +6 -14
- package/src/config/aptosConstants.ts +1 -1
- package/src/hooks/useLocalStorage.ts +9 -4
- package/src/hooks/useSSR.ts +15 -0
- package/src/utilities/util.ts +11 -0
@@ -1,9 +1,10 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
2
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
1
3
|
import {
|
2
|
-
|
3
|
-
ScriptFunctionPayload,
|
4
|
+
TransactionPayload,
|
4
5
|
SubmitTransactionRequest,
|
5
|
-
|
6
|
-
} from 'aptos/dist/
|
6
|
+
HexEncodedBytes
|
7
|
+
} from 'aptos/dist/generated';
|
7
8
|
import {
|
8
9
|
WalletDisconnectionError,
|
9
10
|
WalletNotConnectedError,
|
@@ -74,13 +75,13 @@ export class MultiMaskWalletAdapter extends BaseWalletAdapter {
|
|
74
75
|
}: MultiMaskWalletAdapterConfig = {}) {
|
75
76
|
super();
|
76
77
|
|
77
|
-
this._provider = window.aptosWeb3;
|
78
|
+
this._provider = typeof window !== 'undefined' ? window.aptosWeb3 : undefined;
|
78
79
|
// this._network = network;
|
79
80
|
this._timeout = timeout;
|
80
81
|
this._connecting = false;
|
81
82
|
this._wallet = null;
|
82
83
|
|
83
|
-
if (this._readyState !== WalletReadyState.Unsupported) {
|
84
|
+
if (typeof window !== 'undefined' && this._readyState !== WalletReadyState.Unsupported) {
|
84
85
|
scopePollingDetectionStrategy(() => {
|
85
86
|
if (this._provider) {
|
86
87
|
this._readyState = WalletReadyState.Installed;
|
@@ -202,21 +203,23 @@ export class MultiMaskWalletAdapter extends BaseWalletAdapter {
|
|
202
203
|
}
|
203
204
|
}
|
204
205
|
|
205
|
-
async signAndSubmitTransaction(
|
206
|
+
async signAndSubmitTransaction(
|
207
|
+
tempTransaction: TransactionPayload
|
208
|
+
): Promise<{ hash: HexEncodedBytes }> {
|
206
209
|
try {
|
207
210
|
const wallet = this._provider;
|
208
211
|
if (!wallet) throw new WalletNotConnectedError();
|
209
|
-
const transaction = tempTransaction as ScriptFunctionPayload;
|
212
|
+
// const transaction = tempTransaction as ScriptFunctionPayload;
|
210
213
|
|
211
214
|
try {
|
212
215
|
// console.log('trans', 1);
|
213
|
-
const response = await new Promise<
|
216
|
+
const response = await new Promise<{ hash: HexEncodedBytes }>((resolve, reject) => {
|
214
217
|
// const args = [...transaction.type_arguments, transaction.arguments[0] / 1000];
|
215
218
|
// console.log('trans 2', transaction, transaction.function.split(':')[0]);
|
216
219
|
wallet.currentProvider.sendAsync(
|
217
220
|
{
|
218
221
|
method: 'eth_sendTransaction',
|
219
|
-
params: [{ from: transaction.function.split(':')[0] }]
|
222
|
+
params: [] //[{ from: transaction.function.name.split(':')[0] }]
|
220
223
|
},
|
221
224
|
(error, resp: any) => {
|
222
225
|
console.log('signTransaction', error, resp);
|
@@ -1,260 +1,261 @@
|
|
1
|
-
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
import {
|
16
|
-
import {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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
|
-
|
45
|
-
|
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
|
-
|
55
|
-
|
56
|
-
|
57
|
-
}
|
54
|
+
// export interface NightlyWalletAdapterConfig {
|
55
|
+
// provider?: INightlyWallet;
|
56
|
+
// // network?: WalletAdapterNetwork;
|
57
|
+
// timeout?: number;
|
58
|
+
// }
|
58
59
|
|
59
|
-
export class NightlyWalletAdapter extends BaseWalletAdapter {
|
60
|
-
|
60
|
+
// export class NightlyWalletAdapter extends BaseWalletAdapter {
|
61
|
+
// name = NightlyWalletName;
|
61
62
|
|
62
|
-
|
63
|
-
|
63
|
+
// url =
|
64
|
+
// 'https://chrome.google.com/webstore/detail/nightly/injggoambcadlfkkjcgdfbejanmgfgfm/related?hl=en&authuser=0';
|
64
65
|
|
65
|
-
|
66
|
-
|
66
|
+
// icon =
|
67
|
+
// 'https://lh3.googleusercontent.com/Ha38j09tA-70EiZ17pculpj1KUKDP07ytX4DJx_fumDfod_X2nRTiUg2Y9tDwRBs5jDj-gu52hwaPYVPgq1xAuFA1Q=w128-h128-e365-rj-sc0x00ffffff';
|
67
68
|
|
68
|
-
|
69
|
+
// protected _provider: INightlyWallet | undefined;
|
69
70
|
|
70
|
-
|
71
|
-
|
71
|
+
// // protected _network: WalletAdapterNetwork;
|
72
|
+
// protected _timeout: number;
|
72
73
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
74
|
+
// protected _readyState: WalletReadyState =
|
75
|
+
// typeof window === 'undefined' || typeof document === 'undefined'
|
76
|
+
// ? WalletReadyState.Unsupported
|
77
|
+
// : WalletReadyState.NotDetected;
|
77
78
|
|
78
|
-
|
79
|
+
// protected _connecting: boolean;
|
79
80
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
81
|
+
// protected _wallet: {
|
82
|
+
// publicKey?: string;
|
83
|
+
// address?: string;
|
84
|
+
// authKey?: string;
|
85
|
+
// isConnected: boolean;
|
86
|
+
// } | null;
|
86
87
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
88
|
+
// constructor({
|
89
|
+
// // provider,
|
90
|
+
// // network = WalletAdapterNetwork.Mainnet,
|
91
|
+
// timeout = 10000
|
92
|
+
// }: NightlyWalletAdapterConfig = {}) {
|
93
|
+
// super();
|
93
94
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
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
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
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
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
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
|
-
|
121
|
-
|
122
|
-
|
121
|
+
// get connecting(): boolean {
|
122
|
+
// return this._connecting;
|
123
|
+
// }
|
123
124
|
|
124
|
-
|
125
|
-
|
126
|
-
|
125
|
+
// get connected(): boolean {
|
126
|
+
// return !!this._wallet?.isConnected;
|
127
|
+
// }
|
127
128
|
|
128
|
-
|
129
|
-
|
130
|
-
|
129
|
+
// get readyState(): WalletReadyState {
|
130
|
+
// return this._readyState;
|
131
|
+
// }
|
131
132
|
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
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
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
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
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
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
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
164
|
+
// async disconnect(): Promise<void> {
|
165
|
+
// const wallet = this._wallet;
|
166
|
+
// if (wallet) {
|
167
|
+
// this._wallet = null;
|
167
168
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
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
|
-
|
177
|
-
|
177
|
+
// this.emit('disconnect');
|
178
|
+
// }
|
178
179
|
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
180
|
+
// async signTransaction(transaction: TransactionPayload): Promise<SubmitTransactionRequest> {
|
181
|
+
// try {
|
182
|
+
// const wallet = this._wallet;
|
183
|
+
// if (!wallet) throw new WalletNotConnectedError();
|
183
184
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
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
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
202
|
+
// async signAndSubmitTransaction(tempTransaction: TransactionPayload): Promise<PendingTransaction> {
|
203
|
+
// try {
|
204
|
+
// const wallet = this._wallet;
|
205
|
+
// if (!wallet) throw new WalletNotConnectedError();
|
205
206
|
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
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
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
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
|
+
// }
|