@icp-sdk/core 5.0.0-beta.0 → 5.0.0-beta.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/lib/cjs/agent/actor.js +2 -2
- package/lib/cjs/agent/actor.js.map +1 -1
- package/lib/cjs/agent/agent/api.d.ts +6 -6
- package/lib/cjs/agent/agent/api.js +4 -4
- package/lib/cjs/agent/agent/http/__certificates__/goldenCertificates.d.ts +30 -0
- package/lib/cjs/agent/agent/http/__certificates__/goldenCertificates.d.ts.map +1 -1
- package/lib/cjs/agent/agent/http/__certificates__/goldenCertificates.js +33 -1
- package/lib/cjs/agent/agent/http/__certificates__/goldenCertificates.js.map +1 -1
- package/lib/cjs/agent/agent/http/index.d.ts +22 -3
- package/lib/cjs/agent/agent/http/index.d.ts.map +1 -1
- package/lib/cjs/agent/agent/http/index.js +131 -51
- package/lib/cjs/agent/agent/http/index.js.map +1 -1
- package/lib/cjs/agent/canisterStatus/index.d.ts +18 -50
- package/lib/cjs/agent/canisterStatus/index.d.ts.map +1 -1
- package/lib/cjs/agent/canisterStatus/index.js +30 -92
- package/lib/cjs/agent/canisterStatus/index.js.map +1 -1
- package/lib/cjs/agent/certificate.d.ts +68 -10
- package/lib/cjs/agent/certificate.d.ts.map +1 -1
- package/lib/cjs/agent/certificate.js +198 -27
- package/lib/cjs/agent/certificate.js.map +1 -1
- package/lib/cjs/agent/constants.d.ts +4 -0
- package/lib/cjs/agent/constants.d.ts.map +1 -1
- package/lib/cjs/agent/constants.js +5 -1
- package/lib/cjs/agent/constants.js.map +1 -1
- package/lib/cjs/agent/errors.d.ts +7 -1
- package/lib/cjs/agent/errors.d.ts.map +1 -1
- package/lib/cjs/agent/errors.js +19 -7
- package/lib/cjs/agent/errors.js.map +1 -1
- package/lib/cjs/agent/index.d.ts +97 -3
- package/lib/cjs/agent/index.d.ts.map +1 -1
- package/lib/cjs/agent/index.js +92 -9
- package/lib/cjs/agent/index.js.map +1 -1
- package/lib/cjs/agent/polling/index.js +1 -1
- package/lib/cjs/agent/polling/index.js.map +1 -1
- package/lib/cjs/agent/subnetStatus/index.d.ts +70 -0
- package/lib/cjs/agent/subnetStatus/index.d.ts.map +1 -0
- package/lib/cjs/agent/subnetStatus/index.js +224 -0
- package/lib/cjs/agent/subnetStatus/index.js.map +1 -0
- package/lib/cjs/agent/utils/readState.d.ts +84 -0
- package/lib/cjs/agent/utils/readState.d.ts.map +1 -0
- package/lib/cjs/agent/utils/readState.js +149 -0
- package/lib/cjs/agent/utils/readState.js.map +1 -0
- package/lib/cjs/candid/index.d.ts +20 -1
- package/lib/cjs/candid/index.d.ts.map +1 -1
- package/lib/cjs/candid/index.js +20 -1
- package/lib/cjs/candid/index.js.map +1 -1
- package/lib/cjs/identity/index.d.ts +30 -7
- package/lib/cjs/identity/index.d.ts.map +1 -1
- package/lib/cjs/identity/index.js +31 -11
- package/lib/cjs/identity/index.js.map +1 -1
- package/lib/cjs/identity/secp256k1/index.d.ts +48 -1
- package/lib/cjs/identity/secp256k1/index.d.ts.map +1 -1
- package/lib/cjs/identity/secp256k1/index.js +48 -1
- package/lib/cjs/identity/secp256k1/index.js.map +1 -1
- package/lib/cjs/principal/index.d.ts +15 -0
- package/lib/cjs/principal/index.d.ts.map +1 -1
- package/lib/cjs/principal/index.js +15 -0
- package/lib/cjs/principal/index.js.map +1 -1
- package/lib/esm/agent/actor.js +3 -3
- package/lib/esm/agent/actor.js.map +1 -1
- package/lib/esm/agent/agent/api.d.ts +6 -6
- package/lib/esm/agent/agent/api.js +3 -3
- package/lib/esm/agent/agent/http/__certificates__/goldenCertificates.d.ts +30 -0
- package/lib/esm/agent/agent/http/__certificates__/goldenCertificates.d.ts.map +1 -1
- package/lib/esm/agent/agent/http/__certificates__/goldenCertificates.js +33 -1
- package/lib/esm/agent/agent/http/__certificates__/goldenCertificates.js.map +1 -1
- package/lib/esm/agent/agent/http/index.d.ts +22 -3
- package/lib/esm/agent/agent/http/index.d.ts.map +1 -1
- package/lib/esm/agent/agent/http/index.js +134 -54
- package/lib/esm/agent/agent/http/index.js.map +1 -1
- package/lib/esm/agent/canister-env/index.d.ts +2 -1
- package/lib/esm/agent/canister-env/index.d.ts.map +1 -1
- package/lib/esm/agent/canister-env/index.js +2 -1
- package/lib/esm/agent/canister-env/index.js.map +1 -1
- package/lib/esm/agent/canisterStatus/index.d.ts +18 -50
- package/lib/esm/agent/canisterStatus/index.d.ts.map +1 -1
- package/lib/esm/agent/canisterStatus/index.js +31 -93
- package/lib/esm/agent/canisterStatus/index.js.map +1 -1
- package/lib/esm/agent/certificate.d.ts +68 -10
- package/lib/esm/agent/certificate.d.ts.map +1 -1
- package/lib/esm/agent/certificate.js +196 -29
- package/lib/esm/agent/certificate.js.map +1 -1
- package/lib/esm/agent/constants.d.ts +4 -0
- package/lib/esm/agent/constants.d.ts.map +1 -1
- package/lib/esm/agent/constants.js +4 -0
- package/lib/esm/agent/constants.js.map +1 -1
- package/lib/esm/agent/errors.d.ts +7 -1
- package/lib/esm/agent/errors.d.ts.map +1 -1
- package/lib/esm/agent/errors.js +15 -4
- package/lib/esm/agent/errors.js.map +1 -1
- package/lib/esm/agent/index.d.ts +97 -3
- package/lib/esm/agent/index.d.ts.map +1 -1
- package/lib/esm/agent/index.js +97 -3
- package/lib/esm/agent/index.js.map +1 -1
- package/lib/esm/agent/polling/index.js +1 -1
- package/lib/esm/agent/polling/index.js.map +1 -1
- package/lib/esm/agent/subnetStatus/index.d.ts +70 -0
- package/lib/esm/agent/subnetStatus/index.d.ts.map +1 -0
- package/lib/esm/agent/subnetStatus/index.js +183 -0
- package/lib/esm/agent/subnetStatus/index.js.map +1 -0
- package/lib/esm/agent/utils/readState.d.ts +84 -0
- package/lib/esm/agent/utils/readState.d.ts.map +1 -0
- package/lib/esm/agent/utils/readState.js +107 -0
- package/lib/esm/agent/utils/readState.js.map +1 -0
- package/lib/esm/candid/index.d.ts +20 -1
- package/lib/esm/candid/index.d.ts.map +1 -1
- package/lib/esm/candid/index.js +20 -1
- package/lib/esm/candid/index.js.map +1 -1
- package/lib/esm/identity/index.d.ts +30 -7
- package/lib/esm/identity/index.d.ts.map +1 -1
- package/lib/esm/identity/index.js +30 -9
- package/lib/esm/identity/index.js.map +1 -1
- package/lib/esm/identity/secp256k1/index.d.ts +48 -1
- package/lib/esm/identity/secp256k1/index.d.ts.map +1 -1
- package/lib/esm/identity/secp256k1/index.js +48 -1
- package/lib/esm/identity/secp256k1/index.js.map +1 -1
- package/lib/esm/principal/index.d.ts +15 -0
- package/lib/esm/principal/index.d.ts.map +1 -1
- package/lib/esm/principal/index.js +15 -0
- package/lib/esm/principal/index.js.map +1 -1
- package/package.json +1 -1
- package/src/agent/actor.ts +3 -3
- package/src/agent/agent/api.ts +8 -8
- package/src/agent/agent/http/index.ts +171 -58
- package/src/agent/canister-env/index.ts +2 -1
- package/src/agent/canisterStatus/index.ts +46 -191
- package/src/agent/certificate.ts +271 -52
- package/src/agent/constants.ts +5 -0
- package/src/agent/errors.ts +17 -4
- package/src/agent/index.ts +97 -3
- package/src/agent/polling/index.ts +1 -1
- package/src/agent/subnetStatus/index.ts +270 -0
- package/src/agent/utils/readState.ts +180 -0
- package/src/candid/index.ts +20 -1
- package/src/identity/index.ts +30 -10
- package/src/identity/secp256k1/index.ts +48 -1
- package/src/principal/index.ts +16 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/agent/canisterStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/agent/canisterStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAWvC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAKnD,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,UAAU,EAOX,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,KAAK,cAAc,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExE,MAAM,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAC5C,MAAM,MAAM,MAAM,GAAG,UAAU,GAAG,YAAY,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,aAAa,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE7F,MAAM,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC;AAEnD,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;IAC3B;;;OAGG;IACH,kCAAkC,CAAC,EAAE,OAAO,CAAC;CAC9C,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,OAAO,GAAU,SAAS,qBAAqB,KAAG,OAAO,CAAC,SAAS,CA+G/E,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GACxB,aAAa,UAAU,EACvB,YAAY,SAAS,EACrB,WAAW,UAAU,KACpB,gBAuBF,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,IAAI,EAAE,YAAY,SAAS,KAAG,UAAU,EAoCxE,CAAC"}
|
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
import { Principal } from '../../principal/index.js';
|
|
2
|
-
import { CertificateVerificationErrorCode, MissingRootKeyErrorCode,
|
|
3
|
-
import { Certificate,
|
|
2
|
+
import { CertificateVerificationErrorCode, MissingRootKeyErrorCode, ExternalError, AgentError, UnknownError, UnexpectedErrorCode, InputError, CertificateTimeErrorCode, } from "../errors.js";
|
|
3
|
+
import { Certificate, lookupResultToBuffer } from "../certificate.js";
|
|
4
4
|
import * as cbor from "../cbor.js";
|
|
5
|
-
import {
|
|
5
|
+
import { decodeTime } from "../utils/leb.js";
|
|
6
6
|
import { utf8ToBytes, bytesToHex } from '@noble/hashes/utils';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* @param {Uint8Array[]} path the path to the desired value, represented as an array of buffers
|
|
11
|
-
* @param {string} decodeStrategy the strategy to use to decode the returned value
|
|
12
|
-
*/
|
|
13
|
-
export class CustomPath {
|
|
14
|
-
constructor(key, path, decodeStrategy) {
|
|
15
|
-
this.key = key;
|
|
16
|
-
this.path = path;
|
|
17
|
-
this.decodeStrategy = decodeStrategy;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
7
|
+
import { decodeValue, decodeControllers, encodeMetadataPath, isCustomPath, lookupNodeKeysFromCertificate, IC_ROOT_SUBNET_ID, } from "../utils/readState.js";
|
|
8
|
+
// Re-export shared types for backwards compatibility
|
|
9
|
+
export { CustomPath } from "../utils/readState.js";
|
|
20
10
|
/**
|
|
21
11
|
* Requests information from a canister's `read_state` endpoint.
|
|
22
12
|
* Can be used to request information about the canister's controllers, time, module hash, candid interface, and more.
|
|
13
|
+
*
|
|
14
|
+
* > [!WARNING]
|
|
15
|
+
* > Requesting the `subnet` path from the canister status might be deprecated in the future.
|
|
16
|
+
* > Use {@link https://js.icp.build/core/latest/libs/agent/api/namespaces/subnetstatus/functions/request | SubnetStatus.request} to fetch subnet information instead.
|
|
23
17
|
* @param {CanisterStatusOptions} options The configuration for the canister status request.
|
|
24
18
|
* @see {@link CanisterStatusOptions} for detailed options.
|
|
25
19
|
* @returns {Promise<StatusMap>} A map populated with data from the requested paths. Each path is a key in the map, and the value is the data obtained from the certificate for that path.
|
|
@@ -50,7 +44,7 @@ export const request = async (options) => {
|
|
|
50
44
|
const certificate = await Certificate.create({
|
|
51
45
|
certificate: response.certificate,
|
|
52
46
|
rootKey,
|
|
53
|
-
canisterId,
|
|
47
|
+
principal: { canisterId },
|
|
54
48
|
disableTimeVerification: disableCertificateTimeVerification,
|
|
55
49
|
agent,
|
|
56
50
|
});
|
|
@@ -105,27 +99,8 @@ export const request = async (options) => {
|
|
|
105
99
|
}
|
|
106
100
|
default: {
|
|
107
101
|
// Check for CustomPath signature
|
|
108
|
-
if (
|
|
109
|
-
|
|
110
|
-
case 'raw':
|
|
111
|
-
status.set(path.key, data);
|
|
112
|
-
break;
|
|
113
|
-
case 'leb128': {
|
|
114
|
-
status.set(path.key, decodeLeb128(data));
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
case 'cbor': {
|
|
118
|
-
status.set(path.key, cbor.decode(data));
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
case 'hex': {
|
|
122
|
-
status.set(path.key, bytesToHex(data));
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
case 'utf-8': {
|
|
126
|
-
status.set(path.key, new TextDecoder().decode(data));
|
|
127
|
-
}
|
|
128
|
-
}
|
|
102
|
+
if (isCustomPath(path)) {
|
|
103
|
+
status.set(path.key, decodeValue(data, path.decodeStrategy));
|
|
129
104
|
}
|
|
130
105
|
}
|
|
131
106
|
}
|
|
@@ -138,7 +113,7 @@ export const request = async (options) => {
|
|
|
138
113
|
error.hasCode(CertificateTimeErrorCode))) {
|
|
139
114
|
throw error;
|
|
140
115
|
}
|
|
141
|
-
if (
|
|
116
|
+
if (isCustomPath(path)) {
|
|
142
117
|
status.set(path.key, null);
|
|
143
118
|
}
|
|
144
119
|
else {
|
|
@@ -155,63 +130,35 @@ export const request = async (options) => {
|
|
|
155
130
|
await Promise.all(promises);
|
|
156
131
|
return status;
|
|
157
132
|
};
|
|
133
|
+
/**
|
|
134
|
+
* Lookup node keys from a certificate for a given canister.
|
|
135
|
+
* The certificate is assumed to be already verified, including whether the canister is in range of the subnet.
|
|
136
|
+
* @param certificate the certificate to lookup node keys from
|
|
137
|
+
* @param canisterId the canister ID to lookup node keys for
|
|
138
|
+
* @param root_key the root key to use to lookup node keys
|
|
139
|
+
* @returns a map of node IDs to public keys
|
|
140
|
+
*/
|
|
158
141
|
export const fetchNodeKeys = (certificate, canisterId, root_key) => {
|
|
159
142
|
if (!canisterId._isPrincipal) {
|
|
160
143
|
throw InputError.fromCode(new UnexpectedErrorCode('Invalid canisterId'));
|
|
161
144
|
}
|
|
162
145
|
const cert = cbor.decode(certificate);
|
|
163
|
-
const
|
|
164
|
-
let delegation = cert.delegation;
|
|
146
|
+
const { delegation } = cert;
|
|
165
147
|
let subnetId;
|
|
166
148
|
if (delegation && delegation.subnet_id) {
|
|
167
149
|
subnetId = Principal.fromUint8Array(new Uint8Array(delegation.subnet_id));
|
|
168
150
|
}
|
|
169
|
-
// On local replica, with System type subnet, there is no delegation
|
|
170
151
|
else if (!delegation && typeof root_key !== 'undefined') {
|
|
152
|
+
// On local replica, with System type subnet, there is no delegation
|
|
171
153
|
subnetId = Principal.selfAuthenticating(new Uint8Array(root_key));
|
|
172
|
-
delegation = {
|
|
173
|
-
subnet_id: subnetId.toUint8Array(),
|
|
174
|
-
certificate: new Uint8Array(0),
|
|
175
|
-
};
|
|
176
154
|
}
|
|
177
|
-
// otherwise use default NNS subnet id
|
|
178
155
|
else {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
subnet_id: subnetId.toUint8Array(),
|
|
182
|
-
certificate: new Uint8Array(0),
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
const canisterInRange = check_canister_ranges({ canisterId, subnetId, tree });
|
|
186
|
-
if (!canisterInRange) {
|
|
187
|
-
throw TrustError.fromCode(new CertificateNotAuthorizedErrorCode(canisterId, subnetId));
|
|
188
|
-
}
|
|
189
|
-
const subnetLookupResult = lookup_subtree(['subnet', delegation.subnet_id, 'node'], tree);
|
|
190
|
-
if (subnetLookupResult.status !== LookupSubtreeStatus.Found) {
|
|
191
|
-
throw ProtocolError.fromCode(new LookupErrorCode('Node not found', subnetLookupResult.status));
|
|
156
|
+
// otherwise use default NNS subnet id
|
|
157
|
+
subnetId = IC_ROOT_SUBNET_ID;
|
|
192
158
|
}
|
|
193
|
-
|
|
194
|
-
throw UnknownError.fromCode(new HashTreeDecodeErrorCode('Invalid node tree'));
|
|
195
|
-
}
|
|
196
|
-
// The forks are all labeled trees with the <node_id> label
|
|
197
|
-
const nodeForks = flatten_forks(subnetLookupResult.value);
|
|
198
|
-
const nodeKeys = new Map();
|
|
199
|
-
nodeForks.forEach(fork => {
|
|
200
|
-
const node_id = Principal.from(fork[1]).toText();
|
|
201
|
-
const publicKeyLookupResult = lookup_path(['public_key'], fork[2]);
|
|
202
|
-
if (publicKeyLookupResult.status !== LookupPathStatus.Found) {
|
|
203
|
-
throw ProtocolError.fromCode(new LookupErrorCode('Public key not found', publicKeyLookupResult.status));
|
|
204
|
-
}
|
|
205
|
-
const derEncodedPublicKey = publicKeyLookupResult.value;
|
|
206
|
-
if (derEncodedPublicKey.byteLength !== 44) {
|
|
207
|
-
throw ProtocolError.fromCode(new DerKeyLengthMismatchErrorCode(44, derEncodedPublicKey.byteLength));
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
nodeKeys.set(node_id, derEncodedPublicKey);
|
|
211
|
-
}
|
|
212
|
-
});
|
|
159
|
+
const nodeKeys = lookupNodeKeysFromCertificate(cert, subnetId);
|
|
213
160
|
return {
|
|
214
|
-
subnetId:
|
|
161
|
+
subnetId: subnetId.toText(),
|
|
215
162
|
nodeKeys,
|
|
216
163
|
};
|
|
217
164
|
};
|
|
@@ -235,15 +182,13 @@ export const encodePath = (path, canisterId) => {
|
|
|
235
182
|
];
|
|
236
183
|
default: {
|
|
237
184
|
// Check for CustomPath signature
|
|
238
|
-
if (
|
|
185
|
+
if (isCustomPath(path)) {
|
|
239
186
|
// For simplified metadata queries
|
|
240
187
|
if (typeof path['path'] === 'string' || path['path'] instanceof Uint8Array) {
|
|
241
|
-
|
|
242
|
-
const encoded = typeof metaPath === 'string' ? utf8ToBytes(metaPath) : metaPath;
|
|
243
|
-
return [utf8ToBytes('canister'), canisterUint8Array, utf8ToBytes('metadata'), encoded];
|
|
244
|
-
// For non-metadata, return the provided custompath
|
|
188
|
+
return encodeMetadataPath(path.path, canisterUint8Array);
|
|
245
189
|
}
|
|
246
190
|
else {
|
|
191
|
+
// For non-metadata, return the provided custom path
|
|
247
192
|
return path['path'];
|
|
248
193
|
}
|
|
249
194
|
}
|
|
@@ -251,11 +196,4 @@ export const encodePath = (path, canisterId) => {
|
|
|
251
196
|
}
|
|
252
197
|
throw UnknownError.fromCode(new UnexpectedErrorCode(`Error while encoding your path for canister status. Please ensure that your path ${path} was formatted correctly.`));
|
|
253
198
|
};
|
|
254
|
-
// Controllers are CBOR-encoded buffers
|
|
255
|
-
const decodeControllers = (buf) => {
|
|
256
|
-
const controllersRaw = cbor.decode(buf);
|
|
257
|
-
return controllersRaw.map(buf => {
|
|
258
|
-
return Principal.fromUint8Array(buf);
|
|
259
|
-
});
|
|
260
|
-
};
|
|
261
199
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/agent/canisterStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EACL,gCAAgC,EAChC,uBAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/agent/canisterStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EACL,gCAAgC,EAChC,uBAAuB,EACvB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,wBAAwB,GACzB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAa,WAAW,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,KAAK,IAAI,MAAM,YAAY,CAA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gBAC3D,CAAC;qBAAM,CAAC;oBACN,oDAAoD;oBACpD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;gBACtB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,YAAY,CAAC,QAAQ,CACzB,IAAI,mBAAmB,CACrB,oFAAoF,IAAI,2BAA2B,CACpH,CACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -38,6 +38,18 @@ interface Delegation extends Record<string, unknown> {
|
|
|
38
38
|
certificate: Uint8Array;
|
|
39
39
|
}
|
|
40
40
|
type VerifyFunc = (pk: Uint8Array, sig: Uint8Array, msg: Uint8Array) => Promise<boolean> | boolean;
|
|
41
|
+
export type CertificatePrincipal = {
|
|
42
|
+
/**
|
|
43
|
+
* The effective canister ID of the request when verifying a response, or
|
|
44
|
+
* the signing canister ID when verifying a certified variable.
|
|
45
|
+
*/
|
|
46
|
+
canisterId: Principal;
|
|
47
|
+
} | {
|
|
48
|
+
/**
|
|
49
|
+
* The subnet ID when verifying a certificate from a subnet.
|
|
50
|
+
*/
|
|
51
|
+
subnetId: Principal;
|
|
52
|
+
};
|
|
41
53
|
export interface CreateCertificateOptions {
|
|
42
54
|
/**
|
|
43
55
|
* The bytes encoding the certificate to be verified
|
|
@@ -49,10 +61,9 @@ export interface CreateCertificateOptions {
|
|
|
49
61
|
*/
|
|
50
62
|
rootKey: Uint8Array;
|
|
51
63
|
/**
|
|
52
|
-
* The
|
|
53
|
-
* the signing canister ID when verifying a certified variable.
|
|
64
|
+
* The principal for which the certificate is being verified.
|
|
54
65
|
*/
|
|
55
|
-
|
|
66
|
+
principal: CertificatePrincipal;
|
|
56
67
|
/**
|
|
57
68
|
* BLS Verification strategy. Default strategy uses bls12_381 from @noble/curves
|
|
58
69
|
*/
|
|
@@ -71,7 +82,7 @@ export interface CreateCertificateOptions {
|
|
|
71
82
|
disableTimeVerification?: boolean;
|
|
72
83
|
/**
|
|
73
84
|
* The agent used to sync time with the IC network, if the certificate fails the freshness check.
|
|
74
|
-
* If the agent does not implement the {@link HttpAgent.getTimeDiffMsecs}, {@link HttpAgent.hasSyncedTime} and {@link HttpAgent.
|
|
85
|
+
* If the agent does not implement the {@link HttpAgent.getTimeDiffMsecs}, {@link HttpAgent.hasSyncedTime}, {@link HttpAgent.syncTime} and {@link HttpAgent.syncTimeWithSubnet} methods,
|
|
75
86
|
* time will not be synced in case of a freshness check failure.
|
|
76
87
|
* @default undefined
|
|
77
88
|
*/
|
|
@@ -80,7 +91,7 @@ export interface CreateCertificateOptions {
|
|
|
80
91
|
export declare class Certificate {
|
|
81
92
|
#private;
|
|
82
93
|
private _rootKey;
|
|
83
|
-
private
|
|
94
|
+
private _principal;
|
|
84
95
|
private _blsVerify;
|
|
85
96
|
private _maxAgeInMinutes;
|
|
86
97
|
cert: Cert;
|
|
@@ -106,6 +117,7 @@ export declare class Certificate {
|
|
|
106
117
|
lookup_subtree(path: NodePath): SubtreeLookupResult;
|
|
107
118
|
private verify;
|
|
108
119
|
private _checkDelegationAndGetKey;
|
|
120
|
+
private _syncTime;
|
|
109
121
|
}
|
|
110
122
|
/**
|
|
111
123
|
* Utility function to constrain the type of a lookup result
|
|
@@ -211,6 +223,16 @@ export declare function flatten_forks(t: HashTree): Array<LabeledHashTree | Leaf
|
|
|
211
223
|
* @returns {LabelLookupResult} the result of the label lookup
|
|
212
224
|
*/
|
|
213
225
|
export declare function find_label(label: NodeLabel, tree: HashTree): LabelLookupResult;
|
|
226
|
+
export type CheckCanisterRangesParams = {
|
|
227
|
+
canisterId: Principal;
|
|
228
|
+
subnetId: Principal;
|
|
229
|
+
tree: HashTree;
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* Canister ranges in the form of an array of [start, end] principal tuples,
|
|
233
|
+
* usually decoded from the certificate.
|
|
234
|
+
*/
|
|
235
|
+
export type CanisterRanges = Array<[Principal, Principal]>;
|
|
214
236
|
/**
|
|
215
237
|
* Check if a canister ID falls within the canister ranges of a given subnet
|
|
216
238
|
* @param params the parameters with which to check the canister ranges
|
|
@@ -219,10 +241,46 @@ export declare function find_label(label: NodeLabel, tree: HashTree): LabelLooku
|
|
|
219
241
|
* @param params.tree the hash tree in which to lookup the subnet's canister ranges
|
|
220
242
|
* @returns {boolean} `true` if the canister is in the range, `false` otherwise
|
|
221
243
|
*/
|
|
222
|
-
export declare function check_canister_ranges(params:
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
244
|
+
export declare function check_canister_ranges(params: CheckCanisterRangesParams): boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Lookup the canister ranges using the `/canister_ranges/<subnet_id>/<ranges>` path.
|
|
247
|
+
* Certificates returned by `/api/v4/canister/<effective_canister_id>/call`
|
|
248
|
+
* and `/api/v3/canister/<effective_canister_id>/read_state` use this path.
|
|
249
|
+
*
|
|
250
|
+
* If the new lookup is not found, it tries the fallback lookup with {@link lookupCanisterRangesFallback}.
|
|
251
|
+
* @param params the parameters with which to lookup the canister ranges
|
|
252
|
+
* @param params.subnetId the subnet ID to lookup the canister ranges for
|
|
253
|
+
* @param params.tree the tree to search
|
|
254
|
+
* @param params.canisterId the canister ID to check
|
|
255
|
+
* @returns the encoded canister ranges. Use {@link decodeCanisterRanges} to decode them.
|
|
256
|
+
* @see https://internetcomputer.org/docs/references/ic-interface-spec#http-read-state
|
|
257
|
+
* @see https://internetcomputer.org/docs/references/ic-interface-spec#state-tree-canister-ranges
|
|
258
|
+
*/
|
|
259
|
+
export declare function lookupCanisterRanges(params: CheckCanisterRangesParams): Uint8Array;
|
|
260
|
+
/**
|
|
261
|
+
* Lookup the canister ranges using the `/subnet/<subnet_id>/canister_ranges` path.
|
|
262
|
+
* Certificates returned by `/api/v3/canister/<effective_canister_id>/call`
|
|
263
|
+
* and `/api/v2/canister/<effective_canister_id>/read_state` use this path.
|
|
264
|
+
* @param subnetId the subnet ID to lookup the canister ranges for
|
|
265
|
+
* @param tree the tree to search
|
|
266
|
+
* @returns the encoded canister ranges. Use {@link decodeCanisterRanges} to decode them.
|
|
267
|
+
* @see https://internetcomputer.org/docs/references/ic-interface-spec#http-read-state
|
|
268
|
+
*/
|
|
269
|
+
export declare function lookupCanisterRangesFallback(subnetId: Principal, tree: HashTree): Uint8Array;
|
|
270
|
+
/**
|
|
271
|
+
* Decode canister ranges from CBOR-encoded buffer
|
|
272
|
+
* @param lookupValue the CBOR-encoded value read from the certificate
|
|
273
|
+
* @returns an array of canister range tuples [start, end]
|
|
274
|
+
*/
|
|
275
|
+
export declare function decodeCanisterRanges(lookupValue: Uint8Array): CanisterRanges;
|
|
276
|
+
/**
|
|
277
|
+
* Get the subnet ID from a certificate
|
|
278
|
+
* If the certificate has a delegation, it returns the subnet ID from the delegation.
|
|
279
|
+
* If the certificate has no delegation, it returns the root subnet ID.
|
|
280
|
+
* @param certificate the certificate to get the subnet ID from
|
|
281
|
+
* @param rootKey the root key to use to get the subnet ID
|
|
282
|
+
* @returns the subnet ID
|
|
283
|
+
*/
|
|
284
|
+
export declare function getSubnetIdFromCertificate(certificate: Cert, rootKey: Uint8Array): Principal;
|
|
227
285
|
export {};
|
|
228
286
|
//# sourceMappingURL=certificate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"certificate.d.ts","sourceRoot":"","sources":["../../../src/agent/certificate.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"certificate.d.ts","sourceRoot":"","sources":["../../../src/agent/certificate.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAQvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAc5C,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,UAAU,CAAC;IACtB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,oBAAY,QAAQ;IAClB,KAAK,IAA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