Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a7bea06
refactor: change the name of the folder from api to payments-sdk
lucasvinhas Mar 2, 2026
dd8cebc
fix: remove Crowdsplit naming from SDK
fahmidareem3 Mar 2, 2026
b227568
Merge pull request #62 from oak-network/refactor/type-renaming
fahmidareem3 Mar 2, 2026
568cb9b
docs: update README formatting and improve consistency in code examples
andrefelizardo Mar 2, 2026
7c1466f
Remove OpenSSF Badge from docs
andrefelizardo Mar 3, 2026
2e68241
chore: downgrade version bump from major to minor
fahmidareem3 Mar 3, 2026
f4935cc
Merge pull request #65 from oak-network/refactor/update-changeset
fahmidareem3 Mar 3, 2026
ad775fc
Merge branch 'main' into chore/update-readme
lucasvinhas Mar 3, 2026
1e8e347
docs: enhance README to clarify SDK features and improve readability
lucasvinhas Mar 3, 2026
b3ee539
Refactor: change the name of the package from payment-sdk to payments
lucasvinhas Mar 3, 2026
cf444ea
chore: update package description for clarity and specificity
lucasvinhas Mar 3, 2026
4adbb90
Add keywords to package.json
andrefelizardo Mar 3, 2026
aba5823
Revise README description for Oak Payments SDK
andrefelizardo Mar 3, 2026
05c1ecc
Update documentation link in README.md
andrefelizardo Mar 3, 2026
8081ada
Update installation command in README
andrefelizardo Mar 3, 2026
990a5e7
Merge pull request #59 from oak-network/chore/update-readme
lucasvinhas Mar 3, 2026
bd7bf34
chore: remove OpenSSF Scorecard badge from README
andrefelizardo Mar 3, 2026
07e06f3
docs: update package name in README from @oaknetwork/api to @oaknetwo…
andrefelizardo Mar 3, 2026
580d62c
docs: update import statement in README to reflect new package structure
andrefelizardo Mar 3, 2026
fc5eed4
docs: update SECURITY.md to reflect new package name and improve form…
andrefelizardo Mar 3, 2026
3b4f7ce
docs: correct package name in CLAUDE.md and remove redundant line in …
andrefelizardo Mar 3, 2026
89ee42f
refactor: standardize string quotes and improve formatting in webhook…
andrefelizardo Mar 3, 2026
cafe1ed
refactor: standardize string quotes and improve formatting in jest-ru…
andrefelizardo Mar 3, 2026
3658965
chore: update package name in package.json from @oaknetwork/api to @o…
andrefelizardo Mar 3, 2026
40d85a3
docs: update package name in CHANGELOG.md from @oaknetwork/api to @oa…
andrefelizardo Mar 3, 2026
078875c
chore: add initial changeset for shaggy-cloths-burn
andrefelizardo Mar 3, 2026
d76ddda
docs: update CHANGELOG.md to reflect import changes from @oaknetwork/…
andrefelizardo Mar 3, 2026
8dd0350
chore: rename SDK folder to payments-sdk in changeset
andrefelizardo Mar 3, 2026
9790263
refactor: remove Crowdsplit product facade and update payment method …
andrefelizardo Mar 3, 2026
22e1d49
docs: enhance README.md with credential setup, installation instructi…
andrefelizardo Mar 3, 2026
c8a8447
Update payments package name references
andrefelizardo Mar 3, 2026
88669ba
docs: update documentation link in README.md for SDK overview
andrefelizardo Mar 3, 2026
f7339fd
docs: update links in README.md for consistency and accuracy
andrefelizardo Mar 3, 2026
f85275b
chore: add initial changeset for little-crews-sin
andrefelizardo Mar 3, 2026
6007e2f
Chore/update document links docs
andrefelizardo Mar 3, 2026
150ff6b
chore: version packages
github-actions[bot] Mar 3, 2026
2e9ee32
Merge pull request #66 from oak-network/changeset-release/main
lucasvinhas Mar 3, 2026
a3a0d64
chore: update build command in release workflow
lucasvinhas Mar 4, 2026
236cd67
chore: simplify build command in CI workflow
lucasvinhas Mar 4, 2026
4c2a14e
Merge pull request #69 from oak-network/chore/remove-filter-release-ci
lucasvinhas Mar 5, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: pnpm changeset:status

- name: Build all packages
run: pnpm -r --workspace-concurrency=Infinity --filter=!@oaknetwork/contracts build
run: pnpm -r --workspace-concurrency=Infinity build

- name: Run tests with coverage (enforces 100% threshold)
run: pnpm -r --workspace-concurrency=Infinity --filter=!@oaknetwork/contracts test --coverage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

- name: Build packages
if: steps.changesets.outputs.hasChangesets == 'false'
run: pnpm --filter=!@oaknetwork/contracts build
run: pnpm build

- name: Update npm for OIDC support
if: steps.changesets.outputs.hasChangesets == 'false'
Expand Down
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"jest.runMode": "on-demand",
"jest.virtualFolders": [
{
"name": "api",
"rootPath": "packages/api",
"jestCommandLine": "node packages/api/scripts/jest-run-exact.js --",
"name": "payments",
"rootPath": "packages/payments",
"jestCommandLine": "node packages/payments/scripts/jest-run-exact.js --",
"pathToConfig": "jest.config.js"
},
{
Expand Down
30 changes: 16 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- **Webhook Verification Utilities**: New `verifyWebhookSignature()` and `parseWebhookPayload()` functions for secure webhook handling using HMAC-SHA256 with timing-safe comparison
- **RefundService**: Added to Crowdsplit product facade, exposing refund functionality that was previously available but not exposed
- **RefundService**: Exposed refund functionality that was previously available but not exported
- **Helper Utilities**:
- `withAuth()`: Higher-order function for wrapping HTTP operations with authentication (eliminates 35+ duplications)
- `buildUrl()`: Centralized URL construction with consistent trailing slash handling (standardizes 36+ URL constructions)
Expand All @@ -29,7 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **BREAKING**: Removed `createAuthService()` wrapper - use `client.getAccessToken()` and `client.grantToken()` directly
- **Type System Improvements**:
- Replaced `any` with `unknown` in httpClient methods (`post`, `put`, `patch`) and retryHandler for better type safety
- Converted `ReturnType<typeof>` to direct interface imports in Crowdsplit facade
- Converted `ReturnType<typeof>` to direct interface imports in service types
- Converted intersection types to standalone interfaces in Payment and Transfer types
- **Dependency Updates**:
- Moved `nock` and `dotenv` from dependencies to devDependencies (reduces production bundle size)
Expand Down Expand Up @@ -97,7 +97,7 @@ const client = createOakClient({
**Before:**

```typescript
import { createAuthService } from "@oaknetwork/api";
import { createAuthService } from "@oaknetwork/payments-sdk";

const auth = createAuthService(client);
const token = await auth.getAccessToken();
Expand Down Expand Up @@ -136,7 +136,10 @@ httpClient.post<ResponseType>(url, requestData as RequestType, config);
#### Webhook Verification

```typescript
import { verifyWebhookSignature, parseWebhookPayload } from "@oaknetwork/api";
import {
verifyWebhookSignature,
parseWebhookPayload,
} from "@oaknetwork/payments-sdk";

// Option 1: Verify signature only
app.post("/webhook", (req, res) => {
Expand Down Expand Up @@ -173,13 +176,15 @@ app.post("/webhook", (req, res) => {
#### RefundService Now Available

```typescript
import { Crowdsplit } from "@oaknetwork/api/products/crowdsplit";
import { createOakClient, createRefundService } from "@oaknetwork/payments-sdk";

const crowdsplit = Crowdsplit(client);
const client = createOakClient({
/* config */
});
const refunds = createRefundService(client);

// Refund service is now exposed
const result = await crowdsplit.refunds.create({
transaction_id: "txn_123",
// Create a refund
const result = await refunds.create("pay_123", {
amount: 1000,
});
```
Expand All @@ -189,23 +194,20 @@ const result = await crowdsplit.refunds.create({
1. **Update Package**:

```bash
pnpm update @oaknetwork/api@latest
pnpm update @oaknetwork/payments-sdk@latest
```

2. **Remove `clientSecret` Access**:

- Search codebase for `client.config.clientSecret`
- Store separately if needed for non-SDK purposes
- Update to use environment variables

3. **Replace `createAuthService()`**:

- Search for `createAuthService`
- Replace with direct `client.getAccessToken()` or `client.grantToken()` calls
- Remove import

4. **Add Type Assertions** (if needed):

- TypeScript may require type assertions for HTTP client methods
- Add `as RequestType` where compiler indicates `unknown` cannot be assigned

Expand All @@ -219,7 +221,7 @@ const result = await crowdsplit.refunds.create({
### Added

- Initial release of Oak SDK
- Support for Crowdsplit API
- Support for Oak Network API
- Customer, Payment, PaymentMethod, Transaction services
- Transfer, Webhook, Plan, Buy, Sell services
- OAuth 2.0 client credentials flow
Expand Down
7 changes: 3 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ function processData(data: any): any {

```typescript
// ✅ CORRECT
export interface CrowdsplitProduct {
export interface OakServices {
customers: CustomerService;
payments: PaymentService;
}

// ❌ WRONG
export interface CrowdsplitProduct {
export interface OakServices {
customers: ReturnType<typeof createCustomerService>;
}
```
Expand Down Expand Up @@ -230,7 +230,6 @@ create(customer: Customer.Request): Promise<Result<Customer.Response>>;
```

4. **NEVER log sensitive data**:

- No passwords, tokens, or API keys in logs
- Sanitize error messages before logging
- Use structured logging with sensitive field filtering
Expand Down Expand Up @@ -632,7 +631,7 @@ When introducing breaking changes:

1. Remove references to `client.config.clientSecret`
2. Store secret in environment variables
3. Update to latest `@oaknetwork/api` version
3. Update to latest `@oaknetwork/payments-sdk` version
```

### TSDoc Examples
Expand Down
Loading
Loading