@shapeshiftoss/types 1.24.0 → 2.0.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 -7
- package/dist/base.js +1 -8
- package/dist/chain-adapters/cosmos.d.ts +9 -0
- package/dist/chain-adapters/cosmos.js +2 -0
- package/dist/chain-adapters/index.d.ts +11 -2
- package/dist/chain-adapters/index.js +4 -1
- package/dist/chain-adapters/osmosis.d.ts +6 -0
- package/dist/chain-adapters/osmosis.js +2 -0
- package/package.json +2 -2
package/dist/base.d.ts
CHANGED
|
@@ -8,12 +8,6 @@ export declare type BIP44Params = {
|
|
|
8
8
|
isChange?: boolean;
|
|
9
9
|
index?: number;
|
|
10
10
|
};
|
|
11
|
-
export declare enum ContractTypes {
|
|
12
|
-
ERC20 = "ERC20",
|
|
13
|
-
ERC721 = "ERC721",
|
|
14
|
-
OTHER = "OTHER",
|
|
15
|
-
NONE = "NONE"
|
|
16
|
-
}
|
|
17
11
|
export declare enum ChainTypes {
|
|
18
12
|
Ethereum = "ethereum",
|
|
19
13
|
Bitcoin = "bitcoin",
|
|
@@ -63,7 +57,7 @@ declare type AbstractAsset = {
|
|
|
63
57
|
declare type OmittedTokenAssetFields = 'chain' | 'network' | 'slip44' | 'explorer' | 'explorerTxLink' | 'explorerAddressLink';
|
|
64
58
|
declare type TokenAssetFields = {
|
|
65
59
|
tokenId: string;
|
|
66
|
-
contractType:
|
|
60
|
+
contractType: 'erc20' | 'erc721';
|
|
67
61
|
};
|
|
68
62
|
export declare type TokenAsset = Omit<AbstractAsset, OmittedTokenAssetFields> & TokenAssetFields;
|
|
69
63
|
export declare type BaseAsset = AbstractAsset & {
|
package/dist/base.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SwapperType = exports.AssetDataSource = exports.UtxoAccountType = exports.NetworkTypes = exports.ChainTypes =
|
|
4
|
-
var ContractTypes;
|
|
5
|
-
(function (ContractTypes) {
|
|
6
|
-
ContractTypes["ERC20"] = "ERC20";
|
|
7
|
-
ContractTypes["ERC721"] = "ERC721";
|
|
8
|
-
ContractTypes["OTHER"] = "OTHER";
|
|
9
|
-
ContractTypes["NONE"] = "NONE";
|
|
10
|
-
})(ContractTypes = exports.ContractTypes || (exports.ContractTypes = {}));
|
|
3
|
+
exports.SwapperType = exports.AssetDataSource = exports.UtxoAccountType = exports.NetworkTypes = exports.ChainTypes = void 0;
|
|
11
4
|
var ChainTypes;
|
|
12
5
|
(function (ChainTypes) {
|
|
13
6
|
ChainTypes["Ethereum"] = "ethereum";
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { BTCSignTx, ETHSignTx, HDWallet } from '@shapeshiftoss/hdwallet-core';
|
|
1
|
+
import { BTCSignTx, CosmosSignTx, ETHSignTx, HDWallet } from '@shapeshiftoss/hdwallet-core';
|
|
2
2
|
import { BIP44Params, ChainTypes, NetworkTypes, SwapperType, UtxoAccountType } from '../base';
|
|
3
3
|
import { ChainAndSwapperSpecific, ChainSpecific } from '../utility';
|
|
4
4
|
import * as bitcoin from './bitcoin';
|
|
5
|
+
import * as cosmos from './cosmos';
|
|
5
6
|
import * as ethereum from './ethereum';
|
|
6
|
-
|
|
7
|
+
import * as osmosis from './osmosis';
|
|
8
|
+
export { bitcoin, cosmos, ethereum };
|
|
7
9
|
declare type ChainSpecificAccount<T> = ChainSpecific<T, {
|
|
8
10
|
[ChainTypes.Ethereum]: ethereum.Account;
|
|
9
11
|
[ChainTypes.Bitcoin]: bitcoin.Account;
|
|
12
|
+
[ChainTypes.Cosmos]: cosmos.Account;
|
|
13
|
+
[ChainTypes.Osmosis]: osmosis.Account;
|
|
10
14
|
}>;
|
|
11
15
|
export declare type Account<T extends ChainTypes> = {
|
|
12
16
|
balance: string;
|
|
@@ -52,6 +56,7 @@ declare type ChainSpecificQuoteFeeData<T1, T2> = ChainAndSwapperSpecific<T1, {
|
|
|
52
56
|
declare type ChainSpecificFeeData<T> = ChainSpecific<T, {
|
|
53
57
|
[ChainTypes.Ethereum]: ethereum.FeeData;
|
|
54
58
|
[ChainTypes.Bitcoin]: bitcoin.FeeData;
|
|
59
|
+
[ChainTypes.Cosmos]: cosmos.FeeData;
|
|
55
60
|
}>;
|
|
56
61
|
export declare type QuoteFeeData<T1 extends ChainTypes, T2 extends SwapperType> = {
|
|
57
62
|
fee: string;
|
|
@@ -76,6 +81,7 @@ export declare type TxFee = {
|
|
|
76
81
|
export declare enum TxType {
|
|
77
82
|
Send = "send",
|
|
78
83
|
Receive = "receive",
|
|
84
|
+
Contract = "contract",
|
|
79
85
|
Unknown = "unknown"
|
|
80
86
|
}
|
|
81
87
|
export declare enum TxStatus {
|
|
@@ -131,6 +137,7 @@ export declare type TxHistoryResponse<T extends ChainTypes> = {
|
|
|
131
137
|
declare type ChainTxTypeInner = {
|
|
132
138
|
[ChainTypes.Ethereum]: ETHSignTx;
|
|
133
139
|
[ChainTypes.Bitcoin]: BTCSignTx;
|
|
140
|
+
[ChainTypes.Cosmos]: CosmosSignTx;
|
|
134
141
|
};
|
|
135
142
|
export declare type ChainTxType<T> = T extends keyof ChainTxTypeInner ? ChainTxTypeInner[T] : never;
|
|
136
143
|
export declare type BuildSendTxInput<T extends ChainTypes> = {
|
|
@@ -143,6 +150,8 @@ export declare type BuildSendTxInput<T extends ChainTypes> = {
|
|
|
143
150
|
declare type ChainSpecificBuildTxData<T> = ChainSpecific<T, {
|
|
144
151
|
[ChainTypes.Ethereum]: ethereum.BuildTxInput;
|
|
145
152
|
[ChainTypes.Bitcoin]: bitcoin.BuildTxInput;
|
|
153
|
+
[ChainTypes.Cosmos]: cosmos.BuildTxInput;
|
|
154
|
+
[ChainTypes.Osmosis]: cosmos.BuildTxInput;
|
|
146
155
|
}>;
|
|
147
156
|
export declare type SignTxInput<TxType> = {
|
|
148
157
|
txToSign: TxType;
|
|
@@ -19,10 +19,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.ValidAddressResultType = exports.TradeType = exports.TxStatus = exports.TxType = exports.FeeDataKey = exports.ethereum = exports.bitcoin = void 0;
|
|
22
|
+
exports.ValidAddressResultType = exports.TradeType = exports.TxStatus = exports.TxType = exports.FeeDataKey = exports.ethereum = exports.cosmos = exports.bitcoin = void 0;
|
|
23
23
|
const base_1 = require("../base");
|
|
24
24
|
const bitcoin = __importStar(require("./bitcoin"));
|
|
25
25
|
exports.bitcoin = bitcoin;
|
|
26
|
+
const cosmos = __importStar(require("./cosmos"));
|
|
27
|
+
exports.cosmos = cosmos;
|
|
26
28
|
const ethereum = __importStar(require("./ethereum"));
|
|
27
29
|
exports.ethereum = ethereum;
|
|
28
30
|
var FeeDataKey;
|
|
@@ -35,6 +37,7 @@ var TxType;
|
|
|
35
37
|
(function (TxType) {
|
|
36
38
|
TxType["Send"] = "send";
|
|
37
39
|
TxType["Receive"] = "receive";
|
|
40
|
+
TxType["Contract"] = "contract";
|
|
38
41
|
TxType["Unknown"] = "unknown";
|
|
39
42
|
})(TxType = exports.TxType || (exports.TxType = {}));
|
|
40
43
|
var TxStatus;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapeshiftoss/types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Common types shared across packages",
|
|
5
5
|
"repository": "https://github.com/shapeshift/lib",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
"type-check": "tsc --project ./tsconfig.json --noEmit"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@shapeshiftoss/hdwallet-core": "^1.
|
|
23
|
+
"@shapeshiftoss/hdwallet-core": "^1.19.0"
|
|
24
24
|
}
|
|
25
25
|
}
|