13.3.0 • Published 4 months ago
@hyperlane-xyz/starknet-core v13.3.0
Hyperlane Starknet Core
The Hyperlane Starknet Core package provides TypeScript tooling for interacting with Hyperlane's Cairo contracts on Starknet. It includes TypeScript artifacts autogenerated from Cairo contracts developed in collaboration with Astraly Labs.
Features
- Pre-compiled Cairo contract ABI artifacts
- TypeScript bindings for Starknet contracts
Installation
# Install with NPM
npm install @hyperlane-xyz/starknet-core
# Or with Yarn
yarn add @hyperlane-xyz/starknet-core
Requirements
- Node.js 18 or newer
- For development:
curl
,jq
, andunzip
utilities
Usage
import {
ContractType,
getCompiledContract,
} from '@hyperlane-xyz/starknet-core';
// Get the Hyperlane mailbox contract
const mailboxContract = getCompiledContract('mailbox');
// Get token contracts
const tokenContract = getCompiledContract('erc20', ContractType.TOKEN);
// Get mock contracts
const mockContract = getCompiledContract('mock_validator', ContractType.MOCK);
Contract Categories
Contracts are organized into three categories:
contracts
: Core Hyperlane protocol contractstokens
: Token implementation contractsmocks
: Test and mock contracts
Development
Setup
- Clone the repository
- Install dependencies:
yarn install
Build Process
The build process combines multiple steps in a specific order:
yarn build
This command runs:
- TypeScript compilation (
tsc
) - Fetching contract artifacts from GitHub (
fetch-contracts
) - Generating TypeScript ABI artifacts from Cairo contracts (
generate-artifacts
)
All build output is placed in the dist
directory.
Individual Build Steps
You can also run the individual build steps separately:
Fetching Contract Artifacts
yarn fetch-contracts
This downloads the contract artifacts from the Hyperlane Starknet repository.
Generating TypeScript Artifacts
yarn generate-artifacts
This creates JavaScript and TypeScript declaration files in the dist/artifacts
directory.
License
Apache 2.0
13.3.0
4 months ago
13.2.1
5 months ago
13.2.0
5 months ago
13.1.1
5 months ago
13.1.0
5 months ago
13.0.0
5 months ago
13.0.0-starknet.1
6 months ago
13.0.0-starknet.0
6 months ago