How to use in TypeScript
- Read firstly the docs from How to start section
- See how to connect to the contract/component in the TypeScript layer
- The full source of the package is available here
The info described there is mostly NOT REPEATED below.
Dependencies
- 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
- The package can be deployed by using the above command, defined here.
- The deployed
package.stokenet.addr
address can be found in thescrypto/price_adapter
directory. - 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
- The component can be instantiated by using the above command, defined here.
- The deployed
component.stokenet.addr
address can be found in thescrypto/price_adapter
directory. - The script uses
PriceAdapterRadixContractDeployer
.
Sample run
yarn sample-run
- The sample scenario can be run by using the above command, defined here.
- The script uses
PriceAdapterRadixContractConnector
.