@shapeshiftoss/types 1.25.0 → 2.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/dist/base.d.ts CHANGED
@@ -8,12 +8,6 @@ export declare type BIP44Params = {
8
8
  isChange?: boolean;
9
9
  index?: number;
10
10
  };
11
- export declare enum ContractTypes {
12
- ERC20 = "ERC20",
13
- ERC721 = "ERC721",
14
- OTHER = "OTHER",
15
- NONE = "NONE"
16
- }
17
11
  export declare enum ChainTypes {
18
12
  Ethereum = "ethereum",
19
13
  Bitcoin = "bitcoin",
@@ -63,7 +57,7 @@ declare type AbstractAsset = {
63
57
  declare type OmittedTokenAssetFields = 'chain' | 'network' | 'slip44' | 'explorer' | 'explorerTxLink' | 'explorerAddressLink';
64
58
  declare type TokenAssetFields = {
65
59
  tokenId: string;
66
- contractType: ContractTypes;
60
+ contractType: 'erc20' | 'erc721';
67
61
  };
68
62
  export declare type TokenAsset = Omit<AbstractAsset, OmittedTokenAssetFields> & TokenAssetFields;
69
63
  export declare type BaseAsset = AbstractAsset & {
package/dist/base.js CHANGED
@@ -1,13 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SwapperType = exports.AssetDataSource = exports.UtxoAccountType = exports.NetworkTypes = exports.ChainTypes = exports.ContractTypes = void 0;
4
- var ContractTypes;
5
- (function (ContractTypes) {
6
- ContractTypes["ERC20"] = "ERC20";
7
- ContractTypes["ERC721"] = "ERC721";
8
- ContractTypes["OTHER"] = "OTHER";
9
- ContractTypes["NONE"] = "NONE";
10
- })(ContractTypes = exports.ContractTypes || (exports.ContractTypes = {}));
3
+ exports.SwapperType = exports.AssetDataSource = exports.UtxoAccountType = exports.NetworkTypes = exports.ChainTypes = void 0;
11
4
  var ChainTypes;
12
5
  (function (ChainTypes) {
13
6
  ChainTypes["Ethereum"] = "ethereum";
@@ -0,0 +1,9 @@
1
+ export declare type BuildTxInput = {
2
+ gas: string;
3
+ };
4
+ export declare type Account = {
5
+ sequence: number;
6
+ };
7
+ export declare type FeeData = {
8
+ value: string;
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,12 +1,16 @@
1
- import { BTCSignTx, ETHSignTx, HDWallet } from '@shapeshiftoss/hdwallet-core';
2
- import { BIP44Params, ChainTypes, NetworkTypes, SwapperType, UtxoAccountType } from '../base';
1
+ import { BTCSignTx, CosmosSignTx, ETHSignTx, HDWallet } from '@shapeshiftoss/hdwallet-core';
2
+ import { BIP44Params, ChainTypes, SwapperType, UtxoAccountType } from '../base';
3
3
  import { ChainAndSwapperSpecific, ChainSpecific } from '../utility';
4
4
  import * as bitcoin from './bitcoin';
5
+ import * as cosmos from './cosmos';
5
6
  import * as ethereum from './ethereum';
6
- export { bitcoin, ethereum };
7
+ import * as osmosis from './osmosis';
8
+ export { bitcoin, cosmos, ethereum };
7
9
  declare type ChainSpecificAccount<T> = ChainSpecific<T, {
8
10
  [ChainTypes.Ethereum]: ethereum.Account;
9
11
  [ChainTypes.Bitcoin]: bitcoin.Account;
12
+ [ChainTypes.Cosmos]: cosmos.Account;
13
+ [ChainTypes.Osmosis]: osmosis.Account;
10
14
  }>;
11
15
  export declare type Account<T extends ChainTypes> = {
12
16
  balance: string;
@@ -19,24 +23,6 @@ export declare type AssetBalance = {
19
23
  balance: string;
20
24
  caip19: string;
21
25
  };
22
- declare type ChainSpecificTransaction<T> = ChainSpecific<T, {
23
- [ChainTypes.Bitcoin]: bitcoin.TransactionSpecific;
24
- }>;
25
- export declare type Transaction<T extends ChainTypes> = {
26
- network: NetworkTypes;
27
- chain: T;
28
- symbol: string;
29
- txid: string;
30
- status: string;
31
- from: string;
32
- to?: string;
33
- blockHash?: string;
34
- blockHeight?: number;
35
- confirmations?: number;
36
- timestamp?: number;
37
- value: string;
38
- fee: string;
39
- } & ChainSpecificTransaction<T>;
40
26
  export declare enum FeeDataKey {
41
27
  Slow = "slow",
42
28
  Average = "average",
@@ -52,6 +38,7 @@ declare type ChainSpecificQuoteFeeData<T1, T2> = ChainAndSwapperSpecific<T1, {
52
38
  declare type ChainSpecificFeeData<T> = ChainSpecific<T, {
53
39
  [ChainTypes.Ethereum]: ethereum.FeeData;
54
40
  [ChainTypes.Bitcoin]: bitcoin.FeeData;
41
+ [ChainTypes.Cosmos]: cosmos.FeeData;
55
42
  }>;
56
43
  export declare type QuoteFeeData<T1 extends ChainTypes, T2 extends SwapperType> = {
57
44
  fee: string;
@@ -85,7 +72,7 @@ export declare enum TxStatus {
85
72
  Failed = "failed",
86
73
  Unknown = "unknown"
87
74
  }
88
- export declare type SubscribeTxsMessage<T extends ChainTypes> = {
75
+ export declare type Transaction<T extends ChainTypes> = {
89
76
  address: string;
90
77
  blockHash?: string;
91
78
  blockHeight: number;
@@ -124,14 +111,14 @@ export declare type SubscribeError = {
124
111
  message: string;
125
112
  };
126
113
  export declare type TxHistoryResponse<T extends ChainTypes> = {
127
- page: number;
128
- totalPages: number;
129
- txs: number;
114
+ cursor: string;
115
+ pubkey: string;
130
116
  transactions: Array<Transaction<T>>;
131
117
  };
132
118
  declare type ChainTxTypeInner = {
133
119
  [ChainTypes.Ethereum]: ETHSignTx;
134
120
  [ChainTypes.Bitcoin]: BTCSignTx;
121
+ [ChainTypes.Cosmos]: CosmosSignTx;
135
122
  };
136
123
  export declare type ChainTxType<T> = T extends keyof ChainTxTypeInner ? ChainTxTypeInner[T] : never;
137
124
  export declare type BuildSendTxInput<T extends ChainTypes> = {
@@ -144,16 +131,17 @@ export declare type BuildSendTxInput<T extends ChainTypes> = {
144
131
  declare type ChainSpecificBuildTxData<T> = ChainSpecific<T, {
145
132
  [ChainTypes.Ethereum]: ethereum.BuildTxInput;
146
133
  [ChainTypes.Bitcoin]: bitcoin.BuildTxInput;
134
+ [ChainTypes.Cosmos]: cosmos.BuildTxInput;
135
+ [ChainTypes.Osmosis]: cosmos.BuildTxInput;
147
136
  }>;
148
137
  export declare type SignTxInput<TxType> = {
149
138
  txToSign: TxType;
150
139
  wallet: HDWallet;
151
140
  };
152
141
  export interface TxHistoryInput {
142
+ readonly cursor?: string;
153
143
  readonly pubkey: string;
154
- readonly page?: number;
155
144
  readonly pageSize?: number;
156
- readonly contract?: string;
157
145
  }
158
146
  export declare type GetAddressInputBase = {
159
147
  wallet: HDWallet;
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -19,10 +23,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
19
23
  return result;
20
24
  };
21
25
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.ValidAddressResultType = exports.TradeType = exports.TxStatus = exports.TxType = exports.FeeDataKey = exports.ethereum = exports.bitcoin = void 0;
26
+ exports.ValidAddressResultType = exports.TradeType = exports.TxStatus = exports.TxType = exports.FeeDataKey = exports.ethereum = exports.cosmos = exports.bitcoin = void 0;
23
27
  const base_1 = require("../base");
24
28
  const bitcoin = __importStar(require("./bitcoin"));
25
29
  exports.bitcoin = bitcoin;
30
+ const cosmos = __importStar(require("./cosmos"));
31
+ exports.cosmos = cosmos;
26
32
  const ethereum = __importStar(require("./ethereum"));
27
33
  exports.ethereum = ethereum;
28
34
  var FeeDataKey;
@@ -0,0 +1,6 @@
1
+ export declare type BuildTxInput = {
2
+ gas: string;
3
+ };
4
+ export declare type Account = {
5
+ sequence: number;
6
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/types",
3
- "version": "1.25.0",
3
+ "version": "2.1.0",
4
4
  "description": "Common types shared across packages",
5
5
  "repository": "https://github.com/shapeshift/lib",
6
6
  "license": "MIT",
@@ -20,6 +20,6 @@
20
20
  "type-check": "tsc --project ./tsconfig.json --noEmit"
21
21
  },
22
22
  "devDependencies": {
23
- "@shapeshiftoss/hdwallet-core": "^1.18.2"
23
+ "@shapeshiftoss/hdwallet-core": "^1.19.0"
24
24
  }
25
25
  }