-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distribute the SDK through NPM #301
Conversation
NAR-1609 Distribute the Armory SDK via NPM
ContextWe're looking into publishing the SDK on NPM so third-party applications outside the monorepo can use it. However, we don't want to lose the local development experience of simply importing the latest state of the library directly, rather than having to import it via NPM ourselves. In the diagram above, the developer imports a specific version of the SDK (e.g., 1.1.51) through NPM, while the applications within the monorepo will always import the latest version of the SDK. Problems
Needs validation
Notes
Side quest
Referencehttps://nx.dev/concepts/buildable-and-publishable-libraries https://www.npmjs.com/package/altack/nx-bundlefy https://github.com/bikecoders/ngx-deploy-npm |
IMPORTANT: Because the SDK bundles the signature and the policy engine shared libraries, it MUST include its peer dependencies in its own `package.json`. This is not ideal because peer dependencies lose their autonomy to manage their own dependencies.
"dependencies": { | ||
"axios": "^1.6.7", | ||
"tslib": "^2.3.0", | ||
"uuid": "^9.0.1", | ||
"viem": "^2.7.16", | ||
"zod": "^3.22.4" | ||
"zod": "^3.22.4", | ||
"lodash": "^4.17.21", | ||
"@noble/curves": "1.4.0", | ||
"jose": "^5.2.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the armory-sdk
bundles the signature
and policy-engine-shared
, its package.json
MUST contain the other libraries' dependencies.
"executor": "ngx-deploy-npm:deploy", | ||
"options": { | ||
"distFolderPath": "dist/packages/armory-sdk", | ||
"access": "restricted" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep it restricted for now.
IMPORTANT: You'll need a .npmrc
with a valid token to install the library in another project. You can use the updated version of the file in our 1password.
"build": { | ||
"executor": "@nx/js:tsc", | ||
"outputs": ["{options.outputPath}"], | ||
"options": { | ||
"outputPath": "dist/packages/policy-engine-shared", | ||
"main": "packages/policy-engine-shared/src/index.ts", | ||
"tsConfig": "packages/policy-engine-shared/tsconfig.lib.json", | ||
"assets": [], | ||
"external": "none" | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A publishable library MUST only depend on buildable libraries. Since the armory-sdk
depends on the policy-engine-shared
and signature
, we have to add a build target on them.
Hint: you can use npx nx g @nx/js:setup-build
to turn a given library into buildable.
@@ -4,6 +4,17 @@ | |||
"sourceRoot": "packages/signature/src", | |||
"projectType": "library", | |||
"targets": { | |||
"build": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
"main": "packages/armory-sdk/src/index.ts", | ||
"tsConfig": "packages/armory-sdk/tsconfig.lib.json", | ||
"assets": [], | ||
"external": "none" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This option tells NX to bundle buildable packages in a single artifact. Here it's set to "none" meaning every buildable package will be included. However, it can be set as an array of packages like ["@narval/signature"]
for more granular control.
Clean up tsconfig files.
Send a notification on either success or failure.
Disable changelog file.
* Update Vault Image Version to e654acd * Update policy-engine Image Version to e654acd * Update Armory Image Version to 156a15a * Require admin API key to manage clients in the Armory (#286) * Update Armory Image Version to 30f4cf5 * Feature/nar 1647 devtool improvement (#290) * Update Vault Image Version to ebe09f1 * Update policy-engine Image Version to ebe09f1 * added vault setup to 'make setup' command, update log (#292) * fix test (#293) * Update Armory Image Version to 79ef401 * Add app provision on module init (#291) * Update Armory Image Version to e57f9b9 * move onboarding functions to SDK (#295) * Update Armory Image Version to 2075a0d * Update policy-engine Image Version to 2075a0d * Update Vault Image Version to 2075a0d * Feature/nar 1651 devtool (#296) * Update Vault Image Version to 2c723f9 * Update Armory Image Version to 2c723f9 * Update policy-engine Image Version to 2c723f9 * Feature/nar 1645 add collection and clientid fields to keyvalue model (#289) * mnemonic generation and key derivation from mnemonic * backup stored mnemonics * added e2e test * logs * repared failing test after Wallet type modification * fixed linting * revised unit test * Unit tests on util, switched table storage for unencrypted KV storage * switch dto declaration to zod * schema and naming changes * switched url to plural * import persistence module and not prisma service * backup has to be rsa key on schema * create-client-dto use zod, use PublicWallet.parse instead of custom func * removed function * removed unnecessary constructor for DTO * remove code duplication in importService * migration + some logic * modified repos to set metadatas * fixed wallet test * breaking migration * added tests * Update Vault Image Version to d886cbe * SDK - Encrypt Imports + Vault keygen & derivation (#299) * Update Vault Image Version to 10b7a58 * Update Armory Image Version to 10b7a58 * Update policy-engine Image Version to 10b7a58 * Feature/nar 1606 vault list wallets (#297) * mnemonic generation and key derivation from mnemonic * backup stored mnemonics * added e2e test * logs * repared failing test after Wallet type modification * fixed linting * revised unit test * Unit tests on util, switched table storage for unencrypted KV storage * switch dto declaration to zod * schema and naming changes * switched url to plural * import persistence module and not prisma service * backup has to be rsa key on schema * create-client-dto use zod, use PublicWallet.parse instead of custom func * removed function * removed unnecessary constructor for DTO * remove code duplication in importService * migration + some logic * modified repos to set metadatas * fixed wallet test * breaking migration * added tests * e2e test to generate and list wallets * fixed expected nextaddres * fixed e2e test * Update Vault Image Version to 2a9398e * deleting extra chart directory * Updating Policy Engine helm chart for MPC cluster * Update Vault Image Version to 1273d01 * Update Armory Image Version to 1273d01 * Update policy-engine Image Version to 1273d01 * Changing Armory APP_ID env to APP_UID to be consistent with rest of stack * Update Armory Image Version to 53e52e4 * Engine TSM_API_KEY should be optional env * Hotfix devtool importing removed value * Update policy-engine Image Version to 3b1457d * Renaming armory admin_api_key env to match the rest of the stack * Fixing provision; should set adminApiKey if it does not exist * Update Armory Image Version to 02894b1 * Attempting correct service naming to match argocd app config * provision withMasterKey fix * Fixing provision in Armory; appRespository.save should upsert * Update Vault Image Version to 75b293b * Update policy-engine Image Version to 75b293b * Update Armory Image Version to 441d048 * Feature/nar 1652 devtool encrypt imports vault keygen derivation (#300) * Update Vault Image Version to 2867faa * Update Armory Image Version to 2867faa * Update policy-engine Image Version to 2867faa * Refactor devtool for staging env (#302) * Update policy-engine Image Version to 195b4a3 * Update Vault Image Version to 195b4a3 * Update Armory Image Version to 195b4a3 * Feature/nar 1656 refactor devtool to support staging env (#303) * Update policy-engine Image Version to ecaed98 * Update Armory Image Version to ecaed98 * Update Vault Image Version to ecaed98 * Fix bug when signing DS (#306) * Distribute the SDK through NPM (#301) * Update Armory Image Version to 6c45789 * Update Vault Image Version to 6c45789 * chore(release): publish 0.0.2 * chore(release): publish 0.0.3 * Revert release commits from main (#311) * Revert "chore(release): publish 0.0.2" This reverts commit c6be407. * Revert "chore(release): publish 0.0.3" This reverts commit c39a31b. * Fix SDK version * Update Vault Image Version to 06e52fe * Update Armory Image Version to 06e52fe * Update policy-engine Image Version to 06e52fe * Fix publishable packages NX release projectRoot (#313) * chore(release): publish 0.0.2 * Fix NX release project root * Update Vault Image Version to 0547a82 * Update policy-engine Image Version to 0547a82 * Update Armory Image Version to 0547a82 * Include the SDK README in the release (#314) * Add README in the SDK release * Delete SDK changelog file * Bump SDK to 0.0.3 * Update Armory Image Version to ba8ece5 * Update Vault Image Version to ba8ece5 * Update policy-engine Image Version to ba8ece5 * Expose a /sync endpoint in Armory (#307) * Update Vault Image Version to a68e8eb * Update Armory Image Version to a68e8eb * Update policy-engine Image Version to a68e8eb * Fix SDK release assets (#315) * Delete transaction engine template module (#316) * Delete transaction engine module * Remove references from package-lock.json * Update policy-engine Image Version to 01f8f3d * Update Armory Image Version to 01f8f3d * Update Armory Image Version to 8bb8967 * Update policy-engine Image Version to 8bb8967 * Ensure GitHub actions are using the same Node.js version and NPM cache (#318) * Update policy-engine Image Version to a4bce48 * Update Vault Image Version to a4bce48 * Update Armory Image Version to a4bce48 * Bump supertest from 6.3.4 to 7.0.0 (#275) Bumps [supertest](https://github.com/ladjs/supertest) from 6.3.4 to 7.0.0. - [Release notes](https://github.com/ladjs/supertest/releases) - [Commits](ladjs/supertest@v6.3.4...v7.0.0) --- updated-dependencies: - dependency-name: supertest dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: William Calderipe <wcalderipe@gmail.com> * Bump @nestjs/axios from 3.0.1 to 3.0.2 (#276) Bumps [@nestjs/axios](https://github.com/nestjs/axios) from 3.0.1 to 3.0.2. - [Release notes](https://github.com/nestjs/axios/releases) - [Changelog](https://github.com/nestjs/axios/blob/master/.release-it.json) - [Commits](nestjs/axios@3.0.1...3.0.2) --- updated-dependencies: - dependency-name: "@nestjs/axios" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: William Calderipe <wcalderipe@gmail.com> * Update Vault Image Version to 1998b02 * Update Armory Image Version to 1998b02 * Update policy-engine Image Version to 1998b02 * Bump @docusaurus/tsconfig from 3.0.0 to 3.4.0 (#298) Bumps [@docusaurus/tsconfig](https://github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus-tsconfig) from 3.0.0 to 3.4.0. - [Release notes](https://github.com/facebook/docusaurus/releases) - [Changelog](https://github.com/facebook/docusaurus/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/docusaurus/commits/v3.4.0/packages/docusaurus-tsconfig) --- updated-dependencies: - dependency-name: "@docusaurus/tsconfig" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: William Calderipe <wcalderipe@gmail.com> * Bump jose from 5.2.2 to 5.4.0 (#309) Bumps [jose](https://github.com/panva/jose) from 5.2.2 to 5.4.0. - [Release notes](https://github.com/panva/jose/releases) - [Changelog](https://github.com/panva/jose/blob/main/CHANGELOG.md) - [Commits](panva/jose@v5.2.2...v5.4.0) --- updated-dependencies: - dependency-name: jose dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: William Calderipe <wcalderipe@gmail.com> * Update Vault Image Version to 3c4278b * Update Vault Image Version to d37e3f1 * Update Armory Image Version to 3c4278b * Update Armory Image Version to d37e3f1 * Update policy-engine Image Version to d37e3f1 * Update policy-engine Image Version to 3c4278b * removed nextAddrIndex, added utils and tests (#312) * removed nextAddrIndex, added utils and tests * naming and removed unused functionality * Update Armory Image Version to 15e394a * Update policy-engine Image Version to 15e394a * implicit undefined doesn't compile (#320) * Update Vault Image Version to 8fd5a89 * Feature/nar 1665 armory add client secret (#319) * Update Vault Image Version to 8e71293 * Update Armory Image Version to 8e71293 * Update policy-engine Image Version to 8e71293 * Add Swagger documentation in the vault controllers (#325) * Add Swagger documentation in the vault controllers * Add mandatory headers * Refactor permissions decorator * Update policy-engine Image Version to e66d656 * Update Vault Image Version to e66d656 * Update Armory Image Version to e66d656 * update response when syncing engine (#326) * Update Vault Image Version to b26cdd3 * Update Armory Image Version to b26cdd3 * Update policy-engine Image Version to b26cdd3 * Add missing Swagger documentation in the PE controllers (#327) * Document PE controllers * Fix client guard * Update Vault Image Version to ef510cf * Update Armory Image Version to ef510cf * Fix SDK unit tests and PE sync response (#328) * Fix wrong import * Fix sync DTO Refactor for simplicity * Fix Armory cluster integration tests * Update Armory Image Version to d09cba3 * Update Vault Image Version to d09cba3 * Update policy-engine Image Version to d09cba3 * dependabot private regisry update * dependabot private regisry update #2 * Bump tslib from 2.6.2 to 2.6.3 (#324) Bumps [tslib](https://github.com/Microsoft/tslib) from 2.6.2 to 2.6.3. - [Release notes](https://github.com/Microsoft/tslib/releases) - [Commits](microsoft/tslib@v2.6.2...v2.6.3) --- updated-dependencies: - dependency-name: tslib dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update Vault Image Version to 7598fb0 * Update Armory Image Version to 7598fb0 * Update policy-engine Image Version to 7598fb0 * revert dependabot.yml registry change for now * check existing keyId before inserting mnemonic (#317) * check existing keyId before inserting mnemonic * move integrity check in service * removed unit test on removed feature * Update policy-engine Image Version to 0293daf * Update Vault Image Version to 0293daf * Update Armory Image Version to 0293daf * Making chain required in tx request * Version bumps from dependabot; bypassing pipeline issue w/ private repo (#331) * Update Armory Image Version to 4315d32 * Update policy-engine Image Version to 4315d32 * Adding noop provider for vault * Update Vault Image Version to 9ae6b94 * Modify Armory to improve generated HTTP clients (#333) * Modify controllers and schemas to improve generated HTTP client * Remove unused example config * Refactor managed data store API scheme Prevent cluster service to throw when a node failed to sync * Change client API tag * Rephrase the AssetId TODO comment * Fix data store client * Revert viem bump * update package-loc * Update Armory Image Version to dc235f3 * Update Vault Image Version to dc235f3 * Update policy-engine Image Version to dc235f3 * Fix package-lock.json (#335) * Switch font awesome to free (#337) * Update Armory Image Version to 8dbe49d * Update Vault Image Version to 8dbe49d * Update policy-engine Image Version to 8dbe49d * set default client issuer in the db (#339) * Update Vault Image Version to 0600c09 * fix policy engine unit tests (#340) * Update policy-engine Image Version to 83bc7a9 * Feature/nar 1672 vault refactor (#334) * renamed wallet and wallets to _OLD_WALLET_ and _OLD_WALLETS_ * renamed mnemonic collection/repository to root-key * readme changes * format and readme change * fixed conflict * renamed wallets to accounts * renamed api and controllers * change rootKey schema to have keyType and curve properties * removed unused curve and moved types to correct file * format * updated readme * Update Vault Image Version to 4b02e95 * Update Armory Image Version to 4b02e95 * Update policy-engine Image Version to 4b02e95 * new endpoint to list wallets (#342) * new endpoint to list wallets * revised naming for Wallet and added guard on endpoint * Update Vault Image Version to 199b106 * fixed naming on devtool (#344) * fixed naming on devtool * generatedKey singular in playground * Fixes to be more explicit on spending limits (#341) * Update policy-engine Image Version to 1eab535 * CI to update platform repo helm chart * CI to update platform repo helm chart - 2 * Update Vault Image Version to 4647e28 * update branch name * Update Vault Image Version to 9add0b7 * Adding repo in app token * Update Vault Image Version to 690919d * Pull out helm update action * Update Vault Image Version to 852bba8 * Fix vars & secrets in composite action * Update Vault Image Version to 4b15deb * Update Armory Image Version to 4b15deb * Update policy-engine Image Version to 4b15deb * Removing extra action steps * Removing helm charts; moving to platform repo * Fix devtool following refactor from wallet to account (#351) * Adding vault-prod workflow * Feature/nar 1646 support client issuer in the access token (#343) * Updating non-prod to re-build when prod workflow changes * Removing tags from triggering test workflow * Updating registry config for prod * trigger vault workflow * Adding branch match back to vault workflow * syntax * Adding prod action workflows for Armory and Engine * Remove remeda and playwright deps that are unused (#353) * Remove remeda and playwright deps that are unused * fixing actions wildcard match * Armory e2e test over client secret hashing behavior * Auth and Data Store SDK (#336) * Custom path derivation doesn't derive one too many account (#357) * Fix new sdk types in devtool (#358) * Wallet -> Account in armory and engine (#356) * renamed wallet entities into accounts * removed console statement * renamed fixtures and WALLET classification into VAULT * renamed fixtures in vault and devtool * vault format * rego permissions on wallet not account * fix viem link in comments * Revert "Fix new sdk types in devtool (#358)" This reverts commit 56caa6f. * Revert "Revert "Fix new sdk types in devtool (#358)"" This reverts commit b84f048. * Revert "Wallet -> Account in armory and engine (#356)" This reverts commit 8bdd845. * Add random secret data api key to access data store (#350) * Add retry data store sync on armory boot (#354) * Rename wallet -> account in engine and data store, regenerate sdk clients (#360) * renamed wallet entities into accounts * removed console statement * renamed fixtures and WALLET classification into VAULT * renamed fixtures in vault and devtool * vault format * rego permissions on wallet not account * fix viem link in comments * re-generated client * Vault SDK (#359) * Removing non-mpc engine from prod release * trigger workflow when prod workflow changes * supports pem import for backup keys (#368) * supports pem import for backup keys * fixed devtool account/wallet generation/import * removed console.log * bump viem and re-added the signatureToHex function (#371) * fixed signing service and added a test (#372) * Use new SDK in the Devtool (#362) * Add client id guard to auth request endpoints (#361) * Fix bug on duplicated approvals (#363) * Add MPL 2.0 license (#373) * Add MPL 2.0 license * Update package.json license to MPL-2.0 * Feature/nar 1709 rsapubkeytohex throws (#374) * add unit test for rsaPublicKeyToHex * add browser implementation for rsaPubKeyToHex function * removed polyfill from devtool * cleaned up unit.spec file * fix usage of PEM --> JWK converter in devtool * Add LICENSES_DISCLOSURE.md (#377) * Update README (#378) Update logo. Remove projects section. Add a "what" section. * Cleanup package.json (#370) * Bump prisma from 5.8.1 to 5.16.1 (#379) Bumps [prisma](https://github.com/prisma/prisma/tree/HEAD/packages/cli) from 5.8.1 to 5.16.1. - [Release notes](https://github.com/prisma/prisma/releases) - [Commits](https://github.com/prisma/prisma/commits/5.16.1/packages/cli) --- updated-dependencies: - dependency-name: prisma dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @docusaurus/core from 3.1.1 to 3.4.0 (#367) Bumps [@docusaurus/core](https://github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus) from 3.1.1 to 3.4.0. - [Release notes](https://github.com/facebook/docusaurus/releases) - [Changelog](https://github.com/facebook/docusaurus/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/docusaurus/commits/v3.4.0/packages/docusaurus) --- updated-dependencies: - dependency-name: "@docusaurus/core" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @nestjs/swagger from 7.2.0 to 7.3.1 (#349) Bumps [@nestjs/swagger](https://github.com/nestjs/swagger) from 7.2.0 to 7.3.1. - [Release notes](https://github.com/nestjs/swagger/releases) - [Changelog](https://github.com/nestjs/swagger/blob/master/.release-it.json) - [Commits](nestjs/swagger@7.2.0...7.3.1) --- updated-dependencies: - dependency-name: "@nestjs/swagger" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump usehooks-ts from 3.0.2 to 3.1.0 (#364) Bumps [usehooks-ts](https://github.com/juliencrn/usehooks-ts) from 3.0.2 to 3.1.0. - [Release notes](https://github.com/juliencrn/usehooks-ts/releases) - [Commits](https://github.com/juliencrn/usehooks-ts/compare/usehooks-ts@3.0.2...usehooks-ts@3.1.0) --- updated-dependencies: - dependency-name: usehooks-ts dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @swc/core from 1.5.7 to 1.6.5 (#366) Bumps [@swc/core](https://github.com/swc-project/swc) from 1.5.7 to 1.6.5. - [Release notes](https://github.com/swc-project/swc/releases) - [Changelog](https://github.com/swc-project/swc/blob/main/CHANGELOG.md) - [Commits](swc-project/swc@v1.5.7...v1.6.5) --- updated-dependencies: - dependency-name: "@swc/core" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix bug when polling auth req after creation (#381) * Replace @sepior/tsmsdkv2 by a @narval-xyz/blockdaemon-tsm (#376) * Replace @sepior/tsmsdkv2 by a wrapper package * Load Blockdaemon dependency on demand * Use BlockdaemonTsmService * Delete tsmsdkv2 types * Update package-lock.json * Minor updates in docker-compose Rename a few make targets and update the README. Re-generate package-lock.json * Check PSQL container healthy before start others * Update NPM section in the README * Release SDK version 0.0.4 (#384) * Bump SDK to 0.0.4 * Order the README sections It brings the most important sections to the top. * Update package-lock.json * Remove Bullboard from Prod (#382) * Add spending limit for fixed period. Daily, monthly and yearly basis. (#385) * Feature/nar 1734 add rate limit policy criteria + add transfer destinations filter (#391) * added signRaw support in auth server (#392) * added signRaw support in auth server * added e2e test for raw signing * SDK proxy internal packages (#393) * Proxy signature and policy-engine-shared through the SDK * Bump package.json version * Feature/nar 1689 api versioning (#380) * created withVersionning to shared/nest * every controller at version 1 * fixed tests with prefix * renamed version helper * format * saved exported util * updated armory-sdk version * Revert "updated armory-sdk version" This reverts commit cd32d55. * updated sdk-version (#394) * updated version * ran npm install * user operation being processed * e2e script working * added test to vault userOp signing * new tests lints and readme * serializedEvalRequest in test * corrected some tests * removed nested packages and linted * changed userOperation v6 to take a number chainId * read/create type are serialized unserialized for user operation * use fixtures for e2e test --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Samuel <samuel@narval.xyz> Co-authored-by: Ptroger <44851272+Ptroger@users.noreply.github.com> Co-authored-by: Matt Schoch <matt@narval.xyz> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Pierre Troger <pierre@narval.xyz>
This PR adds enough changes to allow us to distribute the Armory SDK through NPM as a standalone artifact bundling the
@narval/signature
and@narval/policy-engine-shared
packages.Image: just an illustration of what's distributed through the monorepo and NPM (the dependency tree of apps and libs doesn't reflect reality).
Changelog
@narval/signature
and@narval/policy-engine-shared
to buildable projects.@narval/armory-sdk
to a publishable project.tsconfig.json
files in the packages. IMPORTANT: The buildable packages MUST have themodule
property set tocommonjs
.@narval/signature
and@narval/policy-engine-shared
, it must include the dependencies of these projects in itspackage.json
. This is not an ideal end state but will work for now.@narval-xyz/armory-sdk
). IMPORTANT: it publishes the package with restricted access, meaning projects will be required with an auth token to install it. This must change to public at some point in the future.Out of Scope
Building the SDK
Because we won't publish
@narval/signature
and@narval/policy-engine-shared
through NPM today, we must bundle them as part of the SDK's source code. This is accomplished by setting theexternal
option of the@nx/js:tsc
executor tonone
, meaning "none of the buildable packages from the monorepo should be externalized via NPM".This whole problem is documented in this issue: nrwl/nx#4620
To get a better view of what's inside the
armory-sdk
artifact that's published on NPM, click on the expandable section below.Click to see dist/packages/armory-sdk tree view
Reference