Skip to content

Commit

Permalink
createSubscription (#4)
Browse files Browse the repository at this point in the history
* implemented SubscriptionManager class and createSubscription method

* regenerated package-lock.json

* added recompilation in separate command

* regenerated package-lock.json

* added env var during hardhat compilation

* ran prettier

* fixed corrupted package-lock.json
  • Loading branch information
KuphJr authored May 10, 2023
1 parent a6a45c1 commit 315aa4c
Show file tree
Hide file tree
Showing 19 changed files with 4,061 additions and 1,268 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test-converage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
jobs:
coverage:
runs-on: ubuntu-latest
env:
DEBUG_TEST_SETUP: true

steps:
- name: Checkout repository
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
jobs:
tests:
runs-on: ubuntu-latest
env:
DEBUG_TEST_SETUP: true

steps:
- name: Checkout repository
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# functions-toolkit

An NPM package with collection of functions that can be used for working with Chainlink Functions.

## Functions Billing Subscription Management

The `SubscriptionManager` class is used to manage the billing subscription used to pay for Functions requests. Create an instance of this class by passing an instance of the [Ethers.js Signer class](https://docs.ethers.org/v5/api/signer/#Signer) with a connected provider and the address of the [Functions Oracle proxy and the Functions Oracle Registry proxy](https://docs.chain.link/chainlink-functions/supported-networks) contracts on the desired network.

> const subscriptionManager = new SubscriptionManager(
> signer: [Signer](https://docs.ethers.org/v5/api/signer/#Signer),
> [functionsOracleProxyAddress](https://docs.chain.link/chainlink-functions/supported-networks): string,
> [functionsOracleRegistryProxyAddress](https://docs.chain.link/chainlink-functions/supported-networks): string
> )
### Create Subscription

> subscriptionManager.createSubscription() => Promise\<BigInt>
Creates a new Functions billing subscription using the Functions Oracle Registry contract and returns the subscription ID.
Loading

0 comments on commit 315aa4c

Please sign in to comment.