Skip to content

Rawbots-Inc/near-api-flutter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NEAR Flutter API

NEAR Flutter API is here to empower mobile developers to build flutter apps that connect and send transactions to the NEAR PROTOCOL Blockchain.

Currently Implemented Features

  • Genererate Keys
  • Connect Wallet With Limited or Full Access Keys
  • Send NEAR Tokens
  • Call Smart Contract methods

Sample Usage

Generate Keys

var keyPair = KeyStore.newKeyPair();

Connect Wallet

Account account = Account(accountId: accountId, keyPair: keyPair, provider: NEARTestNetRPCProvider());
var wallet = Wallet(walletURL);
wallet.connect(contractId, appTitle, signInSuccessUrl, signInFailureUrl , account.publicKey);

Send Tokens (Full Access Key)

await account.sendTokens(nearAmount, receiver);

Call Smart Contract Methods (without deposit)

Contract contract = Contract(contractId, account);
var result = await contract.callFunction(method, args);

Call Smart Contract Methods (with deposit)

var result = await contract.callFunctionWithDeposit(method, args, wallet, nearAmount, successUrl, failureUrl, approvalURL);

Call Smart Contract Methods (with deposit) using a Full Access Key

Calls with a full access key will not invoke wallets.

var result = await contract.callFunction(method, args, nearAmount);

About

NEAR Protocol API for Flutter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 100.0%