@shapeshiftoss/types 1.17.0 → 1.20.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,7 +1,7 @@
|
|
|
1
1
|
import { HDWallet } from '@shapeshiftoss/hdwallet-core';
|
|
2
2
|
import { FeeDataKey, QuoteFeeData, SignTxInput } from './chain-adapters';
|
|
3
3
|
/** Common */
|
|
4
|
-
export declare type
|
|
4
|
+
export declare type BIP44Params = {
|
|
5
5
|
purpose: number;
|
|
6
6
|
coinType: number;
|
|
7
7
|
accountNumber: number;
|
|
@@ -35,6 +35,7 @@ export declare enum AssetDataSource {
|
|
|
35
35
|
}
|
|
36
36
|
declare type AbstractAsset = {
|
|
37
37
|
caip19: string;
|
|
38
|
+
caip2: string;
|
|
38
39
|
chain: ChainTypes;
|
|
39
40
|
description?: string;
|
|
40
41
|
dataSource: AssetDataSource;
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AssetBalance } from '.';
|
|
2
2
|
export declare type Account = {
|
|
3
3
|
nonce: number;
|
|
4
|
-
tokens?: Array<
|
|
5
|
-
};
|
|
6
|
-
export declare type Token = {
|
|
7
|
-
contract: string;
|
|
8
|
-
precision: number;
|
|
9
|
-
name: string;
|
|
10
|
-
symbol: string;
|
|
11
|
-
contractType: ContractTypes;
|
|
12
|
-
};
|
|
13
|
-
export declare type TokenWithBalance = Token & {
|
|
14
|
-
balance: string;
|
|
4
|
+
tokens?: Array<AssetBalance>;
|
|
15
5
|
};
|
|
16
6
|
export declare type FeeData = {
|
|
17
7
|
gasPrice: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BTCSignTx, ETHSignTx, HDWallet } from '@shapeshiftoss/hdwallet-core';
|
|
2
|
-
import {
|
|
2
|
+
import { BIP44Params, ChainTypes, NetworkTypes, SwapperType, UtxoAccountType } from '../base';
|
|
3
3
|
import { ChainAndSwapperSpecific, ChainSpecific } from '../utility';
|
|
4
4
|
import * as bitcoin from './bitcoin';
|
|
5
5
|
import * as ethereum from './ethereum';
|
|
@@ -11,10 +11,14 @@ declare type ChainSpecificAccount<T> = ChainSpecific<T, {
|
|
|
11
11
|
export declare type Account<T extends ChainTypes> = {
|
|
12
12
|
balance: string;
|
|
13
13
|
pubkey: string;
|
|
14
|
-
|
|
14
|
+
caip2: string;
|
|
15
|
+
caip19: string;
|
|
15
16
|
chain: T;
|
|
16
|
-
network: NetworkTypes;
|
|
17
17
|
} & ChainSpecificAccount<T>;
|
|
18
|
+
export declare type AssetBalance = {
|
|
19
|
+
balance: string;
|
|
20
|
+
caip19: string;
|
|
21
|
+
};
|
|
18
22
|
declare type ChainSpecificTransaction<T> = ChainSpecific<T, {
|
|
19
23
|
[ChainTypes.Bitcoin]: bitcoin.TransactionSpecific;
|
|
20
24
|
}>;
|
|
@@ -62,7 +66,7 @@ export declare type FeeDataEstimate<T extends ChainTypes> = {
|
|
|
62
66
|
};
|
|
63
67
|
export declare type SubscribeTxsInput = {
|
|
64
68
|
wallet: HDWallet;
|
|
65
|
-
|
|
69
|
+
bip44Params?: BIP44Params;
|
|
66
70
|
accountType?: UtxoAccountType;
|
|
67
71
|
};
|
|
68
72
|
export declare type TxFee = {
|
|
@@ -128,7 +132,7 @@ export declare type BuildSendTxInput<T extends ChainTypes> = {
|
|
|
128
132
|
to: string;
|
|
129
133
|
value: string;
|
|
130
134
|
wallet: HDWallet;
|
|
131
|
-
|
|
135
|
+
bip44Params?: BIP44Params;
|
|
132
136
|
sendMax?: boolean;
|
|
133
137
|
} & ChainSpecificBuildTxData<T>;
|
|
134
138
|
declare type ChainSpecificBuildTxData<T> = ChainSpecific<T, {
|
|
@@ -147,7 +151,7 @@ export interface TxHistoryInput {
|
|
|
147
151
|
}
|
|
148
152
|
export declare type GetAddressInputBase = {
|
|
149
153
|
wallet: HDWallet;
|
|
150
|
-
|
|
154
|
+
bip44Params?: BIP44Params;
|
|
151
155
|
/**
|
|
152
156
|
* Request that the address be shown to the user by the device, if supported
|
|
153
157
|
*/
|
package/dist/market.d.ts
CHANGED
|
@@ -24,11 +24,10 @@ export declare type MarketDataArgs = {
|
|
|
24
24
|
caip19: string;
|
|
25
25
|
};
|
|
26
26
|
export declare type FindAllMarketType = (args: FindAllMarketArgs) => Promise<MarketCapResult>;
|
|
27
|
-
export declare type FindByCaip19MarketType = (args: MarketDataArgs) => Promise<MarketData>;
|
|
27
|
+
export declare type FindByCaip19MarketType = (args: MarketDataArgs) => Promise<MarketData | null>;
|
|
28
28
|
export declare type PriceHistoryType = (args: PriceHistoryArgs) => Promise<HistoryData[]>;
|
|
29
29
|
export declare type FindAllMarketArgs = {
|
|
30
|
-
|
|
31
|
-
perPage: number;
|
|
30
|
+
count: number;
|
|
32
31
|
};
|
|
33
32
|
export declare type MarketCapResult = {
|
|
34
33
|
[k: string]: MarketData;
|
package/package.json
CHANGED
|
File without changes
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// import * as ta from 'type-assertions'
|
|
3
|
-
// import { ChainTypes } from '../base'
|
|
4
|
-
// unit tests for types
|
|
5
|
-
// a generic transaction should have details.nonce of string | undefined
|
|
6
|
-
// ta.assert<ta.Equal<Transaction['details']['nonce'], string | undefined>>()
|
|
7
|
-
// // a generic transaction should have details.opReturn of string | undefined
|
|
8
|
-
// ta.assert<ta.Equal<Transaction['details']['opReturn'], string | undefined>>()
|
|
9
|
-
// // an ethereum transaction should have details.nonce of string
|
|
10
|
-
// ta.assert<ta.Equal<Transaction<ChainTypes.Ethereum>['details']['nonce'], string>>()
|
|
11
|
-
// // an ethereum transaction should have details.opReturn of undefined
|
|
12
|
-
// ta.assert<ta.Equal<Transaction<ChainTypes.Ethereum>['details']['opReturn'], undefined>>()
|
|
13
|
-
// // a bitcoin transaction should have details.nonce of undefined
|
|
14
|
-
// ta.assert<ta.Equal<Transaction<ChainTypes.Bitcoin>['details']['nonce'], undefined>>()
|
|
15
|
-
// // a bitcoin transaction should have details.opReturn of string
|
|
16
|
-
// ta.assert<ta.Equal<Transaction<ChainTypes.Bitcoin>['details']['opReturn'], string>>()
|