@frontier-fi/sdk
v0.3.1
Published
SDK for interacting with the Frontier protocol
Readme
Frontier SDK
TypeScript SDK for interacting with the Frontier V3 protocol on supported chains (Ethereum, Base, and Sepolia).
Installation
pnpm add @frontier-fi/sdkLocal Setup
pnpm install
Requirements
fetch
Polyfill
If your platform does not support one of the required features, it is also possible to import a polyfill.
fetch-> node-fetch
Testing
pnpm test:release runs the consumer regression suite without RPC access or Anvil.
pnpm check-types:release checks production sources. Release checks also build
the package and verify its CommonJS and ESM imports. These checks do not replace
transaction execution against a fork of Frontier's deployed contracts.
pnpm test:no-integration excludes fork integration tests and live API contract
tests (*.integration.test.ts and *.contract.test.ts). It still validates
configured deployments via RPC and chain setup against the Frontier API.
pnpm test:all includes Anvil fork integration tests and live API contract tests.
pnpm test
Testing runs against a local Anvil fork and resolves RPC URLs in order: per-chain *_RPC_URL, DRPC_API_KEY (via dRPC across all supported chains), then public RPC fallbacks:
DRPC_API_KEY
# Optional per-chain overrides:
ETHEREUM_RPC_URL
BASE_RPC_URL
SEPOLIA_RPC_URLAnvil Client
To download and install the anvil client, run the following commands (MacOS):
curl -L https://foundry.paradigm.xyz | bashbrew install libusbsource /Users/$(whoami)/.zshenvfoundryup
Releases
The release.yml workflow runs on pushes to main and can be retried manually
on main. Pending Changesets open a version PR; when none remain, it publishes
the version in package.json if that version is absent from npm. Releases use
@frontier-fi/sdk@<version> tags, avoiding the inherited Balancer tags.
For subsequent changes, run pnpm changeset, select @frontier-fi/sdk, and commit
the generated changeset with the fix. Merge the resulting version PR to publish.
Only stable versions are published to latest by this workflow.
Publishing runs the source typecheck, consumer tests, and tsup through
prepublishOnly. It uses the checked-in generated GraphQL types; refreshing
those types with pnpm codegen is a separate, reviewed source change.
One-time setup, matching the maths repository:
- Install the
maxyz-actionsGitHub App onfrontier-fi/sdk, grant contents and pull-request write access, and makeMAXYZ_ACTIONS_PRIVATE_KEYavailable to the workflow. - Configure the GitHub environment
releaseto allow deployments frommain. - Bootstrap the npm package with an authenticated maintainer's initial
npm publish --access publicfrom a reviewed checkout after installing the locked dependencies. The package must exist before configuring its publisher. - Configure an npm trusted publisher
for
@frontier-fi/sdk: organizationfrontier-fi, repositorysdk, workflowrelease.yml, environmentrelease, with directnpm publishallowed. Subsequent CI publications use OIDC and provenance, with no npm token secret.
Upstream documentation
In-depth documentation on this SDK is available at docs-v3.balancer.fi/developer-reference/sdk.
