@shapeshiftoss/types 1.1.1 → 1.2.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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HDWallet } from '@shapeshiftoss/hdwallet-core';
|
|
2
|
-
import {
|
|
2
|
+
import { ethereum, SignTxInput } from './chain-adapters';
|
|
3
3
|
/** Common */
|
|
4
4
|
export declare type BIP32Params = {
|
|
5
5
|
purpose: number;
|
|
@@ -15,8 +15,8 @@ export declare enum ContractTypes {
|
|
|
15
15
|
NONE = "NONE"
|
|
16
16
|
}
|
|
17
17
|
export declare enum ChainTypes {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
Ethereum = "ethereum",
|
|
19
|
+
Bitcoin = "bitcoin"
|
|
20
20
|
}
|
|
21
21
|
export declare enum NetworkTypes {
|
|
22
22
|
MAINNET = "MAINNET",
|
|
@@ -134,7 +134,7 @@ export declare type Quote = {
|
|
|
134
134
|
slipScore?: string;
|
|
135
135
|
txData?: string;
|
|
136
136
|
value?: string;
|
|
137
|
-
feeData?:
|
|
137
|
+
feeData?: ethereum.QuoteFeeData;
|
|
138
138
|
allowanceContract?: string;
|
|
139
139
|
allowanceGrantRequired?: boolean;
|
|
140
140
|
slippage?: string;
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { ContractTypes } from '../base';
|
|
2
2
|
export declare type Account = {
|
|
3
3
|
nonce: number;
|
|
4
|
-
tokens?: Array<
|
|
4
|
+
tokens?: Array<TokenWithBalance>;
|
|
5
5
|
};
|
|
6
6
|
export declare type Token = {
|
|
7
|
-
balance: string;
|
|
8
7
|
contract: string;
|
|
9
8
|
precision: number;
|
|
10
9
|
name: string;
|
|
11
10
|
symbol: string;
|
|
12
11
|
contractType: ContractTypes;
|
|
13
12
|
};
|
|
13
|
+
export declare type TokenWithBalance = Token & {
|
|
14
|
+
balance: string;
|
|
15
|
+
};
|
|
16
|
+
export declare type TxTransfer = {
|
|
17
|
+
token?: Token;
|
|
18
|
+
};
|
|
14
19
|
export declare type FeeData = {
|
|
15
20
|
feePerTx: string;
|
|
16
21
|
feeLimit: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { HDWallet, BTCInputScriptType, BTCSignTx, ETHSignTx } from '@shapeshiftoss/hdwallet-core';
|
|
2
2
|
import { BIP32Params, ChainTypes, NetworkTypes } from '../base';
|
|
3
3
|
import { ChainSpecific } from '../utility';
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
export {
|
|
4
|
+
import * as ethereum from './ethereum';
|
|
5
|
+
import * as bitcoin from './bitcoin';
|
|
6
|
+
export { bitcoin, ethereum };
|
|
7
7
|
declare type ChainSpecificAccount<T> = ChainSpecific<T, {
|
|
8
|
-
[ChainTypes.Ethereum]:
|
|
9
|
-
[ChainTypes.Bitcoin]:
|
|
8
|
+
[ChainTypes.Ethereum]: ethereum.Account;
|
|
9
|
+
[ChainTypes.Bitcoin]: bitcoin.Account;
|
|
10
10
|
}>;
|
|
11
11
|
export declare type Account<T extends ChainTypes> = {
|
|
12
12
|
balance: string;
|
|
@@ -16,7 +16,7 @@ export declare type Account<T extends ChainTypes> = {
|
|
|
16
16
|
network: NetworkTypes;
|
|
17
17
|
} & ChainSpecificAccount<T>;
|
|
18
18
|
declare type ChainSpecificTransaction<T> = ChainSpecific<T, {
|
|
19
|
-
[ChainTypes.Bitcoin]:
|
|
19
|
+
[ChainTypes.Bitcoin]: bitcoin.TransactionSpecific;
|
|
20
20
|
}>;
|
|
21
21
|
export declare type Transaction<T extends ChainTypes> = {
|
|
22
22
|
network: NetworkTypes;
|
|
@@ -39,7 +39,7 @@ export declare enum FeeDataKey {
|
|
|
39
39
|
Fast = "fast"
|
|
40
40
|
}
|
|
41
41
|
declare type ChainSpecificFeeData<T> = ChainSpecific<T, {
|
|
42
|
-
[ChainTypes.Ethereum]:
|
|
42
|
+
[ChainTypes.Ethereum]: ethereum.FeeData;
|
|
43
43
|
}>;
|
|
44
44
|
export declare type FeeData<T extends ChainTypes> = {
|
|
45
45
|
feePerUnit: string;
|
|
@@ -49,6 +49,30 @@ export declare type FeeDataEstimate<T extends ChainTypes> = {
|
|
|
49
49
|
[FeeDataKey.Average]: FeeData<T>;
|
|
50
50
|
[FeeDataKey.Fast]: FeeData<T>;
|
|
51
51
|
};
|
|
52
|
+
export declare type SubscribeTxsInput = {
|
|
53
|
+
addresses: Array<string>;
|
|
54
|
+
};
|
|
55
|
+
export declare type SubscribeTxsMessage<T extends ChainTypes> = {
|
|
56
|
+
address: string;
|
|
57
|
+
blockHash?: string;
|
|
58
|
+
blockHeight: number;
|
|
59
|
+
blockTime: number;
|
|
60
|
+
chain: T;
|
|
61
|
+
confirmations: number;
|
|
62
|
+
network: NetworkTypes;
|
|
63
|
+
txid: string;
|
|
64
|
+
} & TxTransfer<T>;
|
|
65
|
+
declare type ChainSpecificTxTransfer<T> = ChainSpecific<T, {
|
|
66
|
+
[ChainTypes.Ethereum]: ethereum.TxTransfer;
|
|
67
|
+
}>;
|
|
68
|
+
export declare type TxTransfer<T extends ChainTypes> = {
|
|
69
|
+
asset: string;
|
|
70
|
+
type: 'send' | 'receive' | 'fee';
|
|
71
|
+
value: string;
|
|
72
|
+
} & ChainSpecificTxTransfer<T>;
|
|
73
|
+
export declare type SubscribeError = {
|
|
74
|
+
message: string;
|
|
75
|
+
};
|
|
52
76
|
export declare type TxHistoryResponse<T extends ChainTypes> = {
|
|
53
77
|
page: number;
|
|
54
78
|
totalPages: number;
|
|
@@ -68,7 +92,7 @@ export declare type BuildSendTxInput = {
|
|
|
68
92
|
fee?: string;
|
|
69
93
|
/** Optional param for eth txs indicating what ERC20 is being sent **/
|
|
70
94
|
erc20ContractAddress?: string;
|
|
71
|
-
recipients?: Array<
|
|
95
|
+
recipients?: Array<bitcoin.Recipient>;
|
|
72
96
|
opReturnData?: string;
|
|
73
97
|
scriptType?: BTCInputScriptType;
|
|
74
98
|
gasLimit?: string;
|
|
@@ -89,7 +113,7 @@ export declare type GetAddressInputBase = {
|
|
|
89
113
|
wallet: HDWallet;
|
|
90
114
|
bip32Params?: BIP32Params;
|
|
91
115
|
};
|
|
92
|
-
export declare type GetAddressInput = GetAddressInputBase |
|
|
116
|
+
export declare type GetAddressInput = GetAddressInputBase | bitcoin.GetAddressInput;
|
|
93
117
|
export declare type GetFeeDataInput = {
|
|
94
118
|
contractAddress?: string;
|
|
95
119
|
from: string;
|
|
@@ -106,3 +130,14 @@ export declare type ValidAddressResult = {
|
|
|
106
130
|
/** Result type of valid address */
|
|
107
131
|
result: ValidAddressResultType;
|
|
108
132
|
};
|
|
133
|
+
export declare type ZrxFeeResult = {
|
|
134
|
+
fast: number;
|
|
135
|
+
instant: number;
|
|
136
|
+
low: number;
|
|
137
|
+
source: 'ETH_GAS_STATION' | 'ETHERSCAN' | 'ETHERCHAIN' | 'GAS_NOW' | 'MY_CRYPTO' | 'UP_VEST' | 'GETH_PENDING' | 'MEDIAN' | 'AVERAGE';
|
|
138
|
+
standard: number;
|
|
139
|
+
timestamp: number;
|
|
140
|
+
};
|
|
141
|
+
export declare type ZrxGasApiResponse = {
|
|
142
|
+
result: ZrxFeeResult[];
|
|
143
|
+
};
|
|
@@ -19,12 +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.FeeDataKey = exports.
|
|
22
|
+
exports.ValidAddressResultType = exports.FeeDataKey = exports.ethereum = exports.bitcoin = void 0;
|
|
23
23
|
const base_1 = require("../base");
|
|
24
|
-
const
|
|
25
|
-
exports.
|
|
26
|
-
const
|
|
27
|
-
exports.
|
|
24
|
+
const ethereum = __importStar(require("./ethereum"));
|
|
25
|
+
exports.ethereum = ethereum;
|
|
26
|
+
const bitcoin = __importStar(require("./bitcoin"));
|
|
27
|
+
exports.bitcoin = bitcoin;
|
|
28
28
|
var FeeDataKey;
|
|
29
29
|
(function (FeeDataKey) {
|
|
30
30
|
FeeDataKey["Slow"] = "slow";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
export {
|
|
1
|
+
import * as chainAdapters from './chain-adapters';
|
|
2
|
+
export { chainAdapters };
|
|
3
3
|
export * from './base';
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
22
22
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.
|
|
26
|
-
const
|
|
27
|
-
exports.
|
|
25
|
+
exports.chainAdapters = void 0;
|
|
26
|
+
const chainAdapters = __importStar(require("./chain-adapters"));
|
|
27
|
+
exports.chainAdapters = chainAdapters;
|
|
28
28
|
__exportStar(require("./base"), exports);
|