B4J Question Web3X Binance BSC network

Douglas Farias

Expert
Licensed User
Longtime User
Hi All..

First, thanks for the example!

my question is it possible to add another network (Binance BSC)?

I'm playing some NFT games, and i want to know how it works, its possible use this example to make a game?
have all functions to make a game? login (metamask), deposit, withdrawal, earn coins playing, bur

is it possible to create an example on the BSC binance network?

I'm thinking of transforming a game that we have almost ready on web b4j into NFT, but I see that almost all of the games are using the BSC network with the BNB currency. It seems that this is standard for games.

Anyone here with knowledge about it, could create an example of this using BSC network?

thank u

Network Name: Smart Chain
New RPC URL: https://bsc-dataseed.binance.org/
ChainID: 56
Symbol: BNB
Block Explorer URL: https://bscscan.com

Testnet​

Network Name: Smart Chain - Testnet
New RPC URL: https://data-seed-prebsc-1-s1.binance.org:8545/
ChainID: 97
Symbol: BNB
Block Explorer URL: https://testnet.bscscan.com
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It works:
B4X:
Sub Process_Globals
    Private Web3 As Web3X
    Private Utils As W3Utils
End Sub

Sub AppStart (Args() As String)
    Start
    StartMessageLoop '<- non ui app
End Sub

Private Sub Start
    Utils.Initialize
    Web3 = Utils.BuildWeb3Http("https://bsc-dataseed.binance.org/")
    Wait For (Web3.EthBlockNumber) Complete (Result As W3AsyncResult)
    If Result.Success Then
        Log("Block number: " & Result.Value)
    End If
    Wait For (Web3.EthChainId) Complete (Result As W3AsyncResult)
    If Result.Success Then
        Dim chainid As Long = Result.Value
        Log(chainid)
    End If
End Sub

Web3X currently supports the basic features. It doesn't yet support interacting with smart contracts. Support for smart contracts is planned.
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
It works:
B4X:
Sub Process_Globals
    Private Web3 As Web3X
    Private Utils As W3Utils
End Sub

Sub AppStart (Args() As String)
    Start
    StartMessageLoop '<- non ui app
End Sub

Private Sub Start
    Utils.Initialize
    Web3 = Utils.BuildWeb3Http("https://bsc-dataseed.binance.org/")
    Wait For (Web3.EthBlockNumber) Complete (Result As W3AsyncResult)
    If Result.Success Then
        Log("Block number: " & Result.Value)
    End If
    Wait For (Web3.EthChainId) Complete (Result As W3AsyncResult)
    If Result.Success Then
        Dim chainid As Long = Result.Value
        Log(chainid)
    End If
End Sub

Web3X currently supports the basic features. It doesn't yet support interacting with smart contracts. Support for smart contracts is planned.

wow, thank you Erel.


I know it's asking too much, but in the future could you do an example of a game? maybe already using some existing examples on the forum but using web3x?
login, deposit, withdrawal, burn coins etc...

thank u again for the binance example
 
Last edited:
Upvote 0
Top