@metamask-previews/keyring-api 17.0.0-44b05d1 → 17.0.0-6277bf9
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/api/transaction.d.cts +4 -4
- package/dist/api/transaction.d.mts +4 -4
- package/dist/eth/erc4337/types.d.cts +1 -1
- package/dist/eth/erc4337/types.d.mts +1 -1
- package/dist/events.d.cts +3 -3
- package/dist/events.d.mts +3 -3
- package/dist/rpc.d.cts +3 -3
- package/dist/rpc.d.mts +3 -3
- package/dist/sol/types.cjs +7 -1
- package/dist/sol/types.cjs.map +1 -1
- package/dist/sol/types.d.cts +12 -4
- package/dist/sol/types.d.cts.map +1 -1
- package/dist/sol/types.d.mts +12 -4
- package/dist/sol/types.d.mts.map +1 -1
- package/dist/sol/types.mjs +7 -1
- package/dist/sol/types.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -158,8 +158,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
158
158
|
timestamp: number | null;
|
|
159
159
|
}[];
|
|
160
160
|
chain: `${string}:${string}`;
|
|
161
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
162
161
|
account: string;
|
|
162
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
163
163
|
timestamp: number | null;
|
|
164
164
|
to: {
|
|
165
165
|
address: string;
|
|
@@ -435,8 +435,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
435
435
|
timestamp: number | null;
|
|
436
436
|
}[];
|
|
437
437
|
chain: `${string}:${string}`;
|
|
438
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
439
438
|
account: string;
|
|
439
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
440
440
|
timestamp: number | null;
|
|
441
441
|
to: {
|
|
442
442
|
address: string;
|
|
@@ -488,8 +488,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
488
488
|
timestamp: number | null;
|
|
489
489
|
}[];
|
|
490
490
|
chain: `${string}:${string}`;
|
|
491
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
492
491
|
account: string;
|
|
492
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
493
493
|
timestamp: number | null;
|
|
494
494
|
to: {
|
|
495
495
|
address: string;
|
|
@@ -535,8 +535,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
535
535
|
timestamp: number | null;
|
|
536
536
|
}[];
|
|
537
537
|
chain: `${string}:${string}`;
|
|
538
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
539
538
|
account: string;
|
|
539
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
540
540
|
timestamp: number | null;
|
|
541
541
|
to: {
|
|
542
542
|
address: string;
|
|
@@ -158,8 +158,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
158
158
|
timestamp: number | null;
|
|
159
159
|
}[];
|
|
160
160
|
chain: `${string}:${string}`;
|
|
161
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
162
161
|
account: string;
|
|
162
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
163
163
|
timestamp: number | null;
|
|
164
164
|
to: {
|
|
165
165
|
address: string;
|
|
@@ -435,8 +435,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
435
435
|
timestamp: number | null;
|
|
436
436
|
}[];
|
|
437
437
|
chain: `${string}:${string}`;
|
|
438
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
439
438
|
account: string;
|
|
439
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
440
440
|
timestamp: number | null;
|
|
441
441
|
to: {
|
|
442
442
|
address: string;
|
|
@@ -488,8 +488,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
488
488
|
timestamp: number | null;
|
|
489
489
|
}[];
|
|
490
490
|
chain: `${string}:${string}`;
|
|
491
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
492
491
|
account: string;
|
|
492
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
493
493
|
timestamp: number | null;
|
|
494
494
|
to: {
|
|
495
495
|
address: string;
|
|
@@ -535,8 +535,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
535
535
|
timestamp: number | null;
|
|
536
536
|
}[];
|
|
537
537
|
chain: `${string}:${string}`;
|
|
538
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
539
538
|
account: string;
|
|
539
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
540
540
|
timestamp: number | null;
|
|
541
541
|
to: {
|
|
542
542
|
address: string;
|
|
@@ -5,8 +5,8 @@ import { type Infer } from "@metamask/superstruct";
|
|
|
5
5
|
* @see https://eips.ethereum.org/EIPS/eip-4337#definitions
|
|
6
6
|
*/
|
|
7
7
|
export declare const EthUserOperationStruct: import("@metamask/superstruct").Struct<{
|
|
8
|
-
nonce: string;
|
|
9
8
|
sender: string;
|
|
9
|
+
nonce: string;
|
|
10
10
|
initCode: string;
|
|
11
11
|
callData: string;
|
|
12
12
|
callGasLimit: string;
|
|
@@ -5,8 +5,8 @@ import { type Infer } from "@metamask/superstruct";
|
|
|
5
5
|
* @see https://eips.ethereum.org/EIPS/eip-4337#definitions
|
|
6
6
|
*/
|
|
7
7
|
export declare const EthUserOperationStruct: import("@metamask/superstruct").Struct<{
|
|
8
|
-
nonce: string;
|
|
9
8
|
sender: string;
|
|
9
|
+
nonce: string;
|
|
10
10
|
initCode: string;
|
|
11
11
|
callData: string;
|
|
12
12
|
callGasLimit: string;
|
package/dist/events.d.cts
CHANGED
|
@@ -238,8 +238,8 @@ export declare const AccountTransactionsUpdatedEventStruct: import("@metamask/su
|
|
|
238
238
|
timestamp: number | null;
|
|
239
239
|
}[];
|
|
240
240
|
chain: `${string}:${string}`;
|
|
241
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
242
241
|
account: string;
|
|
242
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
243
243
|
timestamp: number | null;
|
|
244
244
|
to: {
|
|
245
245
|
address: string;
|
|
@@ -290,8 +290,8 @@ export declare const AccountTransactionsUpdatedEventStruct: import("@metamask/su
|
|
|
290
290
|
timestamp: number | null;
|
|
291
291
|
}[];
|
|
292
292
|
chain: `${string}:${string}`;
|
|
293
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
294
293
|
account: string;
|
|
294
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
295
295
|
timestamp: number | null;
|
|
296
296
|
to: {
|
|
297
297
|
address: string;
|
|
@@ -342,8 +342,8 @@ export declare const AccountTransactionsUpdatedEventStruct: import("@metamask/su
|
|
|
342
342
|
timestamp: number | null;
|
|
343
343
|
}[];
|
|
344
344
|
chain: `${string}:${string}`;
|
|
345
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
346
345
|
account: string;
|
|
346
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
347
347
|
timestamp: number | null;
|
|
348
348
|
to: {
|
|
349
349
|
address: string;
|
package/dist/events.d.mts
CHANGED
|
@@ -238,8 +238,8 @@ export declare const AccountTransactionsUpdatedEventStruct: import("@metamask/su
|
|
|
238
238
|
timestamp: number | null;
|
|
239
239
|
}[];
|
|
240
240
|
chain: `${string}:${string}`;
|
|
241
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
242
241
|
account: string;
|
|
242
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
243
243
|
timestamp: number | null;
|
|
244
244
|
to: {
|
|
245
245
|
address: string;
|
|
@@ -290,8 +290,8 @@ export declare const AccountTransactionsUpdatedEventStruct: import("@metamask/su
|
|
|
290
290
|
timestamp: number | null;
|
|
291
291
|
}[];
|
|
292
292
|
chain: `${string}:${string}`;
|
|
293
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
294
293
|
account: string;
|
|
294
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
295
295
|
timestamp: number | null;
|
|
296
296
|
to: {
|
|
297
297
|
address: string;
|
|
@@ -342,8 +342,8 @@ export declare const AccountTransactionsUpdatedEventStruct: import("@metamask/su
|
|
|
342
342
|
timestamp: number | null;
|
|
343
343
|
}[];
|
|
344
344
|
chain: `${string}:${string}`;
|
|
345
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
346
345
|
account: string;
|
|
346
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
347
347
|
timestamp: number | null;
|
|
348
348
|
to: {
|
|
349
349
|
address: string;
|
package/dist/rpc.d.cts
CHANGED
|
@@ -197,8 +197,8 @@ export declare const ListAccountTransactionsResponseStruct: import("@metamask/su
|
|
|
197
197
|
timestamp: number | null;
|
|
198
198
|
}[];
|
|
199
199
|
chain: `${string}:${string}`;
|
|
200
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
201
200
|
account: string;
|
|
201
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
202
202
|
timestamp: number | null;
|
|
203
203
|
to: {
|
|
204
204
|
address: string;
|
|
@@ -247,8 +247,8 @@ export declare const ListAccountTransactionsResponseStruct: import("@metamask/su
|
|
|
247
247
|
timestamp: number | null;
|
|
248
248
|
}[];
|
|
249
249
|
chain: `${string}:${string}`;
|
|
250
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
251
250
|
account: string;
|
|
251
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
252
252
|
timestamp: number | null;
|
|
253
253
|
to: {
|
|
254
254
|
address: string;
|
|
@@ -294,8 +294,8 @@ export declare const ListAccountTransactionsResponseStruct: import("@metamask/su
|
|
|
294
294
|
timestamp: number | null;
|
|
295
295
|
}[];
|
|
296
296
|
chain: `${string}:${string}`;
|
|
297
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
298
297
|
account: string;
|
|
298
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
299
299
|
timestamp: number | null;
|
|
300
300
|
to: {
|
|
301
301
|
address: string;
|
package/dist/rpc.d.mts
CHANGED
|
@@ -197,8 +197,8 @@ export declare const ListAccountTransactionsResponseStruct: import("@metamask/su
|
|
|
197
197
|
timestamp: number | null;
|
|
198
198
|
}[];
|
|
199
199
|
chain: `${string}:${string}`;
|
|
200
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
201
200
|
account: string;
|
|
201
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
202
202
|
timestamp: number | null;
|
|
203
203
|
to: {
|
|
204
204
|
address: string;
|
|
@@ -247,8 +247,8 @@ export declare const ListAccountTransactionsResponseStruct: import("@metamask/su
|
|
|
247
247
|
timestamp: number | null;
|
|
248
248
|
}[];
|
|
249
249
|
chain: `${string}:${string}`;
|
|
250
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
251
250
|
account: string;
|
|
251
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
252
252
|
timestamp: number | null;
|
|
253
253
|
to: {
|
|
254
254
|
address: string;
|
|
@@ -294,8 +294,8 @@ export declare const ListAccountTransactionsResponseStruct: import("@metamask/su
|
|
|
294
294
|
timestamp: number | null;
|
|
295
295
|
}[];
|
|
296
296
|
chain: `${string}:${string}`;
|
|
297
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
298
297
|
account: string;
|
|
298
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
299
299
|
timestamp: number | null;
|
|
300
300
|
to: {
|
|
301
301
|
address: string;
|
package/dist/sol/types.cjs
CHANGED
|
@@ -17,7 +17,13 @@ exports.SolAddressStruct = (0, utils_1.definePattern)('SolAddress', /^[1-9A-HJ-N
|
|
|
17
17
|
var SolMethod;
|
|
18
18
|
(function (SolMethod) {
|
|
19
19
|
// General transaction methods
|
|
20
|
+
// @deprecated
|
|
21
|
+
// TODO: Remove this once the new methods are fully adopted
|
|
20
22
|
SolMethod["SendAndConfirmTransaction"] = "sendAndConfirmTransaction";
|
|
23
|
+
SolMethod["SignAndSendTransaction"] = "signAndSendTransaction";
|
|
24
|
+
SolMethod["SignTransaction"] = "signTransaction";
|
|
25
|
+
SolMethod["SignMessage"] = "signMessage";
|
|
26
|
+
SolMethod["SignIn"] = "signIn";
|
|
21
27
|
})(SolMethod || (exports.SolMethod = SolMethod = {}));
|
|
22
28
|
exports.SolDataAccountStruct = (0, keyring_utils_1.object)({
|
|
23
29
|
...api_1.KeyringAccountStruct.schema,
|
|
@@ -36,6 +42,6 @@ exports.SolDataAccountStruct = (0, keyring_utils_1.object)({
|
|
|
36
42
|
/**
|
|
37
43
|
* Account supported methods.
|
|
38
44
|
*/
|
|
39
|
-
methods: (0, superstruct_1.array)((0, superstruct_1.enums)(
|
|
45
|
+
methods: (0, superstruct_1.array)((0, superstruct_1.enums)(Object.values(SolMethod))),
|
|
40
46
|
});
|
|
41
47
|
//# sourceMappingURL=types.cjs.map
|
package/dist/sol/types.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/sol/types.ts"],"names":[],"mappings":";;;AAAA,2DAAiD;AAEjD,uDAAwE;AACxE,2CAAgD;AAEhD,0CAIgB;AAEhB;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,IAAA,qBAAa,EAC3C,YAAY,EACZ,iCAAiC,CAClC,CAAC;AAEF;;GAEG;AACH,IAAY,
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/sol/types.ts"],"names":[],"mappings":";;;AAAA,2DAAiD;AAEjD,uDAAwE;AACxE,2CAAgD;AAEhD,0CAIgB;AAEhB;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,IAAA,qBAAa,EAC3C,YAAY,EACZ,iCAAiC,CAClC,CAAC;AAEF;;GAEG;AACH,IAAY,SAWX;AAXD,WAAY,SAAS;IACnB,8BAA8B;IAE9B,cAAc;IACd,2DAA2D;IAC3D,oEAAuD,CAAA;IAEvD,8DAAiD,CAAA;IACjD,gDAAmC,CAAA;IACnC,wCAA2B,CAAA;IAC3B,8BAAiB,CAAA;AACnB,CAAC,EAXW,SAAS,yBAAT,SAAS,QAWpB;AAEY,QAAA,oBAAoB,GAAG,IAAA,sBAAM,EAAC;IACzC,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,WAAW,EAAE,CAAC;IAE9C;;OAEG;IACH,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,uBAAiB,CAAC,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,mBAAK,EAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;CAChD,CAAC,CAAC","sourcesContent":["import { object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, literal, nonempty } from '@metamask/superstruct';\nimport { definePattern } from '@metamask/utils';\n\nimport {\n CaipChainIdStruct,\n KeyringAccountStruct,\n SolAccountType,\n} from '../api';\n\n/**\n * Solana addresses are represented in the format of a 256-bit ed25519 public key and\n * are encoded using base58.\n * They are usually 32 to 44 characters long.\n */\nexport const SolAddressStruct = definePattern(\n 'SolAddress',\n /^[1-9A-HJ-NP-Za-km-z]{32,44}$/iu,\n);\n\n/**\n * Supported Solana methods.\n */\nexport enum SolMethod {\n // General transaction methods\n\n // @deprecated\n // TODO: Remove this once the new methods are fully adopted\n SendAndConfirmTransaction = 'sendAndConfirmTransaction',\n\n SignAndSendTransaction = 'signAndSendTransaction',\n SignTransaction = 'signTransaction',\n SignMessage = 'signMessage',\n SignIn = 'signIn',\n}\n\nexport const SolDataAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: SolAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${SolAccountType.DataAccount}`),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account supported methods.\n */\n methods: array(enums(Object.values(SolMethod))),\n});\n\nexport type SolDataAccount = Infer<typeof SolDataAccountStruct>;\n"]}
|
package/dist/sol/types.d.cts
CHANGED
|
@@ -9,7 +9,11 @@ export declare const SolAddressStruct: import("@metamask/superstruct").Struct<st
|
|
|
9
9
|
* Supported Solana methods.
|
|
10
10
|
*/
|
|
11
11
|
export declare enum SolMethod {
|
|
12
|
-
SendAndConfirmTransaction = "sendAndConfirmTransaction"
|
|
12
|
+
SendAndConfirmTransaction = "sendAndConfirmTransaction",
|
|
13
|
+
SignAndSendTransaction = "signAndSendTransaction",
|
|
14
|
+
SignTransaction = "signTransaction",
|
|
15
|
+
SignMessage = "signMessage",
|
|
16
|
+
SignIn = "signIn"
|
|
13
17
|
}
|
|
14
18
|
export declare const SolDataAccountStruct: import("@metamask/superstruct").Struct<{
|
|
15
19
|
type: "solana:data-account";
|
|
@@ -17,7 +21,7 @@ export declare const SolDataAccountStruct: import("@metamask/superstruct").Struc
|
|
|
17
21
|
options: Record<string, import("@metamask/utils").Json>;
|
|
18
22
|
address: string;
|
|
19
23
|
scopes: `${string}:${string}`[];
|
|
20
|
-
methods:
|
|
24
|
+
methods: SolMethod[];
|
|
21
25
|
}, {
|
|
22
26
|
/**
|
|
23
27
|
* Account address.
|
|
@@ -34,8 +38,12 @@ export declare const SolDataAccountStruct: import("@metamask/superstruct").Struc
|
|
|
34
38
|
/**
|
|
35
39
|
* Account supported methods.
|
|
36
40
|
*/
|
|
37
|
-
methods: import("@metamask/superstruct").Struct<
|
|
38
|
-
sendAndConfirmTransaction:
|
|
41
|
+
methods: import("@metamask/superstruct").Struct<SolMethod[], import("@metamask/superstruct").Struct<SolMethod, {
|
|
42
|
+
sendAndConfirmTransaction: SolMethod.SendAndConfirmTransaction;
|
|
43
|
+
signAndSendTransaction: SolMethod.SignAndSendTransaction;
|
|
44
|
+
signTransaction: SolMethod.SignTransaction;
|
|
45
|
+
signMessage: SolMethod.SignMessage;
|
|
46
|
+
signIn: SolMethod.SignIn;
|
|
39
47
|
}>>;
|
|
40
48
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
41
49
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
package/dist/sol/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/sol/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAUnD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/sol/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAUnD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAKnB,yBAAyB,8BAA8B;IAEvD,sBAAsB,2BAA2B;IACjD,eAAe,oBAAoB;IACnC,WAAW,gBAAgB;IAC3B,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,oBAAoB;;;;;;;;IAG/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/dist/sol/types.d.mts
CHANGED
|
@@ -9,7 +9,11 @@ export declare const SolAddressStruct: import("@metamask/superstruct").Struct<st
|
|
|
9
9
|
* Supported Solana methods.
|
|
10
10
|
*/
|
|
11
11
|
export declare enum SolMethod {
|
|
12
|
-
SendAndConfirmTransaction = "sendAndConfirmTransaction"
|
|
12
|
+
SendAndConfirmTransaction = "sendAndConfirmTransaction",
|
|
13
|
+
SignAndSendTransaction = "signAndSendTransaction",
|
|
14
|
+
SignTransaction = "signTransaction",
|
|
15
|
+
SignMessage = "signMessage",
|
|
16
|
+
SignIn = "signIn"
|
|
13
17
|
}
|
|
14
18
|
export declare const SolDataAccountStruct: import("@metamask/superstruct").Struct<{
|
|
15
19
|
type: "solana:data-account";
|
|
@@ -17,7 +21,7 @@ export declare const SolDataAccountStruct: import("@metamask/superstruct").Struc
|
|
|
17
21
|
options: Record<string, import("@metamask/utils").Json>;
|
|
18
22
|
address: string;
|
|
19
23
|
scopes: `${string}:${string}`[];
|
|
20
|
-
methods:
|
|
24
|
+
methods: SolMethod[];
|
|
21
25
|
}, {
|
|
22
26
|
/**
|
|
23
27
|
* Account address.
|
|
@@ -34,8 +38,12 @@ export declare const SolDataAccountStruct: import("@metamask/superstruct").Struc
|
|
|
34
38
|
/**
|
|
35
39
|
* Account supported methods.
|
|
36
40
|
*/
|
|
37
|
-
methods: import("@metamask/superstruct").Struct<
|
|
38
|
-
sendAndConfirmTransaction:
|
|
41
|
+
methods: import("@metamask/superstruct").Struct<SolMethod[], import("@metamask/superstruct").Struct<SolMethod, {
|
|
42
|
+
sendAndConfirmTransaction: SolMethod.SendAndConfirmTransaction;
|
|
43
|
+
signAndSendTransaction: SolMethod.SignAndSendTransaction;
|
|
44
|
+
signTransaction: SolMethod.SignTransaction;
|
|
45
|
+
signMessage: SolMethod.SignMessage;
|
|
46
|
+
signIn: SolMethod.SignIn;
|
|
39
47
|
}>>;
|
|
40
48
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
41
49
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
package/dist/sol/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/sol/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAUnD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/sol/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAUnD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAKnB,yBAAyB,8BAA8B;IAEvD,sBAAsB,2BAA2B;IACjD,eAAe,oBAAoB;IACnC,WAAW,gBAAgB;IAC3B,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,oBAAoB;;;;;;;;IAG/B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/dist/sol/types.mjs
CHANGED
|
@@ -14,7 +14,13 @@ export const SolAddressStruct = definePattern('SolAddress', /^[1-9A-HJ-NP-Za-km-
|
|
|
14
14
|
export var SolMethod;
|
|
15
15
|
(function (SolMethod) {
|
|
16
16
|
// General transaction methods
|
|
17
|
+
// @deprecated
|
|
18
|
+
// TODO: Remove this once the new methods are fully adopted
|
|
17
19
|
SolMethod["SendAndConfirmTransaction"] = "sendAndConfirmTransaction";
|
|
20
|
+
SolMethod["SignAndSendTransaction"] = "signAndSendTransaction";
|
|
21
|
+
SolMethod["SignTransaction"] = "signTransaction";
|
|
22
|
+
SolMethod["SignMessage"] = "signMessage";
|
|
23
|
+
SolMethod["SignIn"] = "signIn";
|
|
18
24
|
})(SolMethod || (SolMethod = {}));
|
|
19
25
|
export const SolDataAccountStruct = object({
|
|
20
26
|
...KeyringAccountStruct.schema,
|
|
@@ -33,6 +39,6 @@ export const SolDataAccountStruct = object({
|
|
|
33
39
|
/**
|
|
34
40
|
* Account supported methods.
|
|
35
41
|
*/
|
|
36
|
-
methods: array(enums(
|
|
42
|
+
methods: array(enums(Object.values(SolMethod))),
|
|
37
43
|
});
|
|
38
44
|
//# sourceMappingURL=types.mjs.map
|
package/dist/sol/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/sol/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gCAAgC;AAEjD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AACxE,OAAO,EAAE,aAAa,EAAE,wBAAwB;AAEhD,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACf,yBAAe;AAEhB;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC3C,YAAY,EACZ,iCAAiC,CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/sol/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gCAAgC;AAEjD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AACxE,OAAO,EAAE,aAAa,EAAE,wBAAwB;AAEhD,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACf,yBAAe;AAEhB;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC3C,YAAY,EACZ,iCAAiC,CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAN,IAAY,SAWX;AAXD,WAAY,SAAS;IACnB,8BAA8B;IAE9B,cAAc;IACd,2DAA2D;IAC3D,oEAAuD,CAAA;IAEvD,8DAAiD,CAAA;IACjD,gDAAmC,CAAA;IACnC,wCAA2B,CAAA;IAC3B,8BAAiB,CAAA;AACnB,CAAC,EAXW,SAAS,KAAT,SAAS,QAWpB;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC,GAAG,oBAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,gBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;IAE9C;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;CAChD,CAAC,CAAC","sourcesContent":["import { object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, literal, nonempty } from '@metamask/superstruct';\nimport { definePattern } from '@metamask/utils';\n\nimport {\n CaipChainIdStruct,\n KeyringAccountStruct,\n SolAccountType,\n} from '../api';\n\n/**\n * Solana addresses are represented in the format of a 256-bit ed25519 public key and\n * are encoded using base58.\n * They are usually 32 to 44 characters long.\n */\nexport const SolAddressStruct = definePattern(\n 'SolAddress',\n /^[1-9A-HJ-NP-Za-km-z]{32,44}$/iu,\n);\n\n/**\n * Supported Solana methods.\n */\nexport enum SolMethod {\n // General transaction methods\n\n // @deprecated\n // TODO: Remove this once the new methods are fully adopted\n SendAndConfirmTransaction = 'sendAndConfirmTransaction',\n\n SignAndSendTransaction = 'signAndSendTransaction',\n SignTransaction = 'signTransaction',\n SignMessage = 'signMessage',\n SignIn = 'signIn',\n}\n\nexport const SolDataAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: SolAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${SolAccountType.DataAccount}`),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account supported methods.\n */\n methods: array(enums(Object.values(SolMethod))),\n});\n\nexport type SolDataAccount = Infer<typeof SolDataAccountStruct>;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/keyring-api",
|
|
3
|
-
"version": "17.0.0-
|
|
3
|
+
"version": "17.0.0-6277bf9",
|
|
4
4
|
"description": "MetaMask Keyring API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"metamask",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"test:watch": "jest --watch"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@metamask/keyring-utils": "2.1.
|
|
49
|
+
"@metamask/keyring-utils": "2.1.1",
|
|
50
50
|
"@metamask/superstruct": "^3.1.0",
|
|
51
51
|
"@metamask/utils": "^11.1.0",
|
|
52
52
|
"bech32": "^2.0.0"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@lavamoat/allow-scripts": "^3.2.1",
|
|
56
56
|
"@lavamoat/preinstall-always-fail": "^2.1.0",
|
|
57
57
|
"@metamask/auto-changelog": "^3.4.4",
|
|
58
|
-
"@metamask/keyring-utils": "2.1.
|
|
58
|
+
"@metamask/keyring-utils": "2.1.1",
|
|
59
59
|
"@ts-bridge/cli": "^0.6.1",
|
|
60
60
|
"@types/jest": "^29.5.12",
|
|
61
61
|
"@types/node": "^20.12.12",
|