@riocrypto/common 1.0.2482 → 1.0.2483
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/build/classes/CryptoAsset.d.ts +3 -3
- package/build/classes/CryptoAsset.js +0 -9
- package/build/helpers/format-transaction-hash.js +3 -3
- package/build/helpers/get-address-for-testing.js +0 -6
- package/build/helpers/validate-address.js +2 -4
- package/build/types/crypto.d.ts +0 -3
- package/build/types/crypto.js +0 -3
- package/build/types/order.d.ts +0 -7
- package/build/types/quote.d.ts +0 -7
- package/package.json +1 -1
- package/build/types/base-market.d.ts +0 -5
- package/build/types/base-market.js +0 -9
|
@@ -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)" | "
|
|
8
|
-
getSymbol(): Crypto.
|
|
9
|
-
getGasSymbol(): Crypto.
|
|
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";
|
|
10
10
|
getDescription(): string;
|
|
11
11
|
}
|
|
@@ -74,15 +74,6 @@ 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
|
-
}
|
|
86
77
|
else if (this.rawSymbol === crypto_1.Crypto.USDTPolygon) {
|
|
87
78
|
return "USDT (Polygon)";
|
|
88
79
|
}
|
|
@@ -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
|
|
6
|
+
if ([crypto_1.Crypto.USDC, crypto_1.Crypto.USDTEthereum].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
|
|
12
|
+
else if ([crypto_1.Crypto.USDCSolana].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
|
|
21
|
+
else if ([crypto_1.Crypto.USDCBase].includes(crypto)) {
|
|
22
22
|
return `https://basescan.org/tx/${hash}`;
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
@@ -8,8 +8,6 @@ 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" };
|
|
13
11
|
case crypto_1.Crypto.USDTEthereum:
|
|
14
12
|
return { address: "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C" };
|
|
15
13
|
case crypto_1.Crypto.USDTPolygon:
|
|
@@ -18,8 +16,6 @@ const getAddressForTesting = (crypto) => {
|
|
|
18
16
|
return { address: "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C" };
|
|
19
17
|
case crypto_1.Crypto.USDCSolana:
|
|
20
18
|
return { address: "5BZDQjWad45rT1vYT5KdJHgSU4rWXL1Y5nDoTwSrT8Pr" };
|
|
21
|
-
case crypto_1.Crypto.EURCSolana:
|
|
22
|
-
return { address: "5BZDQjWad45rT1vYT5KdJHgSU4rWXL1Y5nDoTwSrT8Pr" };
|
|
23
19
|
case crypto_1.Crypto.USDTTron:
|
|
24
20
|
return { address: "TS9kzAVq4PR7xNoQDJXSP6Kgi8GFbwUbzg" };
|
|
25
21
|
case crypto_1.Crypto.USDCStellar:
|
|
@@ -29,8 +25,6 @@ const getAddressForTesting = (crypto) => {
|
|
|
29
25
|
};
|
|
30
26
|
case crypto_1.Crypto.USDCBase:
|
|
31
27
|
return { address: "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C" };
|
|
32
|
-
case crypto_1.Crypto.EURCBase:
|
|
33
|
-
return { address: "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C" };
|
|
34
28
|
default:
|
|
35
29
|
throw new Error(`Unsupported crypto: ${crypto}`);
|
|
36
30
|
}
|
|
@@ -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:
|
|
14
14
|
return solanaPattern.test(address);
|
|
15
15
|
case crypto_1.Crypto.USDCStellar:
|
|
16
16
|
return stellarPattern.test(address);
|
|
@@ -19,11 +19,9 @@ 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 ||
|
|
23
22
|
crypto_1.Crypto.USDTTron ||
|
|
24
23
|
crypto_1.Crypto.USDTPolygon ||
|
|
25
|
-
crypto_1.Crypto.USDTEthereum
|
|
26
|
-
crypto_1.Crypto.EURCEthereum:
|
|
24
|
+
crypto_1.Crypto.USDTEthereum:
|
|
27
25
|
return ethereumPattern.test(address);
|
|
28
26
|
default:
|
|
29
27
|
return false;
|
package/build/types/crypto.d.ts
CHANGED
|
@@ -8,9 +8,6 @@ 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",
|
|
14
11
|
USDTPolygon = "USDT_POLYGON",
|
|
15
12
|
USDTEthereum = "USDT_ERC20",
|
|
16
13
|
USDTTron = "TRX_USDT_S2UZ",
|
package/build/types/crypto.js
CHANGED
|
@@ -12,9 +12,6 @@ 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";
|
|
18
15
|
Crypto["USDTPolygon"] = "USDT_POLYGON";
|
|
19
16
|
Crypto["USDTEthereum"] = "USDT_ERC20";
|
|
20
17
|
Crypto["USDTTron"] = "TRX_USDT_S2UZ";
|
package/build/types/order.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ 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";
|
|
16
15
|
export interface Order {
|
|
17
16
|
id: string;
|
|
18
17
|
clientReferenceId?: string;
|
|
@@ -148,11 +147,5 @@ export interface Order {
|
|
|
148
147
|
sessionId: string;
|
|
149
148
|
settlementId: string;
|
|
150
149
|
};
|
|
151
|
-
marketPriceByBaseMarket?: {
|
|
152
|
-
[marketKey in BaseMarket]: number;
|
|
153
|
-
};
|
|
154
|
-
netPriceByBaseMarket?: {
|
|
155
|
-
[marketKey in BaseMarket]: number;
|
|
156
|
-
};
|
|
157
150
|
version: number;
|
|
158
151
|
}
|
package/build/types/quote.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ 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";
|
|
14
13
|
export interface Quote {
|
|
15
14
|
id?: string;
|
|
16
15
|
userId: string;
|
|
@@ -56,10 +55,4 @@ export interface Quote {
|
|
|
56
55
|
twoWaySettlementType: TwoWaySettlementType;
|
|
57
56
|
twoWaySettlementDateOffset?: number;
|
|
58
57
|
effectiveTwoWaySettlementDateOffset?: number;
|
|
59
|
-
marketPriceByBaseMarket?: {
|
|
60
|
-
[marketKey in BaseMarket]: number;
|
|
61
|
-
};
|
|
62
|
-
netPriceByBaseMarket?: {
|
|
63
|
-
[marketKey in BaseMarket]: number;
|
|
64
|
-
};
|
|
65
58
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
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 = {}));
|