Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: exports polling utilities from @dfinity/agent #921

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/certificate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions packages/agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
3 changes: 2 additions & 1 deletion packages/agent/src/polling/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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'],
Expand Down
Loading