@avalabs/vm-module-types 0.1.12 → 0.3.0
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/chunk-4ZJ3LCH6.js +5 -0
- package/dist/chunk-4ZJ3LCH6.js.map +1 -0
- package/dist/chunk-JQSZ7QKK.cjs +7 -0
- package/dist/chunk-JQSZ7QKK.cjs.map +1 -0
- package/dist/index.cjs +5 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/provider.cjs +12 -0
- package/dist/provider.cjs.map +1 -0
- package/dist/provider.d.cts +62 -0
- package/dist/provider.d.ts +62 -0
- package/dist/provider.js +3 -0
- package/dist/provider.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var t=(e=>(e.CORE_WALLET_ANNOUNCE_PROVIDER="core-wallet:announceProvider",e.CORE_WALLET_REQUEST_PROVIDER="core-wallet:requestProvider",e.EIP6963_ANNOUNCE_PROVIDER="eip6963:announceProvider",e.EIP6963_REQUEST_PROVIDER="eip6963:requestProvider",e))(t||{});
|
|
2
|
+
|
|
3
|
+
export { t as a };
|
|
4
|
+
//# sourceMappingURL=out.js.map
|
|
5
|
+
//# sourceMappingURL=chunk-4ZJ3LCH6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/provider.ts"],"names":["EventNames"],"mappings":"AA4BO,IAAKA,OACVA,EAAA,8BAAgC,+BAChCA,EAAA,6BAA+B,8BAC/BA,EAAA,0BAA4B,2BAC5BA,EAAA,yBAA2B,0BAJjBA,OAAA","sourcesContent":["import type { Eip1193Provider } from 'ethers';\nimport type EventEmitter from 'events';\n\nexport interface ChainChangedEventData {\n chainId: string;\n networkVersion: string;\n}\n\nexport type AccountsChangedEventData = string[];\n\nexport interface UnlockStateChangedEventData {\n accounts: string[];\n isUnlocked: boolean;\n}\n\nexport interface EIP6963ProviderInfo {\n uuid: string;\n name: string;\n icon: string;\n rdns: string;\n description: string;\n}\n\nexport interface EIP6963ProviderDetail {\n info: EIP6963ProviderInfo;\n provider: Eip1193Provider;\n}\n\nexport enum EventNames {\n CORE_WALLET_ANNOUNCE_PROVIDER = 'core-wallet:announceProvider',\n CORE_WALLET_REQUEST_PROVIDER = 'core-wallet:requestProvider',\n EIP6963_ANNOUNCE_PROVIDER = 'eip6963:announceProvider',\n EIP6963_REQUEST_PROVIDER = 'eip6963:requestProvider',\n}\n\nexport interface DomainMetadata {\n domain: string;\n name?: string;\n icon?: string;\n tabId?: number;\n}\n\ninterface JsonRpcRequestPayloadBase<Method extends string> {\n readonly id: string;\n readonly method: Method;\n readonly site?: DomainMetadata;\n readonly tabId?: number;\n}\n\ninterface JsonRpcRequestPayloadWithParams<Method extends string, Params = unknown>\n extends JsonRpcRequestPayloadBase<Method> {\n readonly params: Params;\n}\n\ninterface JsonRpcRequestPayloadWithoutParams<Method extends string> extends JsonRpcRequestPayloadBase<Method> {\n readonly params?: never;\n}\n\nexport type JsonRpcRequestPayload<Method extends string, Params = unknown> = Params extends undefined\n ? JsonRpcRequestPayloadWithoutParams<Method>\n : JsonRpcRequestPayloadWithParams<Method, Params>;\n\nexport type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\nexport interface ChainAgnosticProvider extends EventEmitter {\n request({\n data,\n sessionId,\n chainId,\n }: {\n data: PartialBy<JsonRpcRequestPayload<string>, 'id' | 'params'>;\n sessionId: string;\n chainId: string | null;\n }): Promise<unknown>;\n\n subscribeToMessage(callback: ({ method, params }: { method: string; params: unknown }) => void): void;\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var t=(e=>(e.CORE_WALLET_ANNOUNCE_PROVIDER="core-wallet:announceProvider",e.CORE_WALLET_REQUEST_PROVIDER="core-wallet:requestProvider",e.EIP6963_ANNOUNCE_PROVIDER="eip6963:announceProvider",e.EIP6963_REQUEST_PROVIDER="eip6963:requestProvider",e))(t||{});
|
|
4
|
+
|
|
5
|
+
exports.a = t;
|
|
6
|
+
//# sourceMappingURL=out.js.map
|
|
7
|
+
//# sourceMappingURL=chunk-JQSZ7QKK.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/provider.ts"],"names":["EventNames"],"mappings":"AA4BO,IAAKA,OACVA,EAAA,8BAAgC,+BAChCA,EAAA,6BAA+B,8BAC/BA,EAAA,0BAA4B,2BAC5BA,EAAA,yBAA2B,0BAJjBA,OAAA","sourcesContent":["import type { Eip1193Provider } from 'ethers';\nimport type EventEmitter from 'events';\n\nexport interface ChainChangedEventData {\n chainId: string;\n networkVersion: string;\n}\n\nexport type AccountsChangedEventData = string[];\n\nexport interface UnlockStateChangedEventData {\n accounts: string[];\n isUnlocked: boolean;\n}\n\nexport interface EIP6963ProviderInfo {\n uuid: string;\n name: string;\n icon: string;\n rdns: string;\n description: string;\n}\n\nexport interface EIP6963ProviderDetail {\n info: EIP6963ProviderInfo;\n provider: Eip1193Provider;\n}\n\nexport enum EventNames {\n CORE_WALLET_ANNOUNCE_PROVIDER = 'core-wallet:announceProvider',\n CORE_WALLET_REQUEST_PROVIDER = 'core-wallet:requestProvider',\n EIP6963_ANNOUNCE_PROVIDER = 'eip6963:announceProvider',\n EIP6963_REQUEST_PROVIDER = 'eip6963:requestProvider',\n}\n\nexport interface DomainMetadata {\n domain: string;\n name?: string;\n icon?: string;\n tabId?: number;\n}\n\ninterface JsonRpcRequestPayloadBase<Method extends string> {\n readonly id: string;\n readonly method: Method;\n readonly site?: DomainMetadata;\n readonly tabId?: number;\n}\n\ninterface JsonRpcRequestPayloadWithParams<Method extends string, Params = unknown>\n extends JsonRpcRequestPayloadBase<Method> {\n readonly params: Params;\n}\n\ninterface JsonRpcRequestPayloadWithoutParams<Method extends string> extends JsonRpcRequestPayloadBase<Method> {\n readonly params?: never;\n}\n\nexport type JsonRpcRequestPayload<Method extends string, Params = unknown> = Params extends undefined\n ? JsonRpcRequestPayloadWithoutParams<Method>\n : JsonRpcRequestPayloadWithParams<Method, Params>;\n\nexport type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\nexport interface ChainAgnosticProvider extends EventEmitter {\n request({\n data,\n sessionId,\n chainId,\n }: {\n data: PartialBy<JsonRpcRequestPayload<string>, 'id' | 'params'>;\n sessionId: string;\n chainId: string | null;\n }): Promise<unknown>;\n\n subscribeToMessage(callback: ({ method, params }: { method: string; params: unknown }) => void): void;\n}\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('./chunk-AILYKQEY.cjs');
|
|
4
|
+
var chunkJQSZ7QKK_cjs = require('./chunk-JQSZ7QKK.cjs');
|
|
4
5
|
var chunkLYK7OEFS_cjs = require('./chunk-LYK7OEFS.cjs');
|
|
5
6
|
var chunkIQNJXPS3_cjs = require('./chunk-IQNJXPS3.cjs');
|
|
6
7
|
var chunk2KGTZTXY_cjs = require('./chunk-2KGTZTXY.cjs');
|
|
@@ -16,6 +17,10 @@ require('./chunk-OGQBQHLH.cjs');
|
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
|
|
20
|
+
Object.defineProperty(exports, 'EventNames', {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return chunkJQSZ7QKK_cjs.a; }
|
|
23
|
+
});
|
|
19
24
|
Object.defineProperty(exports, 'AlertType', {
|
|
20
25
|
enumerable: true,
|
|
21
26
|
get: function () { return chunkLYK7OEFS_cjs.c; }
|
package/dist/index.d.cts
CHANGED
|
@@ -11,8 +11,10 @@ export { GetTransactionHistory, PChainTransactionType, Transaction, TransactionH
|
|
|
11
11
|
export { BalanceChange, TokenApproval, TokenApprovals, TokenDiff, TokenDiffItem } from './transaction-simulation.cjs';
|
|
12
12
|
export { BtcWalletPolicyDetails, GetAddressParams, GetAddressResponse, PubKeyType, WalletType } from './account.cjs';
|
|
13
13
|
export { AddPermissionlessDelegatorTx, AddPermissionlessValidatorTx, AddSubnetValidatorTx, BaseTx, BlockchainDetails, ChainDetails, CreateChainTx, CreateSubnetTx, ExportImportTxDetails, ExportTx, ImportTx, RemoveSubnetValidatorTx, StakingDetails, SubnetDetails, TxDetails, TxType, VM } from './staking.cjs';
|
|
14
|
+
export { AccountsChangedEventData, ChainAgnosticProvider, ChainChangedEventData, DomainMetadata, EIP6963ProviderDetail, EIP6963ProviderInfo, EventNames, JsonRpcRequestPayload, PartialBy, UnlockStateChangedEventData } from './provider.cjs';
|
|
14
15
|
import 'zod';
|
|
15
16
|
import '@avalabs/glacier-sdk';
|
|
16
17
|
import '@avalabs/core-wallets-sdk';
|
|
17
18
|
import 'ethers';
|
|
18
19
|
import '@metamask/rpc-errors';
|
|
20
|
+
import 'events';
|
package/dist/index.d.ts
CHANGED
|
@@ -11,8 +11,10 @@ export { GetTransactionHistory, PChainTransactionType, Transaction, TransactionH
|
|
|
11
11
|
export { BalanceChange, TokenApproval, TokenApprovals, TokenDiff, TokenDiffItem } from './transaction-simulation.js';
|
|
12
12
|
export { BtcWalletPolicyDetails, GetAddressParams, GetAddressResponse, PubKeyType, WalletType } from './account.js';
|
|
13
13
|
export { AddPermissionlessDelegatorTx, AddPermissionlessValidatorTx, AddSubnetValidatorTx, BaseTx, BlockchainDetails, ChainDetails, CreateChainTx, CreateSubnetTx, ExportImportTxDetails, ExportTx, ImportTx, RemoveSubnetValidatorTx, StakingDetails, SubnetDetails, TxDetails, TxType, VM } from './staking.js';
|
|
14
|
+
export { AccountsChangedEventData, ChainAgnosticProvider, ChainChangedEventData, DomainMetadata, EIP6963ProviderDetail, EIP6963ProviderInfo, EventNames, JsonRpcRequestPayload, PartialBy, UnlockStateChangedEventData } from './provider.js';
|
|
14
15
|
import 'zod';
|
|
15
16
|
import '@avalabs/glacier-sdk';
|
|
16
17
|
import '@avalabs/core-wallets-sdk';
|
|
17
18
|
import 'ethers';
|
|
18
19
|
import '@metamask/rpc-errors';
|
|
20
|
+
import 'events';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import './chunk-7U2R34EQ.js';
|
|
2
|
+
export { a as EventNames } from './chunk-4ZJ3LCH6.js';
|
|
2
3
|
export { c as AlertType, b as DetailItemType, a as RpcMethod } from './chunk-LWDTKZK6.js';
|
|
3
4
|
export { a as TxType } from './chunk-2SJQLDBB.js';
|
|
4
5
|
export { a as TokenType } from './chunk-7Y6UGMPZ.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkJQSZ7QKK_cjs = require('./chunk-JQSZ7QKK.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, 'EventNames', {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkJQSZ7QKK_cjs.a; }
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=out.js.map
|
|
12
|
+
//# sourceMappingURL=provider.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Eip1193Provider } from 'ethers';
|
|
2
|
+
import EventEmitter from 'events';
|
|
3
|
+
|
|
4
|
+
interface ChainChangedEventData {
|
|
5
|
+
chainId: string;
|
|
6
|
+
networkVersion: string;
|
|
7
|
+
}
|
|
8
|
+
type AccountsChangedEventData = string[];
|
|
9
|
+
interface UnlockStateChangedEventData {
|
|
10
|
+
accounts: string[];
|
|
11
|
+
isUnlocked: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface EIP6963ProviderInfo {
|
|
14
|
+
uuid: string;
|
|
15
|
+
name: string;
|
|
16
|
+
icon: string;
|
|
17
|
+
rdns: string;
|
|
18
|
+
description: string;
|
|
19
|
+
}
|
|
20
|
+
interface EIP6963ProviderDetail {
|
|
21
|
+
info: EIP6963ProviderInfo;
|
|
22
|
+
provider: Eip1193Provider;
|
|
23
|
+
}
|
|
24
|
+
declare enum EventNames {
|
|
25
|
+
CORE_WALLET_ANNOUNCE_PROVIDER = "core-wallet:announceProvider",
|
|
26
|
+
CORE_WALLET_REQUEST_PROVIDER = "core-wallet:requestProvider",
|
|
27
|
+
EIP6963_ANNOUNCE_PROVIDER = "eip6963:announceProvider",
|
|
28
|
+
EIP6963_REQUEST_PROVIDER = "eip6963:requestProvider"
|
|
29
|
+
}
|
|
30
|
+
interface DomainMetadata {
|
|
31
|
+
domain: string;
|
|
32
|
+
name?: string;
|
|
33
|
+
icon?: string;
|
|
34
|
+
tabId?: number;
|
|
35
|
+
}
|
|
36
|
+
interface JsonRpcRequestPayloadBase<Method extends string> {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly method: Method;
|
|
39
|
+
readonly site?: DomainMetadata;
|
|
40
|
+
readonly tabId?: number;
|
|
41
|
+
}
|
|
42
|
+
interface JsonRpcRequestPayloadWithParams<Method extends string, Params = unknown> extends JsonRpcRequestPayloadBase<Method> {
|
|
43
|
+
readonly params: Params;
|
|
44
|
+
}
|
|
45
|
+
interface JsonRpcRequestPayloadWithoutParams<Method extends string> extends JsonRpcRequestPayloadBase<Method> {
|
|
46
|
+
readonly params?: never;
|
|
47
|
+
}
|
|
48
|
+
type JsonRpcRequestPayload<Method extends string, Params = unknown> = Params extends undefined ? JsonRpcRequestPayloadWithoutParams<Method> : JsonRpcRequestPayloadWithParams<Method, Params>;
|
|
49
|
+
type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
50
|
+
interface ChainAgnosticProvider extends EventEmitter {
|
|
51
|
+
request({ data, sessionId, chainId, }: {
|
|
52
|
+
data: PartialBy<JsonRpcRequestPayload<string>, 'id' | 'params'>;
|
|
53
|
+
sessionId: string;
|
|
54
|
+
chainId: string | null;
|
|
55
|
+
}): Promise<unknown>;
|
|
56
|
+
subscribeToMessage(callback: ({ method, params }: {
|
|
57
|
+
method: string;
|
|
58
|
+
params: unknown;
|
|
59
|
+
}) => void): void;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { AccountsChangedEventData, ChainAgnosticProvider, ChainChangedEventData, DomainMetadata, EIP6963ProviderDetail, EIP6963ProviderInfo, EventNames, JsonRpcRequestPayload, PartialBy, UnlockStateChangedEventData };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Eip1193Provider } from 'ethers';
|
|
2
|
+
import EventEmitter from 'events';
|
|
3
|
+
|
|
4
|
+
interface ChainChangedEventData {
|
|
5
|
+
chainId: string;
|
|
6
|
+
networkVersion: string;
|
|
7
|
+
}
|
|
8
|
+
type AccountsChangedEventData = string[];
|
|
9
|
+
interface UnlockStateChangedEventData {
|
|
10
|
+
accounts: string[];
|
|
11
|
+
isUnlocked: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface EIP6963ProviderInfo {
|
|
14
|
+
uuid: string;
|
|
15
|
+
name: string;
|
|
16
|
+
icon: string;
|
|
17
|
+
rdns: string;
|
|
18
|
+
description: string;
|
|
19
|
+
}
|
|
20
|
+
interface EIP6963ProviderDetail {
|
|
21
|
+
info: EIP6963ProviderInfo;
|
|
22
|
+
provider: Eip1193Provider;
|
|
23
|
+
}
|
|
24
|
+
declare enum EventNames {
|
|
25
|
+
CORE_WALLET_ANNOUNCE_PROVIDER = "core-wallet:announceProvider",
|
|
26
|
+
CORE_WALLET_REQUEST_PROVIDER = "core-wallet:requestProvider",
|
|
27
|
+
EIP6963_ANNOUNCE_PROVIDER = "eip6963:announceProvider",
|
|
28
|
+
EIP6963_REQUEST_PROVIDER = "eip6963:requestProvider"
|
|
29
|
+
}
|
|
30
|
+
interface DomainMetadata {
|
|
31
|
+
domain: string;
|
|
32
|
+
name?: string;
|
|
33
|
+
icon?: string;
|
|
34
|
+
tabId?: number;
|
|
35
|
+
}
|
|
36
|
+
interface JsonRpcRequestPayloadBase<Method extends string> {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly method: Method;
|
|
39
|
+
readonly site?: DomainMetadata;
|
|
40
|
+
readonly tabId?: number;
|
|
41
|
+
}
|
|
42
|
+
interface JsonRpcRequestPayloadWithParams<Method extends string, Params = unknown> extends JsonRpcRequestPayloadBase<Method> {
|
|
43
|
+
readonly params: Params;
|
|
44
|
+
}
|
|
45
|
+
interface JsonRpcRequestPayloadWithoutParams<Method extends string> extends JsonRpcRequestPayloadBase<Method> {
|
|
46
|
+
readonly params?: never;
|
|
47
|
+
}
|
|
48
|
+
type JsonRpcRequestPayload<Method extends string, Params = unknown> = Params extends undefined ? JsonRpcRequestPayloadWithoutParams<Method> : JsonRpcRequestPayloadWithParams<Method, Params>;
|
|
49
|
+
type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
50
|
+
interface ChainAgnosticProvider extends EventEmitter {
|
|
51
|
+
request({ data, sessionId, chainId, }: {
|
|
52
|
+
data: PartialBy<JsonRpcRequestPayload<string>, 'id' | 'params'>;
|
|
53
|
+
sessionId: string;
|
|
54
|
+
chainId: string | null;
|
|
55
|
+
}): Promise<unknown>;
|
|
56
|
+
subscribeToMessage(callback: ({ method, params }: {
|
|
57
|
+
method: string;
|
|
58
|
+
params: unknown;
|
|
59
|
+
}) => void): void;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { AccountsChangedEventData, ChainAgnosticProvider, ChainChangedEventData, DomainMetadata, EIP6963ProviderDetail, EIP6963ProviderInfo, EventNames, JsonRpcRequestPayload, PartialBy, UnlockStateChangedEventData };
|
package/dist/provider.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avalabs/vm-module-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"main": "dist/index.cjs",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"@avalabs/glacier-sdk": "3.1.0-alpha.1",
|
|
26
26
|
"@avalabs/core-utils-sdk": "3.1.0-alpha.1",
|
|
27
27
|
"@avalabs/core-wallets-sdk": "3.0.1-alpha.1",
|
|
28
|
+
"ethers": "6.8.1",
|
|
28
29
|
"@internal/tsup-config": "0.0.1",
|
|
29
30
|
"eslint-config-custom": "0.0.1"
|
|
30
31
|
},
|