Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require("@rushstack/eslint-patch/modern-module-resolution");

module.exports = {
extends: "@chainsafe",
}
extends: "@chainsafe",
};
5 changes: 2 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:

- uses: google-github-actions/release-please-action@v3 # it will analyze commits and create PR with new version and updated CHANGELOG:md file. On merging it will create github release page with changelog
id: release
with:
Expand All @@ -26,7 +25,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"
if: ${{ steps.release.outputs.releases_created }}

- run: corepack enable
Expand Down Expand Up @@ -82,4 +81,4 @@ jobs:
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 2238a825c5aca59233eab1f221f7aefb
command: pages deploy ./web/.svelte-kit/cloudflare --project-name=gopher-poc
command: pages deploy ./web/.svelte-kit/cloudflare --project-name=gopher-poc
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- master
pull_request:
branches:
- '**'
- "**"

jobs:
unified:
Expand All @@ -26,9 +26,9 @@ jobs:
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: "Unit Tests"
run: 'yarn run test:unit'
run: "yarn run test:unit"
- name: "Integrations Tests"
run: 'yarn run test:integrations'
run: "yarn run test:integrations"
- name: Set branch name for Cloudflare Pages
id: cf-branch
run: |
Expand Down Expand Up @@ -90,4 +90,4 @@ jobs:
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 2238a825c5aca59233eab1f221f7aefb
command: pages deploy ./web/.svelte-kit/cloudflare --project-name=gopher-poc --branch=${{ env.CF_BRANCH_NAME }}
command: pages deploy ./web/.svelte-kit/cloudflare --project-name=gopher-poc --branch=${{ env.CF_BRANCH_NAME }}
9 changes: 4 additions & 5 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ on:
workflow_dispatch:
inputs:
environment:
description: 'Select deployment environment'
description: "Select deployment environment"
required: true
default: 'preview'
default: "preview"
type: choice
options:
- production
Expand All @@ -15,13 +15,12 @@ jobs:
manual-deploy-docs:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"

- run: corepack enable

Expand Down Expand Up @@ -52,4 +51,4 @@ jobs:
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 2238a825c5aca59233eab1f221f7aefb
command: pages deploy ./docs/build --project-name=gopher-docs --branch=${{ env.CF_BRANCH_NAME }}
command: pages deploy ./docs/build --project-name=gopher-docs --branch=${{ env.CF_BRANCH_NAME }}
8 changes: 4 additions & 4 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"docs": "0.0.1",
"packages/sdk": "1.1.2",
"packages/react": "1.1.2"
}
"docs": "1.0.0",
"packages/sdk": "1.2.0",
"packages/react": "1.2.0"
}
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
## Table of Contents

- [Sprinter TS - Cross-Chain Developer Toolkit](#sprinter-ts---cross-chain-developer-toolkit)
- [Introduction](#introduction)
- [Prerequisites](#prerequisites)
- [Getting Started](#getting-started)
- [Building](#building)
- [Testing](#testing)
- [Linting and Formatting](#linting-and-formatting)
- [Introduction](#introduction)
- [Prerequisites](#prerequisites)
- [Getting Started](#getting-started)
- [Building](#building)
- [Testing](#testing)
- [Linting and Formatting](#linting-and-formatting)

---

<a name="introduction"></a>

## Introduction

Sprinter TS is a powerful developer toolkit designed to simplify cross-chain integrations and enhance the developer experience. It includes:
Expand All @@ -26,6 +27,7 @@ Whether you're building cross-chain applications or experimenting with decentral
---

<a name="prerequisites"></a>

## Prerequisites

Before you begin, ensure you have the following installed:
Expand All @@ -36,26 +38,31 @@ Before you begin, ensure you have the following installed:
---

<a name="getting-started"></a>

## Getting Started

To get started with the project:

1. Clone the repository:

```shell
git clone https://github.com/ChainSafe/sprinter-ts.git
```

2. Navigate to the project root:

```shell
cd sprinter-ts
```

3. Set Node.js to the compatible version _(skip if you use a manual approach)_:

```shell
nvm use
```

4. Enable Corepack:

```shell
corepack enable
```
Expand All @@ -68,6 +75,7 @@ To get started with the project:
---

<a name="building"></a>

## Building

To build all packages, run:
Expand All @@ -83,6 +91,7 @@ Here's the corrected and updated **Testing** and **Linting and Formatting** docu
---

<a name="testing"></a>

## Testing

### Run Unit Tests
Expand All @@ -104,6 +113,7 @@ This command executes integration tests in all packages where they are defined.
---

<a name="linting-and-formatting"></a>

## Linting and Formatting

This project uses [ESLint](https://eslint.org/) to enforce code style and formatting. To ensure consistent code quality, you can use the following command:
Expand All @@ -115,4 +125,3 @@ yarn lint
```

This command runs the linter across all workspaces to identify any issues.

20 changes: 20 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Changelog

## [1.0.0](https://github.com/ChainSafe/sprinter-ts/compare/docs-v0.0.1...docs-v1.0.0) (2025-01-13)

### ⚠ BREAKING CHANGES

- All functions renamed, different API and flows, please consult docs or reach out to us directly!

### Features

- add enableSwaps in `transferWithHook` and `transfer` ([#97](https://github.com/ChainSafe/sprinter-ts/issues/97)) ([bd21311](https://github.com/ChainSafe/sprinter-ts/commit/bd213119b2eb8f41d574cbf2fd81d63296d08816)), closes [#94](https://github.com/ChainSafe/sprinter-ts/issues/94)
- add relay to the docs ([#103](https://github.com/ChainSafe/sprinter-ts/issues/103)) ([310c506](https://github.com/ChainSafe/sprinter-ts/commit/310c5062dfbbcf25efd5bea012c03cb236b56547))
- Add sweep function ([#115](https://github.com/ChainSafe/sprinter-ts/issues/115)) ([efaaa2b](https://github.com/ChainSafe/sprinter-ts/commit/efaaa2b3d8674e46b264caddcd373218c3f552c1)), closes [#110](https://github.com/ChainSafe/sprinter-ts/issues/110)
- cross chain contract call ([#21](https://github.com/ChainSafe/sprinter-ts/issues/21)) ([69c0128](https://github.com/ChainSafe/sprinter-ts/commit/69c0128862aa8013d349a615a45a360dd091585e))
- depricate provider param from sdk ([#41](https://github.com/ChainSafe/sprinter-ts/issues/41)) ([72297fe](https://github.com/ChainSafe/sprinter-ts/commit/72297feaff4b98ffcb8ee8f3005f786c5cd9ae72))
- docs POC ([#14](https://github.com/ChainSafe/sprinter-ts/issues/14)) ([8cd800d](https://github.com/ChainSafe/sprinter-ts/commit/8cd800d0729a2d03f7fca821f5f69ef6556b1ac1))
- dynamic supported network and tokens in docs ([#32](https://github.com/ChainSafe/sprinter-ts/issues/32)) ([abe5618](https://github.com/ChainSafe/sprinter-ts/commit/abe5618f56a07548f26963d98bdbe9a7bb301655)), closes [#29](https://github.com/ChainSafe/sprinter-ts/issues/29)
- erc20 with contract call ([#39](https://github.com/ChainSafe/sprinter-ts/issues/39)) ([77e1d8d](https://github.com/ChainSafe/sprinter-ts/commit/77e1d8dceaa4ffa14931c4cddc7897048af9e607)), closes [#38](https://github.com/ChainSafe/sprinter-ts/issues/38)
- native tokens transfers ([#40](https://github.com/ChainSafe/sprinter-ts/issues/40)) ([d4edf35](https://github.com/ChainSafe/sprinter-ts/commit/d4edf3599f74ccce3827fc9291d1c2bcfcc5eea6)), closes [#36](https://github.com/ChainSafe/sprinter-ts/issues/36)
- refactor api ([#61](https://github.com/ChainSafe/sprinter-ts/issues/61)) ([d6b1e9c](https://github.com/ChainSafe/sprinter-ts/commit/d6b1e9caa9c4bf91442b119c19e8b7904a3f9af9))
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docs",
"version": "0.0.1",
"version": "1.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand Down
8 changes: 4 additions & 4 deletions packages/react/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"useTabs": false,
"singleQuote": false,
"trailingComma": "all",
"printWidth": 80
"useTabs": false,
"singleQuote": false,
"trailingComma": "all",
"printWidth": 80
}
37 changes: 17 additions & 20 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,62 @@
# Changelog

## [1.1.2](https://github.com/ChainSafe/sprinter-ts/compare/sprinter-react-v1.1.1...sprinter-react-v1.1.2) (2024-12-11)
## [1.2.0](https://github.com/ChainSafe/sprinter-ts/compare/sprinter-react-v1.1.2...sprinter-react-v1.2.0) (2025-01-13)

### Features

- Add sweep function ([#115](https://github.com/ChainSafe/sprinter-ts/issues/115)) ([efaaa2b](https://github.com/ChainSafe/sprinter-ts/commit/efaaa2b3d8674e46b264caddcd373218c3f552c1)), closes [#110](https://github.com/ChainSafe/sprinter-ts/issues/110)

## [1.1.2](https://github.com/ChainSafe/sprinter-ts/compare/sprinter-react-v1.1.1...sprinter-react-v1.1.2) (2024-12-11)

### Bug Fixes

* docs deploy pipeline ([#106](https://github.com/ChainSafe/sprinter-ts/issues/106)) ([55d8b32](https://github.com/ChainSafe/sprinter-ts/commit/55d8b32919cb98693a7b5d653e10e11f3830a708))
- docs deploy pipeline ([#106](https://github.com/ChainSafe/sprinter-ts/issues/106)) ([55d8b32](https://github.com/ChainSafe/sprinter-ts/commit/55d8b32919cb98693a7b5d653e10e11f3830a708))

## [1.1.1](https://github.com/ChainSafe/sprinter-ts/compare/sprinter-react-v1.1.0...sprinter-react-v1.1.1) (2024-12-11)


### Bug Fixes

* add docs urls to README ([#104](https://github.com/ChainSafe/sprinter-ts/issues/104)) ([bc94336](https://github.com/ChainSafe/sprinter-ts/commit/bc943369b89c860ef7a255da4102ef27f7dc57b4))
- add docs urls to README ([#104](https://github.com/ChainSafe/sprinter-ts/issues/104)) ([bc94336](https://github.com/ChainSafe/sprinter-ts/commit/bc943369b89c860ef7a255da4102ef27f7dc57b4))

## [1.1.0](https://github.com/ChainSafe/sprinter-ts/compare/sprinter-react-v1.0.0...sprinter-react-v1.1.0) (2024-12-11)


### Features

* add enableSwaps in `transferWithHook` and `transfer` ([#97](https://github.com/ChainSafe/sprinter-ts/issues/97)) ([bd21311](https://github.com/ChainSafe/sprinter-ts/commit/bd213119b2eb8f41d574cbf2fd81d63296d08816)), closes [#94](https://github.com/ChainSafe/sprinter-ts/issues/94)

- add enableSwaps in `transferWithHook` and `transfer` ([#97](https://github.com/ChainSafe/sprinter-ts/issues/97)) ([bd21311](https://github.com/ChainSafe/sprinter-ts/commit/bd213119b2eb8f41d574cbf2fd81d63296d08816)), closes [#94](https://github.com/ChainSafe/sprinter-ts/issues/94)

### Bug Fixes

* **PoC:** readme, some errors and other nits ([#90](https://github.com/ChainSafe/sprinter-ts/issues/90)) ([f4fb199](https://github.com/ChainSafe/sprinter-ts/commit/f4fb1996b4d42db90f3c96b5869971f21cdc973e))
- **PoC:** readme, some errors and other nits ([#90](https://github.com/ChainSafe/sprinter-ts/issues/90)) ([f4fb199](https://github.com/ChainSafe/sprinter-ts/commit/f4fb1996b4d42db90f3c96b5869971f21cdc973e))

## [1.0.0](https://github.com/ChainSafe/sprinter-ts/compare/sprinter-react-v0.2.1...sprinter-react-v1.0.0) (2024-10-24)


### ⚠ BREAKING CHANGES

* All functions renamed, different API and flows, please consult docs or reach out to us directly!
- All functions renamed, different API and flows, please consult docs or reach out to us directly!

### Features

* get bridge history for an address ([#68](https://github.com/ChainSafe/sprinter-ts/issues/68)) ([4d524c6](https://github.com/ChainSafe/sprinter-ts/commit/4d524c668393f33c7c200a81f75cab87a3114e9d))
* refactor api ([#61](https://github.com/ChainSafe/sprinter-ts/issues/61)) ([d6b1e9c](https://github.com/ChainSafe/sprinter-ts/commit/d6b1e9caa9c4bf91442b119c19e8b7904a3f9af9))
- get bridge history for an address ([#68](https://github.com/ChainSafe/sprinter-ts/issues/68)) ([4d524c6](https://github.com/ChainSafe/sprinter-ts/commit/4d524c668393f33c7c200a81f75cab87a3114e9d))
- refactor api ([#61](https://github.com/ChainSafe/sprinter-ts/issues/61)) ([d6b1e9c](https://github.com/ChainSafe/sprinter-ts/commit/d6b1e9caa9c4bf91442b119c19e8b7904a3f9af9))

## [0.2.1](https://github.com/ChainSafe/sprinter-ts/compare/sprinter-react-v0.2.0...sprinter-react-v0.2.1) (2024-09-23)


### Bug Fixes

* react package should not be private ([#54](https://github.com/ChainSafe/sprinter-ts/issues/54)) ([ed8a5e0](https://github.com/ChainSafe/sprinter-ts/commit/ed8a5e011661e0e18e0b50d360bb16406692d3da))
- react package should not be private ([#54](https://github.com/ChainSafe/sprinter-ts/issues/54)) ([ed8a5e0](https://github.com/ChainSafe/sprinter-ts/commit/ed8a5e011661e0e18e0b50d360bb16406692d3da))

## [0.2.0](https://github.com/ChainSafe/sprinter-ts/compare/sprinter-react-v0.1.0...sprinter-react-v0.2.0) (2024-09-23)


### Features

* react sdk context ([#48](https://github.com/ChainSafe/sprinter-ts/issues/48)) ([39dbe7e](https://github.com/ChainSafe/sprinter-ts/commit/39dbe7e3cf2d1ec66f386b978a43c93208451f6e)), closes [#47](https://github.com/ChainSafe/sprinter-ts/issues/47)

- react sdk context ([#48](https://github.com/ChainSafe/sprinter-ts/issues/48)) ([39dbe7e](https://github.com/ChainSafe/sprinter-ts/commit/39dbe7e3cf2d1ec66f386b978a43c93208451f6e)), closes [#47](https://github.com/ChainSafe/sprinter-ts/issues/47)

### Bug Fixes

* cd and rect hooks export ([#52](https://github.com/ChainSafe/sprinter-ts/issues/52)) ([33c0604](https://github.com/ChainSafe/sprinter-ts/commit/33c06042a798bd68c8d902ba141a4d02fd4fc23e))
- cd and rect hooks export ([#52](https://github.com/ChainSafe/sprinter-ts/issues/52)) ([33c0604](https://github.com/ChainSafe/sprinter-ts/commit/33c06042a798bd68c8d902ba141a4d02fd4fc23e))

## [0.1.0](https://github.com/ChainSafe/sprinter-ts/compare/sprinter-react-v0.0.1...sprinter-react-v0.1.0) (2024-09-23)


### Features

* react sdk context ([#48](https://github.com/ChainSafe/sprinter-ts/issues/48)) ([39dbe7e](https://github.com/ChainSafe/sprinter-ts/commit/39dbe7e3cf2d1ec66f386b978a43c93208451f6e)), closes [#47](https://github.com/ChainSafe/sprinter-ts/issues/47)
- react sdk context ([#48](https://github.com/ChainSafe/sprinter-ts/issues/48)) ([39dbe7e](https://github.com/ChainSafe/sprinter-ts/commit/39dbe7e3cf2d1ec66f386b978a43c93208451f6e)), closes [#47](https://github.com/ChainSafe/sprinter-ts/issues/47)
16 changes: 11 additions & 5 deletions packages/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Wrap your application in the `SprinterContext` to gain access to blockchain-rela
### Example

```tsx
import React from 'react';
import { SprinterContext } from '@chainsafe/sprinter-react';
import React from "react";
import { SprinterContext } from "@chainsafe/sprinter-react";

const App = () => (
<SprinterContext>
Expand All @@ -34,8 +34,11 @@ export default App;
Inside your components, you can use the provided hooks to interact with blockchain data:

```tsx
import React, { useEffect } from 'react';
import { useSprinterBalances, useSprinterTokens } from '@chainsafe/sprinter-react';
import React, { useEffect } from "react";
import {
useSprinterBalances,
useSprinterTokens,
} from "@chainsafe/sprinter-react";

const YourComponent = () => {
const ownerAddress = "0xYourAddressHere";
Expand Down Expand Up @@ -74,12 +77,15 @@ The following hooks are provided by the SDK:
You can pass custom fetch options when initializing the context:

```tsx
<SprinterContext fetchOptions={{ baseUrl: "https://api.test.sprinter.buildwithsygma.com/" }}>
<SprinterContext
fetchOptions={{ baseUrl: "https://api.test.sprinter.buildwithsygma.com/" }}
>
<YourComponent />
</SprinterContext>
```

## Documentation

For more detailed docs you can check out [SDK docs page](https://docs.sprinter.tech/docs/react-sdk/).

## Contributing
Expand Down
Loading
Loading