signify-ts 0.2.1 → 0.3.0-dev.e31e78d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -34
- package/dist/exports.d.ts +40 -40
- package/dist/exports.js +40 -0
- package/dist/index.d.ts +2 -3
- package/dist/index.js +3 -8
- package/dist/keri/app/aiding.d.ts +54 -18
- package/{src/keri/app/aiding.ts → dist/keri/app/aiding.js} +130 -236
- package/dist/keri/app/clienting.d.ts +59 -22
- package/{src/keri/app/clienting.ts → dist/keri/app/clienting.js} +146 -235
- package/dist/keri/app/contacting.d.ts +30 -23
- package/{src/keri/app/contacting.ts → dist/keri/app/contacting.js} +26 -63
- package/dist/keri/app/controller.d.ts +49 -6
- package/{src/keri/app/controller.ts → dist/keri/app/controller.js} +80 -186
- package/dist/keri/app/coring.d.ts +134 -25
- package/{src/keri/app/coring.ts → dist/keri/app/coring.js} +83 -56
- package/dist/keri/app/credentialing.d.ts +187 -69
- package/dist/keri/app/credentialing.js +540 -0
- package/dist/keri/app/delegating.d.ts +18 -0
- package/dist/keri/app/delegating.js +24 -0
- package/dist/keri/app/escrowing.d.ts +5 -3
- package/{src/keri/app/escrowing.ts → dist/keri/app/escrowing.js} +3 -9
- package/dist/keri/app/exchanging.d.ts +243 -11
- package/dist/keri/app/exchanging.js +242 -0
- package/dist/keri/app/grouping.d.ts +11 -9
- package/{src/keri/app/grouping.ts → dist/keri/app/grouping.js} +10 -29
- package/dist/keri/app/habery.d.ts +2 -2
- package/dist/keri/app/habery.js +117 -0
- package/dist/keri/app/notifying.d.ts +2 -2
- package/{src/keri/app/notifying.ts → dist/keri/app/notifying.js} +7 -17
- package/dist/keri/core/authing.d.ts +2 -2
- package/{src/keri/core/authing.ts → dist/keri/core/authing.js} +26 -42
- package/dist/keri/core/base64.d.ts +2 -0
- package/dist/keri/core/base64.js +16 -0
- package/dist/keri/core/bexter.d.ts +1 -1
- package/{src/keri/core/bexter.ts → dist/keri/core/bexter.js} +18 -32
- package/dist/keri/core/cigar.d.ts +2 -2
- package/dist/keri/core/cigar.js +13 -0
- package/dist/keri/core/cipher.d.ts +1 -1
- package/{src/keri/core/cipher.ts → dist/keri/core/cipher.js} +10 -19
- package/dist/keri/core/core.d.ts +117 -9
- package/dist/keri/core/core.js +385 -0
- package/dist/keri/core/counter.d.ts +2 -2
- package/dist/keri/core/counter.js +221 -0
- package/dist/keri/core/decrypter.d.ts +4 -4
- package/{src/keri/core/decrypter.ts → dist/keri/core/decrypter.js} +23 -40
- package/dist/keri/core/diger.d.ts +3 -3
- package/{src/keri/core/diger.ts → dist/keri/core/diger.js} +18 -33
- package/dist/keri/core/encrypter.d.ts +2 -2
- package/{src/keri/core/encrypter.ts → dist/keri/core/encrypter.js} +18 -38
- package/dist/keri/core/eventing.d.ts +6 -6
- package/dist/keri/core/eventing.js +383 -0
- package/dist/keri/core/httping.d.ts +11 -4
- package/{src/keri/core/httping.ts → dist/keri/core/httping.js} +36 -101
- package/dist/keri/core/indexer.d.ts +1 -1
- package/dist/keri/core/indexer.js +407 -0
- package/dist/keri/core/keeping.d.ts +113 -46
- package/dist/keri/core/keeping.js +347 -0
- package/{src/keri/core/kering.ts → dist/keri/core/kering.js} +1 -3
- package/dist/keri/core/keyState.d.ts +98 -0
- package/dist/keri/core/manager.d.ts +147 -12
- package/dist/keri/core/manager.js +880 -0
- package/dist/keri/core/matter.d.ts +1 -1
- package/dist/keri/core/matter.js +460 -0
- package/dist/keri/core/number.d.ts +2 -2
- package/{src/keri/core/number.ts → dist/keri/core/number.js} +26 -32
- package/dist/keri/core/pather.d.ts +2 -2
- package/{src/keri/core/pather.ts → dist/keri/core/pather.js} +12 -27
- package/dist/keri/core/prefixer.d.ts +10 -10
- package/dist/keri/core/prefixer.js +182 -0
- package/dist/keri/core/saider.d.ts +2 -12
- package/dist/keri/core/saider.js +107 -0
- package/dist/keri/core/salter.d.ts +44 -9
- package/dist/keri/core/salter.js +110 -0
- package/dist/keri/core/seqner.d.ts +1 -1
- package/{src/keri/core/seqner.ts → dist/keri/core/seqner.js} +20 -21
- package/dist/keri/core/serder.d.ts +25 -12
- package/dist/keri/core/serder.js +133 -0
- package/dist/keri/core/siger.d.ts +2 -2
- package/{src/keri/core/siger.ts → dist/keri/core/siger.js} +4 -14
- package/dist/keri/core/signer.d.ts +4 -4
- package/dist/keri/core/signer.js +84 -0
- package/{src/keri/core/tholder.ts → dist/keri/core/tholder.js} +69 -94
- package/dist/keri/core/utils.d.ts +1 -1
- package/{src/keri/core/utils.ts → dist/keri/core/utils.js} +30 -60
- package/dist/keri/core/vdring.d.ts +2 -2
- package/dist/keri/core/vdring.js +61 -0
- package/dist/keri/core/verfer.d.ts +2 -6
- package/dist/keri/core/verfer.js +37 -0
- package/dist/keri/end/ending.d.ts +10 -8
- package/dist/keri/end/ending.js +136 -0
- package/{src/ready.ts → dist/ready.js} +1 -2
- package/dist/types/keria-api-schema.d.ts +1158 -0
- package/dist/types/keria-api-schema.js +34 -0
- package/package.json +53 -52
- package/dist/math.d.ts +0 -1
- package/dist/signify-ts.cjs +0 -7842
- package/dist/signify-ts.cjs.development.js +0 -9501
- package/dist/signify-ts.cjs.development.js.map +0 -1
- package/dist/signify-ts.cjs.map +0 -7
- package/dist/signify-ts.cjs.production.min.js +0 -2
- package/dist/signify-ts.cjs.production.min.js.map +0 -1
- package/dist/signify-ts.esm.js +0 -9345
- package/dist/signify-ts.esm.js.map +0 -1
- package/dist/signify-ts.mjs +0 -7818
- package/dist/signify-ts.mjs.map +0 -7
- package/src/buffer-polyfill.ts +0 -5
- package/src/exports.ts +0 -44
- package/src/index.ts +0 -4
- package/src/keri/app/credentialing.ts +0 -841
- package/src/keri/app/exchanging.ts +0 -220
- package/src/keri/app/habery.ts +0 -185
- package/src/keri/core/cigar.ts +0 -18
- package/src/keri/core/core.ts +0 -326
- package/src/keri/core/counter.ts +0 -273
- package/src/keri/core/eventing.ts +0 -581
- package/src/keri/core/indexer.ts +0 -509
- package/src/keri/core/keeping.ts +0 -684
- package/src/keri/core/manager.ts +0 -1183
- package/src/keri/core/matter.ts +0 -521
- package/src/keri/core/prefixer.ts +0 -233
- package/src/keri/core/saider.ts +0 -186
- package/src/keri/core/salter.ts +0 -120
- package/src/keri/core/serder.ts +0 -163
- package/src/keri/core/signer.ts +0 -133
- package/src/keri/core/vdring.ts +0 -94
- package/src/keri/core/verfer.ts +0 -47
- package/src/keri/end/ending.ts +0 -170
- package/src/math.ts +0 -3
- /package/dist/{buffer-polyfill.d.ts → keri/core/keyState.js} +0 -0
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { SignifyClient } from './clienting';
|
|
2
|
-
import { b, d, Dict, Ident, Ilks, Serials, versify } from '../core/core';
|
|
3
|
-
import { Serder } from '../core/serder';
|
|
4
|
-
import { nowUTC } from '../core/utils';
|
|
5
|
-
import { Pather } from '../core/pather';
|
|
6
|
-
import { Counter, CtrDex } from '../core/counter';
|
|
7
|
-
import { Saider } from '../core/saider';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Exchanges
|
|
11
|
-
*/
|
|
12
|
-
export class Exchanges {
|
|
13
|
-
client: SignifyClient;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Exchanges
|
|
17
|
-
* @param {SignifyClient} client
|
|
18
|
-
*/
|
|
19
|
-
constructor(client: SignifyClient) {
|
|
20
|
-
this.client = client;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Create exn message
|
|
25
|
-
* @async
|
|
26
|
-
* @returns {Promise<any>} A promise to the list of replay messages
|
|
27
|
-
* @param sender
|
|
28
|
-
* @param route
|
|
29
|
-
* @param payload
|
|
30
|
-
* @param embeds
|
|
31
|
-
* @param recipient
|
|
32
|
-
* @param datetime
|
|
33
|
-
* @param dig
|
|
34
|
-
*/
|
|
35
|
-
async createExchangeMessage(
|
|
36
|
-
sender: Dict<any>,
|
|
37
|
-
route: string,
|
|
38
|
-
payload: Dict<any>,
|
|
39
|
-
embeds: Dict<any>,
|
|
40
|
-
recipient?: string,
|
|
41
|
-
datetime?: string,
|
|
42
|
-
dig?: string
|
|
43
|
-
): Promise<[Serder, string[], string]> {
|
|
44
|
-
const keeper = this.client.manager!.get(sender);
|
|
45
|
-
const [exn, end] = exchange(
|
|
46
|
-
route,
|
|
47
|
-
payload,
|
|
48
|
-
sender['prefix'],
|
|
49
|
-
recipient,
|
|
50
|
-
datetime,
|
|
51
|
-
dig,
|
|
52
|
-
undefined,
|
|
53
|
-
embeds
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
const sigs = await keeper.sign(b(exn.raw));
|
|
57
|
-
return [exn, sigs, d(end)];
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Send exn messages to list of recipients
|
|
62
|
-
* @async
|
|
63
|
-
* @returns {Promise<any>} A promise to the list of replay messages
|
|
64
|
-
* @param name
|
|
65
|
-
* @param topic
|
|
66
|
-
* @param sender
|
|
67
|
-
* @param route
|
|
68
|
-
* @param payload
|
|
69
|
-
* @param embeds
|
|
70
|
-
* @param recipients
|
|
71
|
-
*/
|
|
72
|
-
async send(
|
|
73
|
-
name: string,
|
|
74
|
-
topic: string,
|
|
75
|
-
sender: Dict<any>,
|
|
76
|
-
route: string,
|
|
77
|
-
payload: Dict<any>,
|
|
78
|
-
embeds: Dict<any>,
|
|
79
|
-
recipients: string[]
|
|
80
|
-
): Promise<any> {
|
|
81
|
-
const [exn, sigs, atc] = await this.createExchangeMessage(
|
|
82
|
-
sender,
|
|
83
|
-
route,
|
|
84
|
-
payload,
|
|
85
|
-
embeds
|
|
86
|
-
);
|
|
87
|
-
return await this.sendFromEvents(
|
|
88
|
-
name,
|
|
89
|
-
topic,
|
|
90
|
-
exn,
|
|
91
|
-
sigs,
|
|
92
|
-
atc,
|
|
93
|
-
recipients
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Send exn messaget to list of recipients
|
|
99
|
-
* @async
|
|
100
|
-
* @returns {Promise<any>} A promise to the list of replay messages
|
|
101
|
-
* @param name
|
|
102
|
-
* @param topic
|
|
103
|
-
* @param exn
|
|
104
|
-
* @param sigs
|
|
105
|
-
* @param atc
|
|
106
|
-
* @param recipients
|
|
107
|
-
*/
|
|
108
|
-
async sendFromEvents(
|
|
109
|
-
name: string,
|
|
110
|
-
topic: string,
|
|
111
|
-
exn: Serder,
|
|
112
|
-
sigs: string[],
|
|
113
|
-
atc: string,
|
|
114
|
-
recipients: string[]
|
|
115
|
-
): Promise<any> {
|
|
116
|
-
const path = `/identifiers/${name}/exchanges`;
|
|
117
|
-
const method = 'POST';
|
|
118
|
-
const data: any = {
|
|
119
|
-
tpc: topic,
|
|
120
|
-
exn: exn.ked,
|
|
121
|
-
sigs: sigs,
|
|
122
|
-
atc: atc,
|
|
123
|
-
rec: recipients,
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
const res = await this.client.fetch(path, method, data);
|
|
127
|
-
return await res.json();
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Get exn message by said
|
|
132
|
-
* @async
|
|
133
|
-
* @returns A promise to the exn message
|
|
134
|
-
* @param said The said of the exn message
|
|
135
|
-
*/
|
|
136
|
-
async get(said: string): Promise<any> {
|
|
137
|
-
const path = `/exchanges/${said}`;
|
|
138
|
-
const method = 'GET';
|
|
139
|
-
const res = await this.client.fetch(path, method, null);
|
|
140
|
-
return await res.json();
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export function exchange(
|
|
145
|
-
route: string,
|
|
146
|
-
payload: Dict<any>,
|
|
147
|
-
sender: string,
|
|
148
|
-
recipient?: string,
|
|
149
|
-
date?: string,
|
|
150
|
-
dig?: string,
|
|
151
|
-
modifiers?: Dict<any>,
|
|
152
|
-
embeds?: Dict<any>
|
|
153
|
-
): [Serder, Uint8Array] {
|
|
154
|
-
const vs = versify(Ident.KERI, undefined, Serials.JSON, 0);
|
|
155
|
-
const ilk = Ilks.exn;
|
|
156
|
-
const dt =
|
|
157
|
-
date !== undefined
|
|
158
|
-
? date
|
|
159
|
-
: nowUTC().toISOString().replace('Z', '000+00:00');
|
|
160
|
-
const p = dig !== undefined ? dig : '';
|
|
161
|
-
const q = modifiers !== undefined ? modifiers : {};
|
|
162
|
-
const ems = embeds != undefined ? embeds : {};
|
|
163
|
-
|
|
164
|
-
let e = {} as Dict<any>;
|
|
165
|
-
let end = '';
|
|
166
|
-
Object.entries(ems).forEach(([key, value]) => {
|
|
167
|
-
const serder = value[0];
|
|
168
|
-
const atc = value[1];
|
|
169
|
-
e[key] = serder.ked;
|
|
170
|
-
|
|
171
|
-
if (atc == undefined) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
let pathed = '';
|
|
175
|
-
const pather = new Pather({}, undefined, ['e', key]);
|
|
176
|
-
pathed += pather.qb64;
|
|
177
|
-
pathed += atc;
|
|
178
|
-
|
|
179
|
-
const counter = new Counter({
|
|
180
|
-
code: CtrDex.PathedMaterialQuadlets,
|
|
181
|
-
count: Math.floor(pathed.length / 4),
|
|
182
|
-
});
|
|
183
|
-
end += counter.qb64;
|
|
184
|
-
end += pathed;
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
if (Object.keys(e).length > 0) {
|
|
188
|
-
e['d'] = '';
|
|
189
|
-
[, e] = Saider.saidify(e);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
const attrs = {} as Dict<any>;
|
|
193
|
-
|
|
194
|
-
if (recipient !== undefined) {
|
|
195
|
-
attrs['i'] = recipient;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
const a = {
|
|
199
|
-
...attrs,
|
|
200
|
-
...payload,
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
const _ked = {
|
|
204
|
-
v: vs,
|
|
205
|
-
t: ilk,
|
|
206
|
-
d: '',
|
|
207
|
-
i: sender,
|
|
208
|
-
p: p,
|
|
209
|
-
dt: dt,
|
|
210
|
-
r: route,
|
|
211
|
-
q: q,
|
|
212
|
-
a: a,
|
|
213
|
-
e: e,
|
|
214
|
-
};
|
|
215
|
-
const [, ked] = Saider.saidify(_ked);
|
|
216
|
-
|
|
217
|
-
const exn = new Serder(ked);
|
|
218
|
-
|
|
219
|
-
return [exn, b(end)];
|
|
220
|
-
}
|
package/src/keri/app/habery.ts
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { Algos, Manager } from '../core/manager';
|
|
2
|
-
import { MtrDex } from '../core/matter';
|
|
3
|
-
import { Salter } from '../core/salter';
|
|
4
|
-
import { Verfer } from '../core/verfer';
|
|
5
|
-
import { Diger } from '../core/diger';
|
|
6
|
-
import { incept } from '../core/eventing';
|
|
7
|
-
import { Serder } from '../core/serder';
|
|
8
|
-
|
|
9
|
-
export class TraitCodex {
|
|
10
|
-
EstOnly: string = 'EO'; // Only allow establishment events
|
|
11
|
-
DoNotDelegate: string = 'DND'; // Dot not allow delegated identifiers
|
|
12
|
-
NoBackers: string = 'NB'; // Do not allow backers
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const TraitDex = new TraitCodex();
|
|
16
|
-
|
|
17
|
-
export interface HaberyArgs {
|
|
18
|
-
name: string;
|
|
19
|
-
passcode?: string;
|
|
20
|
-
seed?: string | undefined;
|
|
21
|
-
aeid?: string | undefined;
|
|
22
|
-
pidx?: number | undefined;
|
|
23
|
-
salt?: string | undefined;
|
|
24
|
-
tier?: string | undefined;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface MakeHabArgs {
|
|
28
|
-
code?: string;
|
|
29
|
-
transferable?: boolean;
|
|
30
|
-
isith?: string;
|
|
31
|
-
icount?: number;
|
|
32
|
-
nsith?: string;
|
|
33
|
-
ncount?: number;
|
|
34
|
-
toad?: string | number;
|
|
35
|
-
wits?: Array<string>;
|
|
36
|
-
delpre?: string;
|
|
37
|
-
estOnly?: boolean;
|
|
38
|
-
DnD?: boolean;
|
|
39
|
-
data?: any;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export class Hab {
|
|
43
|
-
public name: string;
|
|
44
|
-
public serder: Serder;
|
|
45
|
-
|
|
46
|
-
constructor(name: string, icp: Serder) {
|
|
47
|
-
this.name = name;
|
|
48
|
-
this.serder = icp;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
get pre(): string {
|
|
52
|
-
return this.serder.ked['i'];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export class Habery {
|
|
57
|
-
private readonly _name: string;
|
|
58
|
-
private readonly _mgr: Manager;
|
|
59
|
-
private readonly _habs: Map<string, Hab> = new Map<string, Hab>();
|
|
60
|
-
|
|
61
|
-
constructor({ name, passcode, seed, aeid, pidx, salt }: HaberyArgs) {
|
|
62
|
-
this._name = name;
|
|
63
|
-
if (passcode != undefined && seed == undefined) {
|
|
64
|
-
if (passcode.length < 21) {
|
|
65
|
-
throw new Error('Bran (passcode seed material) too short.');
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const bran = MtrDex.Salt_128 + 'A' + passcode.substring(0, 21); // qb64 salt for seed
|
|
69
|
-
const signer = new Salter({ qb64: bran }).signer(
|
|
70
|
-
MtrDex.Ed25519_Seed,
|
|
71
|
-
false
|
|
72
|
-
);
|
|
73
|
-
seed = signer.qb64;
|
|
74
|
-
if (aeid == undefined) {
|
|
75
|
-
aeid = signer.verfer.qb64; // lest it remove encryption
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
let algo;
|
|
79
|
-
const salter =
|
|
80
|
-
salt != undefined ? new Salter({ qb64: salt }) : undefined;
|
|
81
|
-
if (salt != undefined) {
|
|
82
|
-
algo = Algos.salty;
|
|
83
|
-
} else {
|
|
84
|
-
algo = Algos.randy;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
this._mgr = new Manager({
|
|
88
|
-
seed: seed,
|
|
89
|
-
aeid: aeid,
|
|
90
|
-
pidx: pidx,
|
|
91
|
-
algo: algo,
|
|
92
|
-
salter: salter,
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
get mgr(): Manager {
|
|
97
|
-
return this._mgr;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
get habs(): Array<Hab> {
|
|
101
|
-
return Array.from(this._habs.values());
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
habByName(name: string): Hab | undefined {
|
|
105
|
-
return this._habs.get(name);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
makeHab(
|
|
109
|
-
name: string,
|
|
110
|
-
{
|
|
111
|
-
code = MtrDex.Blake3_256,
|
|
112
|
-
transferable = true,
|
|
113
|
-
isith = undefined,
|
|
114
|
-
icount = 1,
|
|
115
|
-
nsith = undefined,
|
|
116
|
-
ncount = undefined,
|
|
117
|
-
toad = undefined,
|
|
118
|
-
wits = undefined,
|
|
119
|
-
delpre = undefined,
|
|
120
|
-
estOnly = false,
|
|
121
|
-
DnD = false,
|
|
122
|
-
data = undefined,
|
|
123
|
-
}: MakeHabArgs
|
|
124
|
-
): Hab {
|
|
125
|
-
if (nsith == undefined) {
|
|
126
|
-
nsith = isith;
|
|
127
|
-
}
|
|
128
|
-
if (ncount == undefined) {
|
|
129
|
-
ncount = icount;
|
|
130
|
-
}
|
|
131
|
-
if (!transferable) {
|
|
132
|
-
ncount = 0;
|
|
133
|
-
nsith = '0';
|
|
134
|
-
code = MtrDex.Ed25519N;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
const [verfers, digers] = this._mgr.incept({
|
|
138
|
-
icount: icount,
|
|
139
|
-
ncount: ncount,
|
|
140
|
-
stem: this.name,
|
|
141
|
-
transferable: transferable,
|
|
142
|
-
temp: false,
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
icount = verfers.length;
|
|
146
|
-
ncount = digers != undefined ? digers.length : 0;
|
|
147
|
-
if (isith == undefined) {
|
|
148
|
-
isith = `${Math.max(1, Math.ceil(icount / 2)).toString(16)}`;
|
|
149
|
-
}
|
|
150
|
-
if (nsith == undefined) {
|
|
151
|
-
nsith = `${Math.max(1, Math.ceil(ncount / 2)).toString(16)}`;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const cnfg = new Array<string>();
|
|
155
|
-
if (estOnly) {
|
|
156
|
-
cnfg.push(TraitDex.EstOnly);
|
|
157
|
-
}
|
|
158
|
-
if (DnD) {
|
|
159
|
-
cnfg.push(TraitDex.DoNotDelegate);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const keys = Array.from(verfers, (verfer: Verfer) => verfer.qb64);
|
|
163
|
-
const ndigs = Array.from(digers, (diger: Diger) => diger.qb64);
|
|
164
|
-
|
|
165
|
-
const icp = incept({
|
|
166
|
-
keys,
|
|
167
|
-
isith,
|
|
168
|
-
ndigs,
|
|
169
|
-
nsith,
|
|
170
|
-
toad,
|
|
171
|
-
wits,
|
|
172
|
-
cnfg,
|
|
173
|
-
data,
|
|
174
|
-
code,
|
|
175
|
-
delpre,
|
|
176
|
-
});
|
|
177
|
-
const hab = new Hab(name, icp);
|
|
178
|
-
this._habs.set(name, hab);
|
|
179
|
-
return hab;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
get name(): string {
|
|
183
|
-
return this._name;
|
|
184
|
-
}
|
|
185
|
-
}
|
package/src/keri/core/cigar.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Verfer } from './verfer';
|
|
2
|
-
import { Matter, MatterArgs } from './matter';
|
|
3
|
-
|
|
4
|
-
export class Cigar extends Matter {
|
|
5
|
-
private _verfer: Verfer | undefined;
|
|
6
|
-
constructor({ raw, code, qb64, qb64b, qb2 }: MatterArgs, verfer?: Verfer) {
|
|
7
|
-
super({ raw, code, qb64, qb64b, qb2 });
|
|
8
|
-
this._verfer = verfer;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
get verfer(): Verfer | undefined {
|
|
12
|
-
return this._verfer;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
set verfer(verfer: Verfer | undefined) {
|
|
16
|
-
this._verfer = verfer;
|
|
17
|
-
}
|
|
18
|
-
}
|