diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f94f6f6b..2461a19a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,8 +25,6 @@ jobs: NAME: ${{ secrets.NAME }} PRIVATEKEY: ${{ secrets.PRIVATEKEY }} SEED: ${{ secrets.SEED }} - - run: npm install - - run: npm ci - - run: npm publish --dry-run + - run: npm run test:dry-run - run: npm run test:e2e diff --git a/README.md b/README.md index bbaea319..4d64a338 100644 --- a/README.md +++ b/README.md @@ -165,16 +165,16 @@ In order to persist the data for the Wallet, you will need to implement a store await store(data); ``` -For convenience during testing, we provide a `saveWallet` method that stores the Wallet data in your local file system. This is an insecure method of storing wallet seeds and should only be used for development purposes. +For convenience during testing, we provide a `saveSeed` method that stores the Wallet data in your local file system. This is an insecure method of storing wallet seeds and should only be used for development purposes. ```typescript -user.saveWallet(wallet); +user.saveSeed(wallet); ``` -To encrypt the saved data, set encrypt to true. Note that your CDP API key also serves as the encryption key for the data persisted locally. To re-instantiate wallets with encrypted data, ensure that your SDK is configured with the same API key when invoking `saveWallet` and `loadWallets`. +To encrypt the saved data, set encrypt to true. Note that your CDP API key also serves as the encryption key for the data persisted locally. To re-instantiate wallets with encrypted data, ensure that your SDK is configured with the same API key when invoking `saveSeed` and `loadWallets`. ```typescript -user.saveWallet(wallet, true); +user.saveSeed(wallet, true); ``` The below code demonstrates how to re-instantiate a Wallet from the data export. @@ -239,6 +239,11 @@ To run a specific test, run (for example): ```bash npx jest ./src/coinbase/tests/wallet_test.ts ``` +To run e2e tests, run: + +```bash +npm run test:dry-run && NAME="placeholder" PRIVATE_KEY="placeholder" SEED="placeholder" && npm run test:e2e +``` ### Generating Documentation diff --git a/package.json b/package.json index f24ba2f9..68e87a2e 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "format-check": "prettier -c .prettierrc --check \"**/*.{ts,js,cjs,json,md}\"", "check": "tsc --noEmit", "test": "npx jest --no-cache --testMatch=**/*_test.ts", + "test:dry-run": "npm install && npm ci && npm publish --dry-run", "test:e2e": "npx jest --no-cache --testMatch=**/e2e.ts", "clean": "rm -rf dist/*", "build": "tsc",