@shapeshiftoss/unchained-client 9.1.1 → 9.3.1

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.
Files changed (60) hide show
  1. package/dist/bitcoin/parser/index.d.ts +1 -0
  2. package/dist/bitcoin/parser/index.js +2 -1
  3. package/dist/dogecoin/index.d.ts +3 -0
  4. package/dist/dogecoin/index.js +19 -0
  5. package/dist/evm/avalanche/parser/index.d.ts +2 -2
  6. package/dist/evm/ethereum/parser/foxy.d.ts +3 -3
  7. package/dist/evm/ethereum/parser/index.d.ts +2 -2
  8. package/dist/evm/ethereum/parser/thor.d.ts +3 -3
  9. package/dist/evm/ethereum/parser/uniV2.d.ts +5 -5
  10. package/dist/evm/ethereum/parser/weth.d.ts +3 -3
  11. package/dist/evm/ethereum/parser/yearn.d.ts +3 -3
  12. package/dist/evm/ethereum/parser/zrx.d.ts +3 -3
  13. package/dist/evm/index.d.ts +2 -0
  14. package/dist/evm/index.js +3 -1
  15. package/dist/evm/parser/types.d.ts +2 -3
  16. package/dist/generated/avalanche/api.d.ts +121 -152
  17. package/dist/generated/avalanche/api.js +5 -5
  18. package/dist/generated/avalanche/base.d.ts +1 -1
  19. package/dist/generated/avalanche/base.js +1 -1
  20. package/dist/generated/avalanche/common.d.ts +1 -1
  21. package/dist/generated/avalanche/common.js +1 -1
  22. package/dist/generated/avalanche/configuration.d.ts +1 -1
  23. package/dist/generated/avalanche/configuration.js +1 -1
  24. package/dist/generated/avalanche/index.d.ts +1 -1
  25. package/dist/generated/avalanche/index.js +1 -1
  26. package/dist/generated/bitcoin/api.d.ts +45 -76
  27. package/dist/generated/bitcoin/api.js +1 -1
  28. package/dist/generated/bitcoin/base.d.ts +1 -1
  29. package/dist/generated/bitcoin/base.js +1 -1
  30. package/dist/generated/bitcoin/common.d.ts +1 -1
  31. package/dist/generated/bitcoin/common.js +1 -1
  32. package/dist/generated/bitcoin/configuration.d.ts +1 -1
  33. package/dist/generated/bitcoin/configuration.js +1 -1
  34. package/dist/generated/bitcoin/index.d.ts +1 -1
  35. package/dist/generated/bitcoin/index.js +1 -1
  36. package/dist/generated/dogecoin/api.d.ts +1010 -0
  37. package/dist/generated/dogecoin/api.js +521 -0
  38. package/dist/generated/dogecoin/base.d.ts +55 -0
  39. package/dist/generated/dogecoin/base.js +64 -0
  40. package/dist/generated/dogecoin/common.d.ts +65 -0
  41. package/dist/generated/dogecoin/common.js +137 -0
  42. package/dist/generated/dogecoin/configuration.d.ts +83 -0
  43. package/dist/generated/dogecoin/configuration.js +42 -0
  44. package/dist/generated/dogecoin/index.d.ts +13 -0
  45. package/dist/generated/dogecoin/index.js +31 -0
  46. package/dist/generated/ethereum/api.d.ts +117 -148
  47. package/dist/generated/ethereum/api.js +1 -1
  48. package/dist/generated/ethereum/base.d.ts +1 -1
  49. package/dist/generated/ethereum/base.js +1 -1
  50. package/dist/generated/ethereum/common.d.ts +1 -1
  51. package/dist/generated/ethereum/common.js +1 -1
  52. package/dist/generated/ethereum/configuration.d.ts +1 -1
  53. package/dist/generated/ethereum/configuration.js +1 -1
  54. package/dist/generated/ethereum/index.d.ts +1 -1
  55. package/dist/generated/ethereum/index.js +1 -1
  56. package/dist/index.d.ts +4 -1
  57. package/dist/index.js +5 -2
  58. package/dist/websocket.d.ts +11 -3
  59. package/dist/websocket.js +124 -97
  60. package/package.json +2 -2
@@ -3,6 +3,7 @@ import { BitcoinTx } from '../../generated/bitcoin';
3
3
  import { Tx as ParsedTx } from '../../types';
4
4
  export interface TransactionParserArgs {
5
5
  chainId: ChainId;
6
+ assetReference?: string;
6
7
  }
7
8
  export declare class TransactionParser {
8
9
  chainId: ChainId;
@@ -8,10 +8,11 @@ const utils_1 = require("../../utils");
8
8
  class TransactionParser {
9
9
  constructor(args) {
10
10
  this.chainId = args.chainId;
11
+ const assetReference = args.assetReference || caip_1.ASSET_REFERENCE.Bitcoin;
11
12
  this.assetId = (0, caip_1.toAssetId)({
12
13
  ...(0, caip_1.fromChainId)(this.chainId),
13
14
  assetNamespace: 'slip44',
14
- assetReference: caip_1.ASSET_REFERENCE.Bitcoin
15
+ assetReference
15
16
  });
16
17
  }
17
18
  async parse(tx, address) {
@@ -0,0 +1,3 @@
1
+ export * from '../generated/dogecoin';
2
+ export * from '../bitcoin/parser';
3
+ export * from '../bitcoin/types';
@@ -0,0 +1,19 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("../generated/dogecoin"), exports);
18
+ __exportStar(require("../bitcoin/parser"), exports);
19
+ __exportStar(require("../bitcoin/types"), exports);
@@ -1,5 +1,5 @@
1
- import { AvalancheTx } from '../../../generated/avalanche';
1
+ import { Tx } from '../../../generated/avalanche';
2
2
  import { BaseTransactionParser, TransactionParserArgs } from '../../parser';
3
- export declare class TransactionParser extends BaseTransactionParser<AvalancheTx> {
3
+ export declare class TransactionParser extends BaseTransactionParser<Tx> {
4
4
  constructor(args: TransactionParserArgs);
5
5
  }
@@ -1,7 +1,7 @@
1
1
  import { ethers } from 'ethers';
2
- import { EthereumTx } from '../../../generated/ethereum';
2
+ import { Tx } from '../../../generated/ethereum';
3
3
  import { SubParser, TxSpecific } from '../../parser';
4
- export declare class Parser implements SubParser<EthereumTx> {
4
+ export declare class Parser implements SubParser<Tx> {
5
5
  readonly abiInterface: ethers.utils.Interface;
6
6
  readonly supportedFunctions: {
7
7
  stakeSigHash: string;
@@ -9,5 +9,5 @@ export declare class Parser implements SubParser<EthereumTx> {
9
9
  instantUnstakeSigHash: string;
10
10
  claimWithdrawSigHash: string;
11
11
  };
12
- parse(tx: EthereumTx): Promise<TxSpecific | undefined>;
12
+ parse(tx: Tx): Promise<TxSpecific | undefined>;
13
13
  }
@@ -1,5 +1,5 @@
1
- import { EthereumTx } from '../../../generated/ethereum';
1
+ import { Tx } from '../../../generated/ethereum';
2
2
  import { BaseTransactionParser, TransactionParserArgs } from '../../parser';
3
- export declare class TransactionParser extends BaseTransactionParser<EthereumTx> {
3
+ export declare class TransactionParser extends BaseTransactionParser<Tx> {
4
4
  constructor(args: TransactionParserArgs);
5
5
  }
@@ -1,12 +1,12 @@
1
1
  import { ChainId } from '@shapeshiftoss/caip';
2
2
  import { ethers } from 'ethers';
3
- import { EthereumTx } from '../../../generated/ethereum';
3
+ import { Tx } from '../../../generated/ethereum';
4
4
  import { SubParser, TxSpecific } from '../../parser';
5
5
  export interface ParserArgs {
6
6
  chainId: ChainId;
7
7
  rpcUrl: string;
8
8
  }
9
- export declare class Parser implements SubParser<EthereumTx> {
9
+ export declare class Parser implements SubParser<Tx> {
10
10
  readonly routerContract: string;
11
11
  readonly abiInterface: ethers.utils.Interface;
12
12
  readonly supportedFunctions: {
@@ -14,5 +14,5 @@ export declare class Parser implements SubParser<EthereumTx> {
14
14
  transferOutSigHash: string;
15
15
  };
16
16
  constructor(args: ParserArgs);
17
- parse(tx: EthereumTx): Promise<TxSpecific | undefined>;
17
+ parse(tx: Tx): Promise<TxSpecific | undefined>;
18
18
  }
@@ -1,12 +1,12 @@
1
1
  import { ChainId } from '@shapeshiftoss/caip';
2
2
  import { ethers } from 'ethers';
3
- import { EthereumTx } from '../../../generated/ethereum';
3
+ import { Tx } from '../../../generated/ethereum';
4
4
  import { SubParser, TxSpecific } from '../../parser';
5
5
  export interface ParserArgs {
6
6
  chainId: ChainId;
7
7
  provider: ethers.providers.JsonRpcProvider;
8
8
  }
9
- export declare class Parser implements SubParser<EthereumTx> {
9
+ export declare class Parser implements SubParser<Tx> {
10
10
  provider: ethers.providers.JsonRpcProvider;
11
11
  readonly chainId: ChainId;
12
12
  readonly wethContract: string;
@@ -21,8 +21,8 @@ export declare class Parser implements SubParser<EthereumTx> {
21
21
  exitSigHash: string;
22
22
  };
23
23
  constructor(args: ParserArgs);
24
- parseUniV2(tx: EthereumTx): Promise<TxSpecific | undefined>;
25
- parseStakingRewards(tx: EthereumTx): Promise<TxSpecific | undefined>;
26
- parse(tx: EthereumTx): Promise<TxSpecific | undefined>;
24
+ parseUniV2(tx: Tx): Promise<TxSpecific | undefined>;
25
+ parseStakingRewards(tx: Tx): Promise<TxSpecific | undefined>;
26
+ parse(tx: Tx): Promise<TxSpecific | undefined>;
27
27
  private static pairFor;
28
28
  }
@@ -1,12 +1,12 @@
1
1
  import { ChainId } from '@shapeshiftoss/caip';
2
2
  import { ethers } from 'ethers';
3
- import { EthereumTx } from '../../../generated/ethereum';
3
+ import { Tx } from '../../../generated/ethereum';
4
4
  import { SubParser, TxSpecific } from '../../parser';
5
5
  export interface ParserArgs {
6
6
  chainId: ChainId;
7
7
  provider: ethers.providers.JsonRpcProvider;
8
8
  }
9
- export declare class Parser implements SubParser<EthereumTx> {
9
+ export declare class Parser implements SubParser<Tx> {
10
10
  provider: ethers.providers.JsonRpcProvider;
11
11
  readonly chainId: ChainId;
12
12
  readonly wethContract: string;
@@ -16,5 +16,5 @@ export declare class Parser implements SubParser<EthereumTx> {
16
16
  withdrawalSigHash: string;
17
17
  };
18
18
  constructor(args: ParserArgs);
19
- parse(tx: EthereumTx): Promise<TxSpecific | undefined>;
19
+ parse(tx: Tx): Promise<TxSpecific | undefined>;
20
20
  }
@@ -1,13 +1,13 @@
1
1
  import { ChainId } from '@shapeshiftoss/caip';
2
2
  import { ChainId as YearnChainId, Yearn } from '@yfi/sdk';
3
3
  import { ethers } from 'ethers';
4
- import { EthereumTx } from '../../../generated/ethereum';
4
+ import { Tx } from '../../../generated/ethereum';
5
5
  import { SubParser, TxSpecific } from '../../parser';
6
6
  interface ParserArgs {
7
7
  chainId: ChainId;
8
8
  provider: ethers.providers.JsonRpcProvider;
9
9
  }
10
- export declare class Parser implements SubParser<EthereumTx> {
10
+ export declare class Parser implements SubParser<Tx> {
11
11
  provider: ethers.providers.JsonRpcProvider;
12
12
  yearnSdk: Yearn<YearnChainId> | undefined;
13
13
  yearnTokenVaultAddresses: string[] | undefined;
@@ -24,7 +24,7 @@ export declare class Parser implements SubParser<EthereumTx> {
24
24
  depositSigHash: string;
25
25
  };
26
26
  constructor(args: ParserArgs);
27
- parse(tx: EthereumTx): Promise<TxSpecific | undefined>;
27
+ parse(tx: Tx): Promise<TxSpecific | undefined>;
28
28
  getAbiInterface(txSigHash: string | undefined): ethers.utils.Interface | undefined;
29
29
  }
30
30
  export {};
@@ -1,5 +1,5 @@
1
- import { EthereumTx } from '../../../generated/ethereum';
1
+ import { Tx } from '../../../generated/ethereum';
2
2
  import { SubParser, TxSpecific } from '../../parser';
3
- export declare class Parser implements SubParser<EthereumTx> {
4
- parse(tx: EthereumTx): Promise<TxSpecific | undefined>;
3
+ export declare class Parser implements SubParser<Tx> {
4
+ parse(tx: Tx): Promise<TxSpecific | undefined>;
5
5
  }
@@ -1,2 +1,4 @@
1
+ export type { evm as types } from '@shapeshiftoss/common-api';
2
+ export { BaseTransactionParser } from './parser';
1
3
  export * as ethereum from './ethereum';
2
4
  export * as avalanche from './avalanche';
package/dist/evm/index.js CHANGED
@@ -23,6 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.avalanche = exports.ethereum = void 0;
26
+ exports.avalanche = exports.ethereum = exports.BaseTransactionParser = void 0;
27
+ var parser_1 = require("./parser");
28
+ Object.defineProperty(exports, "BaseTransactionParser", { enumerable: true, get: function () { return parser_1.BaseTransactionParser; } });
27
29
  exports.ethereum = __importStar(require("./ethereum"));
28
30
  exports.avalanche = __importStar(require("./avalanche"));
@@ -1,7 +1,6 @@
1
- import { AvalancheTx } from '../../generated/avalanche';
2
- import { EthereumTx } from '../../generated/ethereum';
1
+ import type { evm } from '@shapeshiftoss/common-api';
3
2
  import { BaseTxMetadata, StandardTx, StandardTxMetadata } from '../../types';
4
- export declare type Tx = EthereumTx | AvalancheTx;
3
+ export declare type Tx = evm.Tx;
5
4
  export declare enum TxParser {
6
5
  ERC20 = "erc20"
7
6
  }