@imfact/account-abstraction 1.0.0

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.
Files changed (205) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +115 -0
  3. package/dist/alias/hint/authdid.d.ts +26 -0
  4. package/dist/alias/hint/credential.d.ts +21 -0
  5. package/dist/alias/hint/currency.d.ts +63 -0
  6. package/dist/alias/hint/dao.d.ts +50 -0
  7. package/dist/alias/hint/did.d.ts +26 -0
  8. package/dist/alias/hint/index.d.ts +91 -0
  9. package/dist/alias/hint/kyc.d.ts +27 -0
  10. package/dist/alias/hint/nft.d.ts +39 -0
  11. package/dist/alias/hint/point.d.ts +27 -0
  12. package/dist/alias/hint/prescription.d.ts +15 -0
  13. package/dist/alias/hint/sto.d.ts +37 -0
  14. package/dist/alias/hint/storage.d.ts +19 -0
  15. package/dist/alias/hint/timestamp.d.ts +11 -0
  16. package/dist/alias/hint/token.d.ts +27 -0
  17. package/dist/alias/index.d.ts +3 -0
  18. package/dist/alias/suffix.d.ts +14 -0
  19. package/dist/api/account.d.ts +8 -0
  20. package/dist/api/block.d.ts +10 -0
  21. package/dist/api/index.d.ts +55 -0
  22. package/dist/api/models/authdid.d.ts +10 -0
  23. package/dist/api/models/credential.d.ts +14 -0
  24. package/dist/api/models/currency.d.ts +8 -0
  25. package/dist/api/models/dao.d.ts +14 -0
  26. package/dist/api/models/did.d.ts +10 -0
  27. package/dist/api/models/dmile.d.ts +10 -0
  28. package/dist/api/models/index.d.ts +14 -0
  29. package/dist/api/models/kyc.d.ts +2 -0
  30. package/dist/api/models/nft.d.ts +15 -0
  31. package/dist/api/models/point.d.ts +8 -0
  32. package/dist/api/models/prescription.d.ts +8 -0
  33. package/dist/api/models/sto.d.ts +16 -0
  34. package/dist/api/models/storage.d.ts +10 -0
  35. package/dist/api/models/timestamp.d.ts +9 -0
  36. package/dist/api/models/token.d.ts +8 -0
  37. package/dist/api/node.d.ts +5 -0
  38. package/dist/api/operation.d.ts +19 -0
  39. package/dist/bundle.cjs.cjs +5110 -0
  40. package/dist/bundle.esm.mjs +5094 -0
  41. package/dist/common/amount.d.ts +19 -0
  42. package/dist/common/hint.d.ts +6 -0
  43. package/dist/common/id.d.ts +14 -0
  44. package/dist/common/index.d.ts +5 -0
  45. package/dist/common/token.d.ts +9 -0
  46. package/dist/error/assert.d.ts +50 -0
  47. package/dist/error/code.d.ts +285 -0
  48. package/dist/error/index.d.ts +3 -0
  49. package/dist/index.d.ts +60 -0
  50. package/dist/key/address.d.ts +25 -0
  51. package/dist/key/index.d.ts +97 -0
  52. package/dist/key/keypair.d.ts +46 -0
  53. package/dist/key/pub.d.ts +35 -0
  54. package/dist/key/random.d.ts +7 -0
  55. package/dist/key/types.d.ts +16 -0
  56. package/dist/node/config.d.ts +47 -0
  57. package/dist/node/index.d.ts +101 -0
  58. package/dist/operation/accountAbstraction/index.d.ts +42 -0
  59. package/dist/operation/authdid/create-did.d.ts +16 -0
  60. package/dist/operation/authdid/document.d.ts +52 -0
  61. package/dist/operation/authdid/fact.d.ts +11 -0
  62. package/dist/operation/authdid/index.d.ts +143 -0
  63. package/dist/operation/authdid/register-model.d.ts +12 -0
  64. package/dist/operation/authdid/update_did_document.d.ts +14 -0
  65. package/dist/operation/base/fact.d.ts +36 -0
  66. package/dist/operation/base/factsign.d.ts +22 -0
  67. package/dist/operation/base/generator.d.ts +4 -0
  68. package/dist/operation/base/index.d.ts +8 -0
  69. package/dist/operation/base/item.d.ts +9 -0
  70. package/dist/operation/base/operation.d.ts +28 -0
  71. package/dist/operation/base/userOperation.d.ts +71 -0
  72. package/dist/operation/credential/add-template.d.ts +21 -0
  73. package/dist/operation/credential/assign.d.ts +20 -0
  74. package/dist/operation/credential/create-service.d.ts +9 -0
  75. package/dist/operation/credential/index.d.ts +184 -0
  76. package/dist/operation/credential/issue.d.ts +20 -0
  77. package/dist/operation/credential/item.d.ts +16 -0
  78. package/dist/operation/credential/register-model.d.ts +9 -0
  79. package/dist/operation/credential/revoke.d.ts +14 -0
  80. package/dist/operation/currency/create-account.d.ts +17 -0
  81. package/dist/operation/currency/create-contract-account.d.ts +17 -0
  82. package/dist/operation/currency/currency-design.d.ts +52 -0
  83. package/dist/operation/currency/index.d.ts +389 -0
  84. package/dist/operation/currency/item.d.ts +8 -0
  85. package/dist/operation/currency/mint.d.ts +20 -0
  86. package/dist/operation/currency/register-currency.d.ts +10 -0
  87. package/dist/operation/currency/transfer.d.ts +17 -0
  88. package/dist/operation/currency/update-currency.d.ts +12 -0
  89. package/dist/operation/currency/update-handler.d.ts +14 -0
  90. package/dist/operation/currency/update-key.d.ts +13 -0
  91. package/dist/operation/currency/update-operator.d.ts +14 -0
  92. package/dist/operation/currency/update-recipient.d.ts +14 -0
  93. package/dist/operation/currency/withdraw.d.ts +17 -0
  94. package/dist/operation/dao/cancel-proposal.d.ts +9 -0
  95. package/dist/operation/dao/create-dao.d.ts +13 -0
  96. package/dist/operation/dao/execute.d.ts +9 -0
  97. package/dist/operation/dao/fact.d.ts +10 -0
  98. package/dist/operation/dao/index.d.ts +249 -0
  99. package/dist/operation/dao/policy.d.ts +22 -0
  100. package/dist/operation/dao/post-snap.d.ts +9 -0
  101. package/dist/operation/dao/pre-snap.d.ts +9 -0
  102. package/dist/operation/dao/proposal.d.ts +48 -0
  103. package/dist/operation/dao/propose.d.ts +13 -0
  104. package/dist/operation/dao/register-model.d.ts +13 -0
  105. package/dist/operation/dao/register.d.ts +12 -0
  106. package/dist/operation/dao/update-model-config.d.ts +13 -0
  107. package/dist/operation/dao/update-policy.d.ts +13 -0
  108. package/dist/operation/dao/vote.d.ts +13 -0
  109. package/dist/operation/dao/whitelist.d.ts +11 -0
  110. package/dist/operation/did/create-did.d.ts +16 -0
  111. package/dist/operation/did/deactive-did.d.ts +12 -0
  112. package/dist/operation/did/document.d.ts +52 -0
  113. package/dist/operation/did/fact.d.ts +11 -0
  114. package/dist/operation/did/index.d.ts +116 -0
  115. package/dist/operation/did/migrate-did.d.ts +21 -0
  116. package/dist/operation/did/reactive-did.d.ts +12 -0
  117. package/dist/operation/did/register-model.d.ts +12 -0
  118. package/dist/operation/did/update_did_document.d.ts +14 -0
  119. package/dist/operation/index.d.ts +129 -0
  120. package/dist/operation/kyc/add-controller.d.ts +17 -0
  121. package/dist/operation/kyc/add-customer.d.ts +18 -0
  122. package/dist/operation/kyc/create-service.d.ts +9 -0
  123. package/dist/operation/kyc/index.d.ts +17 -0
  124. package/dist/operation/kyc/item.d.ts +13 -0
  125. package/dist/operation/kyc/remove-controller.d.ts +17 -0
  126. package/dist/operation/kyc/update-customer.d.ts +18 -0
  127. package/dist/operation/nft/add-signature.d.ts +16 -0
  128. package/dist/operation/nft/approve-all.d.ts +18 -0
  129. package/dist/operation/nft/approve.d.ts +18 -0
  130. package/dist/operation/nft/create-collection.d.ts +15 -0
  131. package/dist/operation/nft/delegate.d.ts +18 -0
  132. package/dist/operation/nft/index.d.ts +226 -0
  133. package/dist/operation/nft/item.d.ts +13 -0
  134. package/dist/operation/nft/mint.d.ts +20 -0
  135. package/dist/operation/nft/register-model.d.ts +15 -0
  136. package/dist/operation/nft/sign.d.ts +16 -0
  137. package/dist/operation/nft/signer.d.ts +20 -0
  138. package/dist/operation/nft/transfer.d.ts +18 -0
  139. package/dist/operation/nft/update-collection-policy.d.ts +15 -0
  140. package/dist/operation/nft/update-model-config.d.ts +15 -0
  141. package/dist/operation/point/approve.d.ts +14 -0
  142. package/dist/operation/point/burn.d.ts +14 -0
  143. package/dist/operation/point/fact.d.ts +9 -0
  144. package/dist/operation/point/index.d.ts +105 -0
  145. package/dist/operation/point/mint.d.ts +14 -0
  146. package/dist/operation/point/register-model.d.ts +16 -0
  147. package/dist/operation/point/register-point.d.ts +15 -0
  148. package/dist/operation/point/transfer-from.d.ts +15 -0
  149. package/dist/operation/point/transfer.d.ts +14 -0
  150. package/dist/operation/prescription/fact.d.ts +11 -0
  151. package/dist/operation/prescription/index.d.ts +65 -0
  152. package/dist/operation/prescription/register-prescription.d.ts +15 -0
  153. package/dist/operation/prescription/resgister-model.d.ts +10 -0
  154. package/dist/operation/prescription/use-prescription.d.ts +14 -0
  155. package/dist/operation/signer.d.ts +18 -0
  156. package/dist/operation/sto/authorize-operator.d.ts +19 -0
  157. package/dist/operation/sto/create-security-token.d.ts +18 -0
  158. package/dist/operation/sto/index.d.ts +154 -0
  159. package/dist/operation/sto/issue-sercurity-token.d.ts +19 -0
  160. package/dist/operation/sto/issue.d.ts +19 -0
  161. package/dist/operation/sto/item.d.ts +13 -0
  162. package/dist/operation/sto/partition.d.ts +9 -0
  163. package/dist/operation/sto/redeem-token.d.ts +20 -0
  164. package/dist/operation/sto/redeem.d.ts +20 -0
  165. package/dist/operation/sto/revoke-operator.d.ts +19 -0
  166. package/dist/operation/sto/set-document.d.ts +13 -0
  167. package/dist/operation/sto/transfer-by-partition.d.ts +21 -0
  168. package/dist/operation/sto/transfer-security-token-partition.d.ts +21 -0
  169. package/dist/operation/storage/create-data.d.ts +13 -0
  170. package/dist/operation/storage/delete-data.d.ts +12 -0
  171. package/dist/operation/storage/fact.d.ts +11 -0
  172. package/dist/operation/storage/index.d.ts +94 -0
  173. package/dist/operation/storage/resgister-model.d.ts +12 -0
  174. package/dist/operation/storage/update-data.d.ts +13 -0
  175. package/dist/operation/timestamp/append.d.ts +15 -0
  176. package/dist/operation/timestamp/create-service.d.ts +9 -0
  177. package/dist/operation/timestamp/fact.d.ts +9 -0
  178. package/dist/operation/timestamp/index.d.ts +52 -0
  179. package/dist/operation/timestamp/issue.d.ts +15 -0
  180. package/dist/operation/timestamp/resgister-model.d.ts +9 -0
  181. package/dist/operation/token/approve.d.ts +14 -0
  182. package/dist/operation/token/burn.d.ts +14 -0
  183. package/dist/operation/token/fact.d.ts +9 -0
  184. package/dist/operation/token/index.d.ts +105 -0
  185. package/dist/operation/token/mint.d.ts +14 -0
  186. package/dist/operation/token/register-model.d.ts +16 -0
  187. package/dist/operation/token/register-token.d.ts +15 -0
  188. package/dist/operation/token/transfer-from.d.ts +15 -0
  189. package/dist/operation/token/transfer.d.ts +14 -0
  190. package/dist/types/generator.d.ts +13 -0
  191. package/dist/types/index.d.ts +7 -0
  192. package/dist/types/interface.d.ts +26 -0
  193. package/dist/types/math.d.ts +36 -0
  194. package/dist/types/string.d.ts +20 -0
  195. package/dist/types/time.d.ts +20 -0
  196. package/dist/utils/apiPathUtils.d.ts +4 -0
  197. package/dist/utils/contractUtils.d.ts +5 -0
  198. package/dist/utils/converter.d.ts +3 -0
  199. package/dist/utils/duplicate.d.ts +2 -0
  200. package/dist/utils/hash.d.ts +7 -0
  201. package/dist/utils/index.d.ts +5 -0
  202. package/dist/utils/sort.d.ts +2 -0
  203. package/dist/utils/transformUnit.d.ts +50 -0
  204. package/dist/utils/typeGuard.d.ts +12 -0
  205. package/package.json +60 -0
@@ -0,0 +1,21 @@
1
+ /// <reference types="node" />
2
+ import { ContractFact, FactJson } from "../base";
3
+ import { Address } from "../../key";
4
+ import { CurrencyID } from "../../common";
5
+ import { Bool, ShortDate } from "../../types";
6
+ export declare class AddTemplateFact extends ContractFact {
7
+ readonly templateID: string;
8
+ readonly templateName: string;
9
+ readonly serviceDate: ShortDate;
10
+ readonly expirationDate: ShortDate;
11
+ readonly templateShare: Bool;
12
+ readonly multiAudit: Bool;
13
+ readonly displayName: string;
14
+ readonly subjectKey: string;
15
+ readonly description: string;
16
+ readonly creator: Address;
17
+ constructor(token: string, sender: string | Address, contract: string | Address, templateID: string, templateName: string, serviceDate: string | ShortDate, expirationDate: string | ShortDate, templateShare: boolean | Bool, multiAudit: boolean | Bool, displayName: string, subjectKey: string, description: string, creator: string | Address, currency: string | CurrencyID);
18
+ toBuffer(): Buffer;
19
+ toHintedObject(): FactJson;
20
+ get operationHint(): string;
21
+ }
@@ -0,0 +1,20 @@
1
+ /// <reference types="node" />
2
+ import { OperationFact } from "../base";
3
+ import { CredentialItem } from "./item";
4
+ import { Address } from "../../key";
5
+ import { CurrencyID } from "../../common";
6
+ import { Big, HintedObject } from "../../types";
7
+ export declare class AssignItem extends CredentialItem {
8
+ readonly value: string;
9
+ readonly validFrom: Big;
10
+ readonly validUntil: Big;
11
+ readonly did: string;
12
+ constructor(contract: string | Address, holder: string | Address, templateID: string, id: string, value: string, validFrom: string | number | Big, validUntil: string | number | Big, did: string, currency: string | CurrencyID);
13
+ toBuffer(): Buffer;
14
+ toHintedObject(): HintedObject;
15
+ toString(): string;
16
+ }
17
+ export declare class AssignFact extends OperationFact<AssignItem> {
18
+ constructor(token: string, sender: string | Address, items: AssignItem[]);
19
+ get operationHint(): string;
20
+ }
@@ -0,0 +1,9 @@
1
+ /// <reference types="node" />
2
+ import { Address } from "../../key";
3
+ import { ContractFact } from "../base";
4
+ import { CurrencyID } from "../../common";
5
+ export declare class CreateServiceFact extends ContractFact {
6
+ constructor(token: string, sender: string | Address, contract: string | Address, currency: string | CurrencyID);
7
+ toBuffer(): Buffer;
8
+ get operationHint(): string;
9
+ }
@@ -0,0 +1,184 @@
1
+ import { RegisterModelFact } from "./register-model";
2
+ import { AddTemplateFact } from "./add-template";
3
+ import { IssueFact } from "./issue";
4
+ import { RevokeFact } from "./revoke";
5
+ import { ContractGenerator, Operation } from "../base";
6
+ import { Address } from "../../key";
7
+ import { CurrencyID } from "../../common";
8
+ import { Big, Bool, IP, ShortDate } from "../../types";
9
+ type templateData = {
10
+ templateID: string;
11
+ templateName: string;
12
+ serviceDate: string | ShortDate;
13
+ expirationDate: string | ShortDate;
14
+ templateShare: boolean | Bool;
15
+ multiAudit: boolean | Bool;
16
+ displayName: string;
17
+ subjectKey: string;
18
+ description: string;
19
+ creator: string | Address;
20
+ };
21
+ type issueData = {
22
+ holder: string | Address;
23
+ templateID: string;
24
+ credentialID: string;
25
+ value: string;
26
+ validFrom: string | number | Big;
27
+ validUntil: string | number | Big;
28
+ did: string;
29
+ };
30
+ export declare class Credential extends ContractGenerator {
31
+ constructor(networkID: string, api?: string | IP, delegateIP?: string | IP);
32
+ /**
33
+ * Generate a `register-model` operation to register new credential model on the contract.
34
+ * @param {string | Address} [contract] - The contract's address.
35
+ * @param {string | Address} [sender] - The sender's address.
36
+ * @param {string | CurrencyID} [currency] - The currency ID.
37
+ * @returns `register-model` operation.
38
+ */
39
+ registerModel(contract: string | Address, sender: string | Address, currency: string | CurrencyID): Operation<RegisterModelFact>;
40
+ /**
41
+ * Generate an `add-template` operation for adding a new credential template to the credential service.
42
+ * @param {string | Address} [contract] - The contract's address.
43
+ * @param {string | Address} [sender] - The sender's address.
44
+ * @param {templateData} [data] - The template data to be added. The properties of `templateData` include:
45
+ * - {string} `templateID` - The ID of the template.
46
+ * - {string} `templateName` - The name of the template.
47
+ * - {string | ShortDate} `serviceDate` - The service date.
48
+ * - {string | ShortDate} `expirationDate` - The expiration date.
49
+ * - {boolean | Bool} `templateShare` - Indicates whether the template is shareable.
50
+ * - {boolean | Bool} `multiAudit` - Indicates whether multi-audit is enabled.
51
+ * - {string} `displayName` - The display name of the template.
52
+ * - {string} `subjectKey` - The subject key of the template.
53
+ * - {string} `description` - The description of the template.
54
+ * - {string | Address} `creator` - The address of the creator of the template.
55
+ * @param {string | CurrencyID} [currency] - The currency ID.
56
+ * @returns An `add-template` operation.
57
+ */
58
+ addTemplate(contract: string | Address, sender: string | Address, data: templateData, currency: string | CurrencyID): Operation<AddTemplateFact>;
59
+ /**
60
+ * Generate an `issue` operation for issue credential to holder.
61
+ * @param {string | Address} [contract] - The contract's address.
62
+ * @param {string | Address} [sender] - The sender's address.
63
+ * @param {issueData} [data] - The data required for issuing the credential. The properties of `issueData` include:
64
+ * - {string | Address} `holder` - The address of the credential holder.
65
+ * - {string} `templateID` - The ID of the template.
66
+ * - {string} `credentialID` - The ID of the credential.
67
+ * - {string} `value` - The value of the credential.
68
+ * - {string | number | Big} `validFrom` - The timestamp for validFrom.
69
+ * - {string | number | Big} `validUntil` - The timestamp for validUntil.
70
+ * - {string} `did` - The Decentralized Identifier (DID) associated with the credential.
71
+ * @param {string | CurrencyID} [currency] - The currency ID.
72
+ * @returns `issue` operation.
73
+ */
74
+ issue(contract: string | Address, sender: string | Address, data: issueData, currency: string | CurrencyID): Operation<IssueFact>;
75
+ /**
76
+ * Generate an `revoke` operation to revoke already issued credential.
77
+ * @param {string | Address} contract - The contract's address.
78
+ * @param {string | Address} sender - The sender's address.
79
+ * @param {string | Address} holder - The holder's address of the credential to be revoked.
80
+ * @param {string} templateID - The ID of the template associated with the credential.
81
+ * @param {string} credentialID - The ID of the credential to be revoked.
82
+ * @param {string | CurrencyID} currency - The currency ID.
83
+ * @returns `revoke` operation.
84
+ */
85
+ revoke(contract: string | Address, sender: string | Address, holder: string | Address, templateID: string, credentialID: string, currency: string | CurrencyID): Operation<RevokeFact>;
86
+ /**
87
+ * Get information about a credential model on the contract.
88
+ * @async
89
+ * @param {string | Address} [contract] - The contract's address.
90
+ * @returns `data` of `SuccessResponse` is credential service information:
91
+ * - `_hint`: Hint for credential design,
92
+ * - `policy`:
93
+ * - - `_hint`: Hint for credential policy,
94
+ * - - `templates`: Array of name of templates,
95
+ * - - `holders`: Array of holder object
96
+ * - - - `_hint`: Hint for holder,
97
+ * - - - `address`: Address of holder,
98
+ * - - - `credential_count`: The number of credential for the holder
99
+ * - - `credential_count`: The total number of credential
100
+ */
101
+ getModelInfo(contract: string | Address): Promise<import("../../types").SuccessResponse | import("../../types").ErrorResponse>;
102
+ /**
103
+ * Get detailed information about a specific credential on the template.
104
+ * @async
105
+ * @param {string | Address} [contract] - The contract's address.
106
+ * @param {string} [templateID] - The ID of the template associated with the credential.
107
+ * @param {string} [credentialID] - The unique ID of the credential.
108
+ * @returns `data` of `SuccessResponse` is credential information:
109
+ * - `credential`:
110
+ * - - `_hint`: Hint for credential,
111
+ * - - `holder`: Address of holder,
112
+ * - - `template_id`: The id for the template,
113
+ * - - `credential_id`: The id for the credential,
114
+ * - - `value`: The value of credential,
115
+ * - - `valid_from`: The timestamp for valid_from,
116
+ * - - `valid_until`: The timestamp for valid_until,
117
+ * - - `did`: The name of the credential,
118
+ * - `is_active`: Indicates whether the credential is active or revoked
119
+ */
120
+ getCredential(contract: string | Address, templateID: string, credentialID: string): Promise<import("../../types").SuccessResponse | import("../../types").ErrorResponse>;
121
+ /**
122
+ * Get information about a specific template on the credential service.
123
+ * @async
124
+ * @param {string | Address} [contract] - The contract's address.
125
+ * @param {string} [templateID] - The ID of the template.
126
+ * @returns `data` of `SuccessResponse` is template information:
127
+ * - `_hint`: Hint for credential template,
128
+ * - `template_id`: The ID of the template.- `template_name`: Name for template,
129
+ * - `service_date`: The service date.
130
+ * - `expiration_date`: The expiration date.
131
+ * - `template_share`: Indicates whether the template is shareable.
132
+ * - `multi_audit`: Indicates whether multi-audit is enabled.
133
+ * - `display_name`: The display name of the template.
134
+ * - `subject_key`: The description of the template.
135
+ * - `description`: The description of the template.
136
+ * - `creator`: The address of the creator of the template.
137
+ */
138
+ getTemplate(contract: string | Address, templateID: string): Promise<import("../../types").SuccessResponse | import("../../types").ErrorResponse>;
139
+ /**
140
+ * Get information about all credentials on the template.
141
+ * @async
142
+ * @param {string | Address} [contract] - The contract's address.
143
+ * @param {string} [templateID] - The ID of the template.
144
+ * @returns `data` of `SuccessResponse` is array of the all credential informations of the template:
145
+ * - `_hint`: Hint for currency,
146
+ * - `_embedded`:
147
+ * - - `credential`:
148
+ * - - - `_hint`: Hint for credential,
149
+ * - - - `holder`: Address of holder,
150
+ * - - - `template_id`: The id for the template,
151
+ * - - - `credential_id`: The id for the credential,
152
+ * - - - `value`: The value of credential,
153
+ * - - - `valid_from`: The timestamp for valid_from,
154
+ * - - - `valid_until`: The timestamp for valid_until,
155
+ * - - - `did`: The name of the credential,
156
+ * - - `is_active`: Indicates whether the credential is active or revoked,
157
+ * - `_links`: links to get additional information of the credential,
158
+ */
159
+ getAllCredentials(contract: string | Address, templateID: string): Promise<import("../../types").SuccessResponse | import("../../types").ErrorResponse>;
160
+ /**
161
+ * Get all credentials owned by the holder in the credential service.
162
+ * @async
163
+ * @param {string | Address} [contract] - The contract's address.
164
+ * @param {string | Address} [holder] - The holder's address claiming the credentials.
165
+ * @returns `data` of `SuccessResponse` is a object with all credential information owned by the holder:
166
+ * - `did`: The did value of the most recently issued credential,
167
+ * - `credentials`: Array of all credential information owned by the holder: {
168
+ * - - `_hint`: Hint for currency,
169
+ * - - `_embedded`:
170
+ * - - - `credential`:
171
+ * - - - - `_hint`: Hint for credential,
172
+ * - - - - `holder`: Address of holder,
173
+ * - - - - `template_id`: The id for the template,
174
+ * - - - - `credential_id`: The id for the credential,
175
+ * - - - - `value`: The value of credential,
176
+ * - - - - `valid_from`: The timestamp for valid_from,
177
+ * - - - - `valid_until`: The timestamp for valid_until,
178
+ * - - - - `did`: The name of the credential,
179
+ * - - - `is_active`: Indicates whether the credential is active or revoked,
180
+ * - - `_links`: links to get additional information of the credential
181
+ */
182
+ getByHolder(contract: string | Address, holder: string | Address): Promise<import("../../types").SuccessResponse | import("../../types").ErrorResponse>;
183
+ }
184
+ export {};
@@ -0,0 +1,20 @@
1
+ /// <reference types="node" />
2
+ import { OperationFact } from "../base";
3
+ import { CredentialItem } from "./item";
4
+ import { Address } from "../../key";
5
+ import { CurrencyID } from "../../common";
6
+ import { Big, HintedObject } from "../../types";
7
+ export declare class IssueItem extends CredentialItem {
8
+ readonly value: string;
9
+ readonly validFrom: Big;
10
+ readonly validUntil: Big;
11
+ readonly did: string;
12
+ constructor(contract: string | Address, holder: string | Address, templateID: string, credentialID: string, value: string, validFrom: string | number | Big, validUntil: string | number | Big, did: string, currency: string | CurrencyID);
13
+ toBuffer(): Buffer;
14
+ toHintedObject(): HintedObject;
15
+ toString(): string;
16
+ }
17
+ export declare class IssueFact extends OperationFact<IssueItem> {
18
+ constructor(token: string, sender: string | Address, items: IssueItem[]);
19
+ get operationHint(): string;
20
+ }
@@ -0,0 +1,16 @@
1
+ /// <reference types="node" />
2
+ import { Item } from "../base";
3
+ import { Address } from "../../key";
4
+ import { CurrencyID } from "../../common";
5
+ import { HintedObject } from "../../types";
6
+ export declare abstract class CredentialItem extends Item {
7
+ readonly contract: Address;
8
+ readonly holder: Address;
9
+ readonly templateID: string;
10
+ readonly credentialID: string;
11
+ readonly currency: CurrencyID;
12
+ protected constructor(hint: string, contract: string | Address, holder: string | Address, templateID: string, credentialID: string, currency: string | CurrencyID);
13
+ toBuffer(): Buffer;
14
+ toHintedObject(): HintedObject;
15
+ toString(): string;
16
+ }
@@ -0,0 +1,9 @@
1
+ /// <reference types="node" />
2
+ import { Address } from "../../key";
3
+ import { ContractFact } from "../base";
4
+ import { CurrencyID } from "../../common";
5
+ export declare class RegisterModelFact extends ContractFact {
6
+ constructor(token: string, sender: string | Address, contract: string | Address, currency: string | CurrencyID);
7
+ toBuffer(): Buffer;
8
+ get operationHint(): string;
9
+ }
@@ -0,0 +1,14 @@
1
+ /// <reference types="node" />
2
+ import { OperationFact } from "../base";
3
+ import { CredentialItem } from "./item";
4
+ import { Address } from "../../key";
5
+ import { CurrencyID } from "../../common";
6
+ export declare class RevokeItem extends CredentialItem {
7
+ constructor(contract: string | Address, holder: string | Address, templateID: string, credentialID: string, currency: string | CurrencyID);
8
+ toBuffer(): Buffer;
9
+ toString(): string;
10
+ }
11
+ export declare class RevokeFact extends OperationFact<RevokeItem> {
12
+ constructor(token: string, sender: string | Address, items: RevokeItem[]);
13
+ get operationHint(): string;
14
+ }
@@ -0,0 +1,17 @@
1
+ /// <reference types="node" />
2
+ import { CurrencyItem } from "./item";
3
+ import { OperationFact } from "../base";
4
+ import { Amount } from "../../common";
5
+ import { HintedObject } from "../../types";
6
+ import { Keys, Address } from "../../key";
7
+ export declare class CreateAccountItem extends CurrencyItem {
8
+ readonly keys: Keys;
9
+ constructor(keys: Keys, amounts: Amount[]);
10
+ toBuffer(): Buffer;
11
+ toHintedObject(): HintedObject;
12
+ toString(): string;
13
+ }
14
+ export declare class CreateAccountFact extends OperationFact<CreateAccountItem> {
15
+ constructor(token: string, sender: string | Address, items: CreateAccountItem[]);
16
+ get operationHint(): string;
17
+ }
@@ -0,0 +1,17 @@
1
+ /// <reference types="node" />
2
+ import { CurrencyItem } from "./item";
3
+ import { OperationFact } from "../base";
4
+ import { Amount } from "../../common";
5
+ import { HintedObject } from "../../types";
6
+ import { Keys, Address } from "../../key";
7
+ export declare class CreateContractAccountItem extends CurrencyItem {
8
+ readonly keys: Keys;
9
+ constructor(keys: Keys, amounts: Amount[]);
10
+ toBuffer(): Buffer;
11
+ toHintedObject(): HintedObject;
12
+ toString(): string;
13
+ }
14
+ export declare class CreateContractAccountFact extends OperationFact<CreateContractAccountItem> {
15
+ constructor(token: string, sender: string | Address, items: CreateContractAccountItem[]);
16
+ get operationHint(): string;
17
+ }
@@ -0,0 +1,52 @@
1
+ /// <reference types="node" />
2
+ import { Address } from "../../key";
3
+ import { CurrencyID } from "../../common";
4
+ import { Big, Float, HintedObject, IBuffer, IHintedObject } from "../../types";
5
+ export declare class CurrencyDesign implements IBuffer, IHintedObject {
6
+ private static hint;
7
+ readonly initialSupply: Big;
8
+ readonly currencyID: CurrencyID;
9
+ readonly policy: CurrencyPolicy;
10
+ readonly genesisAccount: Address;
11
+ readonly totalSupply: Big;
12
+ readonly decimal: Big;
13
+ constructor(initialSupply: string | number | Big, currencyID: string | CurrencyID, genesisAccount: string | Address, decimal: string | number | Big, policy: CurrencyPolicy);
14
+ toBuffer(): Buffer;
15
+ toHintedObject(): HintedObject;
16
+ }
17
+ export declare class CurrencyPolicy implements IBuffer, IHintedObject {
18
+ private static hint;
19
+ readonly newAccountMinBalance: Big;
20
+ readonly feeer: Feeer;
21
+ constructor(newAccountMinBalance: string | number | Big, feeer: Feeer);
22
+ toBuffer(): Buffer;
23
+ toHintedObject(): HintedObject;
24
+ }
25
+ declare abstract class Feeer implements IBuffer, IHintedObject {
26
+ private hint;
27
+ readonly exchangeMinAmount?: Big;
28
+ constructor(hint: string, exchangeMinAmount?: string | number | Big);
29
+ abstract toBuffer(): Buffer;
30
+ toHintedObject(): HintedObject;
31
+ }
32
+ export declare class NilFeeer extends Feeer {
33
+ constructor();
34
+ toBuffer(): Buffer;
35
+ }
36
+ export declare class FixedFeeer extends Feeer {
37
+ readonly receiver: Address;
38
+ readonly amount: Big;
39
+ constructor(receiver: string | Address, amount: string | number | Big);
40
+ toBuffer(): Buffer;
41
+ toHintedObject(): HintedObject;
42
+ }
43
+ export declare class RatioFeeer extends Feeer {
44
+ readonly receiver: Address;
45
+ readonly ratio: Float;
46
+ readonly min: Big;
47
+ readonly max: Big;
48
+ constructor(receiver: string | Address, ratio: number, min: string | number | Big, max: string | number | Big);
49
+ toBuffer(): Buffer;
50
+ toHintedObject(): HintedObject;
51
+ }
52
+ export {};