@shapeshiftoss/types 8.3.3 → 8.5.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/base.d.ts +1 -0
- package/dist/base.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -0
- package/dist/utility.d.ts +4 -5
- package/package.json +1 -1
package/dist/base.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare type BIP44Params = {
|
|
|
8
8
|
export declare enum KnownChainIds {
|
|
9
9
|
EthereumMainnet = "eip155:1",
|
|
10
10
|
AvalancheMainnet = "eip155:43114",
|
|
11
|
+
OptimismMainnet = "eip155:10",
|
|
11
12
|
BitcoinMainnet = "bip122:000000000019d6689c085ae165831e93",
|
|
12
13
|
BitcoinCashMainnet = "bip122:000000000000000000651ef99cb9fcbe",
|
|
13
14
|
DogecoinMainnet = "bip122:00000000001a91e3dace36e2be3bf030",
|
package/dist/base.js
CHANGED
|
@@ -5,6 +5,7 @@ var KnownChainIds;
|
|
|
5
5
|
(function (KnownChainIds) {
|
|
6
6
|
KnownChainIds["EthereumMainnet"] = "eip155:1";
|
|
7
7
|
KnownChainIds["AvalancheMainnet"] = "eip155:43114";
|
|
8
|
+
KnownChainIds["OptimismMainnet"] = "eip155:10";
|
|
8
9
|
KnownChainIds["BitcoinMainnet"] = "bip122:000000000019d6689c085ae165831e93";
|
|
9
10
|
KnownChainIds["BitcoinCashMainnet"] = "bip122:000000000000000000651ef99cb9fcbe";
|
|
10
11
|
KnownChainIds["DogecoinMainnet"] = "bip122:00000000001a91e3dace36e2be3bf030";
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./base"), exports);
|
|
18
18
|
__exportStar(require("./market"), exports);
|
|
19
|
+
__exportStar(require("./utility"), exports);
|
package/dist/utility.d.ts
CHANGED
|
@@ -4,22 +4,21 @@
|
|
|
4
4
|
* See: https://stackoverflow.com/questions/55904032/how-to-get-optional-property-from-union
|
|
5
5
|
*/
|
|
6
6
|
/** Get specific type for key(K) in union(T) */
|
|
7
|
-
declare type ValueOfUnion<T, K> = T extends unknown ? (K extends keyof T ? T[K] : undefined) : never;
|
|
7
|
+
export declare type ValueOfUnion<T, K> = T extends unknown ? (K extends keyof T ? T[K] : undefined) : never;
|
|
8
8
|
/** Get all keys in union(T) as union */
|
|
9
|
-
declare type KeysOfUnion<T> = T extends unknown ? keyof T : never;
|
|
9
|
+
export declare type KeysOfUnion<T> = T extends unknown ? keyof T : never;
|
|
10
10
|
/**
|
|
11
11
|
* Create mapping of all keys in union(T) with proper type values
|
|
12
12
|
*
|
|
13
13
|
* _note: `| keyof T` index is simply to tell typescript that T is definitely a sub type of KeysOfUnion_
|
|
14
14
|
*/
|
|
15
|
-
declare type UnionMapping<T> = {
|
|
15
|
+
export declare type UnionMapping<T> = {
|
|
16
16
|
[K in KeysOfUnion<T> | keyof T]: ValueOfUnion<T, K>;
|
|
17
17
|
};
|
|
18
18
|
/** Pick out the elements we know for sure and make everything else optional */
|
|
19
|
-
declare type UnionMerge<T> = Pick<UnionMapping<T>, keyof T> & Partial<UnionMapping<T>>;
|
|
19
|
+
export declare type UnionMerge<T> = Pick<UnionMapping<T>, keyof T> & Partial<UnionMapping<T>>;
|
|
20
20
|
/** Adds all possible values of union(T) as a nested object under a `chainSpecific` key */
|
|
21
21
|
export declare type ChainSpecific<T, M> = UnionMerge<T extends unknown ? (T extends keyof M ? {
|
|
22
22
|
chainSpecific: M[T];
|
|
23
23
|
} : undefined) : never>;
|
|
24
24
|
export declare type PartialRecord<K extends keyof any, V> = Partial<Record<K, V>>;
|
|
25
|
-
export {};
|