This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const client: IWeb3 = TWeb3.Create( | |
| web3.eth.infura.endpoint(web3.Ethereum, INFURA_PROJECT_ID).Value | |
| ); | |
| const task = web3.eth.balancer.v2.listen( | |
| client, | |
| procedure( | |
| blockNo : BigInteger; | |
| poolId : TBytes32; | |
| tokenIn : TAddress; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const client: IWeb3 = TWeb3.Create( | |
| web3.eth.infura.endpoint(web3.Ethereum, INFURA_PROJECT_ID).Value | |
| ); | |
| web3.eth.balancer.v2.swap( | |
| client, | |
| owner, | |
| TSwapKind.GivenIn, | |
| '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC | |
| '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', // WETH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Trade on all the ETH-XXX market pairs. | |
| # Written by Stefan van As <svanas AT runbox DOT com> | |
| # Example: ./ETH-XXX-2.sh --exchange=Bittrex --price=0.05 --pushover-app-key=X --pushover-user-key=X | |
| for i in "$@" | |
| do | |
| case $i in | |
| --exchange=*) | |
| EXCHANGE="${i#*=}" | |
| shift # past argument=value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| uses | |
| // Delphi | |
| System.Classes, | |
| System.JSON, | |
| System.UITypes, | |
| // FireMonkey | |
| FMX.Controls, | |
| FMX.Controls.Presentation, | |
| FMX.Dialogs, | |
| FMX.Forms, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const client: IWeb3 = TWeb3.Create('https://<your-node-name>.quiknode.pro/<your-token>/'); | |
| web3.eth.blockNumber(client, procedure(num: BigInteger; err: IError) | |
| begin | |
| TThread.Synchronize(nil, procedure | |
| begin | |
| if Assigned(err) then | |
| MessageDlg(err.Message, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0) | |
| else | |
| MessageDlg(num.ToString, TMsgDlgType.mtInformation, [TMsgDlgBtn.mbOK], 0); | |
| end); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| web3.eth.write(Client, | |
| TPrivateKey('b5b1870957d373ef0eeffecc6e4812c0fd08f554b37b233526acc331bf1544f7'), // from private key | |
| '0x1a306890df22c0965b0b1515a8082f8301d3d18e', // to smart contract | |
| 'setNumber(uint256)', [143], | |
| procedure(rcpt: ITxReceipt; err: IError) begin end); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| web3.eth.write(Client, | |
| TPrivateKey('b5b1870957d373ef0eeffecc6e4812c0fd08f554b37b233526acc331bf1544f7'), // from private key | |
| '0x1a306890df22c0965b0b1515a8082f8301d3d18e', // to smart contract | |
| 'incrementNumber()', [], | |
| procedure(rcpt: ITxReceipt; err: IError) begin end); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var | |
| Client: IWeb3; | |
| procedure TForm1.FormCreate(Sender: TObject); | |
| begin | |
| Client := TWeb3.Create(Sepolia.SetRPC('https://sepolia.infura.io/v3/your-project-id')); | |
| end; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| web3.eth.call(Client, | |
| '0x1a306890df22c0965b0b1515a8082f8301d3d18e', | |
| 'getNumber()', [], procedure(qty: BigInteger; err: IError) | |
| begin | |
| TThread.Synchronize(nil, procedure | |
| begin | |
| if Assigned(err) then | |
| MessageDlg(err.Message, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0) | |
| else | |
| ShowMessage(qty.ToString); |
NewerOlder