Skip to content

sidharthWeb3auth/near-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo contains some reference code to make near blockchain interactions

test.js

this file contains 4 functions:

generateImplicitAccount() : This method generates a random seedphrase and ED25519 keypair using 'near-seed-phrase' package and log the details.

createNamedAccount() : This is a sample function on how to generate a sub account for an existing near named account. eg home.sidharth.near, work.sidharth.near etc.

createAccountFromContract(): This is a sample function on how to generate an explicit account by making a contract call to near blockchain. only permits names with >=32 chars

sendTokenToId() : This function demonstrates how to initiate token transfer of near tokens.

createNewKeyForAContractWithAllowance() : Adds a new function access key for ref.finance testnet

mainnet.js

This file contains two functions and the execution takes place on near mainnet and involves real tokens. sendTokenUSDCToId() : Reference implementation on how to send USDC token from one account to another invoking a smart contract on mainnet. namedAccountWithSamePhrase() : Implementation on how to create a named account on mainnet. getAccessKeyList() : this function logs all the access keys of an account as a reference.

About

Simple script testing some near functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published