@shapeshiftoss/types 4.4.1 → 6.1.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 +7 -23
- package/dist/base.js +15 -32
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -15
- package/package.json +1 -1
- 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
|
@@ -6,24 +6,17 @@ export declare type BIP44Params = {
|
|
|
6
6
|
isChange?: boolean;
|
|
7
7
|
index?: number;
|
|
8
8
|
};
|
|
9
|
-
export declare enum
|
|
9
|
+
export declare enum KnownChainIds {
|
|
10
|
+
EthereumMainnet = "eip155:1",
|
|
11
|
+
BitcoinMainnet = "bip122:000000000019d6689c085ae165831e93",
|
|
12
|
+
CosmosMainnet = "cosmos:cosmoshub-4",
|
|
13
|
+
OsmosisMainnet = "cosmos:osmosis-1"
|
|
14
|
+
}
|
|
15
|
+
export declare enum CoingeckoAssetPlatform {
|
|
10
16
|
Ethereum = "ethereum",
|
|
11
|
-
Bitcoin = "bitcoin",
|
|
12
17
|
Cosmos = "cosmos",
|
|
13
18
|
Osmosis = "osmosis"
|
|
14
19
|
}
|
|
15
|
-
declare const supportedChainIds: readonly ["eip155:1", "bip122:000000000019d6689c085ae165831e93", "cosmos:cosmoshub-4", "cosmos:osmosis-1"];
|
|
16
|
-
export declare type SupportedChainIds = typeof supportedChainIds[number];
|
|
17
|
-
export declare enum NetworkTypes {
|
|
18
|
-
MAINNET = "MAINNET",
|
|
19
|
-
TESTNET = "TESTNET",
|
|
20
|
-
ETH_ROPSTEN = "ETH_ROPSTEN",
|
|
21
|
-
ETH_RINKEBY = "ETH_RINKEBY",
|
|
22
|
-
COSMOSHUB_MAINNET = "COSMOSHUB_MAINNET",
|
|
23
|
-
COSMOSHUB_VEGA = "COSMOSHUB_VEGA",
|
|
24
|
-
OSMOSIS_MAINNET = "OSMOSIS_MAINNET",
|
|
25
|
-
OSMOSIS_TESTNET = "OSMOSIS_TESTNET"
|
|
26
|
-
}
|
|
27
20
|
export declare enum WithdrawType {
|
|
28
21
|
DELAYED = 0,
|
|
29
22
|
INSTANT = 1
|
|
@@ -33,19 +26,11 @@ export declare enum UtxoAccountType {
|
|
|
33
26
|
SegwitP2sh = "SegwitP2sh",
|
|
34
27
|
P2pkh = "P2pkh"
|
|
35
28
|
}
|
|
36
|
-
export declare enum AssetDataSource {
|
|
37
|
-
CoinGecko = "coingecko",
|
|
38
|
-
YearnFinance = "yearnfinance"
|
|
39
|
-
}
|
|
40
29
|
export declare type Asset = {
|
|
41
30
|
assetId: string;
|
|
42
31
|
chainId: string;
|
|
43
|
-
/** @deprecated: do not use. This will be removed once consumers have handled it */
|
|
44
|
-
chain: ChainTypes;
|
|
45
32
|
description?: string;
|
|
46
33
|
isTrustedDescription?: boolean;
|
|
47
|
-
/** @deprecated: do not use. This will be removed once consumers have handled it */
|
|
48
|
-
network: NetworkTypes;
|
|
49
34
|
symbol: string;
|
|
50
35
|
name: string;
|
|
51
36
|
precision: number;
|
|
@@ -60,4 +45,3 @@ export declare enum SwapperType {
|
|
|
60
45
|
Thorchain = "Thorchain",
|
|
61
46
|
Test = "Test"
|
|
62
47
|
}
|
|
63
|
-
export {};
|
package/dist/base.js
CHANGED
|
@@ -1,31 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/** Common */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.SwapperType = exports.
|
|
5
|
-
var
|
|
6
|
-
(function (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
];
|
|
18
|
-
|
|
19
|
-
(function (NetworkTypes) {
|
|
20
|
-
NetworkTypes["MAINNET"] = "MAINNET";
|
|
21
|
-
NetworkTypes["TESTNET"] = "TESTNET";
|
|
22
|
-
NetworkTypes["ETH_ROPSTEN"] = "ETH_ROPSTEN";
|
|
23
|
-
NetworkTypes["ETH_RINKEBY"] = "ETH_RINKEBY";
|
|
24
|
-
NetworkTypes["COSMOSHUB_MAINNET"] = "COSMOSHUB_MAINNET";
|
|
25
|
-
NetworkTypes["COSMOSHUB_VEGA"] = "COSMOSHUB_VEGA";
|
|
26
|
-
NetworkTypes["OSMOSIS_MAINNET"] = "OSMOSIS_MAINNET";
|
|
27
|
-
NetworkTypes["OSMOSIS_TESTNET"] = "OSMOSIS_TESTNET";
|
|
28
|
-
})(NetworkTypes = exports.NetworkTypes || (exports.NetworkTypes = {}));
|
|
4
|
+
exports.SwapperType = exports.UtxoAccountType = exports.WithdrawType = exports.CoingeckoAssetPlatform = exports.KnownChainIds = void 0;
|
|
5
|
+
var KnownChainIds;
|
|
6
|
+
(function (KnownChainIds) {
|
|
7
|
+
KnownChainIds["EthereumMainnet"] = "eip155:1";
|
|
8
|
+
KnownChainIds["BitcoinMainnet"] = "bip122:000000000019d6689c085ae165831e93";
|
|
9
|
+
KnownChainIds["CosmosMainnet"] = "cosmos:cosmoshub-4";
|
|
10
|
+
KnownChainIds["OsmosisMainnet"] = "cosmos:osmosis-1";
|
|
11
|
+
})(KnownChainIds = exports.KnownChainIds || (exports.KnownChainIds = {}));
|
|
12
|
+
// https://api.coingecko.com/api/v3/asset_platforms
|
|
13
|
+
var CoingeckoAssetPlatform;
|
|
14
|
+
(function (CoingeckoAssetPlatform) {
|
|
15
|
+
CoingeckoAssetPlatform["Ethereum"] = "ethereum";
|
|
16
|
+
CoingeckoAssetPlatform["Cosmos"] = "cosmos";
|
|
17
|
+
CoingeckoAssetPlatform["Osmosis"] = "osmosis";
|
|
18
|
+
})(CoingeckoAssetPlatform = exports.CoingeckoAssetPlatform || (exports.CoingeckoAssetPlatform = {}));
|
|
29
19
|
var WithdrawType;
|
|
30
20
|
(function (WithdrawType) {
|
|
31
21
|
WithdrawType[WithdrawType["DELAYED"] = 0] = "DELAYED";
|
|
@@ -37,13 +27,6 @@ var UtxoAccountType;
|
|
|
37
27
|
UtxoAccountType["SegwitP2sh"] = "SegwitP2sh";
|
|
38
28
|
UtxoAccountType["P2pkh"] = "P2pkh";
|
|
39
29
|
})(UtxoAccountType = exports.UtxoAccountType || (exports.UtxoAccountType = {}));
|
|
40
|
-
// TODO(0xdef1cafe): remove this, client should not be aware of where data is from
|
|
41
|
-
// Describes the data source for where to get the asset details or asset description.
|
|
42
|
-
var AssetDataSource;
|
|
43
|
-
(function (AssetDataSource) {
|
|
44
|
-
AssetDataSource["CoinGecko"] = "coingecko";
|
|
45
|
-
AssetDataSource["YearnFinance"] = "yearnfinance";
|
|
46
|
-
})(AssetDataSource = exports.AssetDataSource || (exports.AssetDataSource = {}));
|
|
47
30
|
// swapper
|
|
48
31
|
// TODO remove this once web is using the type from swapper
|
|
49
32
|
var SwapperType;
|
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,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 = {}));
|