@riocrypto/common 1.0.2481 → 1.0.2482

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.
@@ -4,8 +4,8 @@ export declare class CryptoAsset extends Asset {
4
4
  rawSymbol: Crypto;
5
5
  constructor(rawSymbol: Crypto);
6
6
  getImageUri(): string;
7
- getName(): Crypto.XLM | "Bitcoin" | "Ethereum" | "Ethereum (Base)" | "USDC (Ethereum)" | "USDC (Polygon)" | "USDC (Bridged to Polygon)" | "USDC (Solana)" | "USDC (Stellar)" | "USDC (Base)" | "USDT (Polygon)" | "USDT (Ethereum)" | "USDT (Tron)" | "Tron" | "Solana" | "Polygon";
8
- getSymbol(): Crypto.SOL | Crypto.TRON | Crypto.POL | Crypto.XLM | "USDC (Ethereum)" | "USDC (Polygon)" | "USDC (Bridged to Polygon)" | "USDC (Solana)" | "USDC (Stellar)" | "USDC (Base)" | "USDT (Polygon)" | "USDT (Ethereum)" | "USDT (Tron)" | "BTC" | "ETH" | "ETH (Base)";
9
- getGasSymbol(): Crypto.SOL | Crypto.TRON | Crypto.POL | Crypto.XLM | "BTC" | "ETH" | "BASECHAIN_ETH" | "MATIC" | "TRX" | "SOL" | "XLM";
7
+ getName(): Crypto.XLM | "Bitcoin" | "Ethereum" | "Ethereum (Base)" | "USDC (Ethereum)" | "USDC (Polygon)" | "USDC (Bridged to Polygon)" | "USDC (Solana)" | "USDC (Stellar)" | "USDC (Base)" | "EURC (Ethereum)" | "EURC (Solana)" | "EURC (Base)" | "USDT (Polygon)" | "USDT (Ethereum)" | "USDT (Tron)" | "Tron" | "Solana" | "Polygon";
8
+ getSymbol(): Crypto.EURCEthereum | Crypto.EURCSolana | Crypto.EURCBase | Crypto.SOL | Crypto.TRON | Crypto.POL | Crypto.XLM | "USDC (Ethereum)" | "USDC (Polygon)" | "USDC (Bridged to Polygon)" | "USDC (Solana)" | "USDC (Stellar)" | "USDC (Base)" | "USDT (Polygon)" | "USDT (Ethereum)" | "USDT (Tron)" | "BTC" | "ETH" | "ETH (Base)";
9
+ getGasSymbol(): Crypto.EURCEthereum | Crypto.EURCSolana | Crypto.EURCBase | Crypto.SOL | Crypto.TRON | Crypto.POL | Crypto.XLM | "BTC" | "ETH" | "BASECHAIN_ETH" | "MATIC" | "TRX" | "SOL" | "XLM";
10
10
  getDescription(): string;
11
11
  }
@@ -74,6 +74,15 @@ class CryptoAsset extends Asset_1.Asset {
74
74
  else if (this.rawSymbol === crypto_1.Crypto.USDCBase) {
75
75
  return "USDC (Base)";
76
76
  }
77
+ else if (this.rawSymbol === crypto_1.Crypto.EURCEthereum) {
78
+ return "EURC (Ethereum)";
79
+ }
80
+ else if (this.rawSymbol === crypto_1.Crypto.EURCSolana) {
81
+ return "EURC (Solana)";
82
+ }
83
+ else if (this.rawSymbol === crypto_1.Crypto.EURCBase) {
84
+ return "EURC (Base)";
85
+ }
77
86
  else if (this.rawSymbol === crypto_1.Crypto.USDTPolygon) {
78
87
  return "USDT (Polygon)";
79
88
  }
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.formatTransactionHash = void 0;
4
4
  const crypto_1 = require("../types/crypto");
5
5
  const formatTransactionHash = (hash, crypto) => {
6
- if ([crypto_1.Crypto.USDC, crypto_1.Crypto.USDTEthereum].includes(crypto)) {
6
+ if ([crypto_1.Crypto.USDC, crypto_1.Crypto.USDTEthereum, crypto_1.Crypto.EURCEthereum].includes(crypto)) {
7
7
  return `https://etherscan.io/tx/${hash}`;
8
8
  }
9
9
  else if ([crypto_1.Crypto.USDCPolygon, crypto_1.Crypto.USDTPolygon].includes(crypto)) {
10
10
  return `https://polygonscan.com/tx/${hash}`;
11
11
  }
12
- else if ([crypto_1.Crypto.USDCSolana].includes(crypto)) {
12
+ else if ([crypto_1.Crypto.USDCSolana, crypto_1.Crypto.EURCSolana].includes(crypto)) {
13
13
  return `https://explorer.solana.com/tx/${hash}`;
14
14
  }
15
15
  else if ([crypto_1.Crypto.USDTTron].includes(crypto)) {
@@ -18,7 +18,7 @@ const formatTransactionHash = (hash, crypto) => {
18
18
  else if ([crypto_1.Crypto.USDCStellar].includes(crypto)) {
19
19
  return `https://stellar.expert/explorer/public/tx/${hash}`;
20
20
  }
21
- else if ([crypto_1.Crypto.USDCBase].includes(crypto)) {
21
+ else if ([crypto_1.Crypto.USDCBase, crypto_1.Crypto.EURCBase].includes(crypto)) {
22
22
  return `https://basescan.org/tx/${hash}`;
23
23
  }
24
24
  else {
@@ -8,6 +8,8 @@ const getAddressForTesting = (crypto) => {
8
8
  return { address: "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C" };
9
9
  case crypto_1.Crypto.USDCPolygon:
10
10
  return { address: "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C" };
11
+ case crypto_1.Crypto.EURCEthereum:
12
+ return { address: "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C" };
11
13
  case crypto_1.Crypto.USDTEthereum:
12
14
  return { address: "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C" };
13
15
  case crypto_1.Crypto.USDTPolygon:
@@ -16,6 +18,8 @@ const getAddressForTesting = (crypto) => {
16
18
  return { address: "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C" };
17
19
  case crypto_1.Crypto.USDCSolana:
18
20
  return { address: "5BZDQjWad45rT1vYT5KdJHgSU4rWXL1Y5nDoTwSrT8Pr" };
21
+ case crypto_1.Crypto.EURCSolana:
22
+ return { address: "5BZDQjWad45rT1vYT5KdJHgSU4rWXL1Y5nDoTwSrT8Pr" };
19
23
  case crypto_1.Crypto.USDTTron:
20
24
  return { address: "TS9kzAVq4PR7xNoQDJXSP6Kgi8GFbwUbzg" };
21
25
  case crypto_1.Crypto.USDCStellar:
@@ -25,6 +29,8 @@ const getAddressForTesting = (crypto) => {
25
29
  };
26
30
  case crypto_1.Crypto.USDCBase:
27
31
  return { address: "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C" };
32
+ case crypto_1.Crypto.EURCBase:
33
+ return { address: "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C" };
28
34
  default:
29
35
  throw new Error(`Unsupported crypto: ${crypto}`);
30
36
  }
@@ -10,7 +10,7 @@ const isValidCryptoAddress = (address, crypto) => {
10
10
  switch (crypto) {
11
11
  case crypto_1.Crypto.BTC:
12
12
  return bitcoinPattern.test(address);
13
- case crypto_1.Crypto.SOL:
13
+ case crypto_1.Crypto.SOL || crypto_1.Crypto.USDCSolana || crypto_1.Crypto.EURCSolana:
14
14
  return solanaPattern.test(address);
15
15
  case crypto_1.Crypto.USDCStellar:
16
16
  return stellarPattern.test(address);
@@ -19,9 +19,11 @@ const isValidCryptoAddress = (address, crypto) => {
19
19
  crypto_1.Crypto.USDC ||
20
20
  crypto_1.Crypto.USDCPolygon ||
21
21
  crypto_1.Crypto.USDCBase ||
22
+ crypto_1.Crypto.EURCBase ||
22
23
  crypto_1.Crypto.USDTTron ||
23
24
  crypto_1.Crypto.USDTPolygon ||
24
- crypto_1.Crypto.USDTEthereum:
25
+ crypto_1.Crypto.USDTEthereum ||
26
+ crypto_1.Crypto.EURCEthereum:
25
27
  return ethereumPattern.test(address);
26
28
  default:
27
29
  return false;
@@ -0,0 +1,5 @@
1
+ export declare enum BaseMarket {
2
+ USDC_MXN = "USDC_MXN",
3
+ USDC_PEN = "USDC_PEN",
4
+ EURC_USDC = "EURC_USDC"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseMarket = void 0;
4
+ var BaseMarket;
5
+ (function (BaseMarket) {
6
+ BaseMarket["USDC_MXN"] = "USDC_MXN";
7
+ BaseMarket["USDC_PEN"] = "USDC_PEN";
8
+ BaseMarket["EURC_USDC"] = "EURC_USDC";
9
+ })(BaseMarket = exports.BaseMarket || (exports.BaseMarket = {}));
@@ -8,6 +8,9 @@ export declare enum Crypto {
8
8
  USDCSolana = "SOL_USDC_PTHX",
9
9
  USDCStellar = "XLM_USDC_5F3T",
10
10
  USDCBase = "USDC_BASECHAIN_ETH_5I5C",
11
+ EURCEthereum = "EUROC_ETH_F5NG",
12
+ EURCSolana = "EURC_SOL",
13
+ EURCBase = "EURC_B609K9QB_Y213",
11
14
  USDTPolygon = "USDT_POLYGON",
12
15
  USDTEthereum = "USDT_ERC20",
13
16
  USDTTron = "TRX_USDT_S2UZ",
@@ -12,6 +12,9 @@ var Crypto;
12
12
  Crypto["USDCSolana"] = "SOL_USDC_PTHX";
13
13
  Crypto["USDCStellar"] = "XLM_USDC_5F3T";
14
14
  Crypto["USDCBase"] = "USDC_BASECHAIN_ETH_5I5C";
15
+ Crypto["EURCEthereum"] = "EUROC_ETH_F5NG";
16
+ Crypto["EURCSolana"] = "EURC_SOL";
17
+ Crypto["EURCBase"] = "EURC_B609K9QB_Y213";
15
18
  Crypto["USDTPolygon"] = "USDT_POLYGON";
16
19
  Crypto["USDTEthereum"] = "USDT_ERC20";
17
20
  Crypto["USDTTron"] = "TRX_USDT_S2UZ";
@@ -12,6 +12,7 @@ import { OrderAttribute } from "./order-attribute";
12
12
  import { DeferredPaymentType } from "./deferred-payment-type";
13
13
  import { TwoWaySettlementType } from "./two-way-settlement-type";
14
14
  import { OrderType } from "./order-type";
15
+ import { BaseMarket } from "./base-market";
15
16
  export interface Order {
16
17
  id: string;
17
18
  clientReferenceId?: string;
@@ -147,5 +148,11 @@ export interface Order {
147
148
  sessionId: string;
148
149
  settlementId: string;
149
150
  };
151
+ marketPriceByBaseMarket?: {
152
+ [marketKey in BaseMarket]: number;
153
+ };
154
+ netPriceByBaseMarket?: {
155
+ [marketKey in BaseMarket]: number;
156
+ };
150
157
  version: number;
151
158
  }
@@ -10,6 +10,7 @@ import { Processor } from "./processor";
10
10
  import { Side } from "./side";
11
11
  import { TwoWaySettlementType } from "./two-way-settlement-type";
12
12
  import { OrderType } from "./order-type";
13
+ import { BaseMarket } from "./base-market";
13
14
  export interface Quote {
14
15
  id?: string;
15
16
  userId: string;
@@ -55,4 +56,10 @@ export interface Quote {
55
56
  twoWaySettlementType: TwoWaySettlementType;
56
57
  twoWaySettlementDateOffset?: number;
57
58
  effectiveTwoWaySettlementDateOffset?: number;
59
+ marketPriceByBaseMarket?: {
60
+ [marketKey in BaseMarket]: number;
61
+ };
62
+ netPriceByBaseMarket?: {
63
+ [marketKey in BaseMarket]: number;
64
+ };
58
65
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.2481",
3
+ "version": "1.0.2482",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",