| Feature | Web3.js | Ethers.js | Web3data.js |
|---|---|---|---|
| getHashrate | ✓ | × | ✓ |
| getGasPrice | ✓ | ✓ | ✓ |
| getAccounts | ✓ | ✓ | × |
| getBlockNumber | ✓ | ✓ | ✓ |
| getBalance | ✓ | ✓ | ✓ |
| getStorageAt | ✓ | ✓ | ✓ |
| getCode | ✓ | ✓ | ✓ |
| getBlock | ✓ | ✓ | ✓ |
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
| // File: @ensdomains/buffer/contracts/Buffer.sol | |
| pragma solidity >0.4.18; | |
| /** | |
| * @dev A library for working with mutable byte buffers in Solidity. | |
| * | |
| * Byte buffers are mutable and expandable, and provide a variety of primitives | |
| * for writing to them. At any time you can fetch a bytes object containing the |
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
| pragma solidity ^0.4.24; | |
| import './ChainlinkClient.sol'; | |
| contract AmberdataChainlink is ChainlinkClient { | |
| bytes32 constant JOB_ID = bytes32("447f3b6fac1240ab91d3679fba00baf6"); | |
| uint256 public currentPrice; | |
| constructor() public { | |
| setChainlinkToken(0x20fE562d797A42Dcb3399062AE9546cd06f63280); | |
| setChainlinkOracle(0xc99B3D447826532722E41bc36e644ba3479E4365); |
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
| require('dotenv').config(); // Load your environment variables with 'dotenv' | |
| const EthereumTx = require('ethereumjs-tx').Transaction; | |
| const { privateToAddress } = require('ethereumjs-util'); | |
| const Web3Data = require("web3data-js"); | |
| const w3d = new Web3Data(process.env.API_KEY); | |
| const TO_ADDRESS = 'YOUR_ADDRESS'; | |
| const API_KEY = 'YOUR_API_KEY'; // Need one? see amberdata.io/onboarding | |
| const PRIV_KEY = Buffer.from('YOUR_PRIVATE_KEY', 'hex'); |
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
| // We need a function that will evaluate the order that a set of tasks will be completed in. | |
| // When idle, the CPU will take the next task that has been queued with the lowest time to complete. | |
| // Tasks are queued at the moment in time given by queued_at. | |
| // Tasks will keep the CPU busy for execution_duration units of time. queued_at and execution_duration are not in a particular unit of time, | |
| // but you may consider them in seconds, milliseconds, or whatever makes sense to you. | |
| // The CPU can only execute 1 task at a time. | |
| // You can use anything from Rust's std library. |
This document provides a comprehensive overview of all examples in the Turnkey SDK repository, detailing what features each example showcases and their Turnkey package dependencies.
| Example | sdk-server | http | api-key-stamper | sdk-react | ethers | viem | solana | webauthn-stamper | sdk-browser | crypto | encoding | sdk-types | wallet-stamper | iframe-stamper | cosmjs | eip-1193-provider | indexed-db-stamper | react-wallet-kit | sdk-js | Total |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| with-ethers | ✓ | ✓ | ✓ | ✓ | 4 | |||||||||||||||
| with-viem | ✓ | ✓ | ✓ | ✓ | 4 |
OlderNewer