@avalabs/vm-module-types 0.0.12 → 0.0.15
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/.turbo/turbo-build.log +107 -21
- package/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +19 -0
- package/dist/balance.cjs +6 -0
- package/dist/balance.d.cts +103 -0
- package/dist/balance.d.ts +103 -0
- package/dist/balance.js +3 -0
- package/dist/chunk-4PGCXP4C.cjs +10 -0
- package/dist/chunk-4PGCXP4C.cjs.map +1 -0
- package/dist/chunk-74SNNWSF.cjs +9 -0
- package/dist/chunk-74SNNWSF.cjs.map +1 -0
- package/dist/chunk-7U2R34EQ.js +3 -0
- package/dist/chunk-7U2R34EQ.js.map +1 -0
- package/dist/chunk-A4YEBDMG.js +7 -0
- package/dist/chunk-A4YEBDMG.js.map +1 -0
- package/dist/chunk-AILYKQEY.cjs +4 -0
- package/dist/chunk-AILYKQEY.cjs.map +1 -0
- package/dist/chunk-BFBDZPL3.cjs +9 -0
- package/dist/chunk-BFBDZPL3.cjs.map +1 -0
- package/dist/chunk-BHB5UV3J.js +3 -0
- package/dist/chunk-BHB5UV3J.js.map +1 -0
- package/dist/chunk-CUVJNZP5.js +3 -0
- package/dist/chunk-CUVJNZP5.js.map +1 -0
- package/dist/chunk-FKFLXQOJ.js +5 -0
- package/dist/chunk-FKFLXQOJ.js.map +1 -0
- package/dist/chunk-H6ZZE5M7.js +5 -0
- package/dist/chunk-H6ZZE5M7.js.map +1 -0
- package/dist/chunk-ISTALLTN.cjs +8 -0
- package/dist/chunk-ISTALLTN.cjs.map +1 -0
- package/dist/chunk-JUV577XH.cjs +4 -0
- package/dist/chunk-JUV577XH.cjs.map +1 -0
- package/dist/chunk-KVTVJNN4.cjs +7 -0
- package/dist/chunk-KVTVJNN4.cjs.map +1 -0
- package/dist/chunk-OGQBQHLH.cjs +4 -0
- package/dist/chunk-OGQBQHLH.cjs.map +1 -0
- package/dist/chunk-TSO5BGJ4.js +5 -0
- package/dist/chunk-TSO5BGJ4.js.map +1 -0
- package/dist/chunk-WOO6UGSQ.js +7 -0
- package/dist/chunk-WOO6UGSQ.js.map +1 -0
- package/dist/chunk-XQGU7MZ4.cjs +7 -0
- package/dist/chunk-XQGU7MZ4.cjs.map +1 -0
- package/dist/chunk-YJHKZHST.js +5 -0
- package/dist/chunk-YJHKZHST.js.map +1 -0
- package/dist/coingecko.cjs +16 -0
- package/dist/coingecko.cjs.map +1 -0
- package/dist/coingecko.d.cts +23 -0
- package/dist/coingecko.d.ts +23 -0
- package/dist/coingecko.js +3 -0
- package/dist/coingecko.js.map +1 -0
- package/dist/common.cjs +12 -0
- package/dist/common.cjs.map +1 -0
- package/dist/common.d.cts +32 -0
- package/dist/common.d.ts +32 -0
- package/dist/common.js +3 -0
- package/dist/common.js.map +1 -0
- package/dist/index.cjs +36 -12
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +9 -1
- package/dist/manifest.cjs +12 -0
- package/dist/manifest.cjs.map +1 -0
- package/dist/{types.d.cts → manifest.d.cts} +1 -229
- package/dist/{types.d.ts → manifest.d.ts} +1 -229
- package/dist/manifest.js +3 -0
- package/dist/manifest.js.map +1 -0
- package/dist/module.cjs +6 -0
- package/dist/module.cjs.map +1 -0
- package/dist/module.d.cts +24 -0
- package/dist/module.d.ts +24 -0
- package/dist/module.js +3 -0
- package/dist/module.js.map +1 -0
- package/dist/network-fee.cjs +6 -0
- package/dist/network-fee.cjs.map +1 -0
- package/dist/network-fee.d.cts +18 -0
- package/dist/network-fee.d.ts +18 -0
- package/dist/network-fee.js +3 -0
- package/dist/network-fee.js.map +1 -0
- package/dist/rpc.cjs +16 -0
- package/dist/rpc.cjs.map +1 -0
- package/dist/rpc.d.cts +96 -0
- package/dist/rpc.d.ts +96 -0
- package/dist/rpc.js +3 -0
- package/dist/rpc.js.map +1 -0
- package/dist/token.cjs +12 -0
- package/dist/token.cjs.map +1 -0
- package/dist/token.d.cts +25 -0
- package/dist/token.d.ts +25 -0
- package/dist/token.js +3 -0
- package/dist/token.js.map +1 -0
- package/dist/transaction-history.cjs +20 -0
- package/dist/transaction-history.cjs.map +1 -0
- package/dist/transaction-history.d.cts +106 -0
- package/dist/transaction-history.d.ts +106 -0
- package/dist/transaction-history.js +3 -0
- package/dist/transaction-history.js.map +1 -0
- package/package.json +7 -2
- package/src/balance.ts +118 -0
- package/src/coingecko.ts +15 -0
- package/src/common.ts +34 -0
- package/src/index.ts +9 -1
- package/src/manifest.ts +40 -0
- package/src/module.ts +17 -0
- package/src/network-fee.ts +7 -0
- package/src/rpc.ts +117 -0
- package/src/token.ts +25 -0
- package/src/transaction-history.ts +113 -0
- package/dist/chunk-ODMEO2D7.js +0 -7
- package/dist/chunk-ODMEO2D7.js.map +0 -1
- package/dist/chunk-TJUF73LQ.cjs +0 -14
- package/dist/chunk-TJUF73LQ.cjs.map +0 -1
- package/dist/types.cjs +0 -32
- package/dist/types.js +0 -3
- package/src/types.ts +0 -299
- /package/dist/{types.cjs.map → balance.cjs.map} +0 -0
- /package/dist/{types.js.map → balance.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common.ts"],"names":["Environment"],"mappings":"AA8BO,IAAKA,OACVA,EAAA,WAAa,aACbA,EAAA,IAAM,MAFIA,OAAA","sourcesContent":["import type { NetworkToken } from './token';\n\nexport type Network = {\n isTestnet?: boolean;\n chainId: number;\n chainName: string;\n rpcUrl: string;\n utilityAddresses?: {\n multicall: string;\n };\n networkToken: NetworkToken;\n pricingProviders?: {\n coingecko: {\n assetPlatformId?: string;\n nativeTokenId?: string;\n };\n };\n explorerUrl?: string;\n logoUri?: string;\n};\n\nexport type Storage = {\n get: <T>(id: string) => T | undefined;\n set: <T>(id: string, data: T) => void;\n};\n\nexport type Caip2ChainId = string;\n\nexport type Hex = `0x${string}`;\n\nexport enum Environment {\n PRODUCTION = 'production',\n DEV = 'dev',\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common.ts"],"names":["Environment"],"mappings":"AA8BO,IAAKA,OACVA,EAAA,WAAa,aACbA,EAAA,IAAM,MAFIA,OAAA","sourcesContent":["import type { NetworkToken } from './token';\n\nexport type Network = {\n isTestnet?: boolean;\n chainId: number;\n chainName: string;\n rpcUrl: string;\n utilityAddresses?: {\n multicall: string;\n };\n networkToken: NetworkToken;\n pricingProviders?: {\n coingecko: {\n assetPlatformId?: string;\n nativeTokenId?: string;\n };\n };\n explorerUrl?: string;\n logoUri?: string;\n};\n\nexport type Storage = {\n get: <T>(id: string) => T | undefined;\n set: <T>(id: string, data: T) => void;\n};\n\nexport type Caip2ChainId = string;\n\nexport type Hex = `0x${string}`;\n\nexport enum Environment {\n PRODUCTION = 'production',\n DEV = 'dev',\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk4PGCXP4C_cjs = require('./chunk-4PGCXP4C.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, 'RawSimplePriceResponseSchema', {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunk4PGCXP4C_cjs.b; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, 'SimplePriceResponseSchema', {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return chunk4PGCXP4C_cjs.a; }
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=out.js.map
|
|
16
|
+
//# sourceMappingURL=coingecko.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const SimplePriceResponseSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4
|
+
price: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
5
|
+
change24: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
6
|
+
marketCap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
7
|
+
vol24: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
price?: number | null | undefined;
|
|
10
|
+
change24?: number | null | undefined;
|
|
11
|
+
marketCap?: number | null | undefined;
|
|
12
|
+
vol24?: number | null | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
price?: number | null | undefined;
|
|
15
|
+
change24?: number | null | undefined;
|
|
16
|
+
marketCap?: number | null | undefined;
|
|
17
|
+
vol24?: number | null | undefined;
|
|
18
|
+
}>>>;
|
|
19
|
+
type SimplePriceResponse = z.infer<typeof SimplePriceResponseSchema>;
|
|
20
|
+
declare const RawSimplePriceResponseSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodNullable<z.ZodNumber>>>>;
|
|
21
|
+
type RawSimplePriceResponse = z.infer<typeof RawSimplePriceResponseSchema>;
|
|
22
|
+
|
|
23
|
+
export { RawSimplePriceResponse, RawSimplePriceResponseSchema, SimplePriceResponse, SimplePriceResponseSchema };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const SimplePriceResponseSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4
|
+
price: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
5
|
+
change24: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
6
|
+
marketCap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
7
|
+
vol24: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
price?: number | null | undefined;
|
|
10
|
+
change24?: number | null | undefined;
|
|
11
|
+
marketCap?: number | null | undefined;
|
|
12
|
+
vol24?: number | null | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
price?: number | null | undefined;
|
|
15
|
+
change24?: number | null | undefined;
|
|
16
|
+
marketCap?: number | null | undefined;
|
|
17
|
+
vol24?: number | null | undefined;
|
|
18
|
+
}>>>;
|
|
19
|
+
type SimplePriceResponse = z.infer<typeof SimplePriceResponseSchema>;
|
|
20
|
+
declare const RawSimplePriceResponseSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodNullable<z.ZodNumber>>>>;
|
|
21
|
+
type RawSimplePriceResponse = z.infer<typeof RawSimplePriceResponseSchema>;
|
|
22
|
+
|
|
23
|
+
export { RawSimplePriceResponse, RawSimplePriceResponseSchema, SimplePriceResponse, SimplePriceResponseSchema };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/common.cjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkXQGU7MZ4_cjs = require('./chunk-XQGU7MZ4.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, 'Environment', {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkXQGU7MZ4_cjs.a; }
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=out.js.map
|
|
12
|
+
//# sourceMappingURL=common.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { NetworkToken } from './token.cjs';
|
|
2
|
+
|
|
3
|
+
type Network = {
|
|
4
|
+
isTestnet?: boolean;
|
|
5
|
+
chainId: number;
|
|
6
|
+
chainName: string;
|
|
7
|
+
rpcUrl: string;
|
|
8
|
+
utilityAddresses?: {
|
|
9
|
+
multicall: string;
|
|
10
|
+
};
|
|
11
|
+
networkToken: NetworkToken;
|
|
12
|
+
pricingProviders?: {
|
|
13
|
+
coingecko: {
|
|
14
|
+
assetPlatformId?: string;
|
|
15
|
+
nativeTokenId?: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
explorerUrl?: string;
|
|
19
|
+
logoUri?: string;
|
|
20
|
+
};
|
|
21
|
+
type Storage = {
|
|
22
|
+
get: <T>(id: string) => T | undefined;
|
|
23
|
+
set: <T>(id: string, data: T) => void;
|
|
24
|
+
};
|
|
25
|
+
type Caip2ChainId = string;
|
|
26
|
+
type Hex = `0x${string}`;
|
|
27
|
+
declare enum Environment {
|
|
28
|
+
PRODUCTION = "production",
|
|
29
|
+
DEV = "dev"
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { Caip2ChainId, Environment, Hex, Network, Storage };
|
package/dist/common.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { NetworkToken } from './token.js';
|
|
2
|
+
|
|
3
|
+
type Network = {
|
|
4
|
+
isTestnet?: boolean;
|
|
5
|
+
chainId: number;
|
|
6
|
+
chainName: string;
|
|
7
|
+
rpcUrl: string;
|
|
8
|
+
utilityAddresses?: {
|
|
9
|
+
multicall: string;
|
|
10
|
+
};
|
|
11
|
+
networkToken: NetworkToken;
|
|
12
|
+
pricingProviders?: {
|
|
13
|
+
coingecko: {
|
|
14
|
+
assetPlatformId?: string;
|
|
15
|
+
nativeTokenId?: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
explorerUrl?: string;
|
|
19
|
+
logoUri?: string;
|
|
20
|
+
};
|
|
21
|
+
type Storage = {
|
|
22
|
+
get: <T>(id: string) => T | undefined;
|
|
23
|
+
set: <T>(id: string, data: T) => void;
|
|
24
|
+
};
|
|
25
|
+
type Caip2ChainId = string;
|
|
26
|
+
type Hex = `0x${string}`;
|
|
27
|
+
declare enum Environment {
|
|
28
|
+
PRODUCTION = "production",
|
|
29
|
+
DEV = "dev"
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { Caip2ChainId, Environment, Hex, Network, Storage };
|
package/dist/common.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/index.cjs
CHANGED
|
@@ -1,32 +1,56 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkKVTVJNN4_cjs = require('./chunk-KVTVJNN4.cjs');
|
|
4
|
+
var chunkBFBDZPL3_cjs = require('./chunk-BFBDZPL3.cjs');
|
|
5
|
+
require('./chunk-JUV577XH.cjs');
|
|
6
|
+
var chunk4PGCXP4C_cjs = require('./chunk-4PGCXP4C.cjs');
|
|
7
|
+
var chunkXQGU7MZ4_cjs = require('./chunk-XQGU7MZ4.cjs');
|
|
8
|
+
var chunk74SNNWSF_cjs = require('./chunk-74SNNWSF.cjs');
|
|
9
|
+
require('./chunk-OGQBQHLH.cjs');
|
|
10
|
+
require('./chunk-AILYKQEY.cjs');
|
|
11
|
+
var chunkISTALLTN_cjs = require('./chunk-ISTALLTN.cjs');
|
|
4
12
|
|
|
5
13
|
|
|
6
14
|
|
|
7
|
-
Object.defineProperty(exports, '
|
|
15
|
+
Object.defineProperty(exports, 'TokenType', {
|
|
8
16
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkKVTVJNN4_cjs.a; }
|
|
10
18
|
});
|
|
11
|
-
Object.defineProperty(exports, '
|
|
19
|
+
Object.defineProperty(exports, 'PChainTransactionType', {
|
|
12
20
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkBFBDZPL3_cjs.b; }
|
|
14
22
|
});
|
|
15
|
-
Object.defineProperty(exports, '
|
|
23
|
+
Object.defineProperty(exports, 'TransactionType', {
|
|
16
24
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkBFBDZPL3_cjs.a; }
|
|
18
26
|
});
|
|
19
|
-
Object.defineProperty(exports, '
|
|
27
|
+
Object.defineProperty(exports, 'XChainTransactionType', {
|
|
20
28
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkBFBDZPL3_cjs.c; }
|
|
22
30
|
});
|
|
23
|
-
Object.defineProperty(exports, '
|
|
31
|
+
Object.defineProperty(exports, 'RawSimplePriceResponseSchema', {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return chunk4PGCXP4C_cjs.b; }
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(exports, 'SimplePriceResponseSchema', {
|
|
24
36
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunk4PGCXP4C_cjs.a; }
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, 'Environment', {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () { return chunkXQGU7MZ4_cjs.a; }
|
|
26
42
|
});
|
|
27
43
|
Object.defineProperty(exports, 'parseManifest', {
|
|
28
44
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunk74SNNWSF_cjs.a; }
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(exports, 'RpcMethod', {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () { return chunkISTALLTN_cjs.a; }
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(exports, 'SigningDataType', {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () { return chunkISTALLTN_cjs.b; }
|
|
30
54
|
});
|
|
31
55
|
//# sourceMappingURL=out.js.map
|
|
32
56
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Caip2ChainId, Environment, Hex, Network, Storage } from './common.cjs';
|
|
2
|
+
export { RawSimplePriceResponse, RawSimplePriceResponseSchema, SimplePriceResponse, SimplePriceResponseSchema } from './coingecko.cjs';
|
|
3
|
+
export { GetBalancesParams, GetBalancesResponse, NetworkTokenWithBalance, TokenBalanceData, TokenWithBalance, TokenWithBalanceAVM, TokenWithBalanceBTC, TokenWithBalanceERC20, TokenWithBalanceEVM, TokenWithBalancePVM } from './balance.cjs';
|
|
4
|
+
export { Manifest, parseManifest } from './manifest.cjs';
|
|
5
|
+
export { Module } from './module.cjs';
|
|
6
|
+
export { NetworkFees } from './network-fee.cjs';
|
|
7
|
+
export { ApprovalController, ApprovalParams, ApprovalResponse, DappInfo, DisplayData, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningDataType } from './rpc.cjs';
|
|
8
|
+
export { NetworkContractToken, NetworkToken, TokenType } from './token.cjs';
|
|
9
|
+
export { GetTransactionHistory, PChainTransactionType, Transaction, TransactionHistoryResponse, TransactionType, TxToken, XChainTransactionType } from './transaction-history.cjs';
|
|
2
10
|
import 'zod';
|
|
11
|
+
import 'bn.js';
|
|
12
|
+
import '@avalabs/glacier-sdk';
|
|
3
13
|
import 'ethers';
|
|
4
14
|
import '@metamask/rpc-errors';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Caip2ChainId, Environment, Hex, Network, Storage } from './common.js';
|
|
2
|
+
export { RawSimplePriceResponse, RawSimplePriceResponseSchema, SimplePriceResponse, SimplePriceResponseSchema } from './coingecko.js';
|
|
3
|
+
export { GetBalancesParams, GetBalancesResponse, NetworkTokenWithBalance, TokenBalanceData, TokenWithBalance, TokenWithBalanceAVM, TokenWithBalanceBTC, TokenWithBalanceERC20, TokenWithBalanceEVM, TokenWithBalancePVM } from './balance.js';
|
|
4
|
+
export { Manifest, parseManifest } from './manifest.js';
|
|
5
|
+
export { Module } from './module.js';
|
|
6
|
+
export { NetworkFees } from './network-fee.js';
|
|
7
|
+
export { ApprovalController, ApprovalParams, ApprovalResponse, DappInfo, DisplayData, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningDataType } from './rpc.js';
|
|
8
|
+
export { NetworkContractToken, NetworkToken, TokenType } from './token.js';
|
|
9
|
+
export { GetTransactionHistory, PChainTransactionType, Transaction, TransactionHistoryResponse, TransactionType, TxToken, XChainTransactionType } from './transaction-history.js';
|
|
2
10
|
import 'zod';
|
|
11
|
+
import 'bn.js';
|
|
12
|
+
import '@avalabs/glacier-sdk';
|
|
3
13
|
import 'ethers';
|
|
4
14
|
import '@metamask/rpc-errors';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { a as TokenType } from './chunk-TSO5BGJ4.js';
|
|
2
|
+
export { b as PChainTransactionType, a as TransactionType, c as XChainTransactionType } from './chunk-H6ZZE5M7.js';
|
|
3
|
+
import './chunk-BHB5UV3J.js';
|
|
4
|
+
export { b as RawSimplePriceResponseSchema, a as SimplePriceResponseSchema } from './chunk-WOO6UGSQ.js';
|
|
5
|
+
export { a as Environment } from './chunk-YJHKZHST.js';
|
|
6
|
+
export { a as parseManifest } from './chunk-A4YEBDMG.js';
|
|
7
|
+
import './chunk-CUVJNZP5.js';
|
|
8
|
+
import './chunk-7U2R34EQ.js';
|
|
9
|
+
export { a as RpcMethod, b as SigningDataType } from './chunk-FKFLXQOJ.js';
|
|
2
10
|
//# sourceMappingURL=out.js.map
|
|
3
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk74SNNWSF_cjs = require('./chunk-74SNNWSF.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, 'parseManifest', {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunk74SNNWSF_cjs.a; }
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=out.js.map
|
|
12
|
+
//# sourceMappingURL=manifest.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1,170 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { TransactionRequest } from 'ethers';
|
|
3
|
-
import { JsonRpcError, OptionalDataWithOptionalCause, EthereumProviderError } from '@metamask/rpc-errors';
|
|
4
2
|
|
|
5
|
-
declare enum TransactionType {
|
|
6
|
-
BRIDGE = "Bridge",
|
|
7
|
-
SWAP = "Swap",
|
|
8
|
-
SEND = "Send",
|
|
9
|
-
RECEIVE = "Receive",
|
|
10
|
-
NFT_BUY = "NFTBuy",
|
|
11
|
-
APPROVE = "Approve",
|
|
12
|
-
TRANSFER = "Transfer",
|
|
13
|
-
NFT_SEND = "NFTSend",
|
|
14
|
-
NFT_RECEIVE = "NFTReceive",
|
|
15
|
-
AIRDROP = "Airdrop",
|
|
16
|
-
FILL_ORDER = "FillOrder",
|
|
17
|
-
UNWRAP = "Unwrap",
|
|
18
|
-
UNKNOWN = "UNKNOWN"
|
|
19
|
-
}
|
|
20
|
-
declare enum TokenType {
|
|
21
|
-
NATIVE = "NATIVE",
|
|
22
|
-
ERC20 = "ERC20",
|
|
23
|
-
ERC721 = "ERC721",
|
|
24
|
-
ERC1155 = "ERC1155"
|
|
25
|
-
}
|
|
26
|
-
type NetworkFees = {
|
|
27
|
-
low: {
|
|
28
|
-
maxPriorityFeePerGas: bigint;
|
|
29
|
-
maxFeePerGas: bigint;
|
|
30
|
-
};
|
|
31
|
-
medium: {
|
|
32
|
-
maxPriorityFeePerGas: bigint;
|
|
33
|
-
maxFeePerGas: bigint;
|
|
34
|
-
};
|
|
35
|
-
high: {
|
|
36
|
-
maxPriorityFeePerGas: bigint;
|
|
37
|
-
maxFeePerGas: bigint;
|
|
38
|
-
};
|
|
39
|
-
baseFee: bigint;
|
|
40
|
-
};
|
|
41
|
-
declare enum RpcMethod {
|
|
42
|
-
ETH_SEND_TRANSACTION = "eth_sendTransaction",
|
|
43
|
-
SIGN_TYPED_DATA_V3 = "eth_signTypedData_v3",
|
|
44
|
-
SIGN_TYPED_DATA_V4 = "eth_signTypedData_v4",
|
|
45
|
-
SIGN_TYPED_DATA_V1 = "eth_signTypedData_v1",
|
|
46
|
-
SIGN_TYPED_DATA = "eth_signTypedData",
|
|
47
|
-
PERSONAL_SIGN = "personal_sign",
|
|
48
|
-
ETH_SIGN = "eth_sign"
|
|
49
|
-
}
|
|
50
|
-
type DappInfo = {
|
|
51
|
-
name: string;
|
|
52
|
-
url: string;
|
|
53
|
-
icon: string;
|
|
54
|
-
};
|
|
55
|
-
type RpcRequest = {
|
|
56
|
-
requestId: string;
|
|
57
|
-
sessionId: string;
|
|
58
|
-
method: RpcMethod;
|
|
59
|
-
chainId: Caip2ChainId;
|
|
60
|
-
params: unknown;
|
|
61
|
-
dappInfo: DappInfo;
|
|
62
|
-
context?: Record<string, unknown>;
|
|
63
|
-
};
|
|
64
|
-
type RpcError = JsonRpcError<OptionalDataWithOptionalCause> | EthereumProviderError<OptionalDataWithOptionalCause>;
|
|
65
|
-
type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalDataWithOptionalCause>> = {
|
|
66
|
-
result: R;
|
|
67
|
-
} | {
|
|
68
|
-
error: E;
|
|
69
|
-
};
|
|
70
|
-
type Network = {
|
|
71
|
-
chainId: number;
|
|
72
|
-
chainName: string;
|
|
73
|
-
rpcUrl: string;
|
|
74
|
-
networkToken: NetworkToken;
|
|
75
|
-
utilityAddresses?: {
|
|
76
|
-
multicall: string;
|
|
77
|
-
};
|
|
78
|
-
logoUrl?: string;
|
|
79
|
-
isTestnet?: boolean;
|
|
80
|
-
explorerUrl?: string;
|
|
81
|
-
};
|
|
82
|
-
interface Module {
|
|
83
|
-
getManifest: () => Manifest | undefined;
|
|
84
|
-
getBalances: () => Promise<string>;
|
|
85
|
-
getTransactionHistory: (params: GetTransactionHistory) => Promise<TransactionHistoryResponse>;
|
|
86
|
-
getNetworkFee: (network: Network) => Promise<NetworkFees>;
|
|
87
|
-
getAddress: () => Promise<string>;
|
|
88
|
-
getTokens: (network: Network) => Promise<NetworkContractToken[]>;
|
|
89
|
-
onRpcRequest: (request: RpcRequest, network: Network) => Promise<RpcResponse>;
|
|
90
|
-
}
|
|
91
|
-
type GetTransactionHistory = {
|
|
92
|
-
network: Network;
|
|
93
|
-
address: string;
|
|
94
|
-
nextPageToken?: string;
|
|
95
|
-
offset?: number;
|
|
96
|
-
};
|
|
97
|
-
type TransactionHistoryResponse = {
|
|
98
|
-
transactions: Transaction[];
|
|
99
|
-
nextPageToken?: string;
|
|
100
|
-
};
|
|
101
|
-
type Transaction = {
|
|
102
|
-
isContractCall: boolean;
|
|
103
|
-
isIncoming: boolean;
|
|
104
|
-
isOutgoing: boolean;
|
|
105
|
-
isSender: boolean;
|
|
106
|
-
timestamp: number;
|
|
107
|
-
hash: string;
|
|
108
|
-
from: string;
|
|
109
|
-
to: string;
|
|
110
|
-
tokens: TxToken[];
|
|
111
|
-
gasPrice?: string;
|
|
112
|
-
gasUsed: string;
|
|
113
|
-
txType?: TransactionType;
|
|
114
|
-
chainId: string;
|
|
115
|
-
method?: string;
|
|
116
|
-
explorerLink: string;
|
|
117
|
-
};
|
|
118
|
-
interface TxToken {
|
|
119
|
-
decimal?: string;
|
|
120
|
-
name: string;
|
|
121
|
-
symbol: string;
|
|
122
|
-
amount: string;
|
|
123
|
-
imageUri?: string;
|
|
124
|
-
from?: RichAddress;
|
|
125
|
-
to?: RichAddress;
|
|
126
|
-
collectableTokenId?: string;
|
|
127
|
-
type: TokenType;
|
|
128
|
-
}
|
|
129
|
-
type RichAddress = {
|
|
130
|
-
/**
|
|
131
|
-
* The contract name.
|
|
132
|
-
*/
|
|
133
|
-
name?: string;
|
|
134
|
-
/**
|
|
135
|
-
* The contract symbol.
|
|
136
|
-
*/
|
|
137
|
-
symbol?: string;
|
|
138
|
-
/**
|
|
139
|
-
* The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation.
|
|
140
|
-
*/
|
|
141
|
-
decimals?: number;
|
|
142
|
-
/**
|
|
143
|
-
* The logo uri for the address.
|
|
144
|
-
*/
|
|
145
|
-
logoUri?: string;
|
|
146
|
-
/**
|
|
147
|
-
* A wallet or contract address in mixed-case checksum encoding.
|
|
148
|
-
*/
|
|
149
|
-
address: string;
|
|
150
|
-
};
|
|
151
|
-
interface NetworkToken {
|
|
152
|
-
name: string;
|
|
153
|
-
symbol: string;
|
|
154
|
-
description: string;
|
|
155
|
-
decimals: number;
|
|
156
|
-
logoUri: string;
|
|
157
|
-
}
|
|
158
|
-
interface NetworkContractToken {
|
|
159
|
-
address: string;
|
|
160
|
-
chainId?: number;
|
|
161
|
-
color?: string;
|
|
162
|
-
contractType: string;
|
|
163
|
-
decimals: number;
|
|
164
|
-
logoUri?: string;
|
|
165
|
-
name: string;
|
|
166
|
-
symbol: string;
|
|
167
|
-
}
|
|
168
3
|
declare const manifestSchema: z.ZodObject<{
|
|
169
4
|
name: z.ZodString;
|
|
170
5
|
version: z.ZodString;
|
|
@@ -422,68 +257,5 @@ declare const manifestSchema: z.ZodObject<{
|
|
|
422
257
|
}>;
|
|
423
258
|
type Manifest = z.infer<typeof manifestSchema>;
|
|
424
259
|
declare const parseManifest: (params: unknown) => z.SafeParseReturnType<unknown, Manifest>;
|
|
425
|
-
type Caip2ChainId = string;
|
|
426
|
-
type Hex = `0x${string}`;
|
|
427
|
-
declare enum Environment {
|
|
428
|
-
PRODUCTION = "production",
|
|
429
|
-
DEV = "dev"
|
|
430
|
-
}
|
|
431
|
-
type DisplayData = {
|
|
432
|
-
title: string;
|
|
433
|
-
network: {
|
|
434
|
-
chainId: number;
|
|
435
|
-
name: string;
|
|
436
|
-
logoUrl?: string;
|
|
437
|
-
};
|
|
438
|
-
messageDetails?: string;
|
|
439
|
-
transactionDetails?: {
|
|
440
|
-
website: string;
|
|
441
|
-
from: string;
|
|
442
|
-
to: string;
|
|
443
|
-
data?: string;
|
|
444
|
-
};
|
|
445
|
-
networkFeeSelector?: boolean;
|
|
446
|
-
};
|
|
447
|
-
/**
|
|
448
|
-
* Enum for different types of signing data.
|
|
449
|
-
*/
|
|
450
|
-
declare enum SigningDataType {
|
|
451
|
-
EVM_TRANSACTION = "evm_transaction",
|
|
452
|
-
EVM_MESSAGE_ETH_SIGN = "evm_message_eth_sign",
|
|
453
|
-
EVM_MESSAGE_PERSONAL_SIGN = "evm_message_personal_sign",
|
|
454
|
-
EVM_MESSAGE_ETH_SIGN_TYPED_DATA = "evm_message_eth_sign_typed_data",
|
|
455
|
-
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V1 = "evm_message_eth_sign_typed_data_v1",
|
|
456
|
-
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V3 = "evm_message_eth_sign_typed_data_v3",
|
|
457
|
-
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V4 = "evm_message_eth_sign_typed_data_v4",
|
|
458
|
-
AVALANCHE_TRANSACTION = "avalanche_transaction",
|
|
459
|
-
AVALANCHE_MESSAGE = "avalanche_message",
|
|
460
|
-
BTC_TRANSACTION = "btc_transaction"
|
|
461
|
-
}
|
|
462
|
-
type SigningData = {
|
|
463
|
-
type: SigningDataType.EVM_TRANSACTION;
|
|
464
|
-
account: string;
|
|
465
|
-
chainId: number;
|
|
466
|
-
data: TransactionRequest;
|
|
467
|
-
} | {
|
|
468
|
-
type: SigningDataType.EVM_MESSAGE_ETH_SIGN;
|
|
469
|
-
account: string;
|
|
470
|
-
chainId: number;
|
|
471
|
-
data: string;
|
|
472
|
-
};
|
|
473
|
-
type ApprovalParams = {
|
|
474
|
-
request: RpcRequest;
|
|
475
|
-
displayData: DisplayData;
|
|
476
|
-
signingData: SigningData;
|
|
477
|
-
};
|
|
478
|
-
type ApprovalResponse = {
|
|
479
|
-
result: Hex;
|
|
480
|
-
} | {
|
|
481
|
-
error: RpcError;
|
|
482
|
-
};
|
|
483
|
-
interface ApprovalController {
|
|
484
|
-
requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;
|
|
485
|
-
onTransactionConfirmed: (txHash: Hex) => void;
|
|
486
|
-
onTransactionReverted: (txHash: Hex) => void;
|
|
487
|
-
}
|
|
488
260
|
|
|
489
|
-
export {
|
|
261
|
+
export { Manifest, parseManifest };
|