Releases: dfinity/icp-js-core
Release 2.0.0
Async HttpAgent and call response changes
Some small but backwards incompatible changes come with this release, but it enables some advanced use cases for libraries building with the HttpAgent.
Change 1 - HttpAgent constructor deprecation
The HttpAgent has a TSDoc warning against being constructed with the new constructor. We now prefer await HttpAgent.create(), which will automatically fetch the root key if you pass shouldFetchRootKey: true (for local development) to the HttpAgentOptions. HttpAgent.create will also automatically run the syncTime method, and configure the agent to calculate the difference between the system clock and the Internet Computer replica's time, which should reduce the occurrence of device sync issues. Since not all of your code may run inside of an async function, you can consider running a simple find and replace when upgrading to > v2.0.0.
The createSync method has identical behavior to new currently, and is preferred over accessing the constructor going forward.
function getActor(options){
- return new HttpAgent(options);
+ return HttpAgent.createSync(options);
}Change 2 - Raw Call
In order to support ICRC-49, we need the HttpAgent to provide more details back after making a call. With this change, HttpAgent.call will provide:
requestId - the computed request ID to poll for
response - the raw `http` response from the boundary node
requestDetails - the details sent to the canister, used to compute the request IDIn addition, the output from pollForResponse needs to be updated as well. PollForResponse now returns
certificate: the Certificate tree sent along with the reply
reply: the certified response from the replicaNote
The v2 Actor is able to use older HttpAgent interfaces with backwards compatibility, but the pollForResponse type has a breaking return signature. You must use a v1 polling strategy with a v1 actor, and a v2 strategy with a v2 actor.
What's Changed
- ci: npm cache and cypress action by @krpeacock in #897
- ci: fix cypress by @krpeacock in #898
- ci: removing headless browser tests pending a rewrite by @krpeacock in #900
- feat!: support getting certificate back from call by @krpeacock in #892
- feat: deprecate
HttpAgentconstructor in favor of newcreateby @krpeacock in #873 - chore: v1 agent compatibility with v2 actor tests by @krpeacock in #902
- ci: changing github token for creating release by @krpeacock in #903
Full Changelog: v1.4.0...v2.0.0
Release 1.4.0
What's Changed
- chore: updates dfinity/conventional-pr-title-action to v3.2.0 by @krpeacock in #886
- chore: updates dfinity/conventional-pr-title-action to v4.0.0 by @krpeacock in #889
- chore: updates agent error response by @krpeacock in #885
- fix: updated outdated urls in sample by @r-birkner in #888
- fix: publish script will correctly update the package-lock.json file … by @krpeacock in #883
- feat: add support for proof of absence in certificate lookups by @nathanosdev in #878
- chore: update management canister interface with latest bitcoin features by @krpeacock in #890
- fix: ObservableLog no longer extends Function by @krpeacock in #887
- chore: bump braces by @tmu0 in #891
- feat: strips out bitcoin query methods from management canister IDL by @krpeacock in #893
New Contributors
- @r-birkner made their first contribution in #888
- @tmu0 made their first contribution in #891
Full Changelog: v1.3.0...v1.4.0
Release 1.3.0
What's Changed
New feature - exponential backoff for retries, using a new HttpAgent option - backoffStrategy. The agent can accept a BackoffStrategyFactory, which is a function that returns a BackoffStrategy. The strategy itself must include a next method, which yields a number or null
The default strategy mimics the one used by agent-rs. It will increase the interval using exponential backoff, and adding in a "jitter", randomizing the result a little to decrease the likelihood of calls firing at the same time as your application scales, which could cause performance issues under certain conditions.
If you prefer a constant backoff, a custom factory would look something like this in TypeScript:
import { HttpAgent, BackoffStrategy } from '@dfinity/agent';
const strat: BackoffStrategy = {
next: () => 1000
}
const agent = new HttpAgent({
backoffStrategy: () => strat
});- chore: adds required
npm auditcheck to PRs by @krpeacock in #880 - feat: retry delay strategy by @krpeacock in #871
- docs: adds instructions on how to run unit and e2e tests to the README by @krpeacock in #881
Full Changelog: v1.2.1...v1.3.0
Release 1.2.1
What's Changed
- feat: make
IdbStorageget/setmethods generic by @hpeebles in #869 - chore: Add context to errors thrown on cbor decode by @frederikrothenberger in #874
- chore: replaces global npm install with setup-node by @krpeacock in #875
Full Changelog: v1.2.0...v1.2.1
Release 1.2.0
What's Changed
- feat: allow passing
DBCreateOptionstoIdbStorageconstructor by @hpeebles in #850 - fix: pads date numbers in changelog automation by @krpeacock in #862
- feat: support for management canister logging by @krpeacock in #863
- feat: pure JS BLS verification by @krpeacock in #817
- feat: support for restricting II auth methods by @krpeacock in #856
- chore: npm audit by @krpeacock in #865
Full Changelog: v1.1.1...v1.2.0
Release 1.1.1
What's Changed
- fix: Work around credentials not being enumerable by @frederikrothenberger in #860
Full Changelog: v1.1.0...v1.1.1
Release 1.1.0
What's Changed
- feat: adds fromPem method for identity-secp256k1 by @krpeacock in #816
- chore: switch changelog to markdown by @krpeacock in #853
- feat: replay attack prevention using watermarks by @krpeacock in #854
- fix: Remove ArrayBuffer checks from WebAuthnIdentity by @frederikrothenberger in #857
Full Changelog: v1.0.1...v1.1.0
Release 1.0.1
What's Changed
- chore: export
AuthClientStorageto aid with custom implementations by @hpeebles in #848 - fix: ed25519KeyIdentity generates unique identities when no seed is provided by @krpeacock in #851
Full Changelog: v1.0.0...v1.0.1
Release 1.0.0
What's Changed
- feat: Export AgentHTTPResponseError by @kristoferlund in #823
- chore: adding new controller to mainnet test snapshots by @krpeacock in #841
- feat: customPath changes by @krpeacock in #840
- feat: introduces Observable Log for HttpAgent by @krpeacock in #842
- chore: update management canister interface by @krpeacock in #844
- fix: adds npm run build to publish script by @krpeacock in #845
- chore: npm audit fix by @krpeacock in #846
New Contributors
- @kristoferlund made their first contribution in #823
Full Changelog: v0.21.4...v1.0.0
Release 0.21.4
What's Changed
- fix: distinguish remote dev environments from known hosts by @rvanasa in #830
- feat: release automation changes by @krpeacock in #832
- chore: updating package-lock by @krpeacock in #831
- fix: export partial identity from index of @dfinity/identity by @krpeacock in #833
- fix: edit to the post-release script by @krpeacock in #834
- fix: edit to the post-release script by @krpeacock in #836
Full Changelog: v0.21.2...v0.21.4