@shapeshiftoss/types 4.3.2 → 5.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/README.md +1 -1
- package/dist/base.d.ts +11 -21
- package/dist/base.js +8 -7
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -15
- package/package.json +2 -2
- package/dist/chain-adapters/bitcoin.d.ts +0 -75
- package/dist/chain-adapters/bitcoin.js +0 -2
- package/dist/chain-adapters/cosmos.d.ts +0 -58
- package/dist/chain-adapters/cosmos.js +0 -2
- package/dist/chain-adapters/ethereum.d.ts +0 -28
- package/dist/chain-adapters/ethereum.js +0 -2
- package/dist/chain-adapters/index.d.ts +0 -205
- package/dist/chain-adapters/index.js +0 -63
- package/dist/chain-adapters/osmosis.d.ts +0 -3
- package/dist/chain-adapters/osmosis.js +0 -2
package/README.md
CHANGED
package/dist/base.d.ts
CHANGED
|
@@ -12,8 +12,12 @@ export declare enum ChainTypes {
|
|
|
12
12
|
Cosmos = "cosmos",
|
|
13
13
|
Osmosis = "osmosis"
|
|
14
14
|
}
|
|
15
|
-
declare
|
|
16
|
-
|
|
15
|
+
export declare enum KnownChainIds {
|
|
16
|
+
EthereumMainnet = "eip155:1",
|
|
17
|
+
BitcoinMainnet = "bip122:000000000019d6689c085ae165831e93",
|
|
18
|
+
CosmosMainnet = "cosmos:cosmoshub-4",
|
|
19
|
+
OsmosisMainnet = "cosmos:osmosis-1"
|
|
20
|
+
}
|
|
17
21
|
export declare enum NetworkTypes {
|
|
18
22
|
MAINNET = "MAINNET",
|
|
19
23
|
TESTNET = "TESTNET",
|
|
@@ -37,40 +41,26 @@ export declare enum AssetDataSource {
|
|
|
37
41
|
CoinGecko = "coingecko",
|
|
38
42
|
YearnFinance = "yearnfinance"
|
|
39
43
|
}
|
|
40
|
-
declare type
|
|
44
|
+
export declare type Asset = {
|
|
41
45
|
assetId: string;
|
|
42
46
|
chainId: string;
|
|
43
|
-
|
|
47
|
+
/** @deprecated: do not use. This will be removed once consumers have handled it */
|
|
48
|
+
chain?: ChainTypes;
|
|
44
49
|
description?: string;
|
|
45
50
|
isTrustedDescription?: boolean;
|
|
46
|
-
|
|
47
|
-
network
|
|
51
|
+
/** @deprecated: do not use. This will be removed once consumers have handled it */
|
|
52
|
+
network?: NetworkTypes;
|
|
48
53
|
symbol: string;
|
|
49
54
|
name: string;
|
|
50
55
|
precision: number;
|
|
51
|
-
slip44: number;
|
|
52
56
|
color: string;
|
|
53
|
-
secondaryColor: string;
|
|
54
57
|
icon: string;
|
|
55
58
|
explorer: string;
|
|
56
59
|
explorerTxLink: string;
|
|
57
60
|
explorerAddressLink: string;
|
|
58
|
-
sendSupport: boolean;
|
|
59
|
-
receiveSupport: boolean;
|
|
60
|
-
};
|
|
61
|
-
declare type OmittedTokenAssetFields = 'chain' | 'network' | 'slip44' | 'explorer' | 'explorerTxLink' | 'explorerAddressLink';
|
|
62
|
-
declare type TokenAssetFields = {
|
|
63
|
-
tokenId: string;
|
|
64
|
-
contractType: 'erc20' | 'erc721';
|
|
65
|
-
};
|
|
66
|
-
export declare type TokenAsset = Omit<AbstractAsset, OmittedTokenAssetFields> & TokenAssetFields;
|
|
67
|
-
export declare type BaseAsset = AbstractAsset & {
|
|
68
|
-
tokens?: TokenAsset[];
|
|
69
61
|
};
|
|
70
|
-
export declare type Asset = AbstractAsset & Partial<TokenAssetFields>;
|
|
71
62
|
export declare enum SwapperType {
|
|
72
63
|
Zrx = "0x",
|
|
73
64
|
Thorchain = "Thorchain",
|
|
74
65
|
Test = "Test"
|
|
75
66
|
}
|
|
76
|
-
export {};
|
package/dist/base.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/** Common */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.SwapperType = exports.AssetDataSource = exports.UtxoAccountType = exports.WithdrawType = exports.NetworkTypes = exports.ChainTypes = void 0;
|
|
4
|
+
exports.SwapperType = exports.AssetDataSource = exports.UtxoAccountType = exports.WithdrawType = exports.NetworkTypes = exports.KnownChainIds = exports.ChainTypes = void 0;
|
|
5
5
|
var ChainTypes;
|
|
6
6
|
(function (ChainTypes) {
|
|
7
7
|
ChainTypes["Ethereum"] = "ethereum";
|
|
@@ -9,12 +9,13 @@ var ChainTypes;
|
|
|
9
9
|
ChainTypes["Cosmos"] = "cosmos";
|
|
10
10
|
ChainTypes["Osmosis"] = "osmosis";
|
|
11
11
|
})(ChainTypes = exports.ChainTypes || (exports.ChainTypes = {}));
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
];
|
|
12
|
+
var KnownChainIds;
|
|
13
|
+
(function (KnownChainIds) {
|
|
14
|
+
KnownChainIds["EthereumMainnet"] = "eip155:1";
|
|
15
|
+
KnownChainIds["BitcoinMainnet"] = "bip122:000000000019d6689c085ae165831e93";
|
|
16
|
+
KnownChainIds["CosmosMainnet"] = "cosmos:cosmoshub-4";
|
|
17
|
+
KnownChainIds["OsmosisMainnet"] = "cosmos:osmosis-1";
|
|
18
|
+
})(KnownChainIds = exports.KnownChainIds || (exports.KnownChainIds = {}));
|
|
18
19
|
var NetworkTypes;
|
|
19
20
|
(function (NetworkTypes) {
|
|
20
21
|
NetworkTypes["MAINNET"] = "MAINNET";
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -10,24 +10,9 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
15
|
};
|
|
28
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.chainAdapters = void 0;
|
|
30
|
-
const chainAdapters = __importStar(require("./chain-adapters"));
|
|
31
|
-
exports.chainAdapters = chainAdapters;
|
|
32
17
|
__exportStar(require("./base"), exports);
|
|
33
18
|
__exportStar(require("./market"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapeshiftoss/types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Common types shared across packages",
|
|
5
5
|
"repository": "https://github.com/shapeshift/lib",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"type-check": "tsc --project ./tsconfig.build.json --noEmit"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@shapeshiftoss/hdwallet-core": "^1.
|
|
25
|
+
"@shapeshiftoss/hdwallet-core": "^1.23.0"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { UtxoAccountType } from '../base';
|
|
2
|
-
import { GetAddressInputBase } from '.';
|
|
3
|
-
export declare type Account = {
|
|
4
|
-
/** Derived addresses and associated balances if account is xpub based (gap limit 20) */
|
|
5
|
-
addresses?: Array<Address>;
|
|
6
|
-
/** Next unused change address index for current account if account is xpub based */
|
|
7
|
-
nextChangeAddressIndex?: number;
|
|
8
|
-
/** Next unused receive address index for current account if account is xpub based */
|
|
9
|
-
nextReceiveAddressIndex?: number;
|
|
10
|
-
};
|
|
11
|
-
export declare type Address = {
|
|
12
|
-
pubkey: string;
|
|
13
|
-
balance: string;
|
|
14
|
-
};
|
|
15
|
-
export declare type GetAddressInput = GetAddressInputBase & {
|
|
16
|
-
accountType?: UtxoAccountType;
|
|
17
|
-
};
|
|
18
|
-
export declare type TransactionSpecific = {
|
|
19
|
-
opReturnData?: string;
|
|
20
|
-
};
|
|
21
|
-
export declare type Recipient = {
|
|
22
|
-
value: number;
|
|
23
|
-
address?: string;
|
|
24
|
-
};
|
|
25
|
-
export declare type ScriptSig = {
|
|
26
|
-
hex: string;
|
|
27
|
-
asm: string;
|
|
28
|
-
};
|
|
29
|
-
export declare type Vin = {
|
|
30
|
-
txinwitness?: string;
|
|
31
|
-
scriptSig?: ScriptSig;
|
|
32
|
-
coinbase?: string;
|
|
33
|
-
sequence?: number;
|
|
34
|
-
vout?: number;
|
|
35
|
-
txid?: string;
|
|
36
|
-
};
|
|
37
|
-
export declare type Vout = {
|
|
38
|
-
scriptPubKey?: ScriptPubKey;
|
|
39
|
-
n?: number;
|
|
40
|
-
value?: string | number;
|
|
41
|
-
};
|
|
42
|
-
export declare type ScriptPubKey = {
|
|
43
|
-
addresses: Array<string>;
|
|
44
|
-
type: string;
|
|
45
|
-
reqSigs: number;
|
|
46
|
-
hex: string;
|
|
47
|
-
asm: string;
|
|
48
|
-
};
|
|
49
|
-
export declare type NodeTransaction = {
|
|
50
|
-
txid: string;
|
|
51
|
-
hash: string;
|
|
52
|
-
version: number;
|
|
53
|
-
size: number;
|
|
54
|
-
vsize: number;
|
|
55
|
-
weight: number;
|
|
56
|
-
locktime: number;
|
|
57
|
-
vin: Array<Vin>;
|
|
58
|
-
vout: Array<Vout>;
|
|
59
|
-
hex: string;
|
|
60
|
-
blockhash: string;
|
|
61
|
-
confirmations: number;
|
|
62
|
-
time: number;
|
|
63
|
-
blocktime: number;
|
|
64
|
-
};
|
|
65
|
-
export declare type FeeData = {
|
|
66
|
-
satoshiPerByte: string;
|
|
67
|
-
};
|
|
68
|
-
export declare type BuildTxInput = {
|
|
69
|
-
opReturnData?: string;
|
|
70
|
-
accountType: UtxoAccountType;
|
|
71
|
-
satoshiPerByte: string;
|
|
72
|
-
};
|
|
73
|
-
export declare type GetFeeDataInput = {
|
|
74
|
-
pubkey: string;
|
|
75
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
export declare type BuildTxInput = {
|
|
2
|
-
gas: string;
|
|
3
|
-
fee: string;
|
|
4
|
-
};
|
|
5
|
-
export declare type Info = {
|
|
6
|
-
totalSupply: string;
|
|
7
|
-
bondedTokens: string;
|
|
8
|
-
};
|
|
9
|
-
export declare type Validator = {
|
|
10
|
-
address: string;
|
|
11
|
-
moniker: string;
|
|
12
|
-
tokens?: string;
|
|
13
|
-
apr: string;
|
|
14
|
-
commission: string;
|
|
15
|
-
};
|
|
16
|
-
export declare type Delegation = {
|
|
17
|
-
assetId: string;
|
|
18
|
-
amount: string;
|
|
19
|
-
validator: Validator;
|
|
20
|
-
};
|
|
21
|
-
export declare type RedelegationEntry = {
|
|
22
|
-
assetId: string;
|
|
23
|
-
completionTime: number;
|
|
24
|
-
amount: string;
|
|
25
|
-
};
|
|
26
|
-
export declare type Redelegation = {
|
|
27
|
-
destinationValidator: Validator;
|
|
28
|
-
sourceValidator: Validator;
|
|
29
|
-
entries: RedelegationEntry[];
|
|
30
|
-
};
|
|
31
|
-
export declare type UndelegationEntry = {
|
|
32
|
-
assetId: string;
|
|
33
|
-
completionTime: number;
|
|
34
|
-
amount: string;
|
|
35
|
-
};
|
|
36
|
-
export declare type Undelegation = {
|
|
37
|
-
validator: Validator;
|
|
38
|
-
entries: UndelegationEntry[];
|
|
39
|
-
};
|
|
40
|
-
export declare type Reward = {
|
|
41
|
-
assetId: string;
|
|
42
|
-
amount: string;
|
|
43
|
-
};
|
|
44
|
-
export declare type ValidatorReward = {
|
|
45
|
-
validator: Validator;
|
|
46
|
-
rewards: Reward[];
|
|
47
|
-
};
|
|
48
|
-
export declare type Account = {
|
|
49
|
-
sequence: string;
|
|
50
|
-
accountNumber: string;
|
|
51
|
-
delegations: Delegation[];
|
|
52
|
-
redelegations: Redelegation[];
|
|
53
|
-
undelegations: Undelegation[];
|
|
54
|
-
rewards: ValidatorReward[];
|
|
55
|
-
};
|
|
56
|
-
export declare type FeeData = {
|
|
57
|
-
gasLimit: string;
|
|
58
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { AssetBalance } from '.';
|
|
2
|
-
export declare type Account = {
|
|
3
|
-
nonce: number;
|
|
4
|
-
tokens?: Array<AssetBalance>;
|
|
5
|
-
};
|
|
6
|
-
export declare type FeeData = {
|
|
7
|
-
gasPrice: string;
|
|
8
|
-
gasLimit: string;
|
|
9
|
-
maxFeePerGas: string;
|
|
10
|
-
maxPriorityFeePerGas: string;
|
|
11
|
-
};
|
|
12
|
-
export declare type BuildTxInput = {
|
|
13
|
-
gasLimit: string;
|
|
14
|
-
erc20ContractAddress?: string;
|
|
15
|
-
} & ({
|
|
16
|
-
gasPrice: string;
|
|
17
|
-
maxFeePerGas?: never;
|
|
18
|
-
maxPriorityFeePerGas?: never;
|
|
19
|
-
} | {
|
|
20
|
-
gasPrice?: never;
|
|
21
|
-
maxFeePerGas: string;
|
|
22
|
-
maxPriorityFeePerGas: string;
|
|
23
|
-
});
|
|
24
|
-
export declare type GetFeeDataInput = {
|
|
25
|
-
contractAddress?: string;
|
|
26
|
-
from: string;
|
|
27
|
-
contractData?: string;
|
|
28
|
-
};
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
import { BTCSignTx, CosmosSignTx, ETHSignTx, HDWallet, OsmosisSignTx } from '@shapeshiftoss/hdwallet-core';
|
|
2
|
-
import { BIP44Params, ChainTypes, UtxoAccountType } from '../base';
|
|
3
|
-
import { ChainSpecific } from '../utility';
|
|
4
|
-
import * as bitcoin from './bitcoin';
|
|
5
|
-
import * as cosmos from './cosmos';
|
|
6
|
-
import * as ethereum from './ethereum';
|
|
7
|
-
import * as osmosis from './osmosis';
|
|
8
|
-
export { bitcoin, cosmos, ethereum };
|
|
9
|
-
declare type ChainSpecificAccount<T> = ChainSpecific<T, {
|
|
10
|
-
[ChainTypes.Ethereum]: ethereum.Account;
|
|
11
|
-
[ChainTypes.Bitcoin]: bitcoin.Account;
|
|
12
|
-
[ChainTypes.Cosmos]: cosmos.Account;
|
|
13
|
-
[ChainTypes.Osmosis]: osmosis.Account;
|
|
14
|
-
}>;
|
|
15
|
-
export declare type Account<T extends ChainTypes> = {
|
|
16
|
-
balance: string;
|
|
17
|
-
pubkey: string;
|
|
18
|
-
chainId: string;
|
|
19
|
-
assetId: string;
|
|
20
|
-
chain: T;
|
|
21
|
-
} & ChainSpecificAccount<T>;
|
|
22
|
-
export declare type AssetBalance = {
|
|
23
|
-
balance: string;
|
|
24
|
-
assetId: string;
|
|
25
|
-
};
|
|
26
|
-
export declare enum FeeDataKey {
|
|
27
|
-
Slow = "slow",
|
|
28
|
-
Average = "average",
|
|
29
|
-
Fast = "fast"
|
|
30
|
-
}
|
|
31
|
-
declare type ChainSpecificFeeData<T> = ChainSpecific<T, {
|
|
32
|
-
[ChainTypes.Ethereum]: ethereum.FeeData;
|
|
33
|
-
[ChainTypes.Bitcoin]: bitcoin.FeeData;
|
|
34
|
-
[ChainTypes.Cosmos]: cosmos.FeeData;
|
|
35
|
-
[ChainTypes.Osmosis]: osmosis.FeeData;
|
|
36
|
-
}>;
|
|
37
|
-
export declare type FeeData<T extends ChainTypes> = {
|
|
38
|
-
txFee: string;
|
|
39
|
-
} & ChainSpecificFeeData<T>;
|
|
40
|
-
export declare type FeeDataEstimate<T extends ChainTypes> = {
|
|
41
|
-
[FeeDataKey.Slow]: FeeData<T>;
|
|
42
|
-
[FeeDataKey.Average]: FeeData<T>;
|
|
43
|
-
[FeeDataKey.Fast]: FeeData<T>;
|
|
44
|
-
};
|
|
45
|
-
export declare type SubscribeTxsInput = {
|
|
46
|
-
wallet: HDWallet;
|
|
47
|
-
bip44Params?: BIP44Params;
|
|
48
|
-
accountType?: UtxoAccountType;
|
|
49
|
-
};
|
|
50
|
-
export declare type TxFee = {
|
|
51
|
-
assetId: string;
|
|
52
|
-
value: string;
|
|
53
|
-
};
|
|
54
|
-
export declare enum TxType {
|
|
55
|
-
Send = "send",
|
|
56
|
-
Receive = "receive",
|
|
57
|
-
Contract = "contract",
|
|
58
|
-
Unknown = "unknown"
|
|
59
|
-
}
|
|
60
|
-
export declare enum TxStatus {
|
|
61
|
-
Confirmed = "confirmed",
|
|
62
|
-
Pending = "pending",
|
|
63
|
-
Failed = "failed",
|
|
64
|
-
Unknown = "unknown"
|
|
65
|
-
}
|
|
66
|
-
export declare type Transaction<T extends ChainTypes> = {
|
|
67
|
-
address: string;
|
|
68
|
-
blockHash?: string;
|
|
69
|
-
blockHeight: number;
|
|
70
|
-
blockTime: number;
|
|
71
|
-
chain: T;
|
|
72
|
-
chainId: string;
|
|
73
|
-
confirmations: number;
|
|
74
|
-
txid: string;
|
|
75
|
-
fee?: TxFee;
|
|
76
|
-
status: TxStatus;
|
|
77
|
-
tradeDetails?: TradeDetails;
|
|
78
|
-
transfers: Array<TxTransfer>;
|
|
79
|
-
data?: TxMetadata;
|
|
80
|
-
};
|
|
81
|
-
export declare enum TradeType {
|
|
82
|
-
Trade = "trade",
|
|
83
|
-
Refund = "refund"
|
|
84
|
-
}
|
|
85
|
-
export declare type TradeDetails = {
|
|
86
|
-
dexName: string;
|
|
87
|
-
memo?: string;
|
|
88
|
-
type: TradeType;
|
|
89
|
-
};
|
|
90
|
-
export interface TxMetadata {
|
|
91
|
-
method?: string;
|
|
92
|
-
parser: string;
|
|
93
|
-
}
|
|
94
|
-
export declare type TxTransfer = {
|
|
95
|
-
assetId: string;
|
|
96
|
-
from: string;
|
|
97
|
-
to: string;
|
|
98
|
-
type: TxType;
|
|
99
|
-
value: string;
|
|
100
|
-
};
|
|
101
|
-
export declare type SubscribeError = {
|
|
102
|
-
message: string;
|
|
103
|
-
};
|
|
104
|
-
export declare type TxHistoryResponse<T extends ChainTypes> = {
|
|
105
|
-
cursor: string;
|
|
106
|
-
pubkey: string;
|
|
107
|
-
transactions: Array<Transaction<T>>;
|
|
108
|
-
};
|
|
109
|
-
declare type ChainTxTypeInner = {
|
|
110
|
-
[ChainTypes.Ethereum]: ETHSignTx;
|
|
111
|
-
[ChainTypes.Bitcoin]: BTCSignTx;
|
|
112
|
-
[ChainTypes.Cosmos]: CosmosSignTx;
|
|
113
|
-
[ChainTypes.Osmosis]: OsmosisSignTx;
|
|
114
|
-
};
|
|
115
|
-
export declare type ChainTxType<T> = T extends keyof ChainTxTypeInner ? ChainTxTypeInner[T] : never;
|
|
116
|
-
export declare type BuildDelegateTxInput<T extends ChainTypes> = {
|
|
117
|
-
validator: string;
|
|
118
|
-
value: string;
|
|
119
|
-
wallet: HDWallet;
|
|
120
|
-
bip44Params?: BIP44Params;
|
|
121
|
-
memo?: string;
|
|
122
|
-
} & ChainSpecificBuildTxData<T>;
|
|
123
|
-
export declare type BuildUndelegateTxInput<T extends ChainTypes> = {
|
|
124
|
-
validator: string;
|
|
125
|
-
value: string;
|
|
126
|
-
wallet: HDWallet;
|
|
127
|
-
bip44Params?: BIP44Params;
|
|
128
|
-
memo?: string;
|
|
129
|
-
} & ChainSpecificBuildTxData<T>;
|
|
130
|
-
export declare type BuildRedelegateTxInput<T extends ChainTypes> = {
|
|
131
|
-
fromValidator: string;
|
|
132
|
-
toValidator: string;
|
|
133
|
-
value: string;
|
|
134
|
-
wallet: HDWallet;
|
|
135
|
-
bip44Params?: BIP44Params;
|
|
136
|
-
memo?: string;
|
|
137
|
-
} & ChainSpecificBuildTxData<T>;
|
|
138
|
-
export declare type BuildClaimRewardsTxInput<T extends ChainTypes> = {
|
|
139
|
-
validator: string;
|
|
140
|
-
wallet: HDWallet;
|
|
141
|
-
bip44Params?: BIP44Params;
|
|
142
|
-
memo?: string;
|
|
143
|
-
} & ChainSpecificBuildTxData<T>;
|
|
144
|
-
export declare type BuildSendTxInput<T extends ChainTypes> = {
|
|
145
|
-
to: string;
|
|
146
|
-
value: string;
|
|
147
|
-
wallet: HDWallet;
|
|
148
|
-
bip44Params?: BIP44Params;
|
|
149
|
-
sendMax?: boolean;
|
|
150
|
-
memo?: string;
|
|
151
|
-
} & ChainSpecificBuildTxData<T>;
|
|
152
|
-
declare type ChainSpecificBuildTxData<T> = ChainSpecific<T, {
|
|
153
|
-
[ChainTypes.Ethereum]: ethereum.BuildTxInput;
|
|
154
|
-
[ChainTypes.Bitcoin]: bitcoin.BuildTxInput;
|
|
155
|
-
[ChainTypes.Cosmos]: cosmos.BuildTxInput;
|
|
156
|
-
[ChainTypes.Osmosis]: cosmos.BuildTxInput;
|
|
157
|
-
}>;
|
|
158
|
-
export declare type SignTxInput<TxType> = {
|
|
159
|
-
txToSign: TxType;
|
|
160
|
-
wallet: HDWallet;
|
|
161
|
-
};
|
|
162
|
-
export interface TxHistoryInput {
|
|
163
|
-
readonly cursor?: string;
|
|
164
|
-
readonly pubkey: string;
|
|
165
|
-
readonly pageSize?: number;
|
|
166
|
-
}
|
|
167
|
-
export declare type GetAddressInputBase = {
|
|
168
|
-
wallet: HDWallet;
|
|
169
|
-
bip44Params?: BIP44Params;
|
|
170
|
-
/**
|
|
171
|
-
* Request that the address be shown to the user by the device, if supported
|
|
172
|
-
*/
|
|
173
|
-
showOnDevice?: boolean;
|
|
174
|
-
};
|
|
175
|
-
export declare type GetAddressInput = GetAddressInputBase | bitcoin.GetAddressInput;
|
|
176
|
-
declare type ChainSpecificGetFeeDataInput<T> = ChainSpecific<T, {
|
|
177
|
-
[ChainTypes.Ethereum]: ethereum.GetFeeDataInput;
|
|
178
|
-
[ChainTypes.Bitcoin]: bitcoin.GetFeeDataInput;
|
|
179
|
-
}>;
|
|
180
|
-
export declare type GetFeeDataInput<T extends ChainTypes> = {
|
|
181
|
-
to: string;
|
|
182
|
-
value: string;
|
|
183
|
-
sendMax?: boolean;
|
|
184
|
-
} & ChainSpecificGetFeeDataInput<T>;
|
|
185
|
-
export declare enum ValidAddressResultType {
|
|
186
|
-
Valid = "valid",
|
|
187
|
-
Invalid = "invalid"
|
|
188
|
-
}
|
|
189
|
-
export declare type ValidAddressResult = {
|
|
190
|
-
/** Is this Address valid */
|
|
191
|
-
valid: boolean;
|
|
192
|
-
/** Result type of valid address */
|
|
193
|
-
result: ValidAddressResultType;
|
|
194
|
-
};
|
|
195
|
-
export declare type ZrxFeeResult = {
|
|
196
|
-
fast: number;
|
|
197
|
-
instant: number;
|
|
198
|
-
low: number;
|
|
199
|
-
source: 'ETH_GAS_STATION' | 'ETHERSCAN' | 'ETHERCHAIN' | 'GAS_NOW' | 'MY_CRYPTO' | 'UP_VEST' | 'GETH_PENDING' | 'MEDIAN' | 'AVERAGE';
|
|
200
|
-
standard: number;
|
|
201
|
-
timestamp: number;
|
|
202
|
-
};
|
|
203
|
-
export declare type ZrxGasApiResponse = {
|
|
204
|
-
result: ZrxFeeResult[];
|
|
205
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ValidAddressResultType = exports.TradeType = exports.TxStatus = exports.TxType = exports.FeeDataKey = exports.ethereum = exports.cosmos = exports.bitcoin = void 0;
|
|
27
|
-
const base_1 = require("../base");
|
|
28
|
-
const bitcoin = __importStar(require("./bitcoin"));
|
|
29
|
-
exports.bitcoin = bitcoin;
|
|
30
|
-
const cosmos = __importStar(require("./cosmos"));
|
|
31
|
-
exports.cosmos = cosmos;
|
|
32
|
-
const ethereum = __importStar(require("./ethereum"));
|
|
33
|
-
exports.ethereum = ethereum;
|
|
34
|
-
var FeeDataKey;
|
|
35
|
-
(function (FeeDataKey) {
|
|
36
|
-
FeeDataKey["Slow"] = "slow";
|
|
37
|
-
FeeDataKey["Average"] = "average";
|
|
38
|
-
FeeDataKey["Fast"] = "fast";
|
|
39
|
-
})(FeeDataKey = exports.FeeDataKey || (exports.FeeDataKey = {}));
|
|
40
|
-
var TxType;
|
|
41
|
-
(function (TxType) {
|
|
42
|
-
TxType["Send"] = "send";
|
|
43
|
-
TxType["Receive"] = "receive";
|
|
44
|
-
TxType["Contract"] = "contract";
|
|
45
|
-
TxType["Unknown"] = "unknown";
|
|
46
|
-
})(TxType = exports.TxType || (exports.TxType = {}));
|
|
47
|
-
var TxStatus;
|
|
48
|
-
(function (TxStatus) {
|
|
49
|
-
TxStatus["Confirmed"] = "confirmed";
|
|
50
|
-
TxStatus["Pending"] = "pending";
|
|
51
|
-
TxStatus["Failed"] = "failed";
|
|
52
|
-
TxStatus["Unknown"] = "unknown";
|
|
53
|
-
})(TxStatus = exports.TxStatus || (exports.TxStatus = {}));
|
|
54
|
-
var TradeType;
|
|
55
|
-
(function (TradeType) {
|
|
56
|
-
TradeType["Trade"] = "trade";
|
|
57
|
-
TradeType["Refund"] = "refund";
|
|
58
|
-
})(TradeType = exports.TradeType || (exports.TradeType = {}));
|
|
59
|
-
var ValidAddressResultType;
|
|
60
|
-
(function (ValidAddressResultType) {
|
|
61
|
-
ValidAddressResultType["Valid"] = "valid";
|
|
62
|
-
ValidAddressResultType["Invalid"] = "invalid";
|
|
63
|
-
})(ValidAddressResultType = exports.ValidAddressResultType || (exports.ValidAddressResultType = {}));
|