0.0.9 • Published 10 days ago

@hop-protocol/sdk-core v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
10 days ago

Hop SDK Core

This code is shared across Hop TypeScript SDKs.

License NPM version

!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

MIT

0.0.9

10 days ago

0.0.8

10 days ago

0.0.6

13 days ago

0.0.5

15 days ago

0.0.3

17 days ago

0.0.4

17 days ago

0.0.2-beta.20

21 days ago

0.0.2-beta.22

21 days ago

0.0.2-beta.21

21 days ago

0.0.2-beta.24

21 days ago

0.0.2-beta.23

21 days ago

0.0.2-beta.26

21 days ago

0.0.2-beta.28

21 days ago

0.0.2-beta.27

21 days ago

0.0.2-beta.7

22 days ago

0.0.2-beta.8

21 days ago

0.0.2-beta.9

21 days ago

0.0.2-beta.11

21 days ago

0.0.2-beta.10

21 days ago

0.0.2-beta.13

21 days ago

0.0.2-beta.12

21 days ago

0.0.2-beta.15

21 days ago

0.0.2-beta.14

21 days ago

0.0.2-beta.17

21 days ago

0.0.2-beta.16

21 days ago

0.0.2-beta.19

21 days ago

0.0.2-beta.18

21 days ago

0.0.2-beta.3

22 days ago

0.0.2-beta.4

22 days ago

0.0.2-beta.5

22 days ago

0.0.2-beta.6

22 days ago

0.0.2-beta.1

22 days ago

0.0.2-beta.2

22 days ago

0.0.2-beta.0

26 days ago

0.0.1

29 days ago