diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 3c5b5338..af214b85 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -14,6 +14,9 @@ - docs: documentation and metadata for use-auth-client - feat: adds optional `rootKey` to `HttpAgentOptions` to allow for a custom root key to be used for verifying signatures from other networks - chore: npm audit bumping micromatch +- feat: exports polling utilities from `@dfinity/agent` for use in other packages + - `pollForResponse` now uses the default strategy by default + - Updated the `bls-verify` jsdoc comment to accurately reflect that the default strategy now uses @noble/curves - docs: clarifies meaning of `effectiveCanisterId` in `CallOptions` ### Changed diff --git a/packages/agent/src/certificate.ts b/packages/agent/src/certificate.ts index a8cdf551..4e7c5eac 100644 --- a/packages/agent/src/certificate.ts +++ b/packages/agent/src/certificate.ts @@ -135,7 +135,7 @@ export interface CreateCertificateOptions { */ canisterId: Principal; /** - * BLS Verification strategy. Default strategy uses wasm for performance, but that may not be available in all contexts. + * BLS Verification strategy. Default strategy uses bls12_381 from @noble/curves */ blsVerify?: VerifyFunc; diff --git a/packages/agent/src/index.ts b/packages/agent/src/index.ts index 98608f63..cf911b7f 100644 --- a/packages/agent/src/index.ts +++ b/packages/agent/src/index.ts @@ -29,6 +29,7 @@ import { Agent, HttpAgent } from './agent'; import { IDL } from '@dfinity/candid'; export * as Cbor from './cbor'; +export * from './polling'; export interface GlobalInternetComputer { ic: { diff --git a/packages/agent/src/polling/index.ts b/packages/agent/src/polling/index.ts index 2a18bc26..ccd399eb 100644 --- a/packages/agent/src/polling/index.ts +++ b/packages/agent/src/polling/index.ts @@ -5,6 +5,7 @@ import { RequestId } from '../request_id'; import { toHex } from '../utils/buffer'; export * as strategy from './strategy'; +import { defaultStrategy } from './strategy'; export { defaultStrategy } from './strategy'; export type PollStrategy = ( canisterId: Principal, @@ -27,7 +28,7 @@ export async function pollForResponse( agent: Agent, canisterId: Principal, requestId: RequestId, - strategy: PollStrategy, + strategy: PollStrategy = defaultStrategy(), // eslint-disable-next-line request?: any, blsVerify?: CreateCertificateOptions['blsVerify'],