Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The following is a set of guidelines for contributing to the Base Account SDK. T

### Suggesting Enhancements

1. **Check the [Issues](https://github.com/base/account-sdk/issues)** to see if there's someone who has already suggested the same enhancement.
1. **Check the [Issues](https://github.com/base/account-sdk/issues)** to see if someone has already suggested the same enhancement.

2. If it doesn't exist, [create a new issue](https://github.com/base/account-sdk/issues/new). Provide a clear and detailed explanation of the feature you want and why it's important to add.

Expand Down Expand Up @@ -83,8 +83,7 @@ It's recommended to run `yarn format` before committing your changes to ensure c

### Signing Commits

All commits need to be signed with a GPG key. This adds a second factor of authentication that proves that it came from
you, and not someone who managed to compromise your GitHub account. You can enable signing by following the guide [here](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification#gpg-commit-signature-verification).
All commits need to be signed with a GPG key. This adds a second factor of authentication that proves it came from you, and not someone who managed to compromise your GitHub account. You can enable signing by following the guide [here](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification#gpg-commit-signature-verification).

## Coding Conventions

Expand Down
6 changes: 4 additions & 2 deletions examples/testapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"scripts": {
"build": "next build",
"clean": "rm -rf .next && rm -rf node_modules",
"clean": "rmdir /s /q .next 2>nul & rmdir /s /q node_modules 2>nul || echo \"cleaned\"",
"dev": "next dev --port 3001",
"export": "yarn build && touch ./out/.nojekyll",
"lint": "biome lint .",
Expand All @@ -30,9 +30,11 @@
"viem": "^2.27.2"
},
"devDependencies": {
"@chakra-ui/system": "^2.6.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "^16.2.0",
"@types/react": "18.2.15",
"typescript": "^5.1.6",
"vitest": "^3.0.4"
"vitest": "^2.1.9"
}
}
4 changes: 2 additions & 2 deletions examples/testapp/src/components/RpcMethods/RpcMethodCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ export function RpcMethodCard({ format, method, params, shortcuts }) {
)?.data.chain ?? mainnet;

if (method.includes('wallet_sign')) {
const type = data.type || (data.request as any).type;
const walletSignData = data.data || (data.request as any).data;
const type = data.type || (data.request as Record<string, unknown>)?.type;
const walletSignData = data.data || (data.request as Record<string, unknown>)?.data;
let result: string | null = null;
if (type === '0x01') {
result = await verifySignMsg({
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
"private": true,
"workspaces": [
"packages/*",
"libs/*",
"examples/*"
],
"scripts": {
"build:packages": "yarn workspace @base-org/account build && yarn workspace @base-org/account-ui build",
"clean": "yarn workspaces foreach -A -ipv run clean && rm -rf node_modules && yarn",
"clean": "yarn workspaces foreach -A -ipv run clean && rmdir /s /q node_modules 2>nul && yarn",
"deploy": "yarn build:packages && yarn workspace sdk-playground export",
"dev": "yarn workspaces foreach -A -ipv run dev",
"lint": "yarn workspaces foreach -A -pt run lint",
Expand Down
12 changes: 6 additions & 6 deletions packages/account-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@
"author": "Base",
"license": "Apache-2.0",
"scripts": {
"clean": "rm -rf dist && rm -rf node_modules",
"clean": "rmdir /s /q dist 2>nul & rmdir /s /q node_modules 2>nul || echo \"cleaned\"",
"pretest": "node compile-assets.cjs",
"test": "vitest",
"test:coverage": "vitest --coverage",
"prebuild": "rm -rf ./dist",
"prebuild": "rmdir /s /q dist 2>nul || echo \"dist folder cleaned\"",
"build": "node compile-assets.cjs && tsc -p ./tsconfig.build.json && tsc-alias && yarn build:browser",
"build:browser": "rollup -c rollup.config.js",
"prepublishOnly": "yarn build",
Expand All @@ -131,20 +131,20 @@
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.5",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@size-limit/preset-big-lib": "^11.1.6",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/preact": "^3.2.4",
"@types/node": "^14.18.54",
"@vitest/coverage-v8": "2.1.2",
"@vitest/web-worker": "3.2.1",
"@types/node": "^20.0.0",
"@vitest/coverage-v8": "^2.1.9",
"@vitest/web-worker": "^2.1.9",
"fake-indexeddb": "^6.0.0",
"glob": "^11.0.0",
"jest-websocket-mock": "^2.4.0",
"jsdom": "^25.0.1",
"nodemon": "^3.1.0",
"rollup": "^4.9.6",
"rollup-plugin-terser": "^7.0.2",
"sass": "^1.64.1",
"size-limit": "^11.1.6",
"tsc-alias": "^1.8.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/account-sdk/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import terser from '@rollup/plugin-terser';
import typescript from '@rollup/plugin-typescript';
import { terser } from 'rollup-plugin-terser';

export default {
input: 'src/browser-entry.ts',
Expand Down
4 changes: 3 additions & 1 deletion packages/account-sdk/src/interface/payment/subscribe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ export async function subscribe(options: SubscriptionOptions): Promise<Subscript

// Extract the overridePeriodInSecondsForTestnet if present and valid
const overridePeriodInSecondsForTestnet =
testnet && hasOverridePeriod ? (options as any).overridePeriodInSecondsForTestnet : undefined;
testnet && hasOverridePeriod && 'overridePeriodInSecondsForTestnet' in options
? options.overridePeriodInSecondsForTestnet
: undefined;

// Generate correlation ID for this subscription request
const correlationId = crypto.randomUUID();
Expand Down
10 changes: 6 additions & 4 deletions packages/account-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
"author": "Base",
"license": "Apache-2.0",
"scripts": {
"clean": "rm -rf dist && rm -rf node_modules",
"clean": "rmdir /s /q dist 2>nul & rmdir /s /q node_modules 2>nul || echo \"cleaned\"",
"pretest": "node compile-assets.cjs",
"test": "vitest",
"test:coverage": "vitest --coverage",
"postbuild": "cp -r src/frameworks/vue/*.vue dist/frameworks/vue/ && cp -r src/frameworks/svelte/*.svelte dist/frameworks/svelte/",
"build": "node compile-assets.cjs && rm -rf ./dist && tsc -p ./tsconfig.build.json && tsc-alias && yarn postbuild",
"postbuild": "xcopy /s /y src\\frameworks\\vue\\*.vue dist\\frameworks\\vue\\ 2>nul & xcopy /s /y src\\frameworks\\svelte\\*.svelte dist\\frameworks\\svelte\\ 2>nul || echo \"files copied\"",
"build": "node compile-assets.cjs && rmdir /s /q dist 2>nul & tsc -p ./tsconfig.build.json && tsc-alias && yarn postbuild",
"typecheck": "tsc --noEmit",
"lint": "biome lint .",
"format": "biome format . --write",
Expand All @@ -57,10 +57,12 @@
"@testing-library/preact": "^3.2.4",
"@testing-library/react": "^16.3.0",
"@types/react": "^19.1.8",
"@vitest/coverage-v8": "2.1.2",
"@vitest/coverage-v8": "^2.1.9",
"clsx": "1.2.1",
"glob": "^7.2.0",
"preact": "^10.26.9",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sass": "^1.64.1",
"tsc-alias": "^1.8.8",
"tslib": "^2.6.0",
Expand Down
Loading