@shapeshiftoss/caip 6.4.0 → 6.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/adapters/coincap/generated/bip122_00000000001a91e3dace36e2be3bf030/adapter.json +1 -0
- package/dist/adapters/coincap/generated/eip155_1/adapter.json +1 -1
- package/dist/adapters/coincap/utils.js +1 -0
- package/dist/adapters/coingecko/generated/bip122_00000000001a91e3dace36e2be3bf030/adapter.json +1 -0
- package/dist/adapters/coingecko/generated/eip155_1/adapter.json +1 -1
- package/dist/adapters/coingecko/generated/eip155_43114/adapter.json +1 -1
- package/dist/adapters/coingecko/generated/index.d.ts +2 -1
- package/dist/adapters/coingecko/generated/index.js +11 -9
- package/dist/adapters/osmosis/generated/cosmos_osmosis-1/adapter.json +1 -1
- package/dist/adapters/yearn/generated/eip155_1/adapter.json +1 -1
- package/dist/constants.d.ts +4 -0
- package/dist/constants.js +10 -2
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +14 -1
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { AssetId, AssetNamespace } from './assetId/assetId';
|
|
2
2
|
import { ChainId, ChainNamespace, ChainReference } from './chainId/chainId';
|
|
3
3
|
export declare const btcAssetId: AssetId;
|
|
4
|
+
export declare const dogeAssetId: AssetId;
|
|
4
5
|
export declare const ethAssetId: AssetId;
|
|
5
6
|
export declare const cosmosAssetId: AssetId;
|
|
6
7
|
export declare const osmosisAssetId: AssetId;
|
|
7
8
|
export declare const avalancheAssetId: AssetId;
|
|
8
9
|
export declare const ethChainId: ChainId;
|
|
9
10
|
export declare const btcChainId: ChainId;
|
|
11
|
+
export declare const dogeChainId: ChainId;
|
|
10
12
|
export declare const cosmosChainId: ChainId;
|
|
11
13
|
export declare const osmosisChainId: ChainId;
|
|
12
14
|
export declare const avalancheChainId: ChainId;
|
|
@@ -24,6 +26,7 @@ export declare const CHAIN_REFERENCE: {
|
|
|
24
26
|
readonly EthereumRinkeby: "4";
|
|
25
27
|
readonly BitcoinMainnet: "000000000019d6689c085ae165831e93";
|
|
26
28
|
readonly BitcoinTestnet: "000000000933ea01ad0ee984209779ba";
|
|
29
|
+
readonly DogecoinMainnet: "00000000001a91e3dace36e2be3bf030";
|
|
27
30
|
readonly CosmosHubMainnet: "cosmoshub-4";
|
|
28
31
|
readonly CosmosHubVega: "vega-testnet";
|
|
29
32
|
readonly OsmosisMainnet: "osmosis-1";
|
|
@@ -38,6 +41,7 @@ export declare const VALID_ASSET_NAMESPACE: ValidAssetNamespace;
|
|
|
38
41
|
export declare const ASSET_NAMESPACE_STRINGS: readonly ["cw20", "cw721", "erc20", "erc721", "slip44", "native", "ibc"];
|
|
39
42
|
export declare const ASSET_REFERENCE: {
|
|
40
43
|
readonly Bitcoin: "0";
|
|
44
|
+
readonly Dogecoin: "3";
|
|
41
45
|
readonly Ethereum: "60";
|
|
42
46
|
readonly Cosmos: "118";
|
|
43
47
|
readonly Osmosis: "118";
|
package/dist/constants.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ASSET_REFERENCE = exports.ASSET_NAMESPACE_STRINGS = exports.VALID_ASSET_NAMESPACE = exports.VALID_CHAIN_IDS = exports.CHAIN_REFERENCE = exports.CHAIN_NAMESPACE = exports.avalancheChainId = exports.osmosisChainId = exports.cosmosChainId = exports.btcChainId = exports.ethChainId = exports.avalancheAssetId = exports.osmosisAssetId = exports.cosmosAssetId = exports.ethAssetId = exports.btcAssetId = void 0;
|
|
3
|
+
exports.ASSET_REFERENCE = exports.ASSET_NAMESPACE_STRINGS = exports.VALID_ASSET_NAMESPACE = exports.VALID_CHAIN_IDS = exports.CHAIN_REFERENCE = exports.CHAIN_NAMESPACE = exports.avalancheChainId = exports.osmosisChainId = exports.cosmosChainId = exports.dogeChainId = exports.btcChainId = exports.ethChainId = exports.avalancheAssetId = exports.osmosisAssetId = exports.cosmosAssetId = exports.ethAssetId = exports.dogeAssetId = exports.btcAssetId = void 0;
|
|
4
4
|
exports.btcAssetId = 'bip122:000000000019d6689c085ae165831e93/slip44:0';
|
|
5
|
+
exports.dogeAssetId = 'bip122:00000000001a91e3dace36e2be3bf030/slip44:3';
|
|
5
6
|
exports.ethAssetId = 'eip155:1/slip44:60';
|
|
6
7
|
exports.cosmosAssetId = 'cosmos:cosmoshub-4/slip44:118';
|
|
7
8
|
exports.osmosisAssetId = 'cosmos:osmosis-1/slip44:118';
|
|
8
9
|
exports.avalancheAssetId = 'eip155:43114/slip44:9000';
|
|
9
10
|
exports.ethChainId = 'eip155:1';
|
|
10
11
|
exports.btcChainId = 'bip122:000000000019d6689c085ae165831e93';
|
|
12
|
+
exports.dogeChainId = 'bip122:00000000001a91e3dace36e2be3bf030';
|
|
11
13
|
exports.cosmosChainId = 'cosmos:cosmoshub-4';
|
|
12
14
|
exports.osmosisChainId = 'cosmos:osmosis-1';
|
|
13
15
|
exports.avalancheChainId = 'eip155:43114';
|
|
@@ -25,6 +27,7 @@ exports.CHAIN_REFERENCE = {
|
|
|
25
27
|
// chainId uses max length of 32 chars of the genesis block
|
|
26
28
|
BitcoinMainnet: '000000000019d6689c085ae165831e93',
|
|
27
29
|
BitcoinTestnet: '000000000933ea01ad0ee984209779ba',
|
|
30
|
+
DogecoinMainnet: '00000000001a91e3dace36e2be3bf030',
|
|
28
31
|
CosmosHubMainnet: 'cosmoshub-4',
|
|
29
32
|
CosmosHubVega: 'vega-testnet',
|
|
30
33
|
OsmosisMainnet: 'osmosis-1',
|
|
@@ -32,7 +35,11 @@ exports.CHAIN_REFERENCE = {
|
|
|
32
35
|
AvalancheCChain: '43114' // https://docs.avax.network/apis/avalanchego/apis/c-chain
|
|
33
36
|
};
|
|
34
37
|
exports.VALID_CHAIN_IDS = Object.freeze({
|
|
35
|
-
[exports.CHAIN_NAMESPACE.Bitcoin]: [
|
|
38
|
+
[exports.CHAIN_NAMESPACE.Bitcoin]: [
|
|
39
|
+
exports.CHAIN_REFERENCE.BitcoinMainnet,
|
|
40
|
+
exports.CHAIN_REFERENCE.BitcoinTestnet,
|
|
41
|
+
exports.CHAIN_REFERENCE.DogecoinMainnet
|
|
42
|
+
],
|
|
36
43
|
[exports.CHAIN_NAMESPACE.Ethereum]: [
|
|
37
44
|
exports.CHAIN_REFERENCE.EthereumMainnet,
|
|
38
45
|
exports.CHAIN_REFERENCE.EthereumRopsten,
|
|
@@ -62,6 +69,7 @@ exports.ASSET_NAMESPACE_STRINGS = [
|
|
|
62
69
|
];
|
|
63
70
|
exports.ASSET_REFERENCE = {
|
|
64
71
|
Bitcoin: '0',
|
|
72
|
+
Dogecoin: '3',
|
|
65
73
|
Ethereum: '60',
|
|
66
74
|
Cosmos: '118',
|
|
67
75
|
Osmosis: '118',
|
package/dist/utils.d.ts
CHANGED
|
@@ -11,6 +11,9 @@ export declare const isValidChainPartsPair: (chainNamespace: ChainNamespace, cha
|
|
|
11
11
|
export declare const makeBtcData: () => {
|
|
12
12
|
[x: string]: string;
|
|
13
13
|
};
|
|
14
|
+
export declare const makeDogecoinData: () => {
|
|
15
|
+
[x: string]: string;
|
|
16
|
+
};
|
|
14
17
|
export declare const makeCosmosHubData: () => {
|
|
15
18
|
[x: string]: string;
|
|
16
19
|
};
|
package/dist/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeOsmosisData = exports.makeCosmosHubData = exports.makeBtcData = exports.isValidChainPartsPair = exports.getFeeAssetIdFromAssetId = exports.chainIdToFeeAssetId = exports.accountIdToSpecifier = exports.accountIdToChainId = exports.chainIdToAssetId = exports.parseAssetIdRegExp = void 0;
|
|
3
|
+
exports.makeOsmosisData = exports.makeCosmosHubData = exports.makeDogecoinData = exports.makeBtcData = exports.isValidChainPartsPair = exports.getFeeAssetIdFromAssetId = exports.chainIdToFeeAssetId = exports.accountIdToSpecifier = exports.accountIdToChainId = exports.chainIdToAssetId = exports.parseAssetIdRegExp = void 0;
|
|
4
4
|
const accountId_1 = require("./accountId/accountId");
|
|
5
5
|
const assetId_1 = require("./assetId/assetId");
|
|
6
6
|
const constants_1 = require("./constants");
|
|
@@ -11,6 +11,7 @@ exports.parseAssetIdRegExp = /(?<chainNamespace>[-a-z\d]{3,8}):(?<chainReference
|
|
|
11
11
|
exports.chainIdToAssetId = {
|
|
12
12
|
[constants_1.ethChainId]: constants_1.ethAssetId,
|
|
13
13
|
[constants_1.btcChainId]: constants_1.btcAssetId,
|
|
14
|
+
[constants_1.dogeChainId]: constants_1.dogeAssetId,
|
|
14
15
|
[constants_1.cosmosChainId]: constants_1.cosmosAssetId,
|
|
15
16
|
[constants_1.osmosisChainId]: constants_1.osmosisAssetId,
|
|
16
17
|
[constants_1.avalancheChainId]: constants_1.avalancheAssetId
|
|
@@ -42,6 +43,18 @@ const makeBtcData = () => {
|
|
|
42
43
|
return { [assetId]: 'bitcoin' };
|
|
43
44
|
};
|
|
44
45
|
exports.makeBtcData = makeBtcData;
|
|
46
|
+
const makeDogecoinData = () => {
|
|
47
|
+
const chainNamespace = constants_1.CHAIN_NAMESPACE.Bitcoin;
|
|
48
|
+
const chainReference = constants_1.CHAIN_REFERENCE.DogecoinMainnet;
|
|
49
|
+
const assetId = (0, assetId_1.toAssetId)({
|
|
50
|
+
chainNamespace,
|
|
51
|
+
chainReference,
|
|
52
|
+
assetNamespace: 'slip44',
|
|
53
|
+
assetReference: constants_1.ASSET_REFERENCE.Dogecoin
|
|
54
|
+
});
|
|
55
|
+
return { [assetId]: 'dogecoin' };
|
|
56
|
+
};
|
|
57
|
+
exports.makeDogecoinData = makeDogecoinData;
|
|
45
58
|
const makeCosmosHubData = () => {
|
|
46
59
|
const chainNamespace = constants_1.CHAIN_NAMESPACE.Cosmos;
|
|
47
60
|
const chainReference = constants_1.CHAIN_REFERENCE.CosmosHubMainnet;
|