Skip to content

Commit

Permalink
Merge branch '61-implement-cardano-graphql-network' into 'dev'
Browse files Browse the repository at this point in the history
add cardano-graphql-network

Closes #61

See merge request ergo/rosen-bridge/rosen-chains!79
  • Loading branch information
vorujack committed Dec 7, 2023
2 parents 6a109a8 + 99fa251 commit 8fc9016
Show file tree
Hide file tree
Showing 18 changed files with 15,368 additions and 4,566 deletions.
13,197 changes: 8,631 additions & 4,566 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/networks/cardano-graphql/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
39 changes: 39 additions & 0 deletions packages/networks/cardano-graphql/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# @rosen-chains/cardano-graphql-network

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

`@rosen-chains/cardano-graphql-network` is a package to be used as network api provider for `@rosen-chains/cardano` package

## Installation

npm:

```sh
npm i @rosen-chains/cardano-graphql-network
```

yarn:

```sh
yarn add @rosen-chains/cardano-graphql-network
```

## Usage

```ts
import CardanoGraphQLNetwork from '@rosen-chains/cardano-graphql-network';

let tokens: RosenTokens;
const cardanoGraphQLNetwork = new CardanoGraphQLNetwork(
'GRAPHQL_URL', // graphql url
'lockAddress', // bridge lock address in Cardano (used in CardanoRosenExtractor)
tokens // bridge supported tokens config, provided by `rosen-bridge/contract`
);

const height = await cardanoGraphQLNetwork.getHeight();
```
7 changes: 7 additions & 0 deletions packages/networks/cardano-graphql/codegen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
schema: ./schema.graphql
documents: ./lib/queries.ts
generates:
lib/graphQLTypes.ts:
plugins:
- typescript
- typescript-operations
Loading

0 comments on commit 8fc9016

Please sign in to comment.