-
-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathweb3.eth.blocknative.pas
More file actions
31 lines (25 loc) · 748 Bytes
/
web3.eth.blocknative.pas
File metadata and controls
31 lines (25 loc) · 748 Bytes
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
unit web3.eth.blocknative;
interface
uses
// web3
web3;
function getNetwork(const chain: TChain): IResult<string>;
implementation
function getNetwork(const chain: TChain): IResult<string>;
begin
if chain = Ethereum then
Result := TResult<string>.Ok('main')
else if chain = Sepolia then
Result := TResult<string>.Ok('sepolia')
else if chain = BNB then
Result := TResult<string>.Ok('bsc-main')
else if chain = Gnosis then
Result := TResult<string>.Ok('xdai')
else if chain = Polygon then
Result := TResult<string>.Ok('matic-main')
else if chain = Fantom then
Result := TResult<string>.Ok('fantom-main')
else
Result := TResult<string>.Err(TError.Create('%s not supported', [chain.Name]));
end;
end.