@arcblock/did
TypeScript icon, indicating that this package has built-in type declarations

1.20.15 • Public • Published

DID

styled with prettier docs Gitter

Javascript library to manipulate ArcBlock DID: https://github.com/ArcBlock/abt-did-spec

Usage

pnpm install @ocap/mcrypto @arcblock/did
const Mcrypto = require('@ocap/mcrypto');
const { fromSecretKey, fromPublicKey, fromAppDID } = require('@arcblock/did');

const { types } = Mcrypto;
const keyPair = Mcrypto.Signer.Ed25519.genKeyPair();

// Gen DID from secretKey
const address = fromSecretKey(keyPair.secretKey, {
  role: types.RoleType.ROLE_APPLICATION,
  pk: types.KeyType.ED25519,
  hash: types.HashType.SHA3,
});
console.log(`abt:did:${address}`);

// Gen DID from publicKey
const address = fromPublicKey(keyPair.publicKey, {
  role: types.RoleType.ROLE_APPLICATION,
  pk: types.KeyType.ED25519,
  hash: types.HashType.SHA3,
});
console.log(`abt:did:${address}`);

// Gen DID from appId
const seed =
  '0xa0c42a9c3ac6abf2ba6a9946ae83af18f51bf1c9fa7dacc4c92513cc4dd015834341c775dcd4c0fac73547c5662d81a9e9361a0aac604a73a321bd9103bce8af';
const appDID = 'zNKtCNqYWLYWYW3gWRA1vnRykfCBZYHZvzKr';
const userDID = fromAppDID(appDID, keyPair.publicKey, {
  role: types.RoleType.ROLE_APPLICATION,
  pk: types.KeyType.ED25519,
  hash: types.HashType.SHA3,
});
console.log(`abt:did:${userDID}`);

Documentation

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.20.154,782latest

Version History

VersionDownloads (Last 7 Days)Published
1.20.154,782
1.20.142,550
1.20.1313,987
1.20.1247
1.20.115
1.20.101
1.20.91
1.20.84
1.20.70
1.20.61
1.20.50
1.20.40
1.20.32
1.20.23
1.20.12
1.20.03
1.19.212
1.19.202
1.19.1914
1.19.181
1.19.172
1.19.162
1.19.1546
1.19.142
1.19.131
1.19.123
1.19.113
1.19.101
1.19.9740
1.19.82
1.19.73
1.19.61
1.19.51
1.19.42
1.19.31
1.19.21
1.19.12
1.19.03
1.18.1662
1.18.1652
1.18.1642
1.18.1631
1.18.162207
1.18.1613
1.18.1601
1.18.1593
1.18.1581
1.18.1573
1.18.1562
1.18.1552
1.18.1542
1.18.1532
1.18.1522
1.18.1511
1.18.1501
1.18.1492
1.18.1482
1.18.1472
1.18.1461
1.18.1451
1.18.1442
1.18.1431
1.18.1422
1.18.1402
1.18.1392
1.18.1381
1.18.1371
1.18.1362
1.18.1351
1.18.1342
1.18.1333
1.18.1322
1.18.1311
1.18.1302
1.18.1292
1.18.1282
1.18.1272
1.18.1261
1.18.1252
1.18.1242
1.18.1231
1.18.1221
1.18.1212
1.18.1202
1.18.1192
1.18.1181
1.18.1171
1.18.1161
1.18.1151
1.18.1141
1.18.1133
1.18.1122
1.18.1113
1.18.1102
1.18.1091
1.18.1081
1.18.1072
1.18.1062
1.18.1051
1.18.1043
1.18.1031
1.18.1022
1.18.1012
1.18.1001
1.18.992
1.18.981
1.18.973
1.18.961
1.18.953
1.18.942
1.18.932
1.18.922
1.18.911
1.18.901
1.18.890
1.18.880
1.18.870
1.18.860
1.18.850
1.18.840
1.18.830
1.18.820
1.18.810
1.18.800
1.18.790
1.18.781
1.18.771
1.18.760
1.18.750
1.18.740
1.18.730
1.18.720
1.18.710
1.18.700
1.18.691
1.18.680
1.18.670
1.18.660
1.18.650
1.18.640
1.18.631
1.18.620
1.18.610
1.18.601
1.18.591
1.18.580
1.18.571
1.18.561
1.18.550
1.18.540
1.18.530
1.18.520
1.18.510
1.18.501
1.18.490
1.18.480
1.18.471
1.18.461
1.18.451
1.18.441
1.18.430
1.18.420
1.18.410
1.18.400
1.18.390
1.18.380
1.18.370
1.18.360
1.18.350
1.18.340
1.18.330
1.18.320
1.18.310
1.18.302
1.18.280
1.18.271
1.18.260
1.18.251
1.18.240
1.18.230
1.18.220
1.18.211
1.18.200
1.18.190
1.18.180
1.18.171
1.18.160
1.18.150
1.18.140
1.18.131
1.18.120
1.18.111
1.18.100
1.18.90
1.18.80
1.18.70
1.18.60
1.18.51
1.18.40
1.18.30
1.18.20
1.18.10
1.18.00
1.17.230
1.17.220
1.17.210
1.17.200
1.17.190
1.17.180
1.17.170
1.17.160
1.17.150
1.17.140
1.17.130
1.17.120
1.17.110
1.17.100
1.17.90
1.17.80
1.17.70
1.17.60
1.17.50
1.17.40
1.17.30
1.17.20
1.17.10
1.17.00
1.16.170
1.16.160
1.16.150
1.16.141
1.16.131
1.16.120
1.16.100
1.6.100
1.16.91
1.16.80
1.16.71
1.16.60
1.16.50
1.16.40
1.16.30
1.16.20
1.16.10
1.16.00
1.15.71
1.15.60
1.15.50
1.15.40
1.15.30
1.15.20
1.15.10
1.15.00
1.14.251
1.14.240
1.14.231
1.14.220
1.14.210
1.14.200
1.14.190
1.14.180
1.14.170
1.14.160
1.14.151
1.14.140
1.14.131
1.14.120
1.14.111
1.14.101
1.14.90
1.14.80
1.14.72
1.14.60
1.14.51
1.14.41
1.14.30
1.14.21
1.14.10
1.14.01
1.13.860
1.13.851
1.13.840
1.13.830
1.13.820
1.13.810
1.13.800
1.13.790
1.13.780
1.13.771
1.13.760
1.13.751
1.13.740
1.13.730
1.13.720
1.13.710
1.13.700
1.13.691
1.13.680
1.13.670
1.13.660
1.13.650
1.13.640
1.13.630
1.13.620
1.13.610
1.13.600
1.13.590
1.13.581
1.13.570
1.13.561
1.13.551
1.13.540
1.13.530
1.13.521
1.13.510
1.13.500
1.13.490
1.13.480
1.13.471
1.13.460
1.13.451
1.13.441
1.13.420
1.13.410
1.13.400
1.13.391
1.13.381
1.13.371
1.13.360
1.13.350
1.13.340
1.13.330
1.13.320
1.13.310
1.13.302
1.13.290
1.13.281
1.13.271
1.13.260
1.13.250
1.13.240
1.13.230
1.13.220
1.13.210
1.13.200
1.13.190
1.13.180
1.13.170
1.13.160
1.13.150
1.13.140
1.13.130
1.13.120
1.13.111
1.13.100
1.13.90
1.13.80
1.13.70
1.13.60
1.13.50
1.13.40
1.13.30
1.13.20
1.13.10
1.13.01
1.12.91
1.12.80
1.12.71
1.12.61
1.12.50
1.12.41
1.12.30
1.12.20
1.12.12
1.12.00
1.11.201
1.11.190
1.11.180
1.11.170
1.11.160
1.11.151
1.11.140
1.11.130
1.11.120
1.11.110
1.11.101
1.11.90
1.11.81
1.11.70
1.11.60
1.11.50
1.11.40
1.11.30
1.11.20
1.11.11
1.11.00
1.10.241
1.10.231
1.10.220
1.10.211
1.10.200
1.10.190
1.10.180
1.10.170
1.10.160
1.10.150
1.10.140
1.10.130
1.10.120
1.10.110
1.10.100
1.10.91
1.10.80
1.10.70
1.10.60
1.10.50
1.10.41
1.10.31
1.10.20
1.10.10
1.10.00
1.9.210
1.9.200
1.9.190
1.9.180
1.9.170
1.9.160
1.9.150
1.9.140
1.9.131
1.9.120
1.9.110
1.9.101
1.9.91
1.9.80
1.9.70
1.9.60
1.9.51
1.9.41
1.9.30
1.9.20
1.9.10
1.9.00
1.8.420
1.8.410
1.8.401
1.8.390
1.8.380
1.8.370
1.8.360
1.8.350
1.8.342
1.8.331
1.8.320
1.8.310
1.8.301
1.8.291
1.8.280
1.8.270
1.8.260
1.8.250
1.8.240
1.8.230
1.8.220
1.8.210
1.8.200
1.8.190
1.8.181
1.8.170
1.8.160
1.8.150
1.8.140
1.8.130
1.8.121
1.8.110
1.8.100
1.8.91
1.8.80
1.8.70
1.8.61
1.8.40
1.8.30
1.8.20
1.8.10
1.8.00
1.7.100
1.7.90
1.7.81
1.7.70
1.7.60
1.7.50
1.7.40
1.7.30
1.7.20
1.7.10
1.7.00
1.6.50
1.6.40
1.6.30
1.6.20
1.6.10
1.6.00
1.5.80
1.5.70
1.5.60
1.5.51
1.5.40
1.5.31
1.5.21
1.5.10
1.5.00
1.4.80
1.4.71
1.4.60
1.4.50
1.4.41
1.4.30
1.4.20
1.4.10
1.4.00
1.3.30
1.2.130
1.2.70
1.2.60
1.0.390
1.0.381
1.0.330
1.0.310
1.0.300
1.0.30-alpha.00
1.0.29-alpha.01
1.0.28-alpha.00
1.0.230
1.0.200
1.0.170
1.0.130
1.0.90
1.0.40
1.0.10
1.0.00
0.41.01
0.40.100
0.40.91
0.40.60
0.40.52
0.40.30
0.40.00
0.39.70
0.39.30
0.39.20
0.39.11
0.39.00
0.38.103
0.38.90
0.38.81
0.38.50
0.38.41
0.38.00
0.37.00
0.36.01
0.35.20
0.35.10
0.35.00
0.34.00
0.33.10
0.33.00
0.32.20
0.32.10
0.32.00
0.31.00
0.30.00
0.29.31
0.29.20
0.29.10
0.29.00
0.28.10
0.28.00
0.27.121
0.27.110
0.27.101
0.27.61
0.27.00
0.26.101
0.26.00
0.25.20
0.25.00

Package Sidebar

Install

npm i @arcblock/did

Weekly Downloads

22,675

Version

1.20.15

License

Apache-2.0

Unpacked Size

44 kB

Total Files

15

Last publish

Collaborators

  • wangshijun
  • polunzh
  • mave99a
  • gxw