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 Radix Connector into TypeScript.
{
dependencies: {
...
"@redstone-finance/radix-connector": "0.8.0",
...
}
}

Using the PriceAdapter package with @redstone-finance/radix-connector

Deploying package

yarn sample-deploy
  1. The package can be deployed by using the above command, defined here.
  2. The deployed package.stokenet.addr address can be found in the scrypto/price_adapter directory.
  3. The script uses RadixPackageDeployer with the @atlantis-l/radix-tool package under the hood, as the Radix Desktop Tool uses.

Instantiating component

yarn sample-instantiate
  1. The component can be instantiated by using the above command, defined here.
  2. The deployed component.stokenet.addr address can be found in the scrypto/price_adapter directory.
  3. The script uses PriceAdapterRadixContractDeployer.

Sample run

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