@chainflip/utils 0.11.3 → 2.1.0-beta.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.
Files changed (71) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  2. package/dist/addresses.cjs +15 -40
  3. package/dist/addresses.d.ts +4 -3
  4. package/dist/addresses.js +14 -15
  5. package/dist/assertion.cjs +23 -82
  6. package/dist/assertion.d.ts +3 -2
  7. package/dist/assertion.js +32 -22
  8. package/dist/async.cjs +96 -115
  9. package/dist/async.d.ts +24 -21
  10. package/dist/async.js +92 -87
  11. package/dist/base58.cjs +9 -93
  12. package/dist/base58.d.ts +4 -4
  13. package/dist/base58.js +9 -13
  14. package/dist/bytes.cjs +49 -97
  15. package/dist/bytes.d.ts +4 -4
  16. package/dist/bytes.js +51 -15
  17. package/dist/chainflip.cjs +428 -327
  18. package/dist/chainflip.d.ts +188 -185
  19. package/dist/chainflip.js +425 -41
  20. package/dist/consts.cjs +306 -277
  21. package/dist/consts.d.ts +18 -17
  22. package/dist/consts.js +296 -243
  23. package/dist/date.cjs +74 -131
  24. package/dist/date.d.ts +9 -8
  25. package/dist/date.js +60 -95
  26. package/dist/guard.cjs +28 -63
  27. package/dist/guard.d.ts +10 -9
  28. package/dist/guard.js +17 -28
  29. package/dist/math.cjs +7 -32
  30. package/dist/math.d.ts +3 -2
  31. package/dist/math.js +6 -7
  32. package/dist/number.cjs +5 -29
  33. package/dist/number.d.ts +4 -4
  34. package/dist/number.js +5 -5
  35. package/dist/ss58.cjs +62 -794
  36. package/dist/ss58.d.ts +12 -9
  37. package/dist/ss58.js +59 -712
  38. package/dist/string.cjs +29 -66
  39. package/dist/string.d.ts +4 -4
  40. package/dist/string.js +20 -33
  41. package/dist/tickMath.cjs +32 -232
  42. package/dist/tickMath.d.ts +7 -6
  43. package/dist/tickMath.js +24 -29
  44. package/dist/types.cjs +0 -18
  45. package/dist/types.d.ts +35 -34
  46. package/dist/types.js +1 -0
  47. package/dist/url.cjs +16 -37
  48. package/dist/url.d.ts +5 -4
  49. package/dist/url.js +16 -13
  50. package/package.json +5 -5
  51. package/dist/addresses.d.cts +0 -6
  52. package/dist/assertion.d.cts +0 -11
  53. package/dist/async.d.cts +0 -33
  54. package/dist/base58.d.cts +0 -8
  55. package/dist/bytes.d.cts +0 -11
  56. package/dist/chainflip.d.cts +0 -236
  57. package/dist/chunk-3P6TXYEI.js +0 -15
  58. package/dist/chunk-HBIFE4XN.js +0 -29
  59. package/dist/chunk-LJJH7U4M.js +0 -302
  60. package/dist/chunk-XGNPN5CY.js +0 -61
  61. package/dist/chunk-ZHIKNZLU.js +0 -66
  62. package/dist/consts.d.cts +0 -33
  63. package/dist/date.d.cts +0 -26
  64. package/dist/guard.d.cts +0 -23
  65. package/dist/math.d.cts +0 -4
  66. package/dist/number.d.cts +0 -6
  67. package/dist/ss58.d.cts +0 -14
  68. package/dist/string.d.cts +0 -16
  69. package/dist/tickMath.d.cts +0 -15
  70. package/dist/types.d.cts +0 -41
  71. package/dist/url.d.cts +0 -6
package/dist/url.cjs CHANGED
@@ -1,39 +1,18 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
1
 
20
- // src/url.ts
21
- var url_exports = {};
22
- __export(url_exports, {
23
- parseUrlWithBasicAuth: () => parseUrlWithBasicAuth
24
- });
25
- module.exports = __toCommonJS(url_exports);
26
- var parseUrlWithBasicAuth = (url) => {
27
- const rpcUrl = new URL(url);
28
- let headers = {};
29
- if (rpcUrl.username || rpcUrl.password) {
30
- headers = { Authorization: `Basic ${btoa(`${rpcUrl.username}:${rpcUrl.password}`)}` };
31
- rpcUrl.username = "";
32
- rpcUrl.password = "";
33
- }
34
- return { url: rpcUrl.toString(), headers };
2
+ //#region src/url.ts
3
+ const parseUrlWithBasicAuth = (url) => {
4
+ const rpcUrl = new URL(url);
5
+ let headers = {};
6
+ if (rpcUrl.username || rpcUrl.password) {
7
+ headers = { Authorization: `Basic ${btoa(`${rpcUrl.username}:${rpcUrl.password}`)}` };
8
+ rpcUrl.username = "";
9
+ rpcUrl.password = "";
10
+ }
11
+ return {
12
+ url: rpcUrl.toString(),
13
+ headers
14
+ };
35
15
  };
36
- // Annotate the CommonJS export names for ESM import in node:
37
- 0 && (module.exports = {
38
- parseUrlWithBasicAuth
39
- });
16
+
17
+ //#endregion
18
+ exports.parseUrlWithBasicAuth = parseUrlWithBasicAuth;
package/dist/url.d.ts CHANGED
@@ -1,6 +1,7 @@
1
+ //#region src/url.d.ts
1
2
  declare const parseUrlWithBasicAuth: (url: string) => {
2
- url: string;
3
- headers: {};
3
+ url: string;
4
+ headers: {};
4
5
  };
5
-
6
- export { parseUrlWithBasicAuth };
6
+ //#endregion
7
+ export { parseUrlWithBasicAuth };
package/dist/url.js CHANGED
@@ -1,14 +1,17 @@
1
- // src/url.ts
2
- var parseUrlWithBasicAuth = (url) => {
3
- const rpcUrl = new URL(url);
4
- let headers = {};
5
- if (rpcUrl.username || rpcUrl.password) {
6
- headers = { Authorization: `Basic ${btoa(`${rpcUrl.username}:${rpcUrl.password}`)}` };
7
- rpcUrl.username = "";
8
- rpcUrl.password = "";
9
- }
10
- return { url: rpcUrl.toString(), headers };
11
- };
12
- export {
13
- parseUrlWithBasicAuth
1
+ //#region src/url.ts
2
+ const parseUrlWithBasicAuth = (url) => {
3
+ const rpcUrl = new URL(url);
4
+ let headers = {};
5
+ if (rpcUrl.username || rpcUrl.password) {
6
+ headers = { Authorization: `Basic ${btoa(`${rpcUrl.username}:${rpcUrl.password}`)}` };
7
+ rpcUrl.username = "";
8
+ rpcUrl.password = "";
9
+ }
10
+ return {
11
+ url: rpcUrl.toString(),
12
+ headers
13
+ };
14
14
  };
15
+
16
+ //#endregion
17
+ export { parseUrlWithBasicAuth };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainflip/utils",
3
- "version": "0.11.3",
3
+ "version": "2.1.0-beta.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -9,7 +9,7 @@
9
9
  "exports": {
10
10
  "./*": {
11
11
  "require": {
12
- "types": "./dist/*.d.cts",
12
+ "types": "./dist/*.d.ts",
13
13
  "default": "./dist/*.cjs"
14
14
  },
15
15
  "import": {
@@ -26,11 +26,11 @@
26
26
  }
27
27
  },
28
28
  "devDependencies": {
29
- "@noble/hashes": "^2.0.1",
30
- "@vitest/ui": "3.1.1"
29
+ "@vitest/ui": "4.0.18"
31
30
  },
32
31
  "dependencies": {
33
32
  "@date-fns/utc": "^2.1.1",
33
+ "@noble/hashes": "^2.0.1",
34
34
  "bignumber.js": "^9.3.1",
35
35
  "date-fns": "4.1.0"
36
36
  },
@@ -46,7 +46,7 @@
46
46
  "prettier:write": "pnpm prettier:base --write",
47
47
  "clean": "rm -rf dist",
48
48
  "prepublish": "pnpm test run && pnpm build:clean",
49
- "build": "tsup",
49
+ "build": "tsdown",
50
50
  "build:clean": "pnpm clean && pnpm build",
51
51
  "test:ci": "CI=1 pnpm t run",
52
52
  "test": "vitest",
@@ -1,6 +0,0 @@
1
- import { ChainflipNetwork } from './chainflip.cjs';
2
-
3
- declare const FLIP_CONTRACT_ADDRESSES: Record<ChainflipNetwork, `0x${string}`>;
4
- declare const STATE_CHAIN_GATEWAY_ADDRESSES: Record<ChainflipNetwork, `0x${string}`>;
5
-
6
- export { FLIP_CONTRACT_ADDRESSES, STATE_CHAIN_GATEWAY_ADDRESSES };
@@ -1,11 +0,0 @@
1
- declare function assert(condition: unknown, message?: string, Constructor?: ErrorConstructor): asserts condition;
2
- declare function assertString(value: unknown, message?: string): asserts value is string;
3
- declare function assertNumber(value: unknown, message?: string): asserts value is number;
4
- declare function assertBigInt(value: unknown, message?: string): asserts value is bigint;
5
- declare function assertBoolean(value: unknown, message?: string): asserts value is boolean;
6
- declare function assertSymbol(value: unknown, message?: string): asserts value is symbol;
7
- declare function assertObject(value: unknown, message?: string): asserts value is object;
8
- declare function assertUndefined(value: unknown, message?: string): asserts value is undefined;
9
- declare const unreachable: (x: never, message?: string) => never;
10
-
11
- export { assert, assertBigInt, assertBoolean, assertNumber, assertObject, assertString, assertSymbol, assertUndefined, unreachable };
package/dist/async.d.cts DELETED
@@ -1,33 +0,0 @@
1
- declare const deferredPromise: <T>() => {
2
- promise: Promise<T>;
3
- resolve: (value: T) => void;
4
- reject: (error: Error) => void;
5
- };
6
- type DeferredPromise<T> = ReturnType<typeof deferredPromise<T>>;
7
- declare const sleep: (ms: number, { signal }?: {
8
- signal?: AbortSignal;
9
- }) => Promise<void>;
10
- declare class Queue {
11
- private readonly debounce?;
12
- private promise;
13
- constructor(debounce?: number | undefined);
14
- enqueue<T, Args extends unknown[]>(fn: (...args: Args) => Promise<T>, ...args: Args): Promise<T>;
15
- }
16
- declare class RateLimiter<T, Args extends unknown[]> {
17
- fn: (...args: Args) => Promise<T>;
18
- debounce: number;
19
- queues: Queue[];
20
- index: number;
21
- constructor(opts: {
22
- fn: (...args: Args) => Promise<T>;
23
- debounce: number;
24
- maxConcurrency: number;
25
- });
26
- request(...args: Args): Promise<T>;
27
- }
28
- declare const once: (target: EventTarget, event: string, opts?: {
29
- signal?: AbortSignal;
30
- timeout?: number;
31
- }) => Promise<void>;
32
-
33
- export { type DeferredPromise, Queue, RateLimiter, deferredPromise, once, sleep };
package/dist/base58.d.cts DELETED
@@ -1,8 +0,0 @@
1
- import { Bytelike } from './types.cjs';
2
- import './chainflip.cjs';
3
-
4
- declare const CHARSET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
5
- declare const encode: (bytes: Bytelike) => string;
6
- declare const decode: (input: string) => Uint8Array;
7
-
8
- export { CHARSET, decode, encode };
package/dist/bytes.d.cts DELETED
@@ -1,11 +0,0 @@
1
- import { HexString, Bytelike } from './types.cjs';
2
- import './chainflip.cjs';
3
-
4
- declare const bytesToHex: (input: Uint8Array | number[]) => `0x${string}`;
5
- declare const hexToBytes: (input: HexString) => Uint8Array;
6
- declare const encodeBytesWithCharset: (bytes: Bytelike, charset: string) => string;
7
- declare const decodeBytesWithCharset: (input: string, charset: string) => Uint8Array;
8
- declare function reverseBytes(input: HexString): HexString;
9
- declare function reverseBytes(input: string): string;
10
-
11
- export { bytesToHex, decodeBytesWithCharset, encodeBytesWithCharset, hexToBytes, reverseBytes };
@@ -1,236 +0,0 @@
1
- declare const chainflipAssets: readonly ["Usdc", "Usdt", "Flip", "Eth", "Dot", "Btc", "ArbUsdc", "ArbEth", "Sol", "SolUsdc", "HubDot", "HubUsdt", "HubUsdc"];
2
- type ChainflipAsset = (typeof chainflipAssets)[number];
3
- declare const assetSymbols: readonly ["USDC", "USDT", "FLIP", "DOT", "ETH", "BTC", "SOL"];
4
- declare const priceAssets: readonly ["Btc", "Eth", "Sol", "Usdc", "Usdt", "Usd", "Fine"];
5
- type PriceAsset = (typeof priceAssets)[number];
6
- /** @deprecated use `assetSymbols` instead */
7
- declare const rpcAssets: readonly ["USDC", "USDT", "FLIP", "DOT", "ETH", "BTC", "SOL"];
8
- type AssetSymbol = (typeof assetSymbols)[number];
9
- /** @deprecated use `AssetSymbol` instead */
10
- type RpcAsset = AssetSymbol;
11
- type BaseChainflipAsset = Exclude<ChainflipAsset, 'Usdc'>;
12
- declare const baseChainflipAssets: BaseChainflipAsset[];
13
- declare const chainflipEvmChains: readonly ["Ethereum", "Arbitrum"];
14
- type ChainflipEvmChain = (typeof chainflipEvmChains)[number];
15
- declare const chainflipChains: readonly ["Ethereum", "Arbitrum", "Bitcoin", "Polkadot", "Solana", "Assethub"];
16
- type ChainflipChain = (typeof chainflipChains)[number];
17
- declare const chainflipNetworks: readonly ["backspin", "sisyphos", "perseverance", "mainnet"];
18
- type ChainflipNetwork = (typeof chainflipNetworks)[number];
19
- declare const addressTypes: readonly ["Eth", "Btc", "Dot", "Arb", "Sol", "Hub"];
20
- type AddressType = (typeof addressTypes)[number];
21
- type AssetOfChain<C extends Exclude<ChainflipChain, 'Polkadot'>> = (typeof chainConstants)[C]['assets'][number];
22
- type ChainAssetMap<T> = {
23
- [C in Exclude<ChainflipChain, 'Polkadot'>]: {
24
- [A in AssetOfChain<C>]: T;
25
- };
26
- };
27
- type BaseChainAssetMap<T> = {
28
- [C in Exclude<ChainflipChain, 'Polkadot'>]: {
29
- [A in Exclude<BaseChainflipAsset, 'Dot'> as Extract<(typeof assetConstants)[A], {
30
- chain: C;
31
- }>['symbol']]: T;
32
- };
33
- };
34
- type AssetAndChain = {
35
- [C in Exclude<ChainflipChain, 'Polkadot'>]: {
36
- [A in keyof ChainAssetMap<unknown>[C]]: {
37
- chain: C;
38
- asset: A;
39
- };
40
- }[keyof ChainAssetMap<unknown>[C]];
41
- }[Exclude<ChainflipChain, 'Polkadot'>];
42
- type BaseAssetAndChain = Exclude<AssetAndChain, {
43
- chain: 'Ethereum';
44
- asset: 'USDC';
45
- }>;
46
- type ChainMap<T> = {
47
- [C in Exclude<ChainflipChain, 'Polkadot'>]: T;
48
- };
49
- type InternalAssetMap<T> = {
50
- [A in Exclude<ChainflipAsset, 'Dot'>]: T;
51
- };
52
- type UncheckedAssetAndChain = {
53
- chain: ChainflipChain;
54
- asset: AssetSymbol;
55
- };
56
- declare function readAssetValue<T>(map: ChainAssetMap<T>, asset: ChainflipAsset | BaseChainflipAsset): T;
57
- declare function readAssetValue<T>(map: BaseChainAssetMap<T>, asset: BaseChainflipAsset): T;
58
- declare function readAssetValue<T>(map: ChainAssetMap<T> | BaseChainAssetMap<T>, asset: BaseChainflipAsset): T;
59
- declare const assetConstants: {
60
- readonly Eth: {
61
- readonly chain: "Ethereum";
62
- readonly symbol: "ETH";
63
- readonly rpcAsset: "ETH";
64
- readonly decimals: 18;
65
- };
66
- readonly Flip: {
67
- readonly chain: "Ethereum";
68
- readonly symbol: "FLIP";
69
- readonly rpcAsset: "FLIP";
70
- readonly decimals: 18;
71
- };
72
- readonly Usdc: {
73
- readonly chain: "Ethereum";
74
- readonly symbol: "USDC";
75
- readonly rpcAsset: "USDC";
76
- readonly decimals: 6;
77
- };
78
- readonly Usdt: {
79
- readonly chain: "Ethereum";
80
- readonly symbol: "USDT";
81
- readonly rpcAsset: "USDT";
82
- readonly decimals: 6;
83
- };
84
- readonly Dot: {
85
- readonly chain: "Polkadot";
86
- readonly symbol: "DOT";
87
- readonly rpcAsset: "DOT";
88
- readonly decimals: 10;
89
- };
90
- readonly Btc: {
91
- readonly chain: "Bitcoin";
92
- readonly symbol: "BTC";
93
- readonly rpcAsset: "BTC";
94
- readonly decimals: 8;
95
- };
96
- readonly ArbUsdc: {
97
- readonly chain: "Arbitrum";
98
- readonly symbol: "USDC";
99
- readonly rpcAsset: "USDC";
100
- readonly decimals: 6;
101
- };
102
- readonly ArbEth: {
103
- readonly chain: "Arbitrum";
104
- readonly symbol: "ETH";
105
- readonly rpcAsset: "ETH";
106
- readonly decimals: 18;
107
- };
108
- readonly Sol: {
109
- readonly chain: "Solana";
110
- readonly symbol: "SOL";
111
- readonly rpcAsset: "SOL";
112
- readonly decimals: 9;
113
- };
114
- readonly SolUsdc: {
115
- readonly chain: "Solana";
116
- readonly symbol: "USDC";
117
- readonly rpcAsset: "USDC";
118
- readonly decimals: 6;
119
- };
120
- readonly HubDot: {
121
- readonly chain: "Assethub";
122
- readonly symbol: "DOT";
123
- readonly rpcAsset: "DOT";
124
- readonly decimals: 10;
125
- };
126
- readonly HubUsdc: {
127
- readonly chain: "Assethub";
128
- readonly symbol: "USDC";
129
- readonly rpcAsset: "USDC";
130
- readonly decimals: 6;
131
- };
132
- readonly HubUsdt: {
133
- readonly chain: "Assethub";
134
- readonly symbol: "USDT";
135
- readonly rpcAsset: "USDT";
136
- readonly decimals: 6;
137
- };
138
- };
139
- declare const chainConstants: {
140
- readonly Ethereum: {
141
- readonly chainflipAssets: ["Eth", "Flip", "Usdc", "Usdt"];
142
- readonly assets: ["ETH", "FLIP", "USDC", "USDT"];
143
- readonly rpcAssets: ["ETH", "FLIP", "USDC", "USDT"];
144
- readonly gasAsset: "Eth";
145
- readonly addressType: "Eth";
146
- readonly blockTimeSeconds: 12;
147
- };
148
- readonly Polkadot: {
149
- readonly chainflipAssets: ["Dot"];
150
- readonly assets: ["DOT"];
151
- readonly rpcAssets: ["DOT"];
152
- readonly gasAsset: "Dot";
153
- readonly addressType: "Dot";
154
- readonly blockTimeSeconds: 6;
155
- };
156
- readonly Bitcoin: {
157
- readonly chainflipAssets: ["Btc"];
158
- readonly assets: ["BTC"];
159
- readonly rpcAssets: ["BTC"];
160
- readonly gasAsset: "Btc";
161
- readonly addressType: "Btc";
162
- readonly blockTimeSeconds: number;
163
- };
164
- readonly Arbitrum: {
165
- readonly chainflipAssets: ["ArbUsdc", "ArbEth"];
166
- readonly assets: ["USDC", "ETH"];
167
- readonly rpcAssets: ["USDC", "ETH"];
168
- readonly gasAsset: "ArbEth";
169
- readonly addressType: "Arb";
170
- readonly blockTimeSeconds: 0.26;
171
- };
172
- readonly Solana: {
173
- readonly chainflipAssets: ["Sol", "SolUsdc"];
174
- readonly assets: ["SOL", "USDC"];
175
- readonly rpcAssets: ["SOL", "USDC"];
176
- readonly gasAsset: "Sol";
177
- readonly addressType: "Sol";
178
- readonly blockTimeSeconds: 0.8;
179
- };
180
- readonly Assethub: {
181
- readonly chainflipAssets: ["HubDot", "HubUsdt", "HubUsdc"];
182
- readonly assets: ["DOT", "USDT", "USDC"];
183
- readonly rpcAssets: ["DOT", "USDT", "USDC"];
184
- readonly gasAsset: "HubDot";
185
- readonly addressType: "Hub";
186
- readonly blockTimeSeconds: 12;
187
- };
188
- };
189
- declare const internalAssetToRpcAsset: InternalAssetMap<AssetAndChain> & {
190
- Dot: {
191
- chain: 'Polkadot';
192
- asset: 'DOT';
193
- };
194
- };
195
- declare const chainContractId: ChainMap<number> & {
196
- Polkadot: 2;
197
- };
198
- declare const assetContractId: InternalAssetMap<number> & {
199
- Dot: 4;
200
- };
201
- declare function getInternalAsset(asset: BaseAssetAndChain): BaseChainflipAsset;
202
- declare function getInternalAsset(asset: AssetAndChain): ChainflipAsset;
203
- declare function getInternalAsset(asset: UncheckedAssetAndChain): ChainflipAsset;
204
- declare function getInternalAsset(asset: UncheckedAssetAndChain, assert: true): ChainflipAsset;
205
- declare function getInternalAsset(asset: UncheckedAssetAndChain, assert: boolean): ChainflipAsset | null;
206
- declare function isValidAssetAndChain(assetAndChain: UncheckedAssetAndChain): assetAndChain is AssetAndChain;
207
- declare function getInternalAssets(data: {
208
- srcAsset: AssetSymbol;
209
- srcChain: ChainflipChain;
210
- destAsset: AssetSymbol;
211
- destChain: ChainflipChain;
212
- }): {
213
- srcAsset: ChainflipAsset;
214
- destAsset: ChainflipAsset;
215
- };
216
- declare function getInternalAssets(data: {
217
- srcAsset: AssetSymbol;
218
- srcChain: ChainflipChain;
219
- destAsset: AssetSymbol;
220
- destChain: ChainflipChain;
221
- }, assert: true): {
222
- srcAsset: ChainflipAsset;
223
- destAsset: ChainflipAsset;
224
- };
225
- declare function getInternalAssets(data: {
226
- srcAsset: AssetSymbol;
227
- srcChain: ChainflipChain;
228
- destAsset: AssetSymbol;
229
- destChain: ChainflipChain;
230
- }, assert: boolean): {
231
- srcAsset: ChainflipAsset | null;
232
- destAsset: ChainflipAsset | null;
233
- };
234
- declare const chainflipAssetToPriceAssetMap: Record<ChainflipAsset, Exclude<PriceAsset, 'Usd'> | null>;
235
-
236
- export { type AddressType, type AssetAndChain, type AssetOfChain, type AssetSymbol, type BaseAssetAndChain, type BaseChainAssetMap, type BaseChainflipAsset, type ChainAssetMap, type ChainMap, type ChainflipAsset, type ChainflipChain, type ChainflipEvmChain, type ChainflipNetwork, type InternalAssetMap, type PriceAsset, type RpcAsset, type UncheckedAssetAndChain, addressTypes, assetConstants, assetContractId, assetSymbols, baseChainflipAssets, chainConstants, chainContractId, chainflipAssetToPriceAssetMap, chainflipAssets, chainflipChains, chainflipEvmChains, chainflipNetworks, getInternalAsset, getInternalAssets, internalAssetToRpcAsset, isValidAssetAndChain, priceAssets, readAssetValue, rpcAssets };
@@ -1,15 +0,0 @@
1
- import {
2
- decodeBytesWithCharset,
3
- encodeBytesWithCharset
4
- } from "./chunk-XGNPN5CY.js";
5
-
6
- // src/base58.ts
7
- var CHARSET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
8
- var encode = (bytes) => encodeBytesWithCharset(bytes, CHARSET);
9
- var decode = (input) => decodeBytesWithCharset(input, CHARSET);
10
-
11
- export {
12
- CHARSET,
13
- encode,
14
- decode
15
- };
@@ -1,29 +0,0 @@
1
- // src/guard.ts
2
- var createIsGuard = (type) => (value) => typeof value === type;
3
- var isString = createIsGuard("string");
4
- var isNumber = createIsGuard("number");
5
- var isBigInt = createIsGuard("bigint");
6
- var isBoolean = createIsGuard("boolean");
7
- var isSymbol = createIsGuard("symbol");
8
- var isObject = createIsGuard("object");
9
- var isUndefined = createIsGuard("undefined");
10
- var isNotNullish = (value) => value != null;
11
- var isNullish = (value) => value == null;
12
- var isTruthy = (value) => Boolean(value);
13
- var isFullfilled = (value) => value.status === "fulfilled";
14
- var isRejected = (value) => value.status === "rejected";
15
-
16
- export {
17
- isString,
18
- isNumber,
19
- isBigInt,
20
- isBoolean,
21
- isSymbol,
22
- isObject,
23
- isUndefined,
24
- isNotNullish,
25
- isNullish,
26
- isTruthy,
27
- isFullfilled,
28
- isRejected
29
- };