Package Exports
- aptos
- aptos/dist/api/http-client
- aptos/dist/api/http-client.js
- aptos/dist/index.js
- aptos/dist/transaction_builder/aptos_types
- aptos/dist/transaction_builder/aptos_types/index.js
- aptos/dist/transaction_builder/bcs
- aptos/dist/transaction_builder/bcs/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (aptos) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Aptos TS/JS SDK
You need to connect to an Aptos node to use this library, or run one yourself locally.
API Docs
Docs can be found here
Usage
For Javascript or Typescript usage, check out the ./examples folder with ready-made package.json files
to get you going quickly!
If you are using the types in a commonjs module, like in a Node app, you just have to enable esModuleInterop
and allowSyntheticDefaultImports in your tsconfig for types compatibility:
{
...
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
...
}
}Requirements
sudo apt-get update
sudo apt-get install nodejs yarnGenerating Types
Originally created with this:
$ npx swagger-typescript-api@latest -p ../../../api/doc/openapi.yaml -o ./src/api --modular --axios --single-http-clientChanges to make after generation:
- OpenAPI/SpecHTML routes/types deleted as they're unneeded.
- There are a few type errors in the
http-client.tsas the axios types are incomplete, that were fixed via// @ts-ignore
Testing (jest)
yarn testSemantic versioning
This project follows semver as closely as possible
Release process
- Regenerate generated types
npx swagger-typescript-api@latest -p ../../../api/doc/openapi.yaml -o ./src/api --modular --axios --single-http-client - Update your commit message to follow the Angular Conventional Commits
- Test lint and format
yarn testyarn lintyarn fmt - Update the version in the
package.jsonfile and runyarn changelogto generate the changelog - Once it's all committed you can run npm release
Generate the change log. yarn changelog and bump the version in package.json. Only bump the minor version. Commit the changes. yarn build to build the package. Ideally, you should test the new package in browser to make sure it works in browser as well. Follow https://aptos-org.slack.com/archives/C034HFWPJ05/p1651687417201819, to publish the package