@megaeth-labs/wallet-sdk 0.1.13 → 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 +13 -1
- package/dist/index.d.cts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +13 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -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>;
|
|
@@ -107,6 +115,8 @@ interface RemoteAPI {
|
|
|
107
115
|
method: string;
|
|
108
116
|
data?: any;
|
|
109
117
|
}) => Promise<void>;
|
|
118
|
+
swap: (request: SwapRequest) => Promise<TransactionResult>;
|
|
119
|
+
send: (request: SendRequest) => Promise<TransactionResult>;
|
|
110
120
|
[key: string]: any;
|
|
111
121
|
}
|
|
112
122
|
interface Permission {
|
|
@@ -186,10 +196,12 @@ declare const mega: {
|
|
|
186
196
|
method: string;
|
|
187
197
|
data?: any;
|
|
188
198
|
}) => Promise<void>;
|
|
199
|
+
send: (request: SendRequest) => Promise<TransactionResult>;
|
|
200
|
+
swap: (request: SwapRequest) => Promise<TransactionResult>;
|
|
189
201
|
initialise: (config: Config) => Promise<ConnectionStatus | undefined>;
|
|
190
202
|
events: {
|
|
191
203
|
onStatusChange: (callback: (status: ConnectionStatus) => void) => void;
|
|
192
204
|
};
|
|
193
205
|
};
|
|
194
206
|
|
|
195
|
-
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>;
|
|
@@ -107,6 +115,8 @@ interface RemoteAPI {
|
|
|
107
115
|
method: string;
|
|
108
116
|
data?: any;
|
|
109
117
|
}) => Promise<void>;
|
|
118
|
+
swap: (request: SwapRequest) => Promise<TransactionResult>;
|
|
119
|
+
send: (request: SendRequest) => Promise<TransactionResult>;
|
|
110
120
|
[key: string]: any;
|
|
111
121
|
}
|
|
112
122
|
interface Permission {
|
|
@@ -186,10 +196,12 @@ declare const mega: {
|
|
|
186
196
|
method: string;
|
|
187
197
|
data?: any;
|
|
188
198
|
}) => Promise<void>;
|
|
199
|
+
send: (request: SendRequest) => Promise<TransactionResult>;
|
|
200
|
+
swap: (request: SwapRequest) => Promise<TransactionResult>;
|
|
189
201
|
initialise: (config: Config) => Promise<ConnectionStatus | undefined>;
|
|
190
202
|
events: {
|
|
191
203
|
onStatusChange: (callback: (status: ConnectionStatus) => void) => void;
|
|
192
204
|
};
|
|
193
205
|
};
|
|
194
206
|
|
|
195
|
-
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
|
@@ -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
|