@megaeth-labs/wallet-sdk 0.1.12 → 0.1.14
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 +18 -6
- package/dist/index.d.cts +21 -3
- package/dist/index.d.ts +21 -3
- package/dist/index.js +18 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -160,11 +160,6 @@ var _Logger = class _Logger {
|
|
|
160
160
|
_Logger.logLevel = "error";
|
|
161
161
|
var Logger = _Logger;
|
|
162
162
|
|
|
163
|
-
// src/outbound-methods/account.ts
|
|
164
|
-
var manageAccount = async (method, data) => {
|
|
165
|
-
return state_default.remote.manageAccount(method, data);
|
|
166
|
-
};
|
|
167
|
-
|
|
168
163
|
// src/outbound-methods/authenticate.ts
|
|
169
164
|
var authenticate = async () => {
|
|
170
165
|
return state_default.remote.authenticate();
|
|
@@ -217,6 +212,11 @@ var grantPermissions = (request) => {
|
|
|
217
212
|
return state_default.remote.grantPermissions(request);
|
|
218
213
|
};
|
|
219
214
|
|
|
215
|
+
// src/outbound-methods/manageAccount.ts
|
|
216
|
+
var manageAccount = async (request) => {
|
|
217
|
+
return state_default.remote.manageAccount(request);
|
|
218
|
+
};
|
|
219
|
+
|
|
220
220
|
// src/outbound-methods/open.ts
|
|
221
221
|
var open = async () => {
|
|
222
222
|
return state_default.remote.open();
|
|
@@ -227,6 +227,11 @@ var revokePermissions = () => {
|
|
|
227
227
|
return state_default.remote.revokePermissions();
|
|
228
228
|
};
|
|
229
229
|
|
|
230
|
+
// src/outbound-methods/send.ts
|
|
231
|
+
var send = async (request) => {
|
|
232
|
+
return state_default.remote.send(request);
|
|
233
|
+
};
|
|
234
|
+
|
|
230
235
|
// src/outbound-methods/signData.ts
|
|
231
236
|
var signData = (request) => {
|
|
232
237
|
return state_default.remote.signData(request);
|
|
@@ -242,6 +247,11 @@ var status = () => {
|
|
|
242
247
|
return state_default.remote.status();
|
|
243
248
|
};
|
|
244
249
|
|
|
250
|
+
// src/outbound-methods/swap.ts
|
|
251
|
+
var swap = async (request) => {
|
|
252
|
+
return state_default.remote.swap(request);
|
|
253
|
+
};
|
|
254
|
+
|
|
245
255
|
// src/outbound-methods/transfer.ts
|
|
246
256
|
var transfer = (request) => {
|
|
247
257
|
return state_default.remote.transfer(request);
|
|
@@ -264,7 +274,9 @@ var outboundMethods = {
|
|
|
264
274
|
signData,
|
|
265
275
|
getFromContract,
|
|
266
276
|
authenticate,
|
|
267
|
-
manageAccount
|
|
277
|
+
manageAccount,
|
|
278
|
+
send,
|
|
279
|
+
swap
|
|
268
280
|
};
|
|
269
281
|
|
|
270
282
|
// src/wallet.ts
|
package/dist/index.d.cts
CHANGED
|
@@ -87,6 +87,14 @@ interface GetPermissionsResponse {
|
|
|
87
87
|
};
|
|
88
88
|
} | null;
|
|
89
89
|
}
|
|
90
|
+
interface SwapRequest {
|
|
91
|
+
fromToken?: `0x${string}` | 'native';
|
|
92
|
+
toToken?: `0x${string}` | 'native';
|
|
93
|
+
}
|
|
94
|
+
interface SendRequest {
|
|
95
|
+
token?: `0x${string}` | 'native';
|
|
96
|
+
destination?: `0x${string}`;
|
|
97
|
+
}
|
|
90
98
|
interface RemoteAPI {
|
|
91
99
|
status: () => ConnectionStatus;
|
|
92
100
|
connect: () => Promise<ConnectionStatus>;
|
|
@@ -103,7 +111,12 @@ interface RemoteAPI {
|
|
|
103
111
|
signData: (request: SignDataRequest) => Promise<SignDataResponse>;
|
|
104
112
|
open: () => Promise<void>;
|
|
105
113
|
authenticate: () => Promise<AuthenticateResponse>;
|
|
106
|
-
manageAccount: (
|
|
114
|
+
manageAccount: (request: {
|
|
115
|
+
method: string;
|
|
116
|
+
data?: any;
|
|
117
|
+
}) => Promise<void>;
|
|
118
|
+
swap: (request: SwapRequest) => Promise<TransactionResult>;
|
|
119
|
+
send: (request: SendRequest) => Promise<TransactionResult>;
|
|
107
120
|
[key: string]: any;
|
|
108
121
|
}
|
|
109
122
|
interface Permission {
|
|
@@ -179,11 +192,16 @@ declare const mega: {
|
|
|
179
192
|
signData: (request: SignDataRequest) => Promise<SignDataResponse>;
|
|
180
193
|
getFromContract: <T>(request: GetFromContractRequest) => Promise<T>;
|
|
181
194
|
authenticate: () => Promise<AuthenticateResponse>;
|
|
182
|
-
manageAccount: (
|
|
195
|
+
manageAccount: (request: {
|
|
196
|
+
method: string;
|
|
197
|
+
data?: any;
|
|
198
|
+
}) => Promise<void>;
|
|
199
|
+
send: (request: SendRequest) => Promise<TransactionResult>;
|
|
200
|
+
swap: (request: SwapRequest) => Promise<TransactionResult>;
|
|
183
201
|
initialise: (config: Config) => Promise<ConnectionStatus | undefined>;
|
|
184
202
|
events: {
|
|
185
203
|
onStatusChange: (callback: (status: ConnectionStatus) => void) => void;
|
|
186
204
|
};
|
|
187
205
|
};
|
|
188
206
|
|
|
189
|
-
export { type AuthenticateResponse, type BalancesRequest, type BaseTokenResponse, type CallContractRequest, type Config, type ConnectionStatus, type GetFromContractRequest, type GetPermissionsResponse, type GrantPermissionsRequest, type GrantPermissionsResponse, type LogLevel, type Network, type OwnedTokenResponse, type Permission, type RemoteAPI, type SignDataRequest, type SignDataResponse, type SignMessageResponse, type SponsorMode, type SponsorToken, type TransactionReceipt, type TransactionReceiptLog, type TransactionResult, type TransferRequest, mega };
|
|
207
|
+
export { type AuthenticateResponse, type BalancesRequest, type BaseTokenResponse, type CallContractRequest, type Config, type ConnectionStatus, type GetFromContractRequest, type GetPermissionsResponse, type GrantPermissionsRequest, type GrantPermissionsResponse, type LogLevel, type Network, type OwnedTokenResponse, type Permission, type RemoteAPI, type SendRequest, type SignDataRequest, type SignDataResponse, type SignMessageResponse, type SponsorMode, type SponsorToken, type SwapRequest, type TransactionReceipt, type TransactionReceiptLog, type TransactionResult, type TransferRequest, mega };
|
package/dist/index.d.ts
CHANGED
|
@@ -87,6 +87,14 @@ interface GetPermissionsResponse {
|
|
|
87
87
|
};
|
|
88
88
|
} | null;
|
|
89
89
|
}
|
|
90
|
+
interface SwapRequest {
|
|
91
|
+
fromToken?: `0x${string}` | 'native';
|
|
92
|
+
toToken?: `0x${string}` | 'native';
|
|
93
|
+
}
|
|
94
|
+
interface SendRequest {
|
|
95
|
+
token?: `0x${string}` | 'native';
|
|
96
|
+
destination?: `0x${string}`;
|
|
97
|
+
}
|
|
90
98
|
interface RemoteAPI {
|
|
91
99
|
status: () => ConnectionStatus;
|
|
92
100
|
connect: () => Promise<ConnectionStatus>;
|
|
@@ -103,7 +111,12 @@ interface RemoteAPI {
|
|
|
103
111
|
signData: (request: SignDataRequest) => Promise<SignDataResponse>;
|
|
104
112
|
open: () => Promise<void>;
|
|
105
113
|
authenticate: () => Promise<AuthenticateResponse>;
|
|
106
|
-
manageAccount: (
|
|
114
|
+
manageAccount: (request: {
|
|
115
|
+
method: string;
|
|
116
|
+
data?: any;
|
|
117
|
+
}) => Promise<void>;
|
|
118
|
+
swap: (request: SwapRequest) => Promise<TransactionResult>;
|
|
119
|
+
send: (request: SendRequest) => Promise<TransactionResult>;
|
|
107
120
|
[key: string]: any;
|
|
108
121
|
}
|
|
109
122
|
interface Permission {
|
|
@@ -179,11 +192,16 @@ declare const mega: {
|
|
|
179
192
|
signData: (request: SignDataRequest) => Promise<SignDataResponse>;
|
|
180
193
|
getFromContract: <T>(request: GetFromContractRequest) => Promise<T>;
|
|
181
194
|
authenticate: () => Promise<AuthenticateResponse>;
|
|
182
|
-
manageAccount: (
|
|
195
|
+
manageAccount: (request: {
|
|
196
|
+
method: string;
|
|
197
|
+
data?: any;
|
|
198
|
+
}) => Promise<void>;
|
|
199
|
+
send: (request: SendRequest) => Promise<TransactionResult>;
|
|
200
|
+
swap: (request: SwapRequest) => Promise<TransactionResult>;
|
|
183
201
|
initialise: (config: Config) => Promise<ConnectionStatus | undefined>;
|
|
184
202
|
events: {
|
|
185
203
|
onStatusChange: (callback: (status: ConnectionStatus) => void) => void;
|
|
186
204
|
};
|
|
187
205
|
};
|
|
188
206
|
|
|
189
|
-
export { type AuthenticateResponse, type BalancesRequest, type BaseTokenResponse, type CallContractRequest, type Config, type ConnectionStatus, type GetFromContractRequest, type GetPermissionsResponse, type GrantPermissionsRequest, type GrantPermissionsResponse, type LogLevel, type Network, type OwnedTokenResponse, type Permission, type RemoteAPI, type SignDataRequest, type SignDataResponse, type SignMessageResponse, type SponsorMode, type SponsorToken, type TransactionReceipt, type TransactionReceiptLog, type TransactionResult, type TransferRequest, mega };
|
|
207
|
+
export { type AuthenticateResponse, type BalancesRequest, type BaseTokenResponse, type CallContractRequest, type Config, type ConnectionStatus, type GetFromContractRequest, type GetPermissionsResponse, type GrantPermissionsRequest, type GrantPermissionsResponse, type LogLevel, type Network, type OwnedTokenResponse, type Permission, type RemoteAPI, type SendRequest, type SignDataRequest, type SignDataResponse, type SignMessageResponse, type SponsorMode, type SponsorToken, type SwapRequest, type TransactionReceipt, type TransactionReceiptLog, type TransactionResult, type TransferRequest, mega };
|
package/dist/index.js
CHANGED
|
@@ -124,11 +124,6 @@ var _Logger = class _Logger {
|
|
|
124
124
|
_Logger.logLevel = "error";
|
|
125
125
|
var Logger = _Logger;
|
|
126
126
|
|
|
127
|
-
// src/outbound-methods/account.ts
|
|
128
|
-
var manageAccount = async (method, data) => {
|
|
129
|
-
return state_default.remote.manageAccount(method, data);
|
|
130
|
-
};
|
|
131
|
-
|
|
132
127
|
// src/outbound-methods/authenticate.ts
|
|
133
128
|
var authenticate = async () => {
|
|
134
129
|
return state_default.remote.authenticate();
|
|
@@ -181,6 +176,11 @@ var grantPermissions = (request) => {
|
|
|
181
176
|
return state_default.remote.grantPermissions(request);
|
|
182
177
|
};
|
|
183
178
|
|
|
179
|
+
// src/outbound-methods/manageAccount.ts
|
|
180
|
+
var manageAccount = async (request) => {
|
|
181
|
+
return state_default.remote.manageAccount(request);
|
|
182
|
+
};
|
|
183
|
+
|
|
184
184
|
// src/outbound-methods/open.ts
|
|
185
185
|
var open = async () => {
|
|
186
186
|
return state_default.remote.open();
|
|
@@ -191,6 +191,11 @@ var revokePermissions = () => {
|
|
|
191
191
|
return state_default.remote.revokePermissions();
|
|
192
192
|
};
|
|
193
193
|
|
|
194
|
+
// src/outbound-methods/send.ts
|
|
195
|
+
var send = async (request) => {
|
|
196
|
+
return state_default.remote.send(request);
|
|
197
|
+
};
|
|
198
|
+
|
|
194
199
|
// src/outbound-methods/signData.ts
|
|
195
200
|
var signData = (request) => {
|
|
196
201
|
return state_default.remote.signData(request);
|
|
@@ -206,6 +211,11 @@ var status = () => {
|
|
|
206
211
|
return state_default.remote.status();
|
|
207
212
|
};
|
|
208
213
|
|
|
214
|
+
// src/outbound-methods/swap.ts
|
|
215
|
+
var swap = async (request) => {
|
|
216
|
+
return state_default.remote.swap(request);
|
|
217
|
+
};
|
|
218
|
+
|
|
209
219
|
// src/outbound-methods/transfer.ts
|
|
210
220
|
var transfer = (request) => {
|
|
211
221
|
return state_default.remote.transfer(request);
|
|
@@ -228,7 +238,9 @@ var outboundMethods = {
|
|
|
228
238
|
signData,
|
|
229
239
|
getFromContract,
|
|
230
240
|
authenticate,
|
|
231
|
-
manageAccount
|
|
241
|
+
manageAccount,
|
|
242
|
+
send,
|
|
243
|
+
swap
|
|
232
244
|
};
|
|
233
245
|
|
|
234
246
|
// src/wallet.ts
|