Skip to content

AcoSmrkas/shake-wallet

 
 

Repository files navigation

Shake Wallet

Handshake wallet in the browser

Chrome Web Store

home

Note about wallet rescan

Shake Wallet uses the address indexer to make wallet rescan faster and more performant on our hosted infrastructure. However, this will expose all addresses related to your wallet to our backend. We do not keep any logs containing your addresses. If privacy is a concern, you may point RPC to a different hsd node (including Bob Desktop!) in settings prior to importing your wallet.

Development

Requirement

  • Node v12+

Install

npm install

Build for development

npm run build:dev

Build for production

npm run build

Build with simnet

NETWORK_TYPE=simnet npm run build:dev

Note: The extension now uses Manifest V3 and runs as a service worker. After building, load the extension from the dist/ directory in Chrome via chrome://extensions (enable Developer Mode).

Note: For regular HTTP navigation to work, you need a local Handshake resolver (like hdns or hnsd) or use a DNS provider that supports Handshake names.

Injected Shake

Shake Wallet injects a Shake object to each page, which enables apps to interact with the wallet.

Connect to Shake Wallet and get wallet info

// If Shake Wallet is locked, this will open the popup and prompt user to login
const wallet = await shake.connect();
const receiveAddress = await wallet.getAddress();
const balance = await wallet.getBalance();

Send Open

Once a name is available, a sendopen transaction starts the opening phase.

// Shake uses the same
const wallet = await shake.connect();
const tx = await wallet.sendOpen('silverhand');

Send Bid

Place a bid

Params:

Name Default Description
name Required name to bid on
amount Required amount to bid (in HNS)
lockup Required amount to lock up to blind your bid (must be greater than bid amount)
// Shake uses the same
const wallet = await shake.connect();
const tx = await wallet.sendBid('silverhand', 100, 150);

Send Reveal

Reveal a bid

Params:

Name Default Description
name Required name to reveal bid for
// Shake uses the same
const wallet = await shake.connect();
const tx = await wallet.sendReveal('silverhand');

Send Redeem

Redeem a losing bid after REVEAL period is over.

Params:

Name Default Description
name Required name to redeem bid for
// Shake uses the same
const wallet = await shake.connect();
const tx = await wallet.sendRedeem('silverhand');

Send Update

Update root zone record. First update is called a register, which will return the difference between winning bid and second highest bid.

Params:

Name Default Description
name Required name to update data for
data Required JSON-encoded resource
// Shake uses the same
const wallet = await shake.connect();
const tx = await wallet.sendUpdate('silverhand', [ 
  {
    type: "NS", 
    ns: "ns1.example.com.",
  },
]);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 84.9%
  • SCSS 10.6%
  • JavaScript 2.9%
  • HTML 1.6%