forked from svanas/delphereum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb3.eth.binance.pas
43 lines (33 loc) · 1.32 KB
/
web3.eth.binance.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{******************************************************************************}
{ }
{ Delphereum }
{ }
{ Copyright(c) 2021 Stefan van As <[email protected]> }
{ Github Repository <https://github.com/svanas/delphereum> }
{ }
{ Distributed under Creative Commons NonCommercial (aka CC BY-NC) license. }
{ }
{******************************************************************************}
unit web3.eth.binance;
{$I web3.inc}
interface
uses
// web3
web3;
type
EBinance = class(EWeb3);
function endpoint(chain: TChain): string;
implementation
uses
// Delphi
System.TypInfo;
function endpoint(chain: TChain): string;
begin
if chain = BSC_main_net then
Result := 'https://bsc-dataseed.binance.org/'
else if chain = BSC_test_net then
Result := 'https://data-seed-prebsc-1-s1.binance.org:8545/'
else
raise EBinance.CreateFmt('%s not supported', [GetEnumName(TypeInfo(TChain), Ord(chain))]);
end;
end.