@keetanetwork/anchor 0.0.1
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/.done +0 -0
- package/LICENSE +35 -0
- package/client/index.d.ts +10 -0
- package/client/index.d.ts.map +1 -0
- package/client/index.js +11 -0
- package/client/index.js.map +1 -0
- package/config.d.ts +10 -0
- package/config.d.ts.map +1 -0
- package/config.js +36 -0
- package/config.js.map +1 -0
- package/lib/certificates.d.ts +106 -0
- package/lib/certificates.d.ts.map +1 -0
- package/lib/certificates.js +463 -0
- package/lib/certificates.js.map +1 -0
- package/lib/encrypted-container.d.ts +106 -0
- package/lib/encrypted-container.d.ts.map +1 -0
- package/lib/encrypted-container.js +594 -0
- package/lib/encrypted-container.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -0
- package/lib/log/common.d.ts +35 -0
- package/lib/log/common.d.ts.map +1 -0
- package/lib/log/common.js +19 -0
- package/lib/log/common.js.map +1 -0
- package/lib/log/index.d.ts +59 -0
- package/lib/log/index.d.ts.map +1 -0
- package/lib/log/index.js +207 -0
- package/lib/log/index.js.map +1 -0
- package/lib/log/target_console.d.ts +13 -0
- package/lib/log/target_console.d.ts.map +1 -0
- package/lib/log/target_console.js +44 -0
- package/lib/log/target_console.js.map +1 -0
- package/lib/resolver.d.ts +308 -0
- package/lib/resolver.d.ts.map +1 -0
- package/lib/resolver.js +1429 -0
- package/lib/resolver.js.map +1 -0
- package/lib/utils/array.d.ts +10 -0
- package/lib/utils/array.d.ts.map +1 -0
- package/lib/utils/array.js +12 -0
- package/lib/utils/array.js.map +1 -0
- package/lib/utils/asn1.d.ts +13 -0
- package/lib/utils/asn1.d.ts.map +1 -0
- package/lib/utils/asn1.js +8 -0
- package/lib/utils/asn1.js.map +1 -0
- package/lib/utils/buffer.d.ts +4 -0
- package/lib/utils/buffer.d.ts.map +1 -0
- package/lib/utils/buffer.js +3 -0
- package/lib/utils/buffer.js.map +1 -0
- package/lib/utils/crypto.d.ts +4 -0
- package/lib/utils/crypto.d.ts.map +1 -0
- package/lib/utils/crypto.js +4 -0
- package/lib/utils/crypto.js.map +1 -0
- package/lib/utils/index.d.ts +5 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js +5 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/json.d.ts +8 -0
- package/lib/utils/json.d.ts.map +1 -0
- package/lib/utils/json.js +164 -0
- package/lib/utils/json.js.map +1 -0
- package/lib/utils/never.d.ts +8 -0
- package/lib/utils/never.d.ts.map +1 -0
- package/lib/utils/never.js +14 -0
- package/lib/utils/never.js.map +1 -0
- package/npm-shrinkwrap.json +16517 -0
- package/package.json +42 -0
- package/services/kyc/client.d.ts +139 -0
- package/services/kyc/client.d.ts.map +1 -0
- package/services/kyc/client.js +390 -0
- package/services/kyc/client.js.map +1 -0
- package/services/kyc/common.d.ts +65 -0
- package/services/kyc/common.d.ts.map +1 -0
- package/services/kyc/common.js +2 -0
- package/services/kyc/common.js.map +1 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { ServiceMetadata, ServiceSearchCriteria } from '../../lib/resolver.ts';
|
|
2
|
+
import type { lib as KeetaNetLib } from '@keetanetwork/keetanet-client';
|
|
3
|
+
export type CountryCodesSearchCriteria = ServiceSearchCriteria<'kyc'>['countryCodes'];
|
|
4
|
+
export type Operations = NonNullable<ServiceMetadata['services']['kyc']>[string]['operations'];
|
|
5
|
+
export type OperationNames = keyof Operations;
|
|
6
|
+
export interface KeetaKYCAnchorCreateVerificationRequest {
|
|
7
|
+
countryCodes: CountryCodesSearchCriteria;
|
|
8
|
+
account: ReturnType<InstanceType<typeof KeetaNetLib.Account>['publicKeyString']['get']>;
|
|
9
|
+
signed: {
|
|
10
|
+
nonce: string;
|
|
11
|
+
timestamp: string;
|
|
12
|
+
signature: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
type KeetaNetTokenPublicKeyString = ReturnType<InstanceType<typeof KeetaNetLib.Account<typeof KeetaNetLib.Account.AccountKeyAlgorithm.TOKEN>>['publicKeyString']['get']>;
|
|
16
|
+
export type KeetaKYCAnchorCreateVerificationResponse = ({
|
|
17
|
+
ok: true;
|
|
18
|
+
/**
|
|
19
|
+
* The ID of the verification request -- this is a unique identifier
|
|
20
|
+
* for the verification request that can be used to fetch the
|
|
21
|
+
* certificate later
|
|
22
|
+
*/
|
|
23
|
+
id: string;
|
|
24
|
+
/**
|
|
25
|
+
* The expected cost of the verification request, in the form of a
|
|
26
|
+
* token and a range of minimum and maximum expected costs
|
|
27
|
+
*/
|
|
28
|
+
expectedCost: {
|
|
29
|
+
min: string;
|
|
30
|
+
max: string;
|
|
31
|
+
token: KeetaNetTokenPublicKeyString;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* The URL to the verification service where the user can complete the
|
|
35
|
+
* verification process. This URL is expected to be a web URL that the
|
|
36
|
+
* user can visit to complete the verification.
|
|
37
|
+
*/
|
|
38
|
+
webURL: string;
|
|
39
|
+
} | {
|
|
40
|
+
ok: false;
|
|
41
|
+
error: string;
|
|
42
|
+
});
|
|
43
|
+
export type KeetaKYCAnchorGetCertificateResponse = ({
|
|
44
|
+
ok: true;
|
|
45
|
+
/**
|
|
46
|
+
* The certificates that were issued by the KYC Anchor service.
|
|
47
|
+
* Typically this will just be a single certificate, but
|
|
48
|
+
* it could also be multiple certificates if the service
|
|
49
|
+
* issues multiple certificates for a single verification.
|
|
50
|
+
*
|
|
51
|
+
* Each certificate is represented as a PEM-encoded string.
|
|
52
|
+
* The `intermediates` field is optional and may contain
|
|
53
|
+
* additional intermediate certificates that are required to
|
|
54
|
+
* validate the certificate chain.
|
|
55
|
+
*/
|
|
56
|
+
results: ({
|
|
57
|
+
certificate: string;
|
|
58
|
+
intermediates?: string[];
|
|
59
|
+
})[];
|
|
60
|
+
} | {
|
|
61
|
+
ok: false;
|
|
62
|
+
error: string;
|
|
63
|
+
});
|
|
64
|
+
export {};
|
|
65
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/services/kyc/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,eAAe,EACf,qBAAqB,EACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,GAAG,IAAI,WAAW,EAAE,MAAO,+BAA+B,CAAC;AAEzE,MAAM,MAAM,0BAA0B,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAC;AAEtF,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC;AAC/F,MAAM,MAAM,cAAc,GAAG,MAAM,UAAU,CAAC;AAE9C,MAAM,WAAW,uCAAuC;IACvD,YAAY,EAAE,0BAA0B,CAAC;IACzC,OAAO,EAAE,UAAU,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACxF,MAAM,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QAEd,SAAS,EAAE,MAAM,CAAC;QAElB,SAAS,EAAE,MAAM,CAAC;KAClB,CAAC;CACF;AAED,KAAK,4BAA4B,GAAG,UAAU,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACzK,MAAM,MAAM,wCAAwC,GAAG,CAAC;IACvD,EAAE,EAAE,IAAI,CAAC;IAET;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,YAAY,EAAE;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,4BAA4B,CAAC;KACpC,CAAC;IACF;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;CACf,GAAG;IACH,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,MAAM,MAAM,oCAAoC,GAAG,CAAC;IACnD,EAAE,EAAE,IAAI,CAAC;IACT;;;;;;;;;;OAUG;IACH,OAAO,EAAE,CAAC;QACT,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;KACzB,CAAC,EAAE,CAAC;CACL,GAAG;IACH,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACd,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/services/kyc/common.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n\tServiceMetadata,\n\tServiceSearchCriteria\n} from '../../lib/resolver.ts';\nimport type { lib as KeetaNetLib } from '@keetanetwork/keetanet-client';\n\nexport type CountryCodesSearchCriteria = ServiceSearchCriteria<'kyc'>['countryCodes'];\n\nexport type Operations = NonNullable<ServiceMetadata['services']['kyc']>[string]['operations'];\nexport type OperationNames = keyof Operations;\n\nexport interface KeetaKYCAnchorCreateVerificationRequest {\n\tcountryCodes: CountryCodesSearchCriteria;\n\taccount: ReturnType<InstanceType<typeof KeetaNetLib.Account>['publicKeyString']['get']>;\n\tsigned: {\n\t\tnonce: string;\n\t\t/* Date and time of the request in ISO 8601 format */\n\t\ttimestamp: string;\n\t\t/* Signature of the account public key and the nonce as an ASN.1 Sequence, Base64 DER */\n\t\tsignature: string;\n\t};\n}\n\ntype KeetaNetTokenPublicKeyString = ReturnType<InstanceType<typeof KeetaNetLib.Account<typeof KeetaNetLib.Account.AccountKeyAlgorithm.TOKEN>>['publicKeyString']['get']>;\nexport type KeetaKYCAnchorCreateVerificationResponse = ({\n\tok: true;\n\n\t/**\n\t * The ID of the verification request -- this is a unique identifier\n\t * for the verification request that can be used to fetch the\n\t * certificate later\n\t */\n\tid: string;\n\t/**\n\t * The expected cost of the verification request, in the form of a\n\t * token and a range of minimum and maximum expected costs\n\t */\n\texpectedCost: {\n\t\tmin: string;\n\t\tmax: string;\n\t\ttoken: KeetaNetTokenPublicKeyString;\n\t};\n\t/**\n\t * The URL to the verification service where the user can complete the\n\t * verification process. This URL is expected to be a web URL that the\n\t * user can visit to complete the verification.\n\t */\n\twebURL: string;\n} | {\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaKYCAnchorGetCertificateResponse = ({\n\tok: true;\n\t/**\n\t * The certificates that were issued by the KYC Anchor service.\n\t * Typically this will just be a single certificate, but\n\t * it could also be multiple certificates if the service\n\t * issues multiple certificates for a single verification.\n\t *\n\t * Each certificate is represented as a PEM-encoded string.\n\t * The `intermediates` field is optional and may contain\n\t * additional intermediate certificates that are required to\n\t * validate the certificate chain.\n\t */\n\tresults: ({\n\t\tcertificate: string;\n\t\tintermediates?: string[];\n\t})[];\n} | {\n\tok: false;\n\terror: string;\n});\n"]}
|