@shapeshiftoss/types 1.16.1 → 1.19.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 -0
- package/dist/chain-adapters/ethereum.d.ts +2 -15
- package/dist/chain-adapters/index.d.ts +22 -19
- package/dist/chain-adapters/index.js +7 -2
- package/dist/market.d.ts +5 -8
- package/package.json +1 -1
- package/dist/chain-adapters/index.assert.d.ts +0 -0
- package/dist/chain-adapters/index.assert.js +0 -16
package/dist/base.d.ts
CHANGED
|
@@ -1,20 +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;
|
|
15
|
-
};
|
|
16
|
-
export declare type TxTransfer = {
|
|
17
|
-
token?: Token;
|
|
4
|
+
tokens?: Array<AssetBalance>;
|
|
18
5
|
};
|
|
19
6
|
export declare type FeeData = {
|
|
20
7
|
gasPrice: string;
|
|
@@ -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
|
}>;
|
|
@@ -66,13 +70,13 @@ export declare type SubscribeTxsInput = {
|
|
|
66
70
|
accountType?: UtxoAccountType;
|
|
67
71
|
};
|
|
68
72
|
export declare type TxFee = {
|
|
69
|
-
|
|
73
|
+
caip19: string;
|
|
70
74
|
value: string;
|
|
71
75
|
};
|
|
72
76
|
export declare enum TxType {
|
|
73
77
|
Send = "send",
|
|
74
78
|
Receive = "receive",
|
|
75
|
-
|
|
79
|
+
Unknown = "unknown"
|
|
76
80
|
}
|
|
77
81
|
export declare enum TxStatus {
|
|
78
82
|
Confirmed = "confirmed",
|
|
@@ -86,31 +90,30 @@ export declare type SubscribeTxsMessage<T extends ChainTypes> = {
|
|
|
86
90
|
blockHeight: number;
|
|
87
91
|
blockTime: number;
|
|
88
92
|
chain: T;
|
|
93
|
+
caip2: string;
|
|
89
94
|
confirmations: number;
|
|
90
|
-
network: NetworkTypes;
|
|
91
95
|
txid: string;
|
|
92
|
-
to?: string;
|
|
93
|
-
from?: string;
|
|
94
96
|
fee?: TxFee;
|
|
95
97
|
status: TxStatus;
|
|
96
98
|
tradeDetails?: TradeDetails;
|
|
97
|
-
|
|
99
|
+
transfers: Array<TxTransfer>;
|
|
100
|
+
};
|
|
101
|
+
export declare enum TradeType {
|
|
102
|
+
Trade = "trade",
|
|
103
|
+
Refund = "refund"
|
|
104
|
+
}
|
|
98
105
|
export declare type TradeDetails = {
|
|
99
|
-
buyAmount: string;
|
|
100
|
-
buyAsset: string;
|
|
101
106
|
dexName: string;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
sellAsset: string;
|
|
107
|
+
memo?: string;
|
|
108
|
+
type: TradeType;
|
|
105
109
|
};
|
|
106
|
-
declare type
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
asset: string;
|
|
110
|
+
export declare type TxTransfer = {
|
|
111
|
+
caip19: string;
|
|
112
|
+
from: string;
|
|
113
|
+
to: string;
|
|
111
114
|
type: TxType;
|
|
112
115
|
value: string;
|
|
113
|
-
}
|
|
116
|
+
};
|
|
114
117
|
export declare type SubscribeError = {
|
|
115
118
|
message: string;
|
|
116
119
|
};
|
|
@@ -19,7 +19,7 @@ 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.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.bitcoin = void 0;
|
|
23
23
|
const base_1 = require("../base");
|
|
24
24
|
const bitcoin = __importStar(require("./bitcoin"));
|
|
25
25
|
exports.bitcoin = bitcoin;
|
|
@@ -35,7 +35,7 @@ var TxType;
|
|
|
35
35
|
(function (TxType) {
|
|
36
36
|
TxType["Send"] = "send";
|
|
37
37
|
TxType["Receive"] = "receive";
|
|
38
|
-
TxType["
|
|
38
|
+
TxType["Unknown"] = "unknown";
|
|
39
39
|
})(TxType = exports.TxType || (exports.TxType = {}));
|
|
40
40
|
var TxStatus;
|
|
41
41
|
(function (TxStatus) {
|
|
@@ -44,6 +44,11 @@ var TxStatus;
|
|
|
44
44
|
TxStatus["Failed"] = "failed";
|
|
45
45
|
TxStatus["Unknown"] = "unknown";
|
|
46
46
|
})(TxStatus = exports.TxStatus || (exports.TxStatus = {}));
|
|
47
|
+
var TradeType;
|
|
48
|
+
(function (TradeType) {
|
|
49
|
+
TradeType["Trade"] = "trade";
|
|
50
|
+
TradeType["Refund"] = "refund";
|
|
51
|
+
})(TradeType = exports.TradeType || (exports.TradeType = {}));
|
|
47
52
|
var ValidAddressResultType;
|
|
48
53
|
(function (ValidAddressResultType) {
|
|
49
54
|
ValidAddressResultType["Valid"] = "valid";
|
package/dist/market.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ChainTypes } from '.';
|
|
2
1
|
export declare type MarketData = {
|
|
3
2
|
price: string;
|
|
4
3
|
marketCap: string;
|
|
@@ -18,21 +17,19 @@ export declare type HistoryData = {
|
|
|
18
17
|
date: string;
|
|
19
18
|
};
|
|
20
19
|
export declare type PriceHistoryArgs = {
|
|
21
|
-
|
|
20
|
+
caip19: string;
|
|
22
21
|
timeframe: HistoryTimeframe;
|
|
23
|
-
tokenId?: string;
|
|
24
22
|
};
|
|
25
23
|
export declare type MarketDataArgs = {
|
|
26
|
-
|
|
27
|
-
tokenId?: string;
|
|
24
|
+
caip19: string;
|
|
28
25
|
};
|
|
29
|
-
export declare type
|
|
26
|
+
export declare type FindAllMarketType = (args: FindAllMarketArgs) => Promise<MarketCapResult>;
|
|
27
|
+
export declare type FindByCaip19MarketType = (args: MarketDataArgs) => Promise<MarketData>;
|
|
30
28
|
export declare type PriceHistoryType = (args: PriceHistoryArgs) => Promise<HistoryData[]>;
|
|
31
|
-
export declare type
|
|
29
|
+
export declare type FindAllMarketArgs = {
|
|
32
30
|
pages: number;
|
|
33
31
|
perPage: number;
|
|
34
32
|
};
|
|
35
33
|
export declare type MarketCapResult = {
|
|
36
34
|
[k: string]: MarketData;
|
|
37
35
|
};
|
|
38
|
-
export declare type GetByMarketCapType = (args?: GetByMarketCapArgs) => Promise<MarketCapResult>;
|
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>>()
|