npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fireflywallet-api

v1.0.4

Published

firefly wallet api

Downloads

4

Readme

firefly wallet dapp api

中文说明

Example

install

npm install fireflywallet-api --save
or
yarn add fireflywallet-api

ready

import FireFlyWallet from 'fireflywallet-api';
const FFWProxy = new FireFlyWallet();
FFWProxy.ready().then(FFW=>{
  console.log('firefly wallet api is ready')
}).catch(err=>{
  console.error(err)
})

get version of firefly wallet app

  FFWProxy.version

or

  FFWProxy.getVersion().then(version=>{
    console.log(version)
  }).catch(err=>{
    console.error(err)
  })

get platform of firefly wallet app

  FFWProxy.platform

or

  FFWProxy.getPlatform().then(platform=>{
    console.log(platform);
  }).catch(err=>{
    console.error(err);
  })

get accountID

  FFWProxy.accountID

or

  FFWProxy.getAccountID().then(accountID=>{
    console.log(accountID)
  }).catch(err=>{
    console.log(err)
  })

get accountName

  FFWProxy.accountName

or

  FFWProxy.getAccountName().then(accountName=>{
    console.log(accountName)
  }).catch(err=>{
    console.log(err)
  })

get UUID of phone(The raw data was processed with sha256)

  FFWProxy.UUID

or

  FFWProxy.getUUID().then(uuid=>{
    console.log(uuid);
  }).catch(err=>{
    console.error(err)
  })

get locale of firefly wallet app

  FFWProxy.locale

or

  FFWProxy.getLocale().then(locale=>{
    console.log(locale)
  }).catch(err=>{
    console.error(err)
  })

get horizonUrl

  FFWProxy.horizonUrl

or

  FFWProxy.getHorizonUrl().then(horizonUrl=>{
    console.log(horizonUrl)
  }).catch(err=>{
    console.error(err)
  })

get network

  FFWProxy.network

or

  FFWProxy.getNetwork().then(network=>{
    console.log(network)
    //output: "Public Global Stellar Network ; September 2015" or "Test SDF Network ; September 2015"
  }).catch(err=>{
    console.error(err)
  })

get account balance

FFWProxy.getBalances().then(balances=>{
  console.log(balances)
}).catch(err=>{
  console.error(err)
})

sign data(data is JSON type)

let data = { accountid: 'GG', time: new Date().getTime() }
FFWProxy.sign(data).then(result=>{
  console.log(result)
}).catch(err=>{
  console.error(err)
})

pay

FFWProxy.pay({
  destination: 'GCKKUWHT3ILQWWKQ3MUOCAC7LRJNLCOES7SEI6TCQVGZD4GCULO2PGNU', 
  code: 'XFF', 
  issuer: 'GAZEX2USUBMMWFRZFS77VDJYXUFLXI4ZGFPWX6TBNZCSTEQWNLFZMXFF', 
  amount: 1, 
  memo_type: 'TEXT', //see documents from stellar.org/developers
  memo: 'Hello,FFW'
}).then(data=>{
  console.log('pay success');
}).catch(err=>{
  console.error(err)
})

pathPayment

FFWProxy.pathPayment({
  destination: 'GCKKUWHT3ILQWWKQ3MUOCAC7LRJNLCOES7SEI6TCQVGZD4GCULO2PGNU', 
  code: 'XFF', 
  issuer: 'GAZEX2USUBMMWFRZFS77VDJYXUFLXI4ZGFPWX6TBNZCSTEQWNLFZMXFF', 
  amount: 1, 
  memo_type: 'TEXT', 
  memo: 'Hello,FFW'
}).then(data=>{
    console.log('pathpayment success')
  }).catch(err=>{
    console.error(err)
  })

trust

let code = 'XFF';
let issuer = 'GAZEX2USUBMMWFRZFS77VDJYXUFLXI4ZGFPWX6TBNZCSTEQWNLFZMXFF';
FFWProxy.trust(code,issuer).then(data=>{
    console.log('trust success')
  }).catch(err=>{
    console.error(err)
  })

signXDR

let xdr = 'AAAAAEpng8wi7nIqz02/1bmC4I5jzz763WoadKIWy7M5MVc3AAAAZACHjkkAAAABAAAAAAAAAAAAAAABAAAAAAAAAAoAAAALaG9tZV9kb21haW4AAAAAAQAAABBodHRwOi8vZmNoYWluLmlvAAAAAAAAAAA='
FFWProxy.signXDR(xdr,"sign XDR").then(data=>{
    console.log(`signed XDR:${data}`)
  }).catch(err=>{
    console.error(err)
  })

scan

FFWProxy.scan().then(data=>{
  console.log(`scan result: ${data}`);
}).catch(err=>{
  console.error(err)
})

share

let options = {
  message: 'share image',
  files: ['base64 of image']
}
FFWProxy.share(options).then(data=>{
  console.log('share success')
}).catch(err=>{
  console.error(err)
})

get origin object

FFWProxy.origin
//output: window.FFW

or

FFWProxy.getOrigin().then(FFW => {
  console.log(FFW)
}).catch(err => {
  console.error(err)
})

in browser

  <script src="path\to\dist\fireflywallet.min.js"></script>
  <script>
    var FFWProxy = new FireFlyWallet();
    FFWProxy.ready().then(function(FFW){
      console.log('firefly wallet is ready!')
    }).catch(function(err){
      console.error(err);
    })
  </script>