@icp-sdk/core 4.2.3 → 5.0.0-beta.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 (456) hide show
  1. package/lib/cjs/agent/actor.d.ts +203 -0
  2. package/lib/cjs/agent/actor.d.ts.map +1 -0
  3. package/lib/cjs/agent/actor.js +341 -0
  4. package/lib/cjs/agent/actor.js.map +1 -0
  5. package/lib/cjs/agent/agent/api.d.ts +216 -0
  6. package/lib/cjs/agent/agent/api.d.ts.map +1 -0
  7. package/lib/cjs/agent/agent/api.js +39 -0
  8. package/lib/cjs/agent/agent/api.js.map +1 -0
  9. package/lib/cjs/agent/agent/http/__certificates__/goldenCertificates.d.ts +7 -0
  10. package/lib/cjs/agent/agent/http/__certificates__/goldenCertificates.d.ts.map +1 -0
  11. package/lib/cjs/agent/agent/http/__certificates__/goldenCertificates.js +19 -0
  12. package/lib/cjs/agent/agent/http/__certificates__/goldenCertificates.js.map +1 -0
  13. package/lib/cjs/agent/agent/http/index.d.ts +171 -0
  14. package/lib/cjs/agent/agent/http/index.d.ts.map +1 -0
  15. package/lib/cjs/agent/agent/http/index.js +1079 -0
  16. package/lib/cjs/agent/agent/http/index.js.map +1 -0
  17. package/lib/cjs/agent/agent/http/transforms.d.ts +54 -0
  18. package/lib/cjs/agent/agent/http/transforms.d.ts.map +1 -0
  19. package/lib/cjs/agent/agent/http/transforms.js +135 -0
  20. package/lib/cjs/agent/agent/http/transforms.js.map +1 -0
  21. package/lib/cjs/agent/agent/http/types.d.ts +81 -0
  22. package/lib/cjs/agent/agent/http/types.d.ts.map +1 -0
  23. package/lib/cjs/agent/agent/http/types.js +43 -0
  24. package/lib/cjs/agent/agent/http/types.js.map +1 -0
  25. package/lib/cjs/agent/agent/index.d.ts +3 -0
  26. package/lib/cjs/agent/agent/index.d.ts.map +1 -0
  27. package/lib/cjs/agent/agent/index.js +19 -0
  28. package/lib/cjs/agent/agent/index.js.map +1 -0
  29. package/lib/cjs/agent/auth.d.ts +91 -0
  30. package/lib/cjs/agent/auth.d.ts.map +1 -0
  31. package/lib/cjs/agent/auth.js +65 -0
  32. package/lib/cjs/agent/auth.js.map +1 -0
  33. package/lib/cjs/agent/canisterStatus/index.d.ts +93 -0
  34. package/lib/cjs/agent/canisterStatus/index.d.ts.map +1 -0
  35. package/lib/cjs/agent/canisterStatus/index.js +301 -0
  36. package/lib/cjs/agent/canisterStatus/index.js.map +1 -0
  37. package/lib/cjs/agent/cbor.d.ts +26 -0
  38. package/lib/cjs/agent/cbor.d.ts.map +1 -0
  39. package/lib/cjs/agent/cbor.js +93 -0
  40. package/lib/cjs/agent/cbor.js.map +1 -0
  41. package/lib/cjs/agent/certificate.d.ts +228 -0
  42. package/lib/cjs/agent/certificate.d.ts.map +1 -0
  43. package/lib/cjs/agent/certificate.js +591 -0
  44. package/lib/cjs/agent/certificate.js.map +1 -0
  45. package/lib/cjs/agent/constants.d.ts +14 -0
  46. package/lib/cjs/agent/constants.d.ts.map +1 -0
  47. package/lib/cjs/agent/constants.js +18 -0
  48. package/lib/cjs/agent/constants.js.map +1 -0
  49. package/lib/cjs/agent/der.d.ts +34 -0
  50. package/lib/cjs/agent/der.d.ts.map +1 -0
  51. package/lib/cjs/agent/der.js +175 -0
  52. package/lib/cjs/agent/der.js.map +1 -0
  53. package/lib/cjs/agent/errors.d.ts +380 -0
  54. package/lib/cjs/agent/errors.d.ts.map +1 -0
  55. package/lib/cjs/agent/errors.js +733 -0
  56. package/lib/cjs/agent/errors.js.map +1 -0
  57. package/lib/cjs/agent/fetch_candid.d.ts +9 -0
  58. package/lib/cjs/agent/fetch_candid.d.ts.map +1 -0
  59. package/lib/cjs/agent/fetch_candid.js +69 -0
  60. package/lib/cjs/agent/fetch_candid.js.map +1 -0
  61. package/lib/cjs/agent/index.d.ts +31 -1
  62. package/lib/cjs/agent/index.d.ts.map +1 -1
  63. package/lib/cjs/agent/index.js +59 -1
  64. package/lib/cjs/agent/index.js.map +1 -1
  65. package/lib/cjs/agent/observable.d.ts +24 -0
  66. package/lib/cjs/agent/observable.d.ts.map +1 -0
  67. package/lib/cjs/agent/observable.js +34 -0
  68. package/lib/cjs/agent/observable.js.map +1 -0
  69. package/lib/cjs/agent/polling/backoff.d.ts +50 -0
  70. package/lib/cjs/agent/polling/backoff.d.ts.map +1 -0
  71. package/lib/cjs/agent/polling/backoff.js +90 -0
  72. package/lib/cjs/agent/polling/backoff.js.map +1 -0
  73. package/lib/cjs/agent/polling/index.d.ts +63 -0
  74. package/lib/cjs/agent/polling/index.d.ts.map +1 -0
  75. package/lib/cjs/agent/polling/index.js +183 -0
  76. package/lib/cjs/agent/polling/index.js.map +1 -0
  77. package/lib/cjs/agent/polling/strategy.d.ts +52 -0
  78. package/lib/cjs/agent/polling/strategy.d.ts.map +1 -0
  79. package/lib/cjs/agent/polling/strategy.js +104 -0
  80. package/lib/cjs/agent/polling/strategy.js.map +1 -0
  81. package/lib/cjs/agent/public_key.d.ts +16 -0
  82. package/lib/cjs/agent/public_key.d.ts.map +1 -0
  83. package/lib/cjs/agent/public_key.js +52 -0
  84. package/lib/cjs/agent/public_key.js.map +1 -0
  85. package/lib/cjs/agent/request_id.d.ts +24 -0
  86. package/lib/cjs/agent/request_id.d.ts.map +1 -0
  87. package/lib/cjs/agent/request_id.js +88 -0
  88. package/lib/cjs/agent/request_id.js.map +1 -0
  89. package/lib/cjs/agent/utils/bls.d.ts +10 -0
  90. package/lib/cjs/agent/utils/bls.d.ts.map +1 -0
  91. package/lib/cjs/agent/utils/bls.js +20 -0
  92. package/lib/cjs/agent/utils/bls.js.map +1 -0
  93. package/lib/cjs/agent/utils/buffer.d.ts +22 -0
  94. package/lib/cjs/agent/utils/buffer.d.ts.map +1 -0
  95. package/lib/cjs/agent/utils/buffer.js +55 -0
  96. package/lib/cjs/agent/utils/buffer.js.map +1 -0
  97. package/lib/cjs/agent/utils/expirableMap.d.ts +80 -0
  98. package/lib/cjs/agent/utils/expirableMap.d.ts.map +1 -0
  99. package/lib/cjs/agent/utils/expirableMap.js +148 -0
  100. package/lib/cjs/agent/utils/expirableMap.js.map +1 -0
  101. package/lib/cjs/agent/utils/leb.d.ts +3 -0
  102. package/lib/cjs/agent/utils/leb.d.ts.map +1 -0
  103. package/lib/cjs/agent/utils/leb.js +17 -0
  104. package/lib/cjs/agent/utils/leb.js.map +1 -0
  105. package/lib/cjs/agent/utils/random.d.ts +6 -0
  106. package/lib/cjs/agent/utils/random.d.ts.map +1 -0
  107. package/lib/cjs/agent/utils/random.js +29 -0
  108. package/lib/cjs/agent/utils/random.js.map +1 -0
  109. package/lib/cjs/candid/candid-core.d.ts +72 -0
  110. package/lib/cjs/candid/candid-core.d.ts.map +1 -0
  111. package/lib/cjs/candid/candid-core.js +251 -0
  112. package/lib/cjs/candid/candid-core.js.map +1 -0
  113. package/lib/cjs/candid/candid-ui.d.ts +35 -0
  114. package/lib/cjs/candid/candid-ui.d.ts.map +1 -0
  115. package/lib/cjs/candid/candid-ui.js +317 -0
  116. package/lib/cjs/candid/candid-ui.js.map +1 -0
  117. package/lib/cjs/candid/idl.d.ts +579 -0
  118. package/lib/cjs/candid/idl.d.ts.map +1 -0
  119. package/lib/cjs/candid/idl.js +2228 -0
  120. package/lib/cjs/candid/idl.js.map +1 -0
  121. package/lib/cjs/candid/index.d.ts +11 -1
  122. package/lib/cjs/candid/index.d.ts.map +1 -1
  123. package/lib/cjs/candid/index.js +33 -1
  124. package/lib/cjs/candid/index.js.map +1 -1
  125. package/lib/cjs/candid/types.d.ts +6 -0
  126. package/lib/cjs/candid/types.d.ts.map +1 -0
  127. package/lib/cjs/candid/types.js +4 -0
  128. package/lib/cjs/candid/types.js.map +1 -0
  129. package/lib/cjs/candid/utils/bigint-math.d.ts +14 -0
  130. package/lib/cjs/candid/utils/bigint-math.d.ts.map +1 -0
  131. package/lib/cjs/candid/utils/bigint-math.js +30 -0
  132. package/lib/cjs/candid/utils/bigint-math.js.map +1 -0
  133. package/lib/cjs/candid/utils/buffer.d.ts +86 -0
  134. package/lib/cjs/candid/utils/buffer.d.ts.map +1 -0
  135. package/lib/cjs/candid/utils/buffer.js +191 -0
  136. package/lib/cjs/candid/utils/buffer.js.map +1 -0
  137. package/lib/cjs/candid/utils/hash.d.ts +7 -0
  138. package/lib/cjs/candid/utils/hash.d.ts.map +1 -0
  139. package/lib/cjs/candid/utils/hash.js +33 -0
  140. package/lib/cjs/candid/utils/hash.js.map +1 -0
  141. package/lib/cjs/candid/utils/leb128.d.ts +65 -0
  142. package/lib/cjs/candid/utils/leb128.d.ts.map +1 -0
  143. package/lib/cjs/candid/utils/leb128.js +228 -0
  144. package/lib/cjs/candid/utils/leb128.js.map +1 -0
  145. package/lib/cjs/identity/identity/delegation.d.ts +164 -0
  146. package/lib/cjs/identity/identity/delegation.d.ts.map +1 -0
  147. package/lib/cjs/identity/identity/delegation.js +302 -0
  148. package/lib/cjs/identity/identity/delegation.js.map +1 -0
  149. package/lib/cjs/identity/identity/ecdsa.d.ts +62 -0
  150. package/lib/cjs/identity/identity/ecdsa.d.ts.map +1 -0
  151. package/lib/cjs/identity/identity/ecdsa.js +117 -0
  152. package/lib/cjs/identity/identity/ecdsa.js.map +1 -0
  153. package/lib/cjs/identity/identity/ed25519.d.ts +67 -0
  154. package/lib/cjs/identity/identity/ed25519.d.ts.map +1 -0
  155. package/lib/cjs/identity/identity/ed25519.js +200 -0
  156. package/lib/cjs/identity/identity/ed25519.js.map +1 -0
  157. package/lib/cjs/identity/identity/partial.d.ts +34 -0
  158. package/lib/cjs/identity/identity/partial.d.ts.map +1 -0
  159. package/lib/cjs/identity/identity/partial.js +54 -0
  160. package/lib/cjs/identity/identity/partial.js.map +1 -0
  161. package/lib/cjs/identity/identity/webauthn.d.ts +51 -0
  162. package/lib/cjs/identity/identity/webauthn.d.ts.map +1 -0
  163. package/lib/cjs/identity/identity/webauthn.js +197 -0
  164. package/lib/cjs/identity/identity/webauthn.js.map +1 -0
  165. package/lib/cjs/identity/index.d.ts +15 -1
  166. package/lib/cjs/identity/index.d.ts.map +1 -1
  167. package/lib/cjs/identity/index.js +24 -1
  168. package/lib/cjs/identity/index.js.map +1 -1
  169. package/lib/cjs/identity/secp256k1/der.d.ts +33 -0
  170. package/lib/cjs/identity/secp256k1/der.d.ts.map +1 -0
  171. package/lib/cjs/identity/secp256k1/der.js +165 -0
  172. package/lib/cjs/identity/secp256k1/der.js.map +1 -0
  173. package/lib/cjs/identity/secp256k1/index.d.ts +4 -1
  174. package/lib/cjs/identity/secp256k1/index.d.ts.map +1 -1
  175. package/lib/cjs/identity/secp256k1/index.js +4 -1
  176. package/lib/cjs/identity/secp256k1/index.js.map +1 -1
  177. package/lib/cjs/identity/secp256k1/pem.d.ts +7 -0
  178. package/lib/cjs/identity/secp256k1/pem.d.ts.map +1 -0
  179. package/lib/cjs/identity/secp256k1/pem.js +75 -0
  180. package/lib/cjs/identity/secp256k1/pem.js.map +1 -0
  181. package/lib/cjs/identity/secp256k1/secp256k1.d.ts +87 -0
  182. package/lib/cjs/identity/secp256k1/secp256k1.d.ts.map +1 -0
  183. package/lib/cjs/identity/secp256k1/secp256k1.js +260 -0
  184. package/lib/cjs/identity/secp256k1/secp256k1.js.map +1 -0
  185. package/lib/cjs/principal/index.d.ts +3 -1
  186. package/lib/cjs/principal/index.d.ts.map +1 -1
  187. package/lib/cjs/principal/index.js +7 -1
  188. package/lib/cjs/principal/index.js.map +1 -1
  189. package/lib/cjs/principal/principal.d.ts +50 -0
  190. package/lib/cjs/principal/principal.d.ts.map +1 -0
  191. package/lib/cjs/principal/principal.js +148 -0
  192. package/lib/cjs/principal/principal.js.map +1 -0
  193. package/lib/cjs/principal/utils/base32.d.ts +10 -0
  194. package/lib/cjs/principal/utils/base32.d.ts.map +1 -0
  195. package/lib/cjs/principal/utils/base32.js +90 -0
  196. package/lib/cjs/principal/utils/base32.js.map +1 -0
  197. package/lib/cjs/principal/utils/getCrc.d.ts +6 -0
  198. package/lib/cjs/principal/utils/getCrc.d.ts.map +1 -0
  199. package/lib/cjs/principal/utils/getCrc.js +53 -0
  200. package/lib/cjs/principal/utils/getCrc.js.map +1 -0
  201. package/lib/esm/agent/actor.d.ts +203 -0
  202. package/lib/esm/agent/actor.d.ts.map +1 -0
  203. package/lib/esm/agent/actor.js +337 -0
  204. package/lib/esm/agent/actor.js.map +1 -0
  205. package/lib/esm/agent/agent/api.d.ts +216 -0
  206. package/lib/esm/agent/agent/api.d.ts.map +1 -0
  207. package/lib/esm/agent/agent/api.js +34 -0
  208. package/lib/esm/agent/agent/api.js.map +1 -0
  209. package/lib/esm/agent/agent/http/__certificates__/goldenCertificates.d.ts +7 -0
  210. package/lib/esm/agent/agent/http/__certificates__/goldenCertificates.d.ts.map +1 -0
  211. package/lib/esm/agent/agent/http/__certificates__/goldenCertificates.js +16 -0
  212. package/lib/esm/agent/agent/http/__certificates__/goldenCertificates.js.map +1 -0
  213. package/lib/esm/agent/agent/http/index.d.ts +171 -0
  214. package/lib/esm/agent/agent/http/index.d.ts.map +1 -0
  215. package/lib/esm/agent/agent/http/index.js +1037 -0
  216. package/lib/esm/agent/agent/http/index.js.map +1 -0
  217. package/lib/esm/agent/agent/http/transforms.d.ts +54 -0
  218. package/lib/esm/agent/agent/http/transforms.d.ts.map +1 -0
  219. package/lib/esm/agent/agent/http/transforms.js +128 -0
  220. package/lib/esm/agent/agent/http/transforms.js.map +1 -0
  221. package/lib/esm/agent/agent/http/types.d.ts +81 -0
  222. package/lib/esm/agent/agent/http/types.d.ts.map +1 -0
  223. package/lib/esm/agent/agent/http/types.js +39 -0
  224. package/lib/esm/agent/agent/http/types.js.map +1 -0
  225. package/lib/esm/agent/agent/index.d.ts +3 -0
  226. package/lib/esm/agent/agent/index.d.ts.map +1 -0
  227. package/lib/esm/agent/agent/index.js +3 -0
  228. package/lib/esm/agent/agent/index.js.map +1 -0
  229. package/lib/esm/agent/auth.d.ts +91 -0
  230. package/lib/esm/agent/auth.d.ts.map +1 -0
  231. package/lib/esm/agent/auth.js +59 -0
  232. package/lib/esm/agent/auth.js.map +1 -0
  233. package/lib/esm/agent/canister-env/index.d.ts +110 -1
  234. package/lib/esm/agent/canister-env/index.d.ts.map +1 -1
  235. package/lib/esm/agent/canister-env/index.js +110 -1
  236. package/lib/esm/agent/canister-env/index.js.map +1 -1
  237. package/lib/esm/agent/canisterStatus/index.d.ts +93 -0
  238. package/lib/esm/agent/canisterStatus/index.d.ts.map +1 -0
  239. package/lib/esm/agent/canisterStatus/index.js +261 -0
  240. package/lib/esm/agent/canisterStatus/index.js.map +1 -0
  241. package/lib/esm/agent/cbor.d.ts +26 -0
  242. package/lib/esm/agent/cbor.d.ts.map +1 -0
  243. package/lib/esm/agent/cbor.js +54 -0
  244. package/lib/esm/agent/cbor.js.map +1 -0
  245. package/lib/esm/agent/certificate.d.ts +228 -0
  246. package/lib/esm/agent/certificate.d.ts.map +1 -0
  247. package/lib/esm/agent/certificate.js +545 -0
  248. package/lib/esm/agent/certificate.js.map +1 -0
  249. package/lib/esm/agent/constants.d.ts +14 -0
  250. package/lib/esm/agent/constants.d.ts.map +1 -0
  251. package/lib/esm/agent/constants.js +15 -0
  252. package/lib/esm/agent/constants.js.map +1 -0
  253. package/lib/esm/agent/der.d.ts +34 -0
  254. package/lib/esm/agent/der.d.ts.map +1 -0
  255. package/lib/esm/agent/der.js +166 -0
  256. package/lib/esm/agent/der.js.map +1 -0
  257. package/lib/esm/agent/errors.d.ts +380 -0
  258. package/lib/esm/agent/errors.d.ts.map +1 -0
  259. package/lib/esm/agent/errors.js +678 -0
  260. package/lib/esm/agent/errors.js.map +1 -0
  261. package/lib/esm/agent/fetch_candid.d.ts +9 -0
  262. package/lib/esm/agent/fetch_candid.d.ts.map +1 -0
  263. package/lib/esm/agent/fetch_candid.js +33 -0
  264. package/lib/esm/agent/fetch_candid.js.map +1 -0
  265. package/lib/esm/agent/index.d.ts +31 -1
  266. package/lib/esm/agent/index.d.ts.map +1 -1
  267. package/lib/esm/agent/index.js +31 -1
  268. package/lib/esm/agent/index.js.map +1 -1
  269. package/lib/esm/agent/observable.d.ts +24 -0
  270. package/lib/esm/agent/observable.d.ts.map +1 -0
  271. package/lib/esm/agent/observable.js +29 -0
  272. package/lib/esm/agent/observable.js.map +1 -0
  273. package/lib/esm/agent/polling/backoff.d.ts +50 -0
  274. package/lib/esm/agent/polling/backoff.d.ts.map +1 -0
  275. package/lib/esm/agent/polling/backoff.js +85 -0
  276. package/lib/esm/agent/polling/backoff.js.map +1 -0
  277. package/lib/esm/agent/polling/index.d.ts +63 -0
  278. package/lib/esm/agent/polling/index.d.ts.map +1 -0
  279. package/lib/esm/agent/polling/index.js +144 -0
  280. package/lib/esm/agent/polling/index.js.map +1 -0
  281. package/lib/esm/agent/polling/strategy.d.ts +52 -0
  282. package/lib/esm/agent/polling/strategy.d.ts.map +1 -0
  283. package/lib/esm/agent/polling/strategy.js +94 -0
  284. package/lib/esm/agent/polling/strategy.js.map +1 -0
  285. package/lib/esm/agent/public_key.d.ts +16 -0
  286. package/lib/esm/agent/public_key.d.ts.map +1 -0
  287. package/lib/esm/agent/public_key.js +48 -0
  288. package/lib/esm/agent/public_key.js.map +1 -0
  289. package/lib/esm/agent/request_id.d.ts +24 -0
  290. package/lib/esm/agent/request_id.d.ts.map +1 -0
  291. package/lib/esm/agent/request_id.js +83 -0
  292. package/lib/esm/agent/request_id.js.map +1 -0
  293. package/lib/esm/agent/utils/bls.d.ts +10 -0
  294. package/lib/esm/agent/utils/bls.d.ts.map +1 -0
  295. package/lib/esm/agent/utils/bls.js +17 -0
  296. package/lib/esm/agent/utils/bls.js.map +1 -0
  297. package/lib/esm/agent/utils/buffer.d.ts +22 -0
  298. package/lib/esm/agent/utils/buffer.d.ts.map +1 -0
  299. package/lib/esm/agent/utils/buffer.js +50 -0
  300. package/lib/esm/agent/utils/buffer.js.map +1 -0
  301. package/lib/esm/agent/utils/expirableMap.d.ts +80 -0
  302. package/lib/esm/agent/utils/expirableMap.d.ts.map +1 -0
  303. package/lib/esm/agent/utils/expirableMap.js +144 -0
  304. package/lib/esm/agent/utils/expirableMap.js.map +1 -0
  305. package/lib/esm/agent/utils/leb.d.ts +3 -0
  306. package/lib/esm/agent/utils/leb.d.ts.map +1 -0
  307. package/lib/esm/agent/utils/leb.js +12 -0
  308. package/lib/esm/agent/utils/leb.js.map +1 -0
  309. package/lib/esm/agent/utils/random.d.ts +6 -0
  310. package/lib/esm/agent/utils/random.d.ts.map +1 -0
  311. package/lib/esm/agent/utils/random.js +25 -0
  312. package/lib/esm/agent/utils/random.js.map +1 -0
  313. package/lib/esm/candid/candid-core.d.ts +72 -0
  314. package/lib/esm/candid/candid-core.d.ts.map +1 -0
  315. package/lib/esm/candid/candid-core.js +241 -0
  316. package/lib/esm/candid/candid-core.js.map +1 -0
  317. package/lib/esm/candid/candid-ui.d.ts +35 -0
  318. package/lib/esm/candid/candid-ui.d.ts.map +1 -0
  319. package/lib/esm/candid/candid-ui.js +272 -0
  320. package/lib/esm/candid/candid-ui.js.map +1 -0
  321. package/lib/esm/candid/idl.d.ts +579 -0
  322. package/lib/esm/candid/idl.d.ts.map +1 -0
  323. package/lib/esm/candid/idl.js +2189 -0
  324. package/lib/esm/candid/idl.js.map +1 -0
  325. package/lib/esm/candid/index.d.ts +11 -1
  326. package/lib/esm/candid/index.d.ts.map +1 -1
  327. package/lib/esm/candid/index.js +10 -1
  328. package/lib/esm/candid/index.js.map +1 -1
  329. package/lib/esm/candid/types.d.ts +6 -0
  330. package/lib/esm/candid/types.d.ts.map +1 -0
  331. package/lib/esm/candid/types.js +3 -0
  332. package/lib/esm/candid/types.js.map +1 -0
  333. package/lib/esm/candid/utils/bigint-math.d.ts +14 -0
  334. package/lib/esm/candid/utils/bigint-math.d.ts.map +1 -0
  335. package/lib/esm/candid/utils/bigint-math.js +26 -0
  336. package/lib/esm/candid/utils/bigint-math.js.map +1 -0
  337. package/lib/esm/candid/utils/buffer.d.ts +86 -0
  338. package/lib/esm/candid/utils/buffer.d.ts.map +1 -0
  339. package/lib/esm/candid/utils/buffer.js +182 -0
  340. package/lib/esm/candid/utils/buffer.js.map +1 -0
  341. package/lib/esm/candid/utils/hash.d.ts +7 -0
  342. package/lib/esm/candid/utils/hash.d.ts.map +1 -0
  343. package/lib/esm/candid/utils/hash.js +30 -0
  344. package/lib/esm/candid/utils/hash.js.map +1 -0
  345. package/lib/esm/candid/utils/leb128.d.ts +65 -0
  346. package/lib/esm/candid/utils/leb128.d.ts.map +1 -0
  347. package/lib/esm/candid/utils/leb128.js +216 -0
  348. package/lib/esm/candid/utils/leb128.js.map +1 -0
  349. package/lib/esm/identity/identity/delegation.d.ts +164 -0
  350. package/lib/esm/identity/identity/delegation.d.ts.map +1 -0
  351. package/lib/esm/identity/identity/delegation.js +294 -0
  352. package/lib/esm/identity/identity/delegation.js.map +1 -0
  353. package/lib/esm/identity/identity/ecdsa.d.ts +62 -0
  354. package/lib/esm/identity/identity/ecdsa.d.ts.map +1 -0
  355. package/lib/esm/identity/identity/ecdsa.js +112 -0
  356. package/lib/esm/identity/identity/ecdsa.js.map +1 -0
  357. package/lib/esm/identity/identity/ed25519.d.ts +67 -0
  358. package/lib/esm/identity/identity/ed25519.d.ts.map +1 -0
  359. package/lib/esm/identity/identity/ed25519.js +195 -0
  360. package/lib/esm/identity/identity/ed25519.js.map +1 -0
  361. package/lib/esm/identity/identity/partial.d.ts +34 -0
  362. package/lib/esm/identity/identity/partial.d.ts.map +1 -0
  363. package/lib/esm/identity/identity/partial.js +50 -0
  364. package/lib/esm/identity/identity/partial.js.map +1 -0
  365. package/lib/esm/identity/identity/webauthn.d.ts +51 -0
  366. package/lib/esm/identity/identity/webauthn.d.ts.map +1 -0
  367. package/lib/esm/identity/identity/webauthn.js +192 -0
  368. package/lib/esm/identity/identity/webauthn.js.map +1 -0
  369. package/lib/esm/identity/index.d.ts +15 -1
  370. package/lib/esm/identity/index.d.ts.map +1 -1
  371. package/lib/esm/identity/index.js +17 -1
  372. package/lib/esm/identity/index.js.map +1 -1
  373. package/lib/esm/identity/secp256k1/der.d.ts +33 -0
  374. package/lib/esm/identity/secp256k1/der.d.ts.map +1 -0
  375. package/lib/esm/identity/secp256k1/der.js +156 -0
  376. package/lib/esm/identity/secp256k1/der.js.map +1 -0
  377. package/lib/esm/identity/secp256k1/index.d.ts +4 -1
  378. package/lib/esm/identity/secp256k1/index.d.ts.map +1 -1
  379. package/lib/esm/identity/secp256k1/index.js +4 -1
  380. package/lib/esm/identity/secp256k1/index.js.map +1 -1
  381. package/lib/esm/identity/secp256k1/pem.d.ts +7 -0
  382. package/lib/esm/identity/secp256k1/pem.d.ts.map +1 -0
  383. package/lib/esm/identity/secp256k1/pem.js +39 -0
  384. package/lib/esm/identity/secp256k1/pem.js.map +1 -0
  385. package/lib/esm/identity/secp256k1/secp256k1.d.ts +87 -0
  386. package/lib/esm/identity/secp256k1/secp256k1.d.ts.map +1 -0
  387. package/lib/esm/identity/secp256k1/secp256k1.js +222 -0
  388. package/lib/esm/identity/secp256k1/secp256k1.js.map +1 -0
  389. package/lib/esm/principal/index.d.ts +3 -1
  390. package/lib/esm/principal/index.d.ts.map +1 -1
  391. package/lib/esm/principal/index.js +3 -1
  392. package/lib/esm/principal/index.js.map +1 -1
  393. package/lib/esm/principal/principal.d.ts +50 -0
  394. package/lib/esm/principal/principal.d.ts.map +1 -0
  395. package/lib/esm/principal/principal.js +144 -0
  396. package/lib/esm/principal/principal.js.map +1 -0
  397. package/lib/esm/principal/utils/base32.d.ts +10 -0
  398. package/lib/esm/principal/utils/base32.d.ts.map +1 -0
  399. package/lib/esm/principal/utils/base32.js +86 -0
  400. package/lib/esm/principal/utils/base32.js.map +1 -0
  401. package/lib/esm/principal/utils/getCrc.d.ts +6 -0
  402. package/lib/esm/principal/utils/getCrc.d.ts.map +1 -0
  403. package/lib/esm/principal/utils/getCrc.js +50 -0
  404. package/lib/esm/principal/utils/getCrc.js.map +1 -0
  405. package/package.json +17 -11
  406. package/src/agent/actor.ts +576 -0
  407. package/src/agent/agent/api.ts +262 -0
  408. package/src/agent/agent/http/index.ts +1405 -0
  409. package/src/agent/agent/http/transforms.ts +158 -0
  410. package/src/agent/agent/http/types.ts +126 -0
  411. package/src/agent/agent/index.ts +2 -0
  412. package/src/agent/auth.ts +147 -0
  413. package/src/agent/canister-env/index.ts +191 -1
  414. package/src/agent/canisterStatus/index.ts +412 -0
  415. package/src/agent/cbor.ts +63 -0
  416. package/src/agent/certificate.ts +841 -0
  417. package/src/agent/constants.ts +19 -0
  418. package/src/agent/der.ts +170 -0
  419. package/src/agent/errors.ts +868 -0
  420. package/src/agent/fetch_candid.ts +37 -0
  421. package/src/agent/index.ts +37 -1
  422. package/src/agent/observable.ts +49 -0
  423. package/src/agent/polling/backoff.ts +130 -0
  424. package/src/agent/polling/index.ts +250 -0
  425. package/src/agent/polling/strategy.ts +144 -0
  426. package/src/agent/public_key.ts +65 -0
  427. package/src/agent/request_id.ts +92 -0
  428. package/src/agent/utils/bls.ts +18 -0
  429. package/src/agent/utils/buffer.ts +60 -0
  430. package/src/agent/utils/expirableMap.ts +163 -0
  431. package/src/agent/utils/leb.ts +14 -0
  432. package/src/agent/utils/random.ts +30 -0
  433. package/src/candid/candid-core.ts +276 -0
  434. package/src/candid/candid-ui.ts +289 -0
  435. package/src/candid/idl.ts +2556 -0
  436. package/src/candid/index.ts +16 -1
  437. package/src/candid/types.ts +7 -0
  438. package/src/candid/utils/bigint-math.ts +26 -0
  439. package/src/candid/utils/buffer.ts +221 -0
  440. package/src/candid/utils/hash.ts +31 -0
  441. package/src/candid/utils/leb128.ts +234 -0
  442. package/src/identity/identity/delegation.ts +411 -0
  443. package/src/identity/identity/ecdsa.ts +158 -0
  444. package/src/identity/identity/ed25519.ts +239 -0
  445. package/src/identity/identity/partial.ts +60 -0
  446. package/src/identity/identity/webauthn.ts +265 -0
  447. package/src/identity/index.ts +19 -1
  448. package/src/identity/secp256k1/der.ts +156 -0
  449. package/src/identity/secp256k1/index.ts +5 -1
  450. package/src/identity/secp256k1/pem.ts +40 -0
  451. package/src/identity/secp256k1/secp256k1.ts +270 -0
  452. package/src/package.json +4 -0
  453. package/src/principal/index.ts +3 -1
  454. package/src/principal/principal.ts +171 -0
  455. package/src/principal/utils/base32.ts +101 -0
  456. package/src/principal/utils/getCrc.ts +52 -0
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.idlLabelToId = idlLabelToId;
4
+ /**
5
+ * Hashes a string to a number. Algorithm can be found here:
6
+ * https://caml.inria.fr/pub/papers/garrigue-polymorphic_variants-ml98.pdf
7
+ * @param s - string to hash
8
+ * @returns number representing hashed string
9
+ */
10
+ function idlHash(s) {
11
+ const utf8encoder = new TextEncoder();
12
+ const array = utf8encoder.encode(s);
13
+ let h = 0;
14
+ for (const c of array) {
15
+ h = (h * 223 + c) % 2 ** 32;
16
+ }
17
+ return h;
18
+ }
19
+ /**
20
+ *
21
+ * @param label string
22
+ * @returns number representing hashed label
23
+ */
24
+ function idlLabelToId(label) {
25
+ if (/^_\d+_$/.test(label) || /^_0x[0-9a-fA-F]+_$/.test(label)) {
26
+ const num = +label.slice(1, -1);
27
+ if (Number.isSafeInteger(num) && num >= 0 && num < 2 ** 32) {
28
+ return num;
29
+ }
30
+ }
31
+ return idlHash(label);
32
+ }
33
+ //# sourceMappingURL=hash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hash.js","sourceRoot":"","sources":["../../../../src/candid/utils/hash.ts"],"names":[],"mappings":";;AAsBA,oCAQC;AA9BD;;;;;GAKG;AACH,SAAS,OAAO,CAAC,CAAS;IACxB,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;IACtC,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAEpC,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,KAAa;IACxC,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9D,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;YAC3D,OAAO,GAAG,CAAC;QACb,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { PipeArrayBuffer as Pipe } from './buffer.ts';
2
+ /**
3
+ *
4
+ * @param pipe Pipe from buffer-pipe
5
+ * @param num number
6
+ * @returns Uint8Array
7
+ */
8
+ export declare function safeRead(pipe: Pipe, num: number): Uint8Array;
9
+ /**
10
+ * @param pipe - PipeArrayBuffer simulating buffer-pipe api
11
+ */
12
+ export declare function safeReadUint8(pipe: Pipe): number;
13
+ /**
14
+ * Encode a positive number (or bigint) into a Buffer. The number will be floored to the
15
+ * nearest integer.
16
+ * @param value The number to encode.
17
+ */
18
+ export declare function lebEncode(value: bigint | number): Uint8Array;
19
+ /**
20
+ * Decode a leb encoded buffer into a bigint. The number will always be positive (does not
21
+ * support signed leb encoding).
22
+ * @param pipe A Buffer containing the leb encoded bits.
23
+ */
24
+ export declare function lebDecode(pipe: Pipe): bigint;
25
+ /**
26
+ * Encode a number (or bigint) into a Buffer, with support for negative numbers. The number
27
+ * will be floored to the nearest integer.
28
+ * @param value The number to encode.
29
+ */
30
+ export declare function slebEncode(value: bigint | number): Uint8Array;
31
+ /**
32
+ * Decode a leb encoded buffer into a bigint. The number is decoded with support for negative
33
+ * signed-leb encoding.
34
+ * @param pipe A Buffer containing the signed leb encoded bits.
35
+ */
36
+ export declare function slebDecode(pipe: Pipe): bigint;
37
+ /**
38
+ *
39
+ * @param value bigint or number
40
+ * @param byteLength number
41
+ * @returns Uint8Array
42
+ */
43
+ export declare function writeUIntLE(value: bigint | number, byteLength: number): Uint8Array;
44
+ /**
45
+ *
46
+ * @param value - bigint or number
47
+ * @param byteLength - number
48
+ * @returns Uint8Array
49
+ */
50
+ export declare function writeIntLE(value: bigint | number, byteLength: number): Uint8Array;
51
+ /**
52
+ *
53
+ * @param pipe Pipe from buffer-pipe
54
+ * @param byteLength number
55
+ * @returns bigint
56
+ */
57
+ export declare function readUIntLE(pipe: Pipe, byteLength: number): bigint;
58
+ /**
59
+ *
60
+ * @param pipe Pipe from buffer-pipe
61
+ * @param byteLength number
62
+ * @returns bigint
63
+ */
64
+ export declare function readIntLE(pipe: Pipe, byteLength: number): bigint;
65
+ //# sourceMappingURL=leb128.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leb128.d.ts","sourceRoot":"","sources":["../../../../src/candid/utils/leb128.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,aAAa,CAAC;AAOtD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,CAK5D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAMhD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAuB5D;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAY5C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAmC7D;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAoB7C;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,UAAU,CAKlF;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,UAAU,CAmBjF;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAajE;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAUhE"}
@@ -0,0 +1,228 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.safeRead = safeRead;
4
+ exports.safeReadUint8 = safeReadUint8;
5
+ exports.lebEncode = lebEncode;
6
+ exports.lebDecode = lebDecode;
7
+ exports.slebEncode = slebEncode;
8
+ exports.slebDecode = slebDecode;
9
+ exports.writeUIntLE = writeUIntLE;
10
+ exports.writeIntLE = writeIntLE;
11
+ exports.readUIntLE = readUIntLE;
12
+ exports.readIntLE = readIntLE;
13
+ // Note: this file uses buffer-pipe, which on Node only, uses the Node Buffer
14
+ // implementation, which isn't compatible with the NPM buffer package
15
+ // which we use everywhere else. This means that we have to transform
16
+ // one into the other, hence why every function that returns a Buffer
17
+ // actually return `new Buffer(pipe.buffer)`.
18
+ // TODO: The best solution would be to have our own buffer type around
19
+ // Uint8Array which is standard.
20
+ const buffer_ts_1 = require("./buffer.js");
21
+ const bigint_math_ts_1 = require("./bigint-math.js");
22
+ function eob() {
23
+ throw new Error('unexpected end of buffer');
24
+ }
25
+ /**
26
+ *
27
+ * @param pipe Pipe from buffer-pipe
28
+ * @param num number
29
+ * @returns Uint8Array
30
+ */
31
+ function safeRead(pipe, num) {
32
+ if (pipe.byteLength < num) {
33
+ eob();
34
+ }
35
+ return pipe.read(num);
36
+ }
37
+ /**
38
+ * @param pipe - PipeArrayBuffer simulating buffer-pipe api
39
+ */
40
+ function safeReadUint8(pipe) {
41
+ const byte = pipe.readUint8();
42
+ if (byte === undefined) {
43
+ eob();
44
+ }
45
+ return byte;
46
+ }
47
+ /**
48
+ * Encode a positive number (or bigint) into a Buffer. The number will be floored to the
49
+ * nearest integer.
50
+ * @param value The number to encode.
51
+ */
52
+ function lebEncode(value) {
53
+ if (typeof value === 'number') {
54
+ value = BigInt(value);
55
+ }
56
+ if (value < BigInt(0)) {
57
+ throw new Error('Cannot leb encode negative values.');
58
+ }
59
+ const byteLength = (value === BigInt(0) ? 0 : (0, bigint_math_ts_1.ilog2)(value)) + 1;
60
+ const pipe = new buffer_ts_1.PipeArrayBuffer(new Uint8Array(byteLength), 0);
61
+ while (true) {
62
+ const i = Number(value & BigInt(0x7f));
63
+ value /= BigInt(0x80);
64
+ if (value === BigInt(0)) {
65
+ pipe.write(new Uint8Array([i]));
66
+ break;
67
+ }
68
+ else {
69
+ pipe.write(new Uint8Array([i | 0x80]));
70
+ }
71
+ }
72
+ return pipe.buffer;
73
+ }
74
+ /**
75
+ * Decode a leb encoded buffer into a bigint. The number will always be positive (does not
76
+ * support signed leb encoding).
77
+ * @param pipe A Buffer containing the leb encoded bits.
78
+ */
79
+ function lebDecode(pipe) {
80
+ let weight = BigInt(1);
81
+ let value = BigInt(0);
82
+ let byte;
83
+ do {
84
+ byte = safeReadUint8(pipe);
85
+ value += BigInt(byte & 0x7f).valueOf() * weight;
86
+ weight *= BigInt(128);
87
+ } while (byte >= 0x80);
88
+ return value;
89
+ }
90
+ /**
91
+ * Encode a number (or bigint) into a Buffer, with support for negative numbers. The number
92
+ * will be floored to the nearest integer.
93
+ * @param value The number to encode.
94
+ */
95
+ function slebEncode(value) {
96
+ if (typeof value === 'number') {
97
+ value = BigInt(value);
98
+ }
99
+ const isNeg = value < BigInt(0);
100
+ if (isNeg) {
101
+ value = -value - BigInt(1);
102
+ }
103
+ const byteLength = (value === BigInt(0) ? 0 : (0, bigint_math_ts_1.ilog2)(value)) + 1;
104
+ const pipe = new buffer_ts_1.PipeArrayBuffer(new Uint8Array(byteLength), 0);
105
+ while (true) {
106
+ const i = getLowerBytes(value);
107
+ value /= BigInt(0x80);
108
+ // prettier-ignore
109
+ if ((isNeg && value === BigInt(0) && (i & 0x40) !== 0)
110
+ || (!isNeg && value === BigInt(0) && (i & 0x40) === 0)) {
111
+ pipe.write(new Uint8Array([i]));
112
+ break;
113
+ }
114
+ else {
115
+ pipe.write(new Uint8Array([i | 0x80]));
116
+ }
117
+ }
118
+ function getLowerBytes(num) {
119
+ const bytes = num % BigInt(0x80);
120
+ if (isNeg) {
121
+ // We swap the bits here again, and remove 1 to do two's complement.
122
+ return Number(BigInt(0x80) - bytes - BigInt(1));
123
+ }
124
+ else {
125
+ return Number(bytes);
126
+ }
127
+ }
128
+ return pipe.buffer;
129
+ }
130
+ /**
131
+ * Decode a leb encoded buffer into a bigint. The number is decoded with support for negative
132
+ * signed-leb encoding.
133
+ * @param pipe A Buffer containing the signed leb encoded bits.
134
+ */
135
+ function slebDecode(pipe) {
136
+ // Get the size of the buffer, then cut a buffer of that size.
137
+ const pipeView = new Uint8Array(pipe.buffer);
138
+ let len = 0;
139
+ for (; len < pipeView.byteLength; len++) {
140
+ if (pipeView[len] < 0x80) {
141
+ // If it's a positive number, we reuse lebDecode.
142
+ if ((pipeView[len] & 0x40) === 0) {
143
+ return lebDecode(pipe);
144
+ }
145
+ break;
146
+ }
147
+ }
148
+ const bytes = new Uint8Array(safeRead(pipe, len + 1));
149
+ let value = BigInt(0);
150
+ for (let i = bytes.byteLength - 1; i >= 0; i--) {
151
+ value = value * BigInt(0x80) + BigInt(0x80 - (bytes[i] & 0x7f) - 1);
152
+ }
153
+ return -value - BigInt(1);
154
+ }
155
+ /**
156
+ *
157
+ * @param value bigint or number
158
+ * @param byteLength number
159
+ * @returns Uint8Array
160
+ */
161
+ function writeUIntLE(value, byteLength) {
162
+ if (BigInt(value) < BigInt(0)) {
163
+ throw new Error('Cannot write negative values.');
164
+ }
165
+ return writeIntLE(value, byteLength);
166
+ }
167
+ /**
168
+ *
169
+ * @param value - bigint or number
170
+ * @param byteLength - number
171
+ * @returns Uint8Array
172
+ */
173
+ function writeIntLE(value, byteLength) {
174
+ value = BigInt(value);
175
+ const pipe = new buffer_ts_1.PipeArrayBuffer(new Uint8Array(Math.min(1, byteLength)), 0);
176
+ let i = 0;
177
+ let mul = BigInt(256);
178
+ let sub = BigInt(0);
179
+ let byte = Number(value % mul);
180
+ pipe.write(new Uint8Array([byte]));
181
+ while (++i < byteLength) {
182
+ if (value < 0 && sub === BigInt(0) && byte !== 0) {
183
+ sub = BigInt(1);
184
+ }
185
+ byte = Number((value / mul - sub) % BigInt(256));
186
+ pipe.write(new Uint8Array([byte]));
187
+ mul *= BigInt(256);
188
+ }
189
+ return pipe.buffer;
190
+ }
191
+ /**
192
+ *
193
+ * @param pipe Pipe from buffer-pipe
194
+ * @param byteLength number
195
+ * @returns bigint
196
+ */
197
+ function readUIntLE(pipe, byteLength) {
198
+ if (byteLength <= 0 || !Number.isInteger(byteLength)) {
199
+ throw new Error('Byte length must be a positive integer');
200
+ }
201
+ let val = BigInt(safeReadUint8(pipe));
202
+ let mul = BigInt(1);
203
+ let i = 0;
204
+ while (++i < byteLength) {
205
+ mul *= BigInt(256);
206
+ const byte = BigInt(safeReadUint8(pipe));
207
+ val = val + mul * byte;
208
+ }
209
+ return val;
210
+ }
211
+ /**
212
+ *
213
+ * @param pipe Pipe from buffer-pipe
214
+ * @param byteLength number
215
+ * @returns bigint
216
+ */
217
+ function readIntLE(pipe, byteLength) {
218
+ if (byteLength <= 0 || !Number.isInteger(byteLength)) {
219
+ throw new Error('Byte length must be a positive integer');
220
+ }
221
+ let val = readUIntLE(pipe, byteLength);
222
+ const mul = BigInt(2) ** (BigInt(8) * BigInt(byteLength - 1) + BigInt(7));
223
+ if (val >= mul) {
224
+ val -= mul * BigInt(2);
225
+ }
226
+ return val;
227
+ }
228
+ //# sourceMappingURL=leb128.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leb128.js","sourceRoot":"","sources":["../../../../src/candid/utils/leb128.ts"],"names":[],"mappings":";;AAoBA,4BAKC;AAKD,sCAMC;AAOD,8BAuBC;AAOD,8BAYC;AAOD,gCAmCC;AAOD,gCAoBC;AAQD,kCAKC;AAQD,gCAmBC;AAQD,gCAaC;AAQD,8BAUC;AAzOD,6EAA6E;AAC7E,2EAA2E;AAC3E,2EAA2E;AAC3E,2EAA2E;AAC3E,mDAAmD;AACnD,sEAAsE;AACtE,sCAAsC;AACtC,2CAAsD;AACtD,qDAAyC;AAEzC,SAAS,GAAG;IACV,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAU,EAAE,GAAW;IAC9C,IAAI,IAAI,CAAC,UAAU,GAAG,GAAG,EAAE,CAAC;QAC1B,GAAG,EAAE,CAAC;IACR,CAAC;IACD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,SAAgB,aAAa,CAAC,IAAU;IACtC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;IAC9B,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,GAAG,EAAE,CAAC;IACR,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CAAC,KAAsB;IAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED,IAAI,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KA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,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;QACf,GAAG,IAAI,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,164 @@
1
+ import { type DerEncodedPublicKey, type HttpAgentRequest, type PublicKey, type Signature, SignIdentity, ToCborValue } from '../../agent/index.js';
2
+ import { Principal } from '../../principal/index.js';
3
+ import { PartialIdentity } from './partial.ts';
4
+ /**
5
+ * A single delegation object that is signed by a private key. This is constructed by
6
+ * `DelegationChain.create()`.
7
+ *
8
+ * {@see DelegationChain}
9
+ */
10
+ export declare class Delegation implements ToCborValue {
11
+ readonly pubkey: Uint8Array;
12
+ readonly expiration: bigint;
13
+ readonly targets?: Principal[] | undefined;
14
+ constructor(pubkey: Uint8Array, expiration: bigint, targets?: Principal[] | undefined);
15
+ toCborValue(): {
16
+ targets?: Principal[] | undefined;
17
+ pubkey: Uint8Array<ArrayBufferLike>;
18
+ expiration: bigint;
19
+ };
20
+ toJSON(): JsonnableDelegation;
21
+ }
22
+ /**
23
+ * Type of ReturnType<Delegation.toJSON>.
24
+ * The goal here is to stringify all non-JSON-compatible types to some bytes representation we can
25
+ * stringify as hex.
26
+ * (Hex shouldn't be ambiguous ever, because you can encode as DER with semantic OIDs).
27
+ */
28
+ interface JsonnableDelegation {
29
+ expiration: string;
30
+ pubkey: string;
31
+ targets?: string[];
32
+ }
33
+ /**
34
+ * A signed delegation, which lends its identity to the public key in the delegation
35
+ * object. This is constructed by `DelegationChain.create()`.
36
+ *
37
+ * {@see DelegationChain}
38
+ */
39
+ export interface SignedDelegation {
40
+ delegation: Delegation;
41
+ signature: Signature;
42
+ }
43
+ export interface JsonnableDelegationChain {
44
+ publicKey: string;
45
+ delegations: Array<{
46
+ signature: string;
47
+ delegation: {
48
+ pubkey: string;
49
+ expiration: string;
50
+ targets?: string[];
51
+ };
52
+ }>;
53
+ }
54
+ /**
55
+ * A chain of delegations. This is JSON Serializable.
56
+ * This is the object to serialize and pass to a DelegationIdentity. It does not keep any
57
+ * private keys.
58
+ */
59
+ export declare class DelegationChain {
60
+ readonly delegations: SignedDelegation[];
61
+ readonly publicKey: DerEncodedPublicKey;
62
+ /**
63
+ * Create a delegation chain between two (or more) keys. By default, the expiration time
64
+ * will be very short (15 minutes).
65
+ *
66
+ * To build a chain of more than 2 identities, this function needs to be called multiple times,
67
+ * passing the previous delegation chain into the options argument. For example:
68
+ * @example
69
+ * const rootKey = createKey();
70
+ * const middleKey = createKey();
71
+ * const bottomeKey = createKey();
72
+ *
73
+ * const rootToMiddle = await DelegationChain.create(
74
+ * root, middle.getPublicKey(), Date.parse('2100-01-01'),
75
+ * );
76
+ * const middleToBottom = await DelegationChain.create(
77
+ * middle, bottom.getPublicKey(), Date.parse('2100-01-01'), { previous: rootToMiddle },
78
+ * );
79
+ *
80
+ * // We can now use a delegation identity that uses the delegation above:
81
+ * const identity = DelegationIdentity.fromDelegation(bottomKey, middleToBottom);
82
+ * @param from The identity that will delegate.
83
+ * @param to The identity that gets delegated. It can now sign messages as if it was the
84
+ * identity above.
85
+ * @param expiration The length the delegation is valid. By default, 15 minutes from calling
86
+ * this function.
87
+ * @param options A set of options for this delegation. expiration and previous
88
+ * @param options.previous - Another DelegationChain that this chain should start with.
89
+ * @param options.targets - targets that scope the delegation (e.g. Canister Principals)
90
+ */
91
+ static create(from: SignIdentity, to: PublicKey, expiration?: Date, options?: {
92
+ previous?: DelegationChain;
93
+ targets?: Principal[];
94
+ }): Promise<DelegationChain>;
95
+ /**
96
+ * Creates a DelegationChain object from a JSON string.
97
+ * @param json The JSON string to parse.
98
+ */
99
+ static fromJSON(json: string | JsonnableDelegationChain): DelegationChain;
100
+ /**
101
+ * Creates a DelegationChain object from a list of delegations and a DER-encoded public key.
102
+ * @param delegations The list of delegations.
103
+ * @param publicKey The DER-encoded public key of the key-pair signing the first delegation.
104
+ */
105
+ static fromDelegations(delegations: SignedDelegation[], publicKey: DerEncodedPublicKey): DelegationChain;
106
+ protected constructor(delegations: SignedDelegation[], publicKey: DerEncodedPublicKey);
107
+ toJSON(): JsonnableDelegationChain;
108
+ }
109
+ /**
110
+ * An Identity that adds delegation to a request. Everywhere in this class, the name
111
+ * innerKey refers to the SignIdentity that is being used to sign the requests, while
112
+ * originalKey is the identity that is being borrowed. More identities can be used
113
+ * in the middle to delegate.
114
+ */
115
+ export declare class DelegationIdentity extends SignIdentity {
116
+ private _inner;
117
+ private _delegation;
118
+ /**
119
+ * Create a delegation without having access to delegateKey.
120
+ * @param key The key used to sign the requests.
121
+ * @param delegation A delegation object created using `createDelegation`.
122
+ */
123
+ static fromDelegation(key: Pick<SignIdentity, 'sign'>, delegation: DelegationChain): DelegationIdentity;
124
+ protected constructor(_inner: Pick<SignIdentity, 'sign'>, _delegation: DelegationChain);
125
+ getDelegation(): DelegationChain;
126
+ getPublicKey(): PublicKey;
127
+ sign(blob: Uint8Array): Promise<Signature>;
128
+ transformRequest(request: HttpAgentRequest): Promise<unknown>;
129
+ }
130
+ /**
131
+ * A partial delegated identity, representing a delegation chain and the public key that it targets
132
+ */
133
+ export declare class PartialDelegationIdentity extends PartialIdentity {
134
+ #private;
135
+ /**
136
+ * The Delegation Chain of this identity.
137
+ */
138
+ get delegation(): DelegationChain;
139
+ private constructor();
140
+ /**
141
+ * Create a {@link PartialDelegationIdentity} from a {@link PublicKey} and a {@link DelegationChain}.
142
+ * @param key The {@link PublicKey} to delegate to.
143
+ * @param delegation a {@link DelegationChain} targeting the inner key.
144
+ */
145
+ static fromDelegation(key: PublicKey, delegation: DelegationChain): PartialDelegationIdentity;
146
+ }
147
+ /**
148
+ * List of things to check for a delegation chain validity.
149
+ */
150
+ export interface DelegationValidChecks {
151
+ /**
152
+ * Check that the scope is amongst the scopes that this delegation has access to.
153
+ */
154
+ scope?: Principal | string | Array<Principal | string>;
155
+ }
156
+ /**
157
+ * Analyze a DelegationChain and validate that it's valid, ie. not expired and apply to the
158
+ * scope.
159
+ * @param chain The chain to validate.
160
+ * @param checks Various checks to validate on the chain.
161
+ */
162
+ export declare function isDelegationValid(chain: DelegationChain, checks?: DelegationValidChecks): boolean;
163
+ export {};
164
+ //# sourceMappingURL=delegation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegation.d.ts","sourceRoot":"","sources":["../../../../src/identity/identity/delegation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EAEd,KAAK,SAAS,EACd,YAAY,EAGZ,WAAW,EACZ,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAuB/C;;;;;GAKG;AACH,qBAAa,UAAW,YAAW,WAAW;aAE1B,MAAM,EAAE,UAAU;aAClB,UAAU,EAAE,MAAM;aAClB,OAAO,CAAC,EAAE,SAAS,EAAE;gBAFrB,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,SAAS,EAAE,YAAA;IAGhC,WAAW;;;;;IAUX,MAAM,IAAI,mBAAmB;CAUrC;AAED;;;;;GAKG;AACH,UAAU,mBAAmB;IAE3B,UAAU,EAAE,MAAM,CAAC;IAEnB,MAAM,EAAE,MAAM,CAAC;IAEf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,SAAS,CAAC;CACtB;AAqCD,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,KAAK,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