![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@martiandao/aptos-web3.js
Advanced tools
web3.js library for Aptos
@martiandao/aptos-web3.js is an npm module which allows developers to communicate with the Aptos core code. This module is built on top of Typescript SDK of Aptos.
npm i @martiandao/aptos-web3.js
Name | Argument: [name: type] | Returns | Description |
---|---|---|---|
createWallet | None | "code": string "address key": string | This method is used to create new wallet. It returns “code” which is a secret phrase and “address key” which is public address of the wallet |
importWallet | code: string | "address key": string | This method is used to import wallet from mnemonic/secret phrase. It returns “address key” which is public address of the wallet |
airdrop | code: string amount: number | None | This method is used to add coins in the wallet. |
getBalance | address: string | balance: Integer | This method is used to get available balance of any address. It returns integer |
transfer | code: string recipient_address: string amount: number | None | This method is used to transfer fund from one account to another. It returns Nothing |
getSentEvents | address: string | Click Here | This method is used to fetch sent events done by the wallet. Please hit the url given in the returns field to see what it return |
getReceivedEvents | address: string | Click Here | This method is used to fetch received events to the wallet. Please hit the url given in the returns field to see what it return |
createNFTCollection | code: string name: string description: string uri: string | hash: string | This method is used to create collection inside the wallet/account. It returns submission hash |
createNFT | code: string collection_name: string name: string description: string supply: number uri: string | hash: string | This method is used to create nft inside collection. It returns submission hash |
offerNFT | code: string receiver_address: string creator_address: string collection_name: string token_name: string amount: number | hash: string | This method is used to offer nft to another address. |
claimNFT | code: string sender_address: string creator_address: string collection_name: string token_name: string | hash: string | This method is used to claim nft offered |
getEventStream | address: string event_handle_struct: string field_name: string | response: object | This is used to get the events |
getTokenIds | address: string | tokenIds: list of objects | This is used to get the token IDs of an account |
getEventStream | address: string | tokens: list of objects | This is used to get the tokens of an account |
rotateAuthKey | code: string new_auth_key: string | hash: string | This method is used to rotate the authentication key. The new private/ public key pair used to derive the new auth key will be used to sign the account after this function call completes |
const aptosWeb3 = require('@martiandao/aptos-web3.js');
const walletClient = new aptosWeb3.WalletClient();
async function main() {
// create new wallet (10 test tokens airdropped by default)
console.log("\n=== Wallet Creation ===");
const wallet = await walletClient.createWallet();
const address = wallet['address key'];
const signingKey = wallet['code'];
console.log('Address:', address);
console.log('Secret recovery phrase:', signingKey);
// airdrop test tokens
console.log("\n=== Airdrop ===");
await walletClient.airdrop(wallet['code'],5000);
console.log('Balance:', await walletClient.getBalance(address));
// transfer tokens
console.log("\n=== Transfer ===");
const receiver_address = "d27307a2ccf76b4694c2b8f2ddf032fd487dbc82cb32e8b264026a9aee14df8d";
await walletClient.transfer(signingKey, receiver_address, 420);
console.log('Balance:', await walletClient.getBalance(address));
// get wallet transaction history
console.log("\n=== Wallet history ===");
const received_history = await walletClient.getReceivedEvents(address);
const sent_history = await walletClient.getSentEvents(address);
console.log('Received History:', received_history);
console.log('Sent History:', sent_history);
}
main()
npm install
npm run build
Jest tests allow to test whether each function is working as it supposed to.
npm run test
FAQs
Web3 SDK For Aptos
The npm package @martiandao/aptos-web3.js receives a total of 2 weekly downloads. As such, @martiandao/aptos-web3.js popularity was classified as not popular.
We found that @martiandao/aptos-web3.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.