@megaeth-labs/wallet-sdk 0.1.6 → 0.1.7
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 +7 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +7 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -160,6 +160,11 @@ var _Logger = class _Logger {
|
|
|
160
160
|
_Logger.logLevel = "error";
|
|
161
161
|
var Logger = _Logger;
|
|
162
162
|
|
|
163
|
+
// src/outbound-methods/authenticate.ts
|
|
164
|
+
var authenticate = async () => {
|
|
165
|
+
return state_default.remote.authenticate();
|
|
166
|
+
};
|
|
167
|
+
|
|
163
168
|
// src/outbound-methods/balances.ts
|
|
164
169
|
var balances = async (request) => {
|
|
165
170
|
return state_default.remote.balances(request);
|
|
@@ -252,7 +257,8 @@ var outboundMethods = {
|
|
|
252
257
|
balances,
|
|
253
258
|
open,
|
|
254
259
|
signData,
|
|
255
|
-
getFromContract
|
|
260
|
+
getFromContract,
|
|
261
|
+
authenticate
|
|
256
262
|
};
|
|
257
263
|
|
|
258
264
|
// src/wallet.ts
|
package/dist/index.d.cts
CHANGED
|
@@ -51,6 +51,11 @@ interface SignMessageResponse {
|
|
|
51
51
|
error?: string;
|
|
52
52
|
signature?: `0x${string}`;
|
|
53
53
|
}
|
|
54
|
+
interface AuthenticateResponse {
|
|
55
|
+
status: 'success' | 'cancelled' | 'error';
|
|
56
|
+
error?: string;
|
|
57
|
+
jwt?: string;
|
|
58
|
+
}
|
|
54
59
|
interface GetPermissionsResponse {
|
|
55
60
|
permissions?: {
|
|
56
61
|
expiry: number;
|
|
@@ -82,6 +87,7 @@ interface RemoteAPI {
|
|
|
82
87
|
balances: (request: BalancesRequest) => Promise<OwnedTokenResponse[]>;
|
|
83
88
|
signData: (request: SignDataRequest) => Promise<SignDataResponse>;
|
|
84
89
|
open: () => Promise<void>;
|
|
90
|
+
authenticate: () => Promise<AuthenticateResponse>;
|
|
85
91
|
[key: string]: any;
|
|
86
92
|
}
|
|
87
93
|
interface Permission {
|
|
@@ -156,10 +162,11 @@ declare const mega: {
|
|
|
156
162
|
open: () => Promise<void>;
|
|
157
163
|
signData: (request: SignDataRequest) => Promise<SignDataResponse>;
|
|
158
164
|
getFromContract: <T>(request: GetFromContractRequest) => Promise<T>;
|
|
165
|
+
authenticate: () => Promise<AuthenticateResponse>;
|
|
159
166
|
initialise: (config: Config) => Promise<ConnectionStatus | undefined>;
|
|
160
167
|
events: {
|
|
161
168
|
onStatusChange: (callback: (status: ConnectionStatus) => void) => void;
|
|
162
169
|
};
|
|
163
170
|
};
|
|
164
171
|
|
|
165
|
-
export { 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 TransactionResult, type TransferRequest, mega };
|
|
172
|
+
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 TransactionResult, type TransferRequest, mega };
|
package/dist/index.d.ts
CHANGED
|
@@ -51,6 +51,11 @@ interface SignMessageResponse {
|
|
|
51
51
|
error?: string;
|
|
52
52
|
signature?: `0x${string}`;
|
|
53
53
|
}
|
|
54
|
+
interface AuthenticateResponse {
|
|
55
|
+
status: 'success' | 'cancelled' | 'error';
|
|
56
|
+
error?: string;
|
|
57
|
+
jwt?: string;
|
|
58
|
+
}
|
|
54
59
|
interface GetPermissionsResponse {
|
|
55
60
|
permissions?: {
|
|
56
61
|
expiry: number;
|
|
@@ -82,6 +87,7 @@ interface RemoteAPI {
|
|
|
82
87
|
balances: (request: BalancesRequest) => Promise<OwnedTokenResponse[]>;
|
|
83
88
|
signData: (request: SignDataRequest) => Promise<SignDataResponse>;
|
|
84
89
|
open: () => Promise<void>;
|
|
90
|
+
authenticate: () => Promise<AuthenticateResponse>;
|
|
85
91
|
[key: string]: any;
|
|
86
92
|
}
|
|
87
93
|
interface Permission {
|
|
@@ -156,10 +162,11 @@ declare const mega: {
|
|
|
156
162
|
open: () => Promise<void>;
|
|
157
163
|
signData: (request: SignDataRequest) => Promise<SignDataResponse>;
|
|
158
164
|
getFromContract: <T>(request: GetFromContractRequest) => Promise<T>;
|
|
165
|
+
authenticate: () => Promise<AuthenticateResponse>;
|
|
159
166
|
initialise: (config: Config) => Promise<ConnectionStatus | undefined>;
|
|
160
167
|
events: {
|
|
161
168
|
onStatusChange: (callback: (status: ConnectionStatus) => void) => void;
|
|
162
169
|
};
|
|
163
170
|
};
|
|
164
171
|
|
|
165
|
-
export { 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 TransactionResult, type TransferRequest, mega };
|
|
172
|
+
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 TransactionResult, type TransferRequest, mega };
|
package/dist/index.js
CHANGED
|
@@ -124,6 +124,11 @@ var _Logger = class _Logger {
|
|
|
124
124
|
_Logger.logLevel = "error";
|
|
125
125
|
var Logger = _Logger;
|
|
126
126
|
|
|
127
|
+
// src/outbound-methods/authenticate.ts
|
|
128
|
+
var authenticate = async () => {
|
|
129
|
+
return state_default.remote.authenticate();
|
|
130
|
+
};
|
|
131
|
+
|
|
127
132
|
// src/outbound-methods/balances.ts
|
|
128
133
|
var balances = async (request) => {
|
|
129
134
|
return state_default.remote.balances(request);
|
|
@@ -216,7 +221,8 @@ var outboundMethods = {
|
|
|
216
221
|
balances,
|
|
217
222
|
open,
|
|
218
223
|
signData,
|
|
219
|
-
getFromContract
|
|
224
|
+
getFromContract,
|
|
225
|
+
authenticate
|
|
220
226
|
};
|
|
221
227
|
|
|
222
228
|
// src/wallet.ts
|