@megaeth-labs/wallet-sdk 0.1.6 → 0.1.8
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 +25 -4
- package/dist/index.d.ts +25 -4
- 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
|
@@ -39,11 +39,25 @@ interface GetFromContractRequest {
|
|
|
39
39
|
functionName: string;
|
|
40
40
|
args: any[];
|
|
41
41
|
}
|
|
42
|
+
interface TransactionReceiptLog {
|
|
43
|
+
address: string;
|
|
44
|
+
data: string;
|
|
45
|
+
topics: string[];
|
|
46
|
+
}
|
|
47
|
+
interface TransactionReceipt {
|
|
48
|
+
hash: string;
|
|
49
|
+
blockHash: string;
|
|
50
|
+
blockNumber: number;
|
|
51
|
+
chainId: number;
|
|
52
|
+
gasUsed: number;
|
|
53
|
+
logs: TransactionReceiptLog[];
|
|
54
|
+
status: string;
|
|
55
|
+
transactionHash: string;
|
|
56
|
+
}
|
|
42
57
|
interface TransactionResult {
|
|
43
58
|
status: 'approved' | 'cancelled' | 'error';
|
|
44
|
-
receipt?:
|
|
45
|
-
|
|
46
|
-
};
|
|
59
|
+
receipt?: TransactionReceipt;
|
|
60
|
+
receipts?: TransactionReceipt[];
|
|
47
61
|
error?: string;
|
|
48
62
|
}
|
|
49
63
|
interface SignMessageResponse {
|
|
@@ -51,6 +65,11 @@ interface SignMessageResponse {
|
|
|
51
65
|
error?: string;
|
|
52
66
|
signature?: `0x${string}`;
|
|
53
67
|
}
|
|
68
|
+
interface AuthenticateResponse {
|
|
69
|
+
status: 'success' | 'cancelled' | 'error';
|
|
70
|
+
error?: string;
|
|
71
|
+
jwt?: string;
|
|
72
|
+
}
|
|
54
73
|
interface GetPermissionsResponse {
|
|
55
74
|
permissions?: {
|
|
56
75
|
expiry: number;
|
|
@@ -82,6 +101,7 @@ interface RemoteAPI {
|
|
|
82
101
|
balances: (request: BalancesRequest) => Promise<OwnedTokenResponse[]>;
|
|
83
102
|
signData: (request: SignDataRequest) => Promise<SignDataResponse>;
|
|
84
103
|
open: () => Promise<void>;
|
|
104
|
+
authenticate: () => Promise<AuthenticateResponse>;
|
|
85
105
|
[key: string]: any;
|
|
86
106
|
}
|
|
87
107
|
interface Permission {
|
|
@@ -156,10 +176,11 @@ declare const mega: {
|
|
|
156
176
|
open: () => Promise<void>;
|
|
157
177
|
signData: (request: SignDataRequest) => Promise<SignDataResponse>;
|
|
158
178
|
getFromContract: <T>(request: GetFromContractRequest) => Promise<T>;
|
|
179
|
+
authenticate: () => Promise<AuthenticateResponse>;
|
|
159
180
|
initialise: (config: Config) => Promise<ConnectionStatus | undefined>;
|
|
160
181
|
events: {
|
|
161
182
|
onStatusChange: (callback: (status: ConnectionStatus) => void) => void;
|
|
162
183
|
};
|
|
163
184
|
};
|
|
164
185
|
|
|
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 };
|
|
186
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -39,11 +39,25 @@ interface GetFromContractRequest {
|
|
|
39
39
|
functionName: string;
|
|
40
40
|
args: any[];
|
|
41
41
|
}
|
|
42
|
+
interface TransactionReceiptLog {
|
|
43
|
+
address: string;
|
|
44
|
+
data: string;
|
|
45
|
+
topics: string[];
|
|
46
|
+
}
|
|
47
|
+
interface TransactionReceipt {
|
|
48
|
+
hash: string;
|
|
49
|
+
blockHash: string;
|
|
50
|
+
blockNumber: number;
|
|
51
|
+
chainId: number;
|
|
52
|
+
gasUsed: number;
|
|
53
|
+
logs: TransactionReceiptLog[];
|
|
54
|
+
status: string;
|
|
55
|
+
transactionHash: string;
|
|
56
|
+
}
|
|
42
57
|
interface TransactionResult {
|
|
43
58
|
status: 'approved' | 'cancelled' | 'error';
|
|
44
|
-
receipt?:
|
|
45
|
-
|
|
46
|
-
};
|
|
59
|
+
receipt?: TransactionReceipt;
|
|
60
|
+
receipts?: TransactionReceipt[];
|
|
47
61
|
error?: string;
|
|
48
62
|
}
|
|
49
63
|
interface SignMessageResponse {
|
|
@@ -51,6 +65,11 @@ interface SignMessageResponse {
|
|
|
51
65
|
error?: string;
|
|
52
66
|
signature?: `0x${string}`;
|
|
53
67
|
}
|
|
68
|
+
interface AuthenticateResponse {
|
|
69
|
+
status: 'success' | 'cancelled' | 'error';
|
|
70
|
+
error?: string;
|
|
71
|
+
jwt?: string;
|
|
72
|
+
}
|
|
54
73
|
interface GetPermissionsResponse {
|
|
55
74
|
permissions?: {
|
|
56
75
|
expiry: number;
|
|
@@ -82,6 +101,7 @@ interface RemoteAPI {
|
|
|
82
101
|
balances: (request: BalancesRequest) => Promise<OwnedTokenResponse[]>;
|
|
83
102
|
signData: (request: SignDataRequest) => Promise<SignDataResponse>;
|
|
84
103
|
open: () => Promise<void>;
|
|
104
|
+
authenticate: () => Promise<AuthenticateResponse>;
|
|
85
105
|
[key: string]: any;
|
|
86
106
|
}
|
|
87
107
|
interface Permission {
|
|
@@ -156,10 +176,11 @@ declare const mega: {
|
|
|
156
176
|
open: () => Promise<void>;
|
|
157
177
|
signData: (request: SignDataRequest) => Promise<SignDataResponse>;
|
|
158
178
|
getFromContract: <T>(request: GetFromContractRequest) => Promise<T>;
|
|
179
|
+
authenticate: () => Promise<AuthenticateResponse>;
|
|
159
180
|
initialise: (config: Config) => Promise<ConnectionStatus | undefined>;
|
|
160
181
|
events: {
|
|
161
182
|
onStatusChange: (callback: (status: ConnectionStatus) => void) => void;
|
|
162
183
|
};
|
|
163
184
|
};
|
|
164
185
|
|
|
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 };
|
|
186
|
+
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 };
|
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
|