Skip to content
Tezos wallet & JS SDK powered by two-party EdDSA
TypeScript JavaScript
Branch: master
Clone or download
Pull request Compare This branch is 9 commits ahead, 8 commits behind AndrewKishino:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo
src
tests
.eslintignore
.eslintrc
.gitignore
.travis.yml
LICENSE Initial commit May 10, 2018
README.md
package.json v0.1.1 Sep 16, 2019
tsconfig.json
yarn.lock

README.md

Tezos Threshold Wallet

npm

Tezos wallet and JS SDK powered by two-party EdDSA (Ed25519).

Installation

yarn install @kzen-networks/tezos-thresh-wallet

Usage

Server (acts as the co-signer in the two-party signing protocol):

import { Ed25519Party1 } from '@kzen-networks/tezos-thresh-wallet';

new Ed25519Party1().launchServer();

Client:

import TezClient, { Ed25519Party2, Ed25519Party2Share } from '@kzen-networks/tezos-thresh-wallet';
const client = new TezClient('http://127.0.0.1:8732');

const P1_SERVER_ENDPOINT = 'http://localhost:8000';
const party2 = new Ed25519Party2(P1_SERVER_ENDPOINT);

(async () => {
  await client.importEd25519Party2(party2);  // activates two-party key generation protocol
  const address = client.party2.publicKeyHash();
  console.log(address);
  // tz1csGALMvB6sh3KJyHAMYVYVMUaucBgBDw7

  /* Now you should deposit XTZ into this address */

  console.log(await client.getBalance(address));  // in mutez (1 XTZ = 1,000,000 mutez)
  // 982974

  const { hash } = await client.transfer({
    source: address,
    to: 'tz1YaqLFe8nywjCiAF1vK1U1yns69nPQoyg1',
    amount: 10000
  });
  console.log(hash);
  // ooebvSGroFp7bma7Gicx5s2GeDT2j69m5r8z2nUMMzogYASCBzX

})();

Demo

You can also use a demo using the command line.
Server:

$ demo/server

Client:

$ demo/client --help
Usage: client [options] [command]

Options:
  -h, --help                        output usage information

Commands:
  address
  balance <address>
  transfer <from> <to> <xtz_amount>
Transfer demo

Development

yarn install
yarn run build

Built files will be located in the dist folder.

License

MIT

Credits

This work is a fork extending the work of Andrew Kishino's Sotez.

You can’t perform that action at this time.