![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@kiltprotocol/augment-api
Advanced tools
[![](https://user-images.githubusercontent.com/39338561/122415864-8d6a7c00-cf88-11eb-846f-a98a936f88da.png) ](https://kilt.io)
This package provides TypeScript interfaces for data structures and transaction types used on the KILT blockchain.
It improves the developer experience when using @polkadot/api
to interact with the KILT blockchain and is required for the use of @kiltprotocol/sdk-js
in a TypeScript development environment.
@polkadot/api
and (optionally) @kiltprotocol/sdk-js
.@polkadot/api
alone, also include @kiltprotocol/type-definitions
in your project.
These definitions must be passed to the API constructor. For detailed guidance, refer to its package documentation.To install, run:
yarn add --dev @kiltprotocol/augment-api
Add the following import at the beginning of your application's entry point:
// this import should be made at the earliest point possible
import '@kiltprotocol/augment-api'
// imports of other KILT or Polkadot packages should follow
import { connect } from '@kiltprotocol/sdk-js'
const api = await connect('wss://…')
// api is now augmented with types for the latest Spiritnet runtime
api.tx.did.dispatchAs()
We release types corresponding to each runtime version of our mainnet and testnet, aligned with the blockchain client releases.
To use types for a specific runtime version, simply pin their corresponding client release version:
yarn add --dev @kiltprotocol/augment-api@1.11300.0
For the Peregrine testnet, append -peregrine
:
yarn add --dev @kiltprotocol/augment-api@1.11300.0-peregrine
To always use the latest Peregrine testnet types, use the peregrine
distribution tag:
yarn add --dev @kiltprotocol/augment-api@peregrine
Each version of the package indicates, via peer dependencies on @polkadot/api
& @polkadot/typegen
, which versions of these packages were used to generate types.
Sometimes definitions of Polkadot built-in runtime components change between releases of these libraries, resulting in type conflicts when trying to use the generated types with a different release.
If you need to use divergent @polkadot/api
versions in your project, you can run the generator scripts to regenerate type definitions based on your local configuration.
@polkadot/typegen
to your package dependencies, matching your version of @polkadot/api
.typescript
and @kiltprotocol/type-definitions
installed.Regenerate types using:
yarn run kilt_reaugment
For persistency across installations, we recommend adding a postinstall script to your package.json
:
{
"scripts": {
"postinstall": "yarn run kilt_reaugment"
}
}
The kilt_reaugment
script can also generate types for other KILT runtimes, such as for our staging or standalone chains.
Run yarn kilt_reaugment --help
to learn more about its command line arguments.
This functionality is best used in combination with the kilt_updateMetadata
package script, which fetches runtime metadata and version information from a blockchain client:
yarn run kilt_updateMetadata -e wss://peregrine.kilt.io
This creates a file with the chain's metadata, along with a .env.kilt
file that changes the default behavior of kilt_reaugment
to perform type generation based on this metadata file.
Commit these files to your project and include kilt_reaugment
in your postinstall script (see above) to ensure types are always up-to-date with your project metadata.
FAQs
[![](https://user-images.githubusercontent.com/39338561/122415864-8d6a7c00-cf88-11eb-846f-a98a936f88da.png) ](https://kilt.io)
The npm package @kiltprotocol/augment-api receives a total of 748 weekly downloads. As such, @kiltprotocol/augment-api popularity was classified as not popular.
We found that @kiltprotocol/augment-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.