Skip to main content

How to use in TypeScript

  1. Read firstly the docs from How to start section
  2. See how to connect to the contract/component in the TypeScript layer
  3. The full source of the package is available here

The info described there is mostly NOT REPEATED below.

Dependencies​

  1. Use the following dependencies to embed RedStone Stellar Connector into TypeScript.
{
dependencies: {
...
"@redstone-finance/stellar-connector": "0.9.0",
...
}
}

Using the PriceAdapter package with @redstone-finance/stellar-connector​

Use the .env.example file to create your .env file.

Deploying contracts​

yarn sample-deploy
  1. The contract can be deployed by using the above command, defined here.
  2. The deployed redstone_adapter-id.testnet and/or redstone_price_feed-XXX-id.testnet addresses can be found in the stellar directory.

Sample run​

yarn sample-run
  1. The sample scenario can be run by using the above command, defined here.
  2. The script uses PriceAdapterStellarContractConnector.