1.18.138 • Published 5 months ago

@ocap/wallet v1.18.138

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 months ago

forge-wallet

styled with prettier docs Gitter

Utility function to create and use a forge compatible wallet, the wallet is also DID compatible.

Usage

yarn add @ocap/wallet
# OR
npm i @ocap/wallet -S
const assert = require('assert');
const { fromSecretKey, WalletType, fromJSON } = require('@ocap/wallet');
const { types } = require('@ocap/mcrypto');

const sk =
  '0xD67C071B6F51D2B61180B9B1AA9BE0DD0704619F0E30453AB4A592B036EDE644E4852B7091317E3622068E62A5127D1FB0D4AE2FC50213295E10652D2F0ABFC7';
const appId = 'zNKtCNqYWLYWYW3gWRA1vnRykfCBZYHZvzKr';
const sig =
  '0x08a102851c38c072e42756c1cc70938b5499c8e9358dfe5f383823f56cdb282ffda60fcd581a02c6c673069e5afc0bf09abbe3639b61b84d64fd58ef9f083003';

const type = WalletType({
  role: types.RoleType.ROLE_APPLICATION,
  pk: types.KeyType.ED25519,
  hash: types.HashType.SHA3,
  address: types.EncodingType.BASE58,
});

const wallet = fromSecretKey(sk, type);
const message = 'data to sign';
const signature = wallet.sign(message);
assert.equal(signature, sig, 'signature should match');
assert.ok(wallet.verify(message, signature), 'signature should be verified');

const wallet2 = fromJSON(wallet.toJSON());
// Do something with wallet 2

Documentation

For full documentation, checkout https://asset-chain.netlify.com

1.18.138

5 months ago

1.18.137

5 months ago

1.18.136

6 months ago

1.18.135

7 months ago

1.18.134

7 months ago

1.18.133

7 months ago

1.18.132

8 months ago

1.18.131

8 months ago

1.18.130

8 months ago

1.18.129

8 months ago

1.18.128

8 months ago

1.18.127

8 months ago

1.18.126

9 months ago

1.18.125

9 months ago

1.18.124

9 months ago

1.18.123

10 months ago

1.18.122

10 months ago

1.18.121

11 months ago

1.18.120

11 months ago

1.18.119

11 months ago

1.18.118

11 months ago

1.18.117

11 months ago

1.18.116

11 months ago

1.18.115

12 months ago

1.18.114

1 year ago

1.18.113

1 year ago

1.18.112

1 year ago

1.18.111

1 year ago

1.18.110

1 year ago

1.18.109

1 year ago

1.18.108

1 year ago

1.18.107

1 year ago

1.18.106

1 year ago

1.18.105

1 year ago

1.18.104

1 year ago

1.18.103

1 year ago

1.18.85

2 years ago

1.18.89

2 years ago

1.18.88

2 years ago

1.18.87

2 years ago

1.18.86

2 years ago

1.18.92

1 year ago

1.18.91

2 years ago

1.18.90

2 years ago

1.18.96

1 year ago

1.18.95

1 year ago

1.18.94

1 year ago

1.18.93

1 year ago

1.18.99

1 year ago

1.18.98

1 year ago

1.18.97

1 year ago

1.18.102

1 year ago

1.18.101

1 year ago

1.18.100

1 year ago

1.18.81

2 years ago

1.18.80

2 years ago

1.18.84

2 years ago

1.18.83

2 years ago

1.18.82

2 years ago

1.18.78

2 years ago

1.18.77

2 years ago

1.18.79

2 years ago

1.18.70

2 years ago

1.18.74

2 years ago

1.18.73

2 years ago

1.18.72

2 years ago

1.18.71

2 years ago

1.18.76

2 years ago

1.18.75

2 years ago

1.18.63

2 years ago

1.18.62

2 years ago

1.18.61

2 years ago

1.18.60

2 years ago

1.18.67

2 years ago

1.18.66

2 years ago

1.18.65

2 years ago

1.18.64

2 years ago

1.18.69

2 years ago

1.18.68

2 years ago

1.18.52

2 years ago

1.18.51

2 years ago

1.18.56

2 years ago

1.18.55

2 years ago

1.18.54

2 years ago

1.18.53

2 years ago

1.18.59

2 years ago

1.18.58

2 years ago

1.18.57

2 years ago

1.18.41

2 years ago

1.18.40

2 years ago

1.18.45

2 years ago

1.18.44

2 years ago

1.18.43

2 years ago

1.18.42

2 years ago

1.18.49

2 years ago

1.18.48

2 years ago

1.18.47

2 years ago

1.18.46

2 years ago

1.18.38

2 years ago

1.18.37

2 years ago

1.18.39

2 years ago

1.18.50

2 years ago

1.18.30

2 years ago

1.18.34

2 years ago

1.18.33

2 years ago

1.18.32

2 years ago

1.18.31

2 years ago

1.18.36

2 years ago

1.18.35

2 years ago

1.18.27

2 years ago

1.18.28

2 years ago

1.18.23

2 years ago

1.18.22

2 years ago

1.18.21

2 years ago

1.18.20

2 years ago

1.18.26

2 years ago

1.18.25

2 years ago

1.18.24

2 years ago

1.18.16

2 years ago

1.18.15

2 years ago

1.18.14

2 years ago

1.18.19

2 years ago

1.18.18

2 years ago

1.18.17

2 years ago

1.18.1

2 years ago

1.18.0

2 years ago

1.18.5

2 years ago

1.18.4

2 years ago

1.18.3

2 years ago

1.18.2

2 years ago

1.18.9

2 years ago

1.18.8

2 years ago

1.18.7

2 years ago

1.18.6

2 years ago

1.17.22

2 years ago

1.17.21

2 years ago

1.17.20

3 years ago

1.17.23

2 years ago

1.18.12

2 years ago

1.18.11

2 years ago

1.18.10

2 years ago

1.18.13

2 years ago

1.17.15

3 years ago

1.17.14

3 years ago

1.17.13

3 years ago

1.17.12

3 years ago

1.17.19

3 years ago

1.17.18

3 years ago

1.17.17

3 years ago

1.17.16

3 years ago

1.16.17

3 years ago

1.16.16

3 years ago

1.17.11

3 years ago

1.17.10

3 years ago

1.17.2

3 years ago

1.17.1

3 years ago

1.17.0

3 years ago

1.17.6

3 years ago

1.17.5

3 years ago

1.17.4

3 years ago

1.17.3

3 years ago

1.17.9

3 years ago

1.17.8

3 years ago

1.17.7

3 years ago

1.16.10

3 years ago

1.16.14

3 years ago

1.16.13

3 years ago

1.16.12

3 years ago

1.16.15

3 years ago

1.16.7

3 years ago

1.16.6

3 years ago

1.16.5

3 years ago

1.16.9

3 years ago

1.16.8

3 years ago

1.6.10

3 years ago

1.15.0

3 years ago

1.15.4

3 years ago

1.15.3

3 years ago

1.15.2

3 years ago

1.15.1

3 years ago

1.15.7

3 years ago

1.15.6

3 years ago

1.15.5

3 years ago

1.16.3

3 years ago

1.16.2

3 years ago

1.16.1

3 years ago

1.16.0

3 years ago

1.16.4

3 years ago

1.14.20

3 years ago

1.14.21

3 years ago

1.14.22

3 years ago

1.14.23

3 years ago

1.14.24

3 years ago

1.14.25

3 years ago

1.13.77

3 years ago

1.13.76

3 years ago

1.13.79

3 years ago

1.13.78

3 years ago

1.13.80

3 years ago

1.13.86

3 years ago

1.13.85

3 years ago

1.13.82

3 years ago

1.13.81

3 years ago

1.13.84

3 years ago

1.13.83

3 years ago

1.14.1

3 years ago

1.14.0

3 years ago

1.14.5

3 years ago

1.14.4

3 years ago

1.14.3

3 years ago

1.14.2

3 years ago

1.14.9

3 years ago

1.14.8

3 years ago

1.14.7

3 years ago

1.14.6

3 years ago

1.14.10

3 years ago

1.14.11

3 years ago

1.14.12

3 years ago

1.14.17

3 years ago

1.14.18

3 years ago

1.14.19

3 years ago

1.14.13

3 years ago

1.14.14

3 years ago

1.14.15

3 years ago

1.14.16

3 years ago

1.13.75

3 years ago

1.13.74

3 years ago

1.13.71

3 years ago

1.13.70

3 years ago

1.13.73

3 years ago

1.13.72

3 years ago

1.13.64

3 years ago

1.13.63

3 years ago

1.13.66

3 years ago

1.13.65

3 years ago

1.13.60

3 years ago

1.13.62

3 years ago

1.13.61

3 years ago

1.13.68

3 years ago

1.13.67

3 years ago

1.13.69

3 years ago

1.13.57

3 years ago

1.13.56

3 years ago

1.13.59

3 years ago

1.13.58

3 years ago

1.13.53

3 years ago

1.13.52

3 years ago

1.13.55

3 years ago

1.13.54

3 years ago

1.13.51

3 years ago

1.13.50

3 years ago

1.13.49

3 years ago

1.13.48

3 years ago

1.13.47

3 years ago

1.13.46

3 years ago

1.13.31

3 years ago

1.13.30

3 years ago

1.13.33

3 years ago

1.13.32

3 years ago

1.13.39

3 years ago

1.13.38

3 years ago

1.13.35

3 years ago

1.13.34

3 years ago

1.13.37

3 years ago

1.13.36

3 years ago

1.13.28

3 years ago

1.13.29

3 years ago

1.13.42

3 years ago

1.13.41

3 years ago

1.13.44

3 years ago

1.13.40

3 years ago

1.13.45

3 years ago

1.13.27

4 years ago

1.13.26

4 years ago

1.13.25

4 years ago

1.13.22

4 years ago

1.13.24

4 years ago

1.13.23

4 years ago

1.13.21

4 years ago

1.13.20

4 years ago

1.13.19

4 years ago

1.13.18

4 years ago

1.13.17

4 years ago

1.13.16

4 years ago

1.13.15

4 years ago

1.13.14

4 years ago

1.13.13

4 years ago

1.13.11

4 years ago

1.13.12

4 years ago

1.13.9

4 years ago

1.13.10

4 years ago

1.13.6

4 years ago

1.13.8

4 years ago

1.13.7

4 years ago

1.13.5

4 years ago

1.13.4

4 years ago

1.13.2

4 years ago

1.13.1

4 years ago

1.13.0

4 years ago

1.13.3

4 years ago

1.12.9

4 years ago

1.12.8

4 years ago

1.12.7

4 years ago

1.12.6

4 years ago

1.12.5

4 years ago

1.11.20

4 years ago

1.12.3

4 years ago

1.12.2

4 years ago

1.12.1

4 years ago

1.12.0

4 years ago

1.12.4

4 years ago

1.11.19

4 years ago

1.11.18

4 years ago

1.11.16

4 years ago

1.11.17

4 years ago

1.11.15

4 years ago

1.11.14

4 years ago

1.11.13

4 years ago

1.11.12

4 years ago

1.11.10

4 years ago

1.11.11

4 years ago

1.11.9

4 years ago

1.11.8

4 years ago

1.11.7

4 years ago

1.11.6

4 years ago

1.11.5

4 years ago

1.11.4

4 years ago

1.11.3

4 years ago

1.11.2

4 years ago

1.11.1

4 years ago

1.11.0

4 years ago

1.10.24

4 years ago

1.10.22

4 years ago

1.10.23

4 years ago

1.10.21

4 years ago

1.10.20

4 years ago

1.10.9

4 years ago

1.10.8

4 years ago

1.10.7

4 years ago

1.10.15

4 years ago

1.10.16

4 years ago

1.10.13

4 years ago

1.10.14

4 years ago

1.10.11

4 years ago

1.10.12

4 years ago

1.10.10

4 years ago

1.10.19

4 years ago

1.10.17

4 years ago

1.10.18

4 years ago

1.10.6

4 years ago

1.10.5

4 years ago

1.10.4

4 years ago

1.10.3

4 years ago

1.10.2

4 years ago

1.9.21

4 years ago

1.9.20

4 years ago

1.9.19

4 years ago

1.9.18

4 years ago

1.9.17

4 years ago

1.9.16

4 years ago

1.9.15

4 years ago

1.9.14

4 years ago

1.9.13

4 years ago

1.9.12

4 years ago

1.9.11

4 years ago

1.9.10

4 years ago

1.9.9

4 years ago

1.9.8

4 years ago

1.9.7

4 years ago

1.9.6

4 years ago

1.9.5

4 years ago

1.9.4

4 years ago

1.9.3

4 years ago

1.9.2

4 years ago

1.10.1

4 years ago

1.10.0

4 years ago

1.9.1

4 years ago

1.9.0

4 years ago

1.8.42

4 years ago

1.8.40

4 years ago

1.8.41

4 years ago

1.8.39

4 years ago

1.8.38

4 years ago

1.8.37

4 years ago

1.8.36

4 years ago

1.8.32

4 years ago

1.8.33

4 years ago

1.8.34

4 years ago

1.8.35

4 years ago

1.8.31

4 years ago

1.8.30

4 years ago

1.8.24

4 years ago

1.8.25

4 years ago

1.8.26

4 years ago

1.8.27

4 years ago

1.8.28

4 years ago

1.8.29

4 years ago

1.8.23

4 years ago

1.8.22

4 years ago

1.8.20

4 years ago

1.8.21

4 years ago

1.8.19

4 years ago

1.8.18

4 years ago

1.8.17

4 years ago

1.8.14

4 years ago

1.8.15

4 years ago

1.8.16

4 years ago

1.8.13

4 years ago

1.8.9

4 years ago

1.8.10

4 years ago

1.8.11

4 years ago

1.8.12

4 years ago

1.8.8

4 years ago

1.8.7

4 years ago

1.8.6

4 years ago

1.8.4

4 years ago

1.8.2

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.7.9

4 years ago

1.7.10

4 years ago

1.7.8

4 years ago

1.7.7

4 years ago

1.7.6

4 years ago

1.7.5

4 years ago

1.8.3

4 years ago

1.7.4

4 years ago

1.7.3

4 years ago

1.7.2

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.5

4 years ago

1.6.4

4 years ago

1.6.3

4 years ago

1.6.2

4 years ago

1.6.1

4 years ago