@hop-protocol/sdk-core v0.0.9
Hop SDK Core
This code is shared across Hop TypeScript SDKs.
!NOTE This package is only meant to be used by the Hop TypeScript SDKs. We recommend installing one of the Hop SDKs if you want access to functionality in this package.
Development
Install dependencies
pnpm install
Build sdk
pnpm build
Run github action build locally with act:
(cd ../../ && act --job publish-sdk --workflows .github/workflows/npm_publish_sdk.yml --secret-file=.secrets --verbose)
Test
pnpm test
Adding New Contracts
The logic to create a new entry in the contract/
module requires a deprecated version of typechain
that does not work well with modern tooling. This logic has been moved out of this repository and new contracts should be created out of band and copied here.
The ABI file should be a simple JSON file with only the contract ABI (example).
# Create contracts
npm i -g typechain@8.1.0 && npm i -g @typechain/ethers-v5@10.1.0
typechain --target=ethers-v5 --out-dir=<OUT_DIR> <ABI_FILE>.json
# Update imports at <OUT_DIR>/<CONTRACT>.ts. Add `.js` to the `from "./common"` import
from "./common.js"
# Update imports at <OUT_DIR>/factories/<CONTRACT>__factory.ts. Add `.js` to the `from "./<CONTRACT>"` import
from "../<CONTRACT>.js"
# Move relevant files
mv <OUT_DIR>/<CONTRACT>.ts <SDK_DIR>/src/contracts/
mv <OUT_DIR>/factories/<CONTRACT>__factory.ts <SDK_DIR>/src/contracts/factories
# Add to SDK contracts exports at <SDK_DIR>/src/contracts/index.ts
export type { <CONTRACT> } from "./<CONTRACT>.js"
export { <CONTRACT>__factory } from "./<CONTRACT>__factory.js"
# Add to SDK contract factories exports at <SDK_DIR>/src/contracts/factories/index.ts
export { <CONTRACT>__factory } from "./<CONTRACT>__factory.js"
License
10 days ago
10 days ago
13 days ago
15 days ago
17 days ago
17 days ago
21 days ago
21 days ago
21 days ago
21 days ago
21 days ago
21 days ago
21 days ago
21 days ago
22 days ago
21 days ago
21 days ago
21 days ago
21 days ago
21 days ago
21 days ago
21 days ago
21 days ago
21 days ago
21 days ago
21 days ago
21 days ago
22 days ago
22 days ago
22 days ago
22 days ago
22 days ago
22 days ago
26 days ago
29 days ago