Skip to content

Commit fd46b12

Browse files
feat: xrpl chain information (#986)
* feat: xrpl chain information * fix: explorer address * fix: xrpl icon
1 parent a1f3ced commit fd46b12

File tree

7 files changed

+36
-1
lines changed

7 files changed

+36
-1
lines changed

core/base/src/constants/chains.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const chainIdAndChainEntries = [
5252
[ 60, "Stacks" ],
5353
[ 63, "Moca" ],
5454
[ 64, "MegaETH" ],
55+
[ 66, "Xrpl" ],
5556
[ 67, "ZeroGravity" ],
5657
[ 3104, "Wormchain" ],
5758
[ 4000, "Cosmoshub" ],

core/base/src/constants/decimals.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ const nativeDecimalEntries = [
1212
["Algorand", 6],
1313
["Btc", 8],
1414
["Near", 12],
15-
["Stacks", 6]
15+
["Stacks", 6],
16+
["Xrpl", 6],
1617
] as const satisfies MapLevel<Platform, number>;
1718

1819
/** Number of decimals for the native token on a given platform */

core/base/src/constants/explorer.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,16 @@ const explorerConfig = [[
218218
}
219219
}
220220
],
221+
[
222+
"Xrpl", {
223+
name: "XRPL Explorer",
224+
baseUrl: "https://livenet.xrpl.org/",
225+
endpoints: {
226+
tx: "transactions/",
227+
account: "accounts/"
228+
}
229+
}
230+
],
221231
]], [
222232
"Testnet", [[
223233
"Ethereum", {
@@ -409,6 +419,16 @@ const explorerConfig = [[
409419
}
410420
}
411421
],
422+
[
423+
"Xrpl", {
424+
name: "XRPL Testnet Explorer",
425+
baseUrl: "https://testnet.xrpl.org/",
426+
endpoints: {
427+
tx: "transactions/",
428+
account: "accounts/"
429+
}
430+
}
431+
],
412432
]],
413433
] as const satisfies MapLevels<["Mainnet" | "Testnet", Chain, ExplorerSettings]>;
414434

core/base/src/constants/finality.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const finalityThresholds = [
6464
["Plume", 4096], // inferred from testing
6565
["Plasma", 2],
6666
["XRPLEVM", 1],
67+
["Xrpl", 0],
6768
["CreditCoin", 3],
6869
["Cosmoshub", 0],
6970
["Evmos", 0],
@@ -150,6 +151,7 @@ const blockTimeMilliseconds = [
150151
["Plume", 250],
151152
["Plasma", 1_000],
152153
["XRPLEVM", 5_000],
154+
["Xrpl", 4_000],
153155
["Seievm", 400],
154156
["CreditCoin", 15_000],
155157
["Stacks", 15_000],

core/base/src/constants/platforms.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ const platformAndChainsEntries = [[
8484
]], [
8585
"Stacks", [
8686
"Stacks"
87+
]], [
88+
"Xrpl", [
89+
"Xrpl"
8790
]]
8891
] as const satisfies MapLevel<string, RoArray<Chain>>;
8992

@@ -110,6 +113,7 @@ const platformAddressFormatEntries = [
110113
["Aptos", "hex"],
111114
["Near", "sha256"],
112115
["Stacks", "keccak256"],
116+
["Xrpl", "base58"],
113117
] as const;
114118

115119
export const platformToAddressFormat = constMap(platformAddressFormatEntries);

core/base/src/constants/rpc.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const rpcConfig = [[
4848
// ["HyperCore", "https://rpc.hyperliquid.xyz/evm"],
4949
["Plume", "https://rpc.plume.org/"],
5050
["XRPLEVM", "https://rpc.xrplevm.org/"],
51+
["Xrpl", "https://xrplcluster.com/"],
5152
["Plasma", "https://rpc.plasma.to/"],
5253
["CreditCoin", "https://mainnet3.creditcoin.network/"],
5354
["Stacks", "https://api.mainnet.hiro.so"],
@@ -97,6 +98,7 @@ const rpcConfig = [[
9798
["Fogo", "https://testnet.fogo.io"],
9899
["Plume", "https://testnet-rpc.plume.org"],
99100
["XRPLEVM", "https://rpc.testnet.xrplevm.org/"],
101+
["Xrpl", "https://s.altnet.rippletest.net:51234/"],
100102
["Plasma", "https://testnet-rpc.plasma.to"],
101103
["CreditCoin", "https://rpc.cc3-testnet.creditcoin.network"],
102104
["Stacks", "https://api.testnet.hiro.so"],

core/icons/src/constants/chainIcons.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@ export function chainToIcon(chain: Chain): string {
280280
PREFIX +
281281
"PHN2ZyB3aWR0aD0iMTQ0IiBoZWlnaHQ9IjE0NCIgdmlld0JveD0iMCAwIDE0NCAxNDQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0NCA3MS42OTkxQzE0NCAxMTkuMzA2IDExNC44NjYgMTM0LjU4MiA5OS41MTU2IDEyMC45OEM4Ni44ODA0IDEwOS44ODkgODMuMTIxMSA4Ni40NTIxIDY0LjExNiA4NC4wNDU2QzM5Ljk5NDIgODEuMDExMyAzNy45MDU3IDExMy4xMzMgMjIuMDMzNCAxMTMuMTMzQzMuNTUwNCAxMTMuMTMzIDAgODYuMjQyOCAwIDcyLjQzMTVDMCA1OC4zMDYzIDMuOTY4MDkgMzkuMDU0MiAxOS43MzYgMzkuMDU0MkMzOC4xMTQ2IDM5LjA1NDIgMzkuMTU4OCA2Ni41NzIyIDYyLjEzMiA2NS4xMDczQzg1LjAwMDcgNjMuNTM3OSA4NS40MTg0IDM0Ljg2ODkgMTAwLjI0NyAyMi42MjcxQzExMy4xOTUgMTIuMDU5MyAxNDQgMjMuNDY0MSAxNDQgNzEuNjk5MVoiIGZpbGw9IiM5N0ZDRTQiLz48L3N2Zz4="
282282
);
283+
} else if (chain === "Xrpl") {
284+
return (
285+
PREFIX +
286+
"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNzMgMjk0Ij4gIDxnIGZpbGw9IiNmZmYiIGNsaXAtcGF0aD0idXJsKCNhKSI+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