-
Notifications
You must be signed in to change notification settings - Fork 215
/
Copy pathmintHolder.js
51 lines (44 loc) · 1.18 KB
/
mintHolder.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// @jessie-check
import { prepareIssuerKit } from '@agoric/ertp';
/** @import {Baggage} from '@agoric/vat-data' */
/**
* NOTE: "keyword" connotes initial caps constraint, which doesn't apply here.
*
* @template {AssetKind} K
* @typedef {{
* keyword: string;
* assetKind: K;
* displayInfo: DisplayInfo;
* }} IssuerInfo<K>
*/
/**
* @template {AssetKind} K
* @param {ZCF<IssuerInfo<K>>} zcf
* @param {Baggage} baggage
*/
function provideIssuerKit(zcf, baggage) {
const { keyword, assetKind, displayInfo } = zcf.getTerms();
return prepareIssuerKit(baggage, keyword, assetKind, displayInfo);
}
/** @type {ContractMeta<typeof start>} */
export const meta = {
upgradability: 'canUpgrade',
};
harden(meta);
/**
* This contract holds one mint; it basically wraps makeIssuerKit in its own
* contract, and hence in its own vat.
*
* @template {AssetKind} K
* @param {ZCF<IssuerInfo<K>>} zcf
* @param {undefined} _privateArgs
* @param {Baggage} instanceBaggage
*/
export const start = (zcf, _privateArgs, instanceBaggage) => {
const { mint, issuer } = provideIssuerKit(zcf, instanceBaggage);
return {
publicFacet: issuer,
creatorFacet: mint,
};
};
harden(start);