@icp-sdk/core 4.2.2 → 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.
- package/lib/cjs/agent/actor.d.ts +203 -0
- package/lib/cjs/agent/actor.d.ts.map +1 -0
- package/lib/cjs/agent/actor.js +341 -0
- package/lib/cjs/agent/actor.js.map +1 -0
- package/lib/cjs/agent/agent/api.d.ts +216 -0
- package/lib/cjs/agent/agent/api.d.ts.map +1 -0
- package/lib/cjs/agent/agent/api.js +39 -0
- package/lib/cjs/agent/agent/api.js.map +1 -0
- package/lib/cjs/agent/agent/http/__certificates__/goldenCertificates.d.ts +7 -0
- package/lib/cjs/agent/agent/http/__certificates__/goldenCertificates.d.ts.map +1 -0
- package/lib/cjs/agent/agent/http/__certificates__/goldenCertificates.js +19 -0
- package/lib/cjs/agent/agent/http/__certificates__/goldenCertificates.js.map +1 -0
- package/lib/cjs/agent/agent/http/index.d.ts +171 -0
- package/lib/cjs/agent/agent/http/index.d.ts.map +1 -0
- package/lib/cjs/agent/agent/http/index.js +1079 -0
- package/lib/cjs/agent/agent/http/index.js.map +1 -0
- package/lib/cjs/agent/agent/http/transforms.d.ts +54 -0
- package/lib/cjs/agent/agent/http/transforms.d.ts.map +1 -0
- package/lib/cjs/agent/agent/http/transforms.js +135 -0
- package/lib/cjs/agent/agent/http/transforms.js.map +1 -0
- package/lib/cjs/agent/agent/http/types.d.ts +81 -0
- package/lib/cjs/agent/agent/http/types.d.ts.map +1 -0
- package/lib/cjs/agent/agent/http/types.js +43 -0
- package/lib/cjs/agent/agent/http/types.js.map +1 -0
- package/lib/cjs/agent/agent/index.d.ts +3 -0
- package/lib/cjs/agent/agent/index.d.ts.map +1 -0
- package/lib/cjs/agent/agent/index.js +19 -0
- package/lib/cjs/agent/agent/index.js.map +1 -0
- package/lib/cjs/agent/auth.d.ts +91 -0
- package/lib/cjs/agent/auth.d.ts.map +1 -0
- package/lib/cjs/agent/auth.js +65 -0
- package/lib/cjs/agent/auth.js.map +1 -0
- package/lib/cjs/agent/canisterStatus/index.d.ts +93 -0
- package/lib/cjs/agent/canisterStatus/index.d.ts.map +1 -0
- package/lib/cjs/agent/canisterStatus/index.js +301 -0
- package/lib/cjs/agent/canisterStatus/index.js.map +1 -0
- package/lib/cjs/agent/cbor.d.ts +26 -0
- package/lib/cjs/agent/cbor.d.ts.map +1 -0
- package/lib/cjs/agent/cbor.js +93 -0
- package/lib/cjs/agent/cbor.js.map +1 -0
- package/lib/cjs/agent/certificate.d.ts +228 -0
- package/lib/cjs/agent/certificate.d.ts.map +1 -0
- package/lib/cjs/agent/certificate.js +591 -0
- package/lib/cjs/agent/certificate.js.map +1 -0
- package/lib/cjs/agent/constants.d.ts +14 -0
- package/lib/cjs/agent/constants.d.ts.map +1 -0
- package/lib/cjs/agent/constants.js +18 -0
- package/lib/cjs/agent/constants.js.map +1 -0
- package/lib/cjs/agent/der.d.ts +34 -0
- package/lib/cjs/agent/der.d.ts.map +1 -0
- package/lib/cjs/agent/der.js +175 -0
- package/lib/cjs/agent/der.js.map +1 -0
- package/lib/cjs/agent/errors.d.ts +380 -0
- package/lib/cjs/agent/errors.d.ts.map +1 -0
- package/lib/cjs/agent/errors.js +733 -0
- package/lib/cjs/agent/errors.js.map +1 -0
- package/lib/cjs/agent/fetch_candid.d.ts +9 -0
- package/lib/cjs/agent/fetch_candid.d.ts.map +1 -0
- package/lib/cjs/agent/fetch_candid.js +69 -0
- package/lib/cjs/agent/fetch_candid.js.map +1 -0
- package/lib/cjs/agent/index.d.ts +31 -1
- package/lib/cjs/agent/index.d.ts.map +1 -1
- package/lib/cjs/agent/index.js +59 -1
- package/lib/cjs/agent/index.js.map +1 -1
- package/lib/cjs/agent/observable.d.ts +24 -0
- package/lib/cjs/agent/observable.d.ts.map +1 -0
- package/lib/cjs/agent/observable.js +34 -0
- package/lib/cjs/agent/observable.js.map +1 -0
- package/lib/cjs/agent/polling/backoff.d.ts +50 -0
- package/lib/cjs/agent/polling/backoff.d.ts.map +1 -0
- package/lib/cjs/agent/polling/backoff.js +90 -0
- package/lib/cjs/agent/polling/backoff.js.map +1 -0
- package/lib/cjs/agent/polling/index.d.ts +63 -0
- package/lib/cjs/agent/polling/index.d.ts.map +1 -0
- package/lib/cjs/agent/polling/index.js +183 -0
- package/lib/cjs/agent/polling/index.js.map +1 -0
- package/lib/cjs/agent/polling/strategy.d.ts +52 -0
- package/lib/cjs/agent/polling/strategy.d.ts.map +1 -0
- package/lib/cjs/agent/polling/strategy.js +104 -0
- package/lib/cjs/agent/polling/strategy.js.map +1 -0
- package/lib/cjs/agent/public_key.d.ts +16 -0
- package/lib/cjs/agent/public_key.d.ts.map +1 -0
- package/lib/cjs/agent/public_key.js +52 -0
- package/lib/cjs/agent/public_key.js.map +1 -0
- package/lib/cjs/agent/request_id.d.ts +24 -0
- package/lib/cjs/agent/request_id.d.ts.map +1 -0
- package/lib/cjs/agent/request_id.js +88 -0
- package/lib/cjs/agent/request_id.js.map +1 -0
- package/lib/cjs/agent/utils/bls.d.ts +10 -0
- package/lib/cjs/agent/utils/bls.d.ts.map +1 -0
- package/lib/cjs/agent/utils/bls.js +20 -0
- package/lib/cjs/agent/utils/bls.js.map +1 -0
- package/lib/cjs/agent/utils/buffer.d.ts +22 -0
- package/lib/cjs/agent/utils/buffer.d.ts.map +1 -0
- package/lib/cjs/agent/utils/buffer.js +55 -0
- package/lib/cjs/agent/utils/buffer.js.map +1 -0
- package/lib/cjs/agent/utils/expirableMap.d.ts +80 -0
- package/lib/cjs/agent/utils/expirableMap.d.ts.map +1 -0
- package/lib/cjs/agent/utils/expirableMap.js +148 -0
- package/lib/cjs/agent/utils/expirableMap.js.map +1 -0
- package/lib/cjs/agent/utils/leb.d.ts +3 -0
- package/lib/cjs/agent/utils/leb.d.ts.map +1 -0
- package/lib/cjs/agent/utils/leb.js +17 -0
- package/lib/cjs/agent/utils/leb.js.map +1 -0
- package/lib/cjs/agent/utils/random.d.ts +6 -0
- package/lib/cjs/agent/utils/random.d.ts.map +1 -0
- package/lib/cjs/agent/utils/random.js +29 -0
- package/lib/cjs/agent/utils/random.js.map +1 -0
- package/lib/cjs/candid/candid-core.d.ts +72 -0
- package/lib/cjs/candid/candid-core.d.ts.map +1 -0
- package/lib/cjs/candid/candid-core.js +251 -0
- package/lib/cjs/candid/candid-core.js.map +1 -0
- package/lib/cjs/candid/candid-ui.d.ts +35 -0
- package/lib/cjs/candid/candid-ui.d.ts.map +1 -0
- package/lib/cjs/candid/candid-ui.js +317 -0
- package/lib/cjs/candid/candid-ui.js.map +1 -0
- package/lib/cjs/candid/idl.d.ts +579 -0
- package/lib/cjs/candid/idl.d.ts.map +1 -0
- package/lib/cjs/candid/idl.js +2228 -0
- package/lib/cjs/candid/idl.js.map +1 -0
- package/lib/cjs/candid/index.d.ts +11 -1
- package/lib/cjs/candid/index.d.ts.map +1 -1
- package/lib/cjs/candid/index.js +33 -1
- package/lib/cjs/candid/index.js.map +1 -1
- package/lib/cjs/candid/types.d.ts +6 -0
- package/lib/cjs/candid/types.d.ts.map +1 -0
- package/lib/cjs/candid/types.js +4 -0
- package/lib/cjs/candid/types.js.map +1 -0
- package/lib/cjs/candid/utils/bigint-math.d.ts +14 -0
- package/lib/cjs/candid/utils/bigint-math.d.ts.map +1 -0
- package/lib/cjs/candid/utils/bigint-math.js +30 -0
- package/lib/cjs/candid/utils/bigint-math.js.map +1 -0
- package/lib/cjs/candid/utils/buffer.d.ts +86 -0
- package/lib/cjs/candid/utils/buffer.d.ts.map +1 -0
- package/lib/cjs/candid/utils/buffer.js +191 -0
- package/lib/cjs/candid/utils/buffer.js.map +1 -0
- package/lib/cjs/candid/utils/hash.d.ts +7 -0
- package/lib/cjs/candid/utils/hash.d.ts.map +1 -0
- package/lib/cjs/candid/utils/hash.js +33 -0
- package/lib/cjs/candid/utils/hash.js.map +1 -0
- package/lib/cjs/candid/utils/leb128.d.ts +65 -0
- package/lib/cjs/candid/utils/leb128.d.ts.map +1 -0
- package/lib/cjs/candid/utils/leb128.js +228 -0
- package/lib/cjs/candid/utils/leb128.js.map +1 -0
- package/lib/cjs/identity/identity/delegation.d.ts +164 -0
- package/lib/cjs/identity/identity/delegation.d.ts.map +1 -0
- package/lib/cjs/identity/identity/delegation.js +302 -0
- package/lib/cjs/identity/identity/delegation.js.map +1 -0
- package/lib/cjs/identity/identity/ecdsa.d.ts +62 -0
- package/lib/cjs/identity/identity/ecdsa.d.ts.map +1 -0
- package/lib/cjs/identity/identity/ecdsa.js +117 -0
- package/lib/cjs/identity/identity/ecdsa.js.map +1 -0
- package/lib/cjs/identity/identity/ed25519.d.ts +67 -0
- package/lib/cjs/identity/identity/ed25519.d.ts.map +1 -0
- package/lib/cjs/identity/identity/ed25519.js +200 -0
- package/lib/cjs/identity/identity/ed25519.js.map +1 -0
- package/lib/cjs/identity/identity/partial.d.ts +34 -0
- package/lib/cjs/identity/identity/partial.d.ts.map +1 -0
- package/lib/cjs/identity/identity/partial.js +54 -0
- package/lib/cjs/identity/identity/partial.js.map +1 -0
- package/lib/cjs/identity/identity/webauthn.d.ts +51 -0
- package/lib/cjs/identity/identity/webauthn.d.ts.map +1 -0
- package/lib/cjs/identity/identity/webauthn.js +197 -0
- package/lib/cjs/identity/identity/webauthn.js.map +1 -0
- package/lib/cjs/identity/index.d.ts +15 -1
- package/lib/cjs/identity/index.d.ts.map +1 -1
- package/lib/cjs/identity/index.js +24 -1
- package/lib/cjs/identity/index.js.map +1 -1
- package/lib/cjs/identity/secp256k1/der.d.ts +33 -0
- package/lib/cjs/identity/secp256k1/der.d.ts.map +1 -0
- package/lib/cjs/identity/secp256k1/der.js +165 -0
- package/lib/cjs/identity/secp256k1/der.js.map +1 -0
- package/lib/cjs/identity/secp256k1/index.d.ts +4 -1
- package/lib/cjs/identity/secp256k1/index.d.ts.map +1 -1
- package/lib/cjs/identity/secp256k1/index.js +4 -1
- package/lib/cjs/identity/secp256k1/index.js.map +1 -1
- package/lib/cjs/identity/secp256k1/pem.d.ts +7 -0
- package/lib/cjs/identity/secp256k1/pem.d.ts.map +1 -0
- package/lib/cjs/identity/secp256k1/pem.js +75 -0
- package/lib/cjs/identity/secp256k1/pem.js.map +1 -0
- package/lib/cjs/identity/secp256k1/secp256k1.d.ts +87 -0
- package/lib/cjs/identity/secp256k1/secp256k1.d.ts.map +1 -0
- package/lib/cjs/identity/secp256k1/secp256k1.js +260 -0
- package/lib/cjs/identity/secp256k1/secp256k1.js.map +1 -0
- package/lib/cjs/principal/index.d.ts +3 -1
- package/lib/cjs/principal/index.d.ts.map +1 -1
- package/lib/cjs/principal/index.js +7 -1
- package/lib/cjs/principal/index.js.map +1 -1
- package/lib/cjs/principal/principal.d.ts +50 -0
- package/lib/cjs/principal/principal.d.ts.map +1 -0
- package/lib/cjs/principal/principal.js +148 -0
- package/lib/cjs/principal/principal.js.map +1 -0
- package/lib/cjs/principal/utils/base32.d.ts +10 -0
- package/lib/cjs/principal/utils/base32.d.ts.map +1 -0
- package/lib/cjs/principal/utils/base32.js +90 -0
- package/lib/cjs/principal/utils/base32.js.map +1 -0
- package/lib/cjs/principal/utils/getCrc.d.ts +6 -0
- package/lib/cjs/principal/utils/getCrc.d.ts.map +1 -0
- package/lib/cjs/principal/utils/getCrc.js +53 -0
- package/lib/cjs/principal/utils/getCrc.js.map +1 -0
- package/lib/esm/agent/actor.d.ts +203 -0
- package/lib/esm/agent/actor.d.ts.map +1 -0
- package/lib/esm/agent/actor.js +337 -0
- package/lib/esm/agent/actor.js.map +1 -0
- package/lib/esm/agent/agent/api.d.ts +216 -0
- package/lib/esm/agent/agent/api.d.ts.map +1 -0
- package/lib/esm/agent/agent/api.js +34 -0
- package/lib/esm/agent/agent/api.js.map +1 -0
- package/lib/esm/agent/agent/http/__certificates__/goldenCertificates.d.ts +7 -0
- package/lib/esm/agent/agent/http/__certificates__/goldenCertificates.d.ts.map +1 -0
- package/lib/esm/agent/agent/http/__certificates__/goldenCertificates.js +16 -0
- package/lib/esm/agent/agent/http/__certificates__/goldenCertificates.js.map +1 -0
- package/lib/esm/agent/agent/http/index.d.ts +171 -0
- package/lib/esm/agent/agent/http/index.d.ts.map +1 -0
- package/lib/esm/agent/agent/http/index.js +1037 -0
- package/lib/esm/agent/agent/http/index.js.map +1 -0
- package/lib/esm/agent/agent/http/transforms.d.ts +54 -0
- package/lib/esm/agent/agent/http/transforms.d.ts.map +1 -0
- package/lib/esm/agent/agent/http/transforms.js +128 -0
- package/lib/esm/agent/agent/http/transforms.js.map +1 -0
- package/lib/esm/agent/agent/http/types.d.ts +81 -0
- package/lib/esm/agent/agent/http/types.d.ts.map +1 -0
- package/lib/esm/agent/agent/http/types.js +39 -0
- package/lib/esm/agent/agent/http/types.js.map +1 -0
- package/lib/esm/agent/agent/index.d.ts +3 -0
- package/lib/esm/agent/agent/index.d.ts.map +1 -0
- package/lib/esm/agent/agent/index.js +3 -0
- package/lib/esm/agent/agent/index.js.map +1 -0
- package/lib/esm/agent/auth.d.ts +91 -0
- package/lib/esm/agent/auth.d.ts.map +1 -0
- package/lib/esm/agent/auth.js +59 -0
- package/lib/esm/agent/auth.js.map +1 -0
- package/lib/esm/agent/canister-env/index.d.ts +110 -1
- package/lib/esm/agent/canister-env/index.d.ts.map +1 -1
- package/lib/esm/agent/canister-env/index.js +110 -1
- package/lib/esm/agent/canister-env/index.js.map +1 -1
- package/lib/esm/agent/canisterStatus/index.d.ts +93 -0
- package/lib/esm/agent/canisterStatus/index.d.ts.map +1 -0
- package/lib/esm/agent/canisterStatus/index.js +261 -0
- package/lib/esm/agent/canisterStatus/index.js.map +1 -0
- package/lib/esm/agent/cbor.d.ts +26 -0
- package/lib/esm/agent/cbor.d.ts.map +1 -0
- package/lib/esm/agent/cbor.js +54 -0
- package/lib/esm/agent/cbor.js.map +1 -0
- package/lib/esm/agent/certificate.d.ts +228 -0
- package/lib/esm/agent/certificate.d.ts.map +1 -0
- package/lib/esm/agent/certificate.js +545 -0
- package/lib/esm/agent/certificate.js.map +1 -0
- package/lib/esm/agent/constants.d.ts +14 -0
- package/lib/esm/agent/constants.d.ts.map +1 -0
- package/lib/esm/agent/constants.js +15 -0
- package/lib/esm/agent/constants.js.map +1 -0
- package/lib/esm/agent/der.d.ts +34 -0
- package/lib/esm/agent/der.d.ts.map +1 -0
- package/lib/esm/agent/der.js +166 -0
- package/lib/esm/agent/der.js.map +1 -0
- package/lib/esm/agent/errors.d.ts +380 -0
- package/lib/esm/agent/errors.d.ts.map +1 -0
- package/lib/esm/agent/errors.js +678 -0
- package/lib/esm/agent/errors.js.map +1 -0
- package/lib/esm/agent/fetch_candid.d.ts +9 -0
- package/lib/esm/agent/fetch_candid.d.ts.map +1 -0
- package/lib/esm/agent/fetch_candid.js +33 -0
- package/lib/esm/agent/fetch_candid.js.map +1 -0
- package/lib/esm/agent/index.d.ts +31 -1
- package/lib/esm/agent/index.d.ts.map +1 -1
- package/lib/esm/agent/index.js +31 -1
- package/lib/esm/agent/index.js.map +1 -1
- package/lib/esm/agent/observable.d.ts +24 -0
- package/lib/esm/agent/observable.d.ts.map +1 -0
- package/lib/esm/agent/observable.js +29 -0
- package/lib/esm/agent/observable.js.map +1 -0
- package/lib/esm/agent/polling/backoff.d.ts +50 -0
- package/lib/esm/agent/polling/backoff.d.ts.map +1 -0
- package/lib/esm/agent/polling/backoff.js +85 -0
- package/lib/esm/agent/polling/backoff.js.map +1 -0
- package/lib/esm/agent/polling/index.d.ts +63 -0
- package/lib/esm/agent/polling/index.d.ts.map +1 -0
- package/lib/esm/agent/polling/index.js +144 -0
- package/lib/esm/agent/polling/index.js.map +1 -0
- package/lib/esm/agent/polling/strategy.d.ts +52 -0
- package/lib/esm/agent/polling/strategy.d.ts.map +1 -0
- package/lib/esm/agent/polling/strategy.js +94 -0
- package/lib/esm/agent/polling/strategy.js.map +1 -0
- package/lib/esm/agent/public_key.d.ts +16 -0
- package/lib/esm/agent/public_key.d.ts.map +1 -0
- package/lib/esm/agent/public_key.js +48 -0
- package/lib/esm/agent/public_key.js.map +1 -0
- package/lib/esm/agent/request_id.d.ts +24 -0
- package/lib/esm/agent/request_id.d.ts.map +1 -0
- package/lib/esm/agent/request_id.js +83 -0
- package/lib/esm/agent/request_id.js.map +1 -0
- package/lib/esm/agent/utils/bls.d.ts +10 -0
- package/lib/esm/agent/utils/bls.d.ts.map +1 -0
- package/lib/esm/agent/utils/bls.js +17 -0
- package/lib/esm/agent/utils/bls.js.map +1 -0
- package/lib/esm/agent/utils/buffer.d.ts +22 -0
- package/lib/esm/agent/utils/buffer.d.ts.map +1 -0
- package/lib/esm/agent/utils/buffer.js +50 -0
- package/lib/esm/agent/utils/buffer.js.map +1 -0
- package/lib/esm/agent/utils/expirableMap.d.ts +80 -0
- package/lib/esm/agent/utils/expirableMap.d.ts.map +1 -0
- package/lib/esm/agent/utils/expirableMap.js +144 -0
- package/lib/esm/agent/utils/expirableMap.js.map +1 -0
- package/lib/esm/agent/utils/leb.d.ts +3 -0
- package/lib/esm/agent/utils/leb.d.ts.map +1 -0
- package/lib/esm/agent/utils/leb.js +12 -0
- package/lib/esm/agent/utils/leb.js.map +1 -0
- package/lib/esm/agent/utils/random.d.ts +6 -0
- package/lib/esm/agent/utils/random.d.ts.map +1 -0
- package/lib/esm/agent/utils/random.js +25 -0
- package/lib/esm/agent/utils/random.js.map +1 -0
- package/lib/esm/candid/candid-core.d.ts +72 -0
- package/lib/esm/candid/candid-core.d.ts.map +1 -0
- package/lib/esm/candid/candid-core.js +241 -0
- package/lib/esm/candid/candid-core.js.map +1 -0
- package/lib/esm/candid/candid-ui.d.ts +35 -0
- package/lib/esm/candid/candid-ui.d.ts.map +1 -0
- package/lib/esm/candid/candid-ui.js +272 -0
- package/lib/esm/candid/candid-ui.js.map +1 -0
- package/lib/esm/candid/idl.d.ts +579 -0
- package/lib/esm/candid/idl.d.ts.map +1 -0
- package/lib/esm/candid/idl.js +2189 -0
- package/lib/esm/candid/idl.js.map +1 -0
- package/lib/esm/candid/index.d.ts +11 -1
- package/lib/esm/candid/index.d.ts.map +1 -1
- package/lib/esm/candid/index.js +10 -1
- package/lib/esm/candid/index.js.map +1 -1
- package/lib/esm/candid/types.d.ts +6 -0
- package/lib/esm/candid/types.d.ts.map +1 -0
- package/lib/esm/candid/types.js +3 -0
- package/lib/esm/candid/types.js.map +1 -0
- package/lib/esm/candid/utils/bigint-math.d.ts +14 -0
- package/lib/esm/candid/utils/bigint-math.d.ts.map +1 -0
- package/lib/esm/candid/utils/bigint-math.js +26 -0
- package/lib/esm/candid/utils/bigint-math.js.map +1 -0
- package/lib/esm/candid/utils/buffer.d.ts +86 -0
- package/lib/esm/candid/utils/buffer.d.ts.map +1 -0
- package/lib/esm/candid/utils/buffer.js +182 -0
- package/lib/esm/candid/utils/buffer.js.map +1 -0
- package/lib/esm/candid/utils/hash.d.ts +7 -0
- package/lib/esm/candid/utils/hash.d.ts.map +1 -0
- package/lib/esm/candid/utils/hash.js +30 -0
- package/lib/esm/candid/utils/hash.js.map +1 -0
- package/lib/esm/candid/utils/leb128.d.ts +65 -0
- package/lib/esm/candid/utils/leb128.d.ts.map +1 -0
- package/lib/esm/candid/utils/leb128.js +216 -0
- package/lib/esm/candid/utils/leb128.js.map +1 -0
- package/lib/esm/identity/identity/delegation.d.ts +164 -0
- package/lib/esm/identity/identity/delegation.d.ts.map +1 -0
- package/lib/esm/identity/identity/delegation.js +294 -0
- package/lib/esm/identity/identity/delegation.js.map +1 -0
- package/lib/esm/identity/identity/ecdsa.d.ts +62 -0
- package/lib/esm/identity/identity/ecdsa.d.ts.map +1 -0
- package/lib/esm/identity/identity/ecdsa.js +112 -0
- package/lib/esm/identity/identity/ecdsa.js.map +1 -0
- package/lib/esm/identity/identity/ed25519.d.ts +67 -0
- package/lib/esm/identity/identity/ed25519.d.ts.map +1 -0
- package/lib/esm/identity/identity/ed25519.js +195 -0
- package/lib/esm/identity/identity/ed25519.js.map +1 -0
- package/lib/esm/identity/identity/partial.d.ts +34 -0
- package/lib/esm/identity/identity/partial.d.ts.map +1 -0
- package/lib/esm/identity/identity/partial.js +50 -0
- package/lib/esm/identity/identity/partial.js.map +1 -0
- package/lib/esm/identity/identity/webauthn.d.ts +51 -0
- package/lib/esm/identity/identity/webauthn.d.ts.map +1 -0
- package/lib/esm/identity/identity/webauthn.js +192 -0
- package/lib/esm/identity/identity/webauthn.js.map +1 -0
- package/lib/esm/identity/index.d.ts +15 -1
- package/lib/esm/identity/index.d.ts.map +1 -1
- package/lib/esm/identity/index.js +17 -1
- package/lib/esm/identity/index.js.map +1 -1
- package/lib/esm/identity/secp256k1/der.d.ts +33 -0
- package/lib/esm/identity/secp256k1/der.d.ts.map +1 -0
- package/lib/esm/identity/secp256k1/der.js +156 -0
- package/lib/esm/identity/secp256k1/der.js.map +1 -0
- package/lib/esm/identity/secp256k1/index.d.ts +4 -1
- package/lib/esm/identity/secp256k1/index.d.ts.map +1 -1
- package/lib/esm/identity/secp256k1/index.js +4 -1
- package/lib/esm/identity/secp256k1/index.js.map +1 -1
- package/lib/esm/identity/secp256k1/pem.d.ts +7 -0
- package/lib/esm/identity/secp256k1/pem.d.ts.map +1 -0
- package/lib/esm/identity/secp256k1/pem.js +39 -0
- package/lib/esm/identity/secp256k1/pem.js.map +1 -0
- package/lib/esm/identity/secp256k1/secp256k1.d.ts +87 -0
- package/lib/esm/identity/secp256k1/secp256k1.d.ts.map +1 -0
- package/lib/esm/identity/secp256k1/secp256k1.js +222 -0
- package/lib/esm/identity/secp256k1/secp256k1.js.map +1 -0
- package/lib/esm/principal/index.d.ts +3 -1
- package/lib/esm/principal/index.d.ts.map +1 -1
- package/lib/esm/principal/index.js +3 -1
- package/lib/esm/principal/index.js.map +1 -1
- package/lib/esm/principal/principal.d.ts +50 -0
- package/lib/esm/principal/principal.d.ts.map +1 -0
- package/lib/esm/principal/principal.js +144 -0
- package/lib/esm/principal/principal.js.map +1 -0
- package/lib/esm/principal/utils/base32.d.ts +10 -0
- package/lib/esm/principal/utils/base32.d.ts.map +1 -0
- package/lib/esm/principal/utils/base32.js +86 -0
- package/lib/esm/principal/utils/base32.js.map +1 -0
- package/lib/esm/principal/utils/getCrc.d.ts +6 -0
- package/lib/esm/principal/utils/getCrc.d.ts.map +1 -0
- package/lib/esm/principal/utils/getCrc.js +50 -0
- package/lib/esm/principal/utils/getCrc.js.map +1 -0
- package/package.json +17 -11
- package/src/agent/actor.ts +576 -0
- package/src/agent/agent/api.ts +262 -0
- package/src/agent/agent/http/index.ts +1405 -0
- package/src/agent/agent/http/transforms.ts +158 -0
- package/src/agent/agent/http/types.ts +126 -0
- package/src/agent/agent/index.ts +2 -0
- package/src/agent/auth.ts +147 -0
- package/src/agent/canister-env/index.ts +191 -1
- package/src/agent/canisterStatus/index.ts +412 -0
- package/src/agent/cbor.ts +63 -0
- package/src/agent/certificate.ts +841 -0
- package/src/agent/constants.ts +19 -0
- package/src/agent/der.ts +170 -0
- package/src/agent/errors.ts +868 -0
- package/src/agent/fetch_candid.ts +37 -0
- package/src/agent/index.ts +37 -1
- package/src/agent/observable.ts +49 -0
- package/src/agent/polling/backoff.ts +130 -0
- package/src/agent/polling/index.ts +250 -0
- package/src/agent/polling/strategy.ts +144 -0
- package/src/agent/public_key.ts +65 -0
- package/src/agent/request_id.ts +92 -0
- package/src/agent/utils/bls.ts +18 -0
- package/src/agent/utils/buffer.ts +60 -0
- package/src/agent/utils/expirableMap.ts +163 -0
- package/src/agent/utils/leb.ts +14 -0
- package/src/agent/utils/random.ts +30 -0
- package/src/candid/candid-core.ts +276 -0
- package/src/candid/candid-ui.ts +289 -0
- package/src/candid/idl.ts +2556 -0
- package/src/candid/index.ts +16 -1
- package/src/candid/types.ts +7 -0
- package/src/candid/utils/bigint-math.ts +26 -0
- package/src/candid/utils/buffer.ts +221 -0
- package/src/candid/utils/hash.ts +31 -0
- package/src/candid/utils/leb128.ts +234 -0
- package/src/identity/identity/delegation.ts +411 -0
- package/src/identity/identity/ecdsa.ts +158 -0
- package/src/identity/identity/ed25519.ts +239 -0
- package/src/identity/identity/partial.ts +60 -0
- package/src/identity/identity/webauthn.ts +265 -0
- package/src/identity/index.ts +19 -1
- package/src/identity/secp256k1/der.ts +156 -0
- package/src/identity/secp256k1/index.ts +5 -1
- package/src/identity/secp256k1/pem.ts +40 -0
- package/src/identity/secp256k1/secp256k1.ts +270 -0
- package/src/package.json +4 -0
- package/src/principal/index.ts +3 -1
- package/src/principal/principal.ts +171 -0
- package/src/principal/utils/base32.ts +101 -0
- package/src/principal/utils/getCrc.ts +52 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { type Agent, type HttpDetailsResponse } from './agent/index.ts';
|
|
2
|
+
import { IDL } from '../candid/index.js';
|
|
3
|
+
import { type PollingOptions } from './polling/index.ts';
|
|
4
|
+
import { Principal } from '../principal/index.js';
|
|
5
|
+
import { Certificate, type CreateCertificateOptions } from './certificate.ts';
|
|
6
|
+
/**
|
|
7
|
+
* Configuration to make calls to the Replica.
|
|
8
|
+
*/
|
|
9
|
+
export interface CallConfig {
|
|
10
|
+
/**
|
|
11
|
+
* An agent to use in this call, otherwise the actor or call will try to discover the
|
|
12
|
+
* agent to use.
|
|
13
|
+
*/
|
|
14
|
+
agent?: Agent;
|
|
15
|
+
/**
|
|
16
|
+
* Options for controlling polling behavior.
|
|
17
|
+
*/
|
|
18
|
+
pollingOptions?: PollingOptions;
|
|
19
|
+
/**
|
|
20
|
+
* The canister ID of this Actor.
|
|
21
|
+
*/
|
|
22
|
+
canisterId?: string | Principal;
|
|
23
|
+
/**
|
|
24
|
+
* The effective canister ID.
|
|
25
|
+
*/
|
|
26
|
+
effectiveCanisterId?: Principal;
|
|
27
|
+
/**
|
|
28
|
+
* The nonce to use for this call. This is used to prevent replay attacks.
|
|
29
|
+
*/
|
|
30
|
+
nonce?: Uint8Array;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Configuration that can be passed to customize the Actor behavior.
|
|
34
|
+
*/
|
|
35
|
+
export interface ActorConfig extends Pick<CallConfig, 'agent' | 'effectiveCanisterId'> {
|
|
36
|
+
/**
|
|
37
|
+
* The Canister ID of this Actor. This is required for an Actor.
|
|
38
|
+
*/
|
|
39
|
+
canisterId: string | Principal;
|
|
40
|
+
/**
|
|
41
|
+
* An override function for update calls' CallConfig. This will be called on every calls.
|
|
42
|
+
*/
|
|
43
|
+
callTransform?(methodName: string, args: unknown[], callConfig: CallConfig): Partial<CallConfig> | void;
|
|
44
|
+
/**
|
|
45
|
+
* An override function for query calls' CallConfig. This will be called on every query.
|
|
46
|
+
*/
|
|
47
|
+
queryTransform?(methodName: string, args: unknown[], callConfig: CallConfig): Partial<CallConfig> | void;
|
|
48
|
+
/**
|
|
49
|
+
* Polyfill for BLS Certificate verification in case wasm is not supported
|
|
50
|
+
*/
|
|
51
|
+
blsVerify?: CreateCertificateOptions['blsVerify'];
|
|
52
|
+
/**
|
|
53
|
+
* Polling options to use when making update calls. This will override the default DEFAULT_POLLING_OPTIONS.
|
|
54
|
+
*/
|
|
55
|
+
pollingOptions?: PollingOptions;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* A subclass of an actor. Actor class itself is meant to be a based class.
|
|
59
|
+
*/
|
|
60
|
+
export type ActorSubclass<T = Record<string, ActorMethod>> = Actor & T;
|
|
61
|
+
/**
|
|
62
|
+
* An actor method type, defined for each methods of the actor service.
|
|
63
|
+
*/
|
|
64
|
+
export interface ActorMethod<Args extends unknown[] = unknown[], Ret = unknown> {
|
|
65
|
+
(...args: Args): Promise<Ret>;
|
|
66
|
+
withOptions(options: CallConfig): (...args: Args) => Promise<Ret>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* An actor method type, defined for each methods of the actor service.
|
|
70
|
+
*/
|
|
71
|
+
export interface ActorMethodWithHttpDetails<Args extends unknown[] = unknown[], Ret = unknown> extends ActorMethod {
|
|
72
|
+
(...args: Args): Promise<{
|
|
73
|
+
httpDetails: HttpDetailsResponse;
|
|
74
|
+
result: Ret;
|
|
75
|
+
}>;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* An actor method type, defined for each methods of the actor service.
|
|
79
|
+
*/
|
|
80
|
+
export interface ActorMethodExtended<Args extends unknown[] = unknown[], Ret = unknown> extends ActorMethod {
|
|
81
|
+
(...args: Args): Promise<{
|
|
82
|
+
certificate?: Certificate;
|
|
83
|
+
httpDetails?: HttpDetailsResponse;
|
|
84
|
+
result: Ret;
|
|
85
|
+
}>;
|
|
86
|
+
}
|
|
87
|
+
export type FunctionWithArgsAndReturn<Args extends unknown[] = unknown[], Ret = unknown> = (...args: Args) => Ret;
|
|
88
|
+
export type ActorMethodMappedWithHttpDetails<T> = {
|
|
89
|
+
[K in keyof T]: T[K] extends FunctionWithArgsAndReturn<infer Args, infer Ret> ? ActorMethodWithHttpDetails<Args, Ret> : never;
|
|
90
|
+
};
|
|
91
|
+
export type ActorMethodMappedExtended<T> = {
|
|
92
|
+
[K in keyof T]: T[K] extends FunctionWithArgsAndReturn<infer Args, infer Ret> ? ActorMethodExtended<Args, Ret> : never;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Internal metadata for actors. It's an enhanced version of ActorConfig with
|
|
96
|
+
* some fields marked as required (as they are defaulted) and canisterId as
|
|
97
|
+
* a Principal type.
|
|
98
|
+
*/
|
|
99
|
+
interface ActorMetadata {
|
|
100
|
+
service: IDL.ServiceClass;
|
|
101
|
+
agent?: Agent;
|
|
102
|
+
config: ActorConfig;
|
|
103
|
+
}
|
|
104
|
+
declare const metadataSymbol: unique symbol;
|
|
105
|
+
export interface CreateActorClassOpts {
|
|
106
|
+
httpDetails?: boolean;
|
|
107
|
+
certificate?: boolean;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* An actor base class. An actor is an object containing only functions that will
|
|
111
|
+
* return a promise. These functions are derived from the IDL definition.
|
|
112
|
+
*/
|
|
113
|
+
export declare class Actor {
|
|
114
|
+
/**
|
|
115
|
+
* Get the Agent class this Actor would call, or undefined if the Actor would use
|
|
116
|
+
* the default agent (global.ic.agent).
|
|
117
|
+
* @param actor The actor to get the agent of.
|
|
118
|
+
*/
|
|
119
|
+
static agentOf(actor: Actor): Agent | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Get the interface of an actor, in the form of an instance of a Service.
|
|
122
|
+
* @param actor The actor to get the interface of.
|
|
123
|
+
*/
|
|
124
|
+
static interfaceOf(actor: Actor): IDL.ServiceClass;
|
|
125
|
+
static canisterIdOf(actor: Actor): Principal;
|
|
126
|
+
static createActorClass(interfaceFactory: IDL.InterfaceFactory, options?: CreateActorClassOpts): ActorConstructor;
|
|
127
|
+
/**
|
|
128
|
+
* Creates an actor with the given interface factory and configuration.
|
|
129
|
+
*
|
|
130
|
+
* The [`@icp-sdk/bindgen`](https://js.icp.build/bindgen/) package can be used to generate the interface factory for your canister.
|
|
131
|
+
* @param interfaceFactory - the interface factory for the actor, typically generated by the [`@icp-sdk/bindgen`](https://js.icp.build/bindgen/) package
|
|
132
|
+
* @param configuration - the configuration for the actor
|
|
133
|
+
* @returns an actor with the given interface factory and configuration
|
|
134
|
+
* @see The {@link https://js.icp.build/core/latest/canister-environment/ | Canister Environment Guide} for more details on how to configure an actor using the canister environment.
|
|
135
|
+
* @example
|
|
136
|
+
* Using the interface factory generated by the [`@icp-sdk/bindgen`](https://js.icp.build/bindgen/) package:
|
|
137
|
+
* ```ts
|
|
138
|
+
* import { Actor, HttpAgent } from '@icp-sdk/core/agent';
|
|
139
|
+
* import { Principal } from '@icp-sdk/core/principal';
|
|
140
|
+
* import { idlFactory } from './api/declarations/hello-world.did';
|
|
141
|
+
*
|
|
142
|
+
* // For a convenient way to get the canister ID,
|
|
143
|
+
* // see the https://js.icp.build/core/latest/canister-environment/ guide.
|
|
144
|
+
* const canisterId = Principal.fromText('rrkah-fqaaa-aaaaa-aaaaq-cai');
|
|
145
|
+
*
|
|
146
|
+
* const agent = await HttpAgent.create({
|
|
147
|
+
* host: 'https://icp-api.io',
|
|
148
|
+
* });
|
|
149
|
+
*
|
|
150
|
+
* const actor = Actor.createActor(idlFactory, {
|
|
151
|
+
* agent,
|
|
152
|
+
* canisterId,
|
|
153
|
+
* });
|
|
154
|
+
*
|
|
155
|
+
* const response = await actor.greet('world');
|
|
156
|
+
* console.log(response);
|
|
157
|
+
* ```
|
|
158
|
+
* @example
|
|
159
|
+
* Using the `createActor` wrapper function generated by the [`@icp-sdk/bindgen`](https://js.icp.build/bindgen/) package:
|
|
160
|
+
* ```ts
|
|
161
|
+
* import { HttpAgent } from '@icp-sdk/core/agent';
|
|
162
|
+
* import { Principal } from '@icp-sdk/core/principal';
|
|
163
|
+
* import { createActor } from './api/hello-world';
|
|
164
|
+
*
|
|
165
|
+
* // For a convenient way to get the canister ID,
|
|
166
|
+
* // see the https://js.icp.build/core/latest/canister-environment/ guide.
|
|
167
|
+
* const canisterId = Principal.fromText('rrkah-fqaaa-aaaaa-aaaaq-cai');
|
|
168
|
+
*
|
|
169
|
+
* const agent = await HttpAgent.create({
|
|
170
|
+
* host: 'https://icp-api.io',
|
|
171
|
+
* });
|
|
172
|
+
*
|
|
173
|
+
* const actor = createActor(canisterId, {
|
|
174
|
+
* agent,
|
|
175
|
+
* });
|
|
176
|
+
*
|
|
177
|
+
* const response = await actor.greet('world');
|
|
178
|
+
* console.log(response);
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
static createActor<T = Record<string, ActorMethod>>(interfaceFactory: IDL.InterfaceFactory, configuration: ActorConfig): ActorSubclass<T>;
|
|
182
|
+
/**
|
|
183
|
+
* Returns an actor with methods that return the http response details along with the result
|
|
184
|
+
* @param interfaceFactory - the interface factory for the actor
|
|
185
|
+
* @param configuration - the configuration for the actor
|
|
186
|
+
* @deprecated - use createActor with actorClassOptions instead
|
|
187
|
+
*/
|
|
188
|
+
static createActorWithHttpDetails<T = Record<string, ActorMethod>>(interfaceFactory: IDL.InterfaceFactory, configuration: ActorConfig): ActorSubclass<ActorMethodMappedWithHttpDetails<T>>;
|
|
189
|
+
/**
|
|
190
|
+
* Returns an actor with methods that return the http response details along with the result
|
|
191
|
+
* @param interfaceFactory - the interface factory for the actor
|
|
192
|
+
* @param configuration - the configuration for the actor
|
|
193
|
+
* @param actorClassOptions - options for the actor class extended details to return with the result
|
|
194
|
+
*/
|
|
195
|
+
static createActorWithExtendedDetails<T = Record<string, ActorMethod>>(interfaceFactory: IDL.InterfaceFactory, configuration: ActorConfig, actorClassOptions?: CreateActorClassOpts): ActorSubclass<ActorMethodMappedExtended<T>>;
|
|
196
|
+
private [metadataSymbol];
|
|
197
|
+
protected constructor(metadata: ActorMetadata);
|
|
198
|
+
}
|
|
199
|
+
export type ActorConstructor = new (config: ActorConfig) => ActorSubclass;
|
|
200
|
+
export declare const ACTOR_METHOD_WITH_HTTP_DETAILS = "http-details";
|
|
201
|
+
export declare const ACTOR_METHOD_WITH_CERTIFICATE = "certificate";
|
|
202
|
+
export {};
|
|
203
|
+
//# sourceMappingURL=actor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actor.d.ts","sourceRoot":"","sources":["../../../src/agent/actor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EACV,KAAK,mBAAmB,EAIzB,MAAM,kBAAkB,CAAC;AAa1B,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAmB,KAAK,cAAc,EAA2B,MAAM,oBAAoB,CAAC;AACnG,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,KAAK,wBAAwB,EAAwB,MAAM,kBAAkB,CAAC;AAIpG;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEhC;;OAEG;IACH,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAEhC;;OAEG;IACH,K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AO,MAAM,8BAA8B,iBAAiB,CAAC;AAC7D,eAAO,MAAM,6BAA6B,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ACTOR_METHOD_WITH_CERTIFICATE = exports.ACTOR_METHOD_WITH_HTTP_DETAILS = exports.Actor = void 0;
|
|
4
|
+
const index_ts_1 = require("./agent/index.js");
|
|
5
|
+
const errors_ts_1 = require("./errors.js");
|
|
6
|
+
const _candid_1 = require("../candid/index.js");
|
|
7
|
+
const index_ts_2 = require("./polling/index.js");
|
|
8
|
+
const _principal_1 = require("../principal/index.js");
|
|
9
|
+
const certificate_ts_1 = require("./certificate.js");
|
|
10
|
+
const index_ts_3 = require("./agent/http/index.js");
|
|
11
|
+
const utils_1 = require("@noble/hashes/utils");
|
|
12
|
+
const metadataSymbol = Symbol.for('ic-agent-metadata');
|
|
13
|
+
/**
|
|
14
|
+
* An actor base class. An actor is an object containing only functions that will
|
|
15
|
+
* return a promise. These functions are derived from the IDL definition.
|
|
16
|
+
*/
|
|
17
|
+
class Actor {
|
|
18
|
+
/**
|
|
19
|
+
* Get the Agent class this Actor would call, or undefined if the Actor would use
|
|
20
|
+
* the default agent (global.ic.agent).
|
|
21
|
+
* @param actor The actor to get the agent of.
|
|
22
|
+
*/
|
|
23
|
+
static agentOf(actor) {
|
|
24
|
+
return actor[metadataSymbol].config.agent;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get the interface of an actor, in the form of an instance of a Service.
|
|
28
|
+
* @param actor The actor to get the interface of.
|
|
29
|
+
*/
|
|
30
|
+
static interfaceOf(actor) {
|
|
31
|
+
return actor[metadataSymbol].service;
|
|
32
|
+
}
|
|
33
|
+
static canisterIdOf(actor) {
|
|
34
|
+
return _principal_1.Principal.from(actor[metadataSymbol].config.canisterId);
|
|
35
|
+
}
|
|
36
|
+
static createActorClass(interfaceFactory, options) {
|
|
37
|
+
const service = interfaceFactory({ IDL: _candid_1.IDL });
|
|
38
|
+
class CanisterActor extends Actor {
|
|
39
|
+
constructor(config) {
|
|
40
|
+
if (!config.canisterId) {
|
|
41
|
+
throw errors_ts_1.InputError.fromCode(new errors_ts_1.MissingCanisterIdErrorCode(config.canisterId));
|
|
42
|
+
}
|
|
43
|
+
const canisterId = typeof config.canisterId === 'string'
|
|
44
|
+
? _principal_1.Principal.fromText(config.canisterId)
|
|
45
|
+
: config.canisterId;
|
|
46
|
+
super({
|
|
47
|
+
config: {
|
|
48
|
+
...DEFAULT_ACTOR_CONFIG,
|
|
49
|
+
...config,
|
|
50
|
+
canisterId,
|
|
51
|
+
},
|
|
52
|
+
service,
|
|
53
|
+
});
|
|
54
|
+
for (const [methodName, func] of service._fields) {
|
|
55
|
+
if (options?.httpDetails) {
|
|
56
|
+
func.annotations.push(exports.ACTOR_METHOD_WITH_HTTP_DETAILS);
|
|
57
|
+
}
|
|
58
|
+
if (options?.certificate) {
|
|
59
|
+
func.annotations.push(exports.ACTOR_METHOD_WITH_CERTIFICATE);
|
|
60
|
+
}
|
|
61
|
+
this[methodName] = _createActorMethod(this, methodName, func, config.blsVerify);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return CanisterActor;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Creates an actor with the given interface factory and configuration.
|
|
69
|
+
*
|
|
70
|
+
* The [`@icp-sdk/bindgen`](https://js.icp.build/bindgen/) package can be used to generate the interface factory for your canister.
|
|
71
|
+
* @param interfaceFactory - the interface factory for the actor, typically generated by the [`@icp-sdk/bindgen`](https://js.icp.build/bindgen/) package
|
|
72
|
+
* @param configuration - the configuration for the actor
|
|
73
|
+
* @returns an actor with the given interface factory and configuration
|
|
74
|
+
* @see The {@link https://js.icp.build/core/latest/canister-environment/ | Canister Environment Guide} for more details on how to configure an actor using the canister environment.
|
|
75
|
+
* @example
|
|
76
|
+
* Using the interface factory generated by the [`@icp-sdk/bindgen`](https://js.icp.build/bindgen/) package:
|
|
77
|
+
* ```ts
|
|
78
|
+
* import { Actor, HttpAgent } from '@icp-sdk/core/agent';
|
|
79
|
+
* import { Principal } from '@icp-sdk/core/principal';
|
|
80
|
+
* import { idlFactory } from './api/declarations/hello-world.did';
|
|
81
|
+
*
|
|
82
|
+
* // For a convenient way to get the canister ID,
|
|
83
|
+
* // see the https://js.icp.build/core/latest/canister-environment/ guide.
|
|
84
|
+
* const canisterId = Principal.fromText('rrkah-fqaaa-aaaaa-aaaaq-cai');
|
|
85
|
+
*
|
|
86
|
+
* const agent = await HttpAgent.create({
|
|
87
|
+
* host: 'https://icp-api.io',
|
|
88
|
+
* });
|
|
89
|
+
*
|
|
90
|
+
* const actor = Actor.createActor(idlFactory, {
|
|
91
|
+
* agent,
|
|
92
|
+
* canisterId,
|
|
93
|
+
* });
|
|
94
|
+
*
|
|
95
|
+
* const response = await actor.greet('world');
|
|
96
|
+
* console.log(response);
|
|
97
|
+
* ```
|
|
98
|
+
* @example
|
|
99
|
+
* Using the `createActor` wrapper function generated by the [`@icp-sdk/bindgen`](https://js.icp.build/bindgen/) package:
|
|
100
|
+
* ```ts
|
|
101
|
+
* import { HttpAgent } from '@icp-sdk/core/agent';
|
|
102
|
+
* import { Principal } from '@icp-sdk/core/principal';
|
|
103
|
+
* import { createActor } from './api/hello-world';
|
|
104
|
+
*
|
|
105
|
+
* // For a convenient way to get the canister ID,
|
|
106
|
+
* // see the https://js.icp.build/core/latest/canister-environment/ guide.
|
|
107
|
+
* const canisterId = Principal.fromText('rrkah-fqaaa-aaaaa-aaaaq-cai');
|
|
108
|
+
*
|
|
109
|
+
* const agent = await HttpAgent.create({
|
|
110
|
+
* host: 'https://icp-api.io',
|
|
111
|
+
* });
|
|
112
|
+
*
|
|
113
|
+
* const actor = createActor(canisterId, {
|
|
114
|
+
* agent,
|
|
115
|
+
* });
|
|
116
|
+
*
|
|
117
|
+
* const response = await actor.greet('world');
|
|
118
|
+
* console.log(response);
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
static createActor(interfaceFactory, configuration) {
|
|
122
|
+
if (!configuration.canisterId) {
|
|
123
|
+
throw errors_ts_1.InputError.fromCode(new errors_ts_1.MissingCanisterIdErrorCode(configuration.canisterId));
|
|
124
|
+
}
|
|
125
|
+
return new (this.createActorClass(interfaceFactory))(configuration);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Returns an actor with methods that return the http response details along with the result
|
|
129
|
+
* @param interfaceFactory - the interface factory for the actor
|
|
130
|
+
* @param configuration - the configuration for the actor
|
|
131
|
+
* @deprecated - use createActor with actorClassOptions instead
|
|
132
|
+
*/
|
|
133
|
+
static createActorWithHttpDetails(interfaceFactory, configuration) {
|
|
134
|
+
return new (this.createActorClass(interfaceFactory, { httpDetails: true }))(configuration);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Returns an actor with methods that return the http response details along with the result
|
|
138
|
+
* @param interfaceFactory - the interface factory for the actor
|
|
139
|
+
* @param configuration - the configuration for the actor
|
|
140
|
+
* @param actorClassOptions - options for the actor class extended details to return with the result
|
|
141
|
+
*/
|
|
142
|
+
static createActorWithExtendedDetails(interfaceFactory, configuration, actorClassOptions = {
|
|
143
|
+
httpDetails: true,
|
|
144
|
+
certificate: true,
|
|
145
|
+
}) {
|
|
146
|
+
return new (this.createActorClass(interfaceFactory, actorClassOptions))(configuration);
|
|
147
|
+
}
|
|
148
|
+
constructor(metadata) {
|
|
149
|
+
this[metadataSymbol] = Object.freeze(metadata);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
exports.Actor = Actor;
|
|
153
|
+
// IDL functions can have multiple return values, so decoding always
|
|
154
|
+
// produces an array. Ensure that functions with single or zero return
|
|
155
|
+
// values behave as expected.
|
|
156
|
+
function decodeReturnValue(types, msg) {
|
|
157
|
+
const returnValues = _candid_1.IDL.decode(types, msg);
|
|
158
|
+
switch (returnValues.length) {
|
|
159
|
+
case 0:
|
|
160
|
+
return undefined;
|
|
161
|
+
case 1:
|
|
162
|
+
return returnValues[0];
|
|
163
|
+
default:
|
|
164
|
+
return returnValues;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
const DEFAULT_ACTOR_CONFIG = {
|
|
168
|
+
pollingOptions: index_ts_2.DEFAULT_POLLING_OPTIONS,
|
|
169
|
+
};
|
|
170
|
+
exports.ACTOR_METHOD_WITH_HTTP_DETAILS = 'http-details';
|
|
171
|
+
exports.ACTOR_METHOD_WITH_CERTIFICATE = 'certificate';
|
|
172
|
+
function _createActorMethod(actor, methodName, func, blsVerify) {
|
|
173
|
+
let caller;
|
|
174
|
+
if (func.annotations.includes('query') || func.annotations.includes('composite_query')) {
|
|
175
|
+
caller = async (options, ...args) => {
|
|
176
|
+
// First, if there's a config transformation, call it.
|
|
177
|
+
options = {
|
|
178
|
+
...options,
|
|
179
|
+
...actor[metadataSymbol].config.queryTransform?.(methodName, args, {
|
|
180
|
+
...actor[metadataSymbol].config,
|
|
181
|
+
...options,
|
|
182
|
+
}),
|
|
183
|
+
};
|
|
184
|
+
const agent = options.agent || actor[metadataSymbol].config.agent || new index_ts_3.HttpAgent();
|
|
185
|
+
const cid = _principal_1.Principal.from(options.canisterId || actor[metadataSymbol].config.canisterId);
|
|
186
|
+
const arg = _candid_1.IDL.encode(func.argTypes, args);
|
|
187
|
+
const result = await agent.query(cid, {
|
|
188
|
+
methodName,
|
|
189
|
+
arg,
|
|
190
|
+
effectiveCanisterId: options.effectiveCanisterId,
|
|
191
|
+
});
|
|
192
|
+
const httpDetails = {
|
|
193
|
+
...result.httpDetails,
|
|
194
|
+
requestDetails: result.requestDetails,
|
|
195
|
+
};
|
|
196
|
+
switch (result.status) {
|
|
197
|
+
case index_ts_1.QueryResponseStatus.Rejected: {
|
|
198
|
+
const uncertifiedRejectErrorCode = new errors_ts_1.UncertifiedRejectErrorCode(result.requestId, result.reject_code, result.reject_message, result.error_code, result.signatures);
|
|
199
|
+
uncertifiedRejectErrorCode.callContext = {
|
|
200
|
+
canisterId: cid,
|
|
201
|
+
methodName,
|
|
202
|
+
httpDetails,
|
|
203
|
+
};
|
|
204
|
+
throw errors_ts_1.RejectError.fromCode(uncertifiedRejectErrorCode);
|
|
205
|
+
}
|
|
206
|
+
case index_ts_1.QueryResponseStatus.Replied:
|
|
207
|
+
return func.annotations.includes(exports.ACTOR_METHOD_WITH_HTTP_DETAILS)
|
|
208
|
+
? {
|
|
209
|
+
httpDetails,
|
|
210
|
+
result: decodeReturnValue(func.retTypes, result.reply.arg),
|
|
211
|
+
}
|
|
212
|
+
: decodeReturnValue(func.retTypes, result.reply.arg);
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
caller = async (options, ...args) => {
|
|
218
|
+
// First, if there's a config transformation, call it.
|
|
219
|
+
options = {
|
|
220
|
+
...options,
|
|
221
|
+
...actor[metadataSymbol].config.callTransform?.(methodName, args, {
|
|
222
|
+
...actor[metadataSymbol].config,
|
|
223
|
+
...options,
|
|
224
|
+
}),
|
|
225
|
+
};
|
|
226
|
+
const agent = options.agent || actor[metadataSymbol].config.agent || index_ts_3.HttpAgent.createSync();
|
|
227
|
+
const { canisterId, effectiveCanisterId, pollingOptions } = {
|
|
228
|
+
...DEFAULT_ACTOR_CONFIG,
|
|
229
|
+
...actor[metadataSymbol].config,
|
|
230
|
+
...options,
|
|
231
|
+
};
|
|
232
|
+
const cid = _principal_1.Principal.from(canisterId);
|
|
233
|
+
const ecid = effectiveCanisterId !== undefined ? _principal_1.Principal.from(effectiveCanisterId) : cid;
|
|
234
|
+
const arg = _candid_1.IDL.encode(func.argTypes, args);
|
|
235
|
+
const { requestId, response, requestDetails } = await agent.call(cid, {
|
|
236
|
+
methodName,
|
|
237
|
+
arg,
|
|
238
|
+
effectiveCanisterId: ecid,
|
|
239
|
+
nonce: options.nonce,
|
|
240
|
+
});
|
|
241
|
+
let reply;
|
|
242
|
+
let certificate;
|
|
243
|
+
if ((0, index_ts_1.isV3ResponseBody)(response.body)) {
|
|
244
|
+
if (agent.rootKey == null) {
|
|
245
|
+
throw errors_ts_1.ExternalError.fromCode(new errors_ts_1.MissingRootKeyErrorCode());
|
|
246
|
+
}
|
|
247
|
+
const cert = response.body.certificate;
|
|
248
|
+
certificate = await certificate_ts_1.Certificate.create({
|
|
249
|
+
certificate: cert,
|
|
250
|
+
rootKey: agent.rootKey,
|
|
251
|
+
canisterId: ecid,
|
|
252
|
+
blsVerify,
|
|
253
|
+
agent,
|
|
254
|
+
});
|
|
255
|
+
const path = [(0, utils_1.utf8ToBytes)('request_status'), requestId];
|
|
256
|
+
const status = new TextDecoder().decode((0, certificate_ts_1.lookupResultToBuffer)(certificate.lookup_path([...path, 'status'])));
|
|
257
|
+
switch (status) {
|
|
258
|
+
case 'replied':
|
|
259
|
+
reply = (0, certificate_ts_1.lookupResultToBuffer)(certificate.lookup_path([...path, 'reply']));
|
|
260
|
+
break;
|
|
261
|
+
case 'rejected': {
|
|
262
|
+
// Find rejection details in the certificate
|
|
263
|
+
const rejectCode = new Uint8Array((0, certificate_ts_1.lookupResultToBuffer)(certificate.lookup_path([...path, 'reject_code'])))[0];
|
|
264
|
+
const rejectMessage = new TextDecoder().decode((0, certificate_ts_1.lookupResultToBuffer)(certificate.lookup_path([...path, 'reject_message'])));
|
|
265
|
+
const error_code_buf = (0, certificate_ts_1.lookupResultToBuffer)(certificate.lookup_path([...path, 'error_code']));
|
|
266
|
+
const error_code = error_code_buf
|
|
267
|
+
? new TextDecoder().decode(error_code_buf)
|
|
268
|
+
: undefined;
|
|
269
|
+
const certifiedRejectErrorCode = new errors_ts_1.CertifiedRejectErrorCode(requestId, rejectCode, rejectMessage, error_code);
|
|
270
|
+
certifiedRejectErrorCode.callContext = {
|
|
271
|
+
canisterId: cid,
|
|
272
|
+
methodName,
|
|
273
|
+
httpDetails: response,
|
|
274
|
+
};
|
|
275
|
+
throw errors_ts_1.RejectError.fromCode(certifiedRejectErrorCode);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
else if ((0, index_ts_1.isV2ResponseBody)(response.body)) {
|
|
280
|
+
const { reject_code, reject_message, error_code } = response.body;
|
|
281
|
+
const errorCode = new errors_ts_1.UncertifiedRejectUpdateErrorCode(requestId, reject_code, reject_message, error_code);
|
|
282
|
+
errorCode.callContext = {
|
|
283
|
+
canisterId: cid,
|
|
284
|
+
methodName,
|
|
285
|
+
httpDetails: response,
|
|
286
|
+
};
|
|
287
|
+
throw errors_ts_1.RejectError.fromCode(errorCode);
|
|
288
|
+
}
|
|
289
|
+
// Fall back to polling if we receive an Accepted response code
|
|
290
|
+
if (response.status === 202) {
|
|
291
|
+
const pollOptions = {
|
|
292
|
+
...pollingOptions,
|
|
293
|
+
blsVerify,
|
|
294
|
+
};
|
|
295
|
+
// Contains the certificate and the reply from the boundary node
|
|
296
|
+
const response = await (0, index_ts_2.pollForResponse)(agent, ecid, requestId, pollOptions);
|
|
297
|
+
certificate = response.certificate;
|
|
298
|
+
reply = response.reply;
|
|
299
|
+
}
|
|
300
|
+
const shouldIncludeHttpDetails = func.annotations.includes(exports.ACTOR_METHOD_WITH_HTTP_DETAILS);
|
|
301
|
+
const shouldIncludeCertificate = func.annotations.includes(exports.ACTOR_METHOD_WITH_CERTIFICATE);
|
|
302
|
+
const httpDetails = { ...response, requestDetails };
|
|
303
|
+
if (reply !== undefined) {
|
|
304
|
+
if (shouldIncludeHttpDetails && shouldIncludeCertificate) {
|
|
305
|
+
return {
|
|
306
|
+
httpDetails,
|
|
307
|
+
certificate,
|
|
308
|
+
result: decodeReturnValue(func.retTypes, reply),
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
else if (shouldIncludeCertificate) {
|
|
312
|
+
return {
|
|
313
|
+
certificate,
|
|
314
|
+
result: decodeReturnValue(func.retTypes, reply),
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
else if (shouldIncludeHttpDetails) {
|
|
318
|
+
return {
|
|
319
|
+
httpDetails,
|
|
320
|
+
result: decodeReturnValue(func.retTypes, reply),
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
return decodeReturnValue(func.retTypes, reply);
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
const errorCode = new errors_ts_1.UnexpectedErrorCode(`Call was returned undefined. We cannot determine if the call was successful or not. Return types: [${func.retTypes.map(t => t.display()).join(',')}].`);
|
|
327
|
+
errorCode.callContext = {
|
|
328
|
+
canisterId: cid,
|
|
329
|
+
methodName,
|
|
330
|
+
httpDetails,
|
|
331
|
+
};
|
|
332
|
+
throw errors_ts_1.UnknownError.fromCode(errorCode);
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
const handler = (...args) => caller({}, ...args);
|
|
337
|
+
handler.withOptions =
|
|
338
|
+
(options) => (...args) => caller(options, ...args);
|
|
339
|
+
return handler;
|
|
340
|
+
}
|
|
341
|
+
//# sourceMappingURL=actor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actor.js","sourceRoot":"","sources":["../../../src/agent/actor.ts"],"names":[],"mappings":";;;AAAA,+CAM0B;AAC1B,2CAWqB;AACrB,qCAA8B;AAC9B,iDAAmG;AACnG,2CAAuC;AACvC,qDAAoG;AACpG,oDAAkD;AAClD,+CAAkD;AAuIlD,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;AAOvD;;;GAGG;AACH,MAAa,KAAK;IAChB;;;;OAIG;IACI,MAAM,CAAC,OAAO,CAAC,KAAY;QAChC,OAAO,KAAK,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;IAC5C,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,WAAW,CAAC,KAAY;QACpC,OAAO,KAAK,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC;IACvC,CAAC;IAEM,MAAM,CAAC,YAAY,CAAC,KAAY;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