Skip to content
Merged
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: 5 additions & 0 deletions .changeset/customer-id-forward-compatible.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@blindpay/node": patch
---

Revert `BlockchainWalletOut`, `OfframpWallet` and `GetLimitIncreaseRequestsResponse` back to declaring `customer_id`. A response-rewriting middleware already aliases `receiver_id` to `customer_id` on every customer route in production, so `customer_id` is present on the wire today, and it becomes the API's own field name once the server-side rename ships. The nested `Owner` type now declares both `receiver_id` and `customer_id` as optional: production sends neither on that nested object today, `receiver_id` will keep working, and `customer_id` will start arriving once the server-side rename ships.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blindpay/node",
"version": "4.1.0",
"version": "4.1.1",
"description": "Official Node.js SDK for Blindpay API - Stablecoin API for global payments",
"keywords": [
"blindpay",
Expand Down
6 changes: 3 additions & 3 deletions src/resources/customers/customers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ describe("Customers", () => {
const mockedLimitIncreaseRequests: GetLimitIncreaseRequestsResponse = [
{
id: "rl_000000000000",
receiver_id: "re_YuaMcI2B8zbQ",
customer_id: "re_YuaMcI2B8zbQ",
status: "in_review",
daily: 50000,
monthly: 250000,
Expand All @@ -589,7 +589,7 @@ describe("Customers", () => {
},
{
id: "rl_000000000000",
receiver_id: "re_YuaMcI2B8zbQ",
customer_id: "re_YuaMcI2B8zbQ",
status: "approved",
daily: 30000,
monthly: 150000,
Expand Down Expand Up @@ -618,7 +618,7 @@ describe("Customers", () => {
const mockedLimitIncreaseRequests: GetLimitIncreaseRequestsResponse = [
{
id: "rl_000000000000",
receiver_id: "re_YuaMcI2B8zbQ",
customer_id: "re_YuaMcI2B8zbQ",
status: "approved",
daily: 50000,
monthly: 250000,
Expand Down
3 changes: 2 additions & 1 deletion src/resources/customers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export type Owner = {
tax_type?: OwnerTaxType | null;
instance_id?: string;
receiver_id?: string;
customer_id?: string;
};

export type IndividualWithStandardKYC = {
Expand Down Expand Up @@ -485,7 +486,7 @@ export type LimitIncreaseRequestSupportingDocumentType =

export type GetLimitIncreaseRequestsResponse = Array<{
id: string;
receiver_id: string;
customer_id: string;
status: LimitIncreaseRequestStatus;
daily: number;
monthly: number;
Expand Down
8 changes: 4 additions & 4 deletions src/resources/wallets/blockchain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe("Blockchain wallets", () => {
address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C",
signature_tx_hash: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
is_account_abstraction: false,
receiver_id: "re_000000000000",
customer_id: "re_000000000000",
},
];

Expand All @@ -64,7 +64,7 @@ describe("Blockchain wallets", () => {
address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C",
signature_tx_hash: undefined,
is_account_abstraction: true,
receiver_id: "re_000000000000",
customer_id: "re_000000000000",
};

fetchMock.mockResponseOnce(JSON.stringify(mockedWallet), {
Expand Down Expand Up @@ -92,7 +92,7 @@ describe("Blockchain wallets", () => {
address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C",
signature_tx_hash: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
is_account_abstraction: false,
receiver_id: "re_000000000000",
customer_id: "re_000000000000",
};

fetchMock.mockResponseOnce(JSON.stringify(mockedWallet), {
Expand Down Expand Up @@ -120,7 +120,7 @@ describe("Blockchain wallets", () => {
address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C",
signature_tx_hash: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
is_account_abstraction: false,
receiver_id: "re_000000000000",
customer_id: "re_000000000000",
};

fetchMock.mockResponseOnce(JSON.stringify(mockedWallet), {
Expand Down
6 changes: 3 additions & 3 deletions src/resources/wallets/blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type ListBlockchainWalletsResponse = Array<{
address?: string;
signature_tx_hash?: string;
is_account_abstraction: boolean;
receiver_id: string;
customer_id: string;
}>;

export type CreateBlockchainWalletWithAddressInput = {
Expand Down Expand Up @@ -50,7 +50,7 @@ export type GetBlockchainWalletResponse = {
address?: string;
signature_tx_hash?: string;
is_account_abstraction: boolean;
receiver_id: string;
customer_id: string;
};

export type CreateBlockchainWalletResponse = {
Expand All @@ -60,7 +60,7 @@ export type CreateBlockchainWalletResponse = {
address?: string;
signature_tx_hash?: string;
is_account_abstraction: boolean;
receiver_id: string;
customer_id: string;
};

export type CreateAssetTrustlineInput = string;
Expand Down
4 changes: 2 additions & 2 deletions src/resources/wallets/offramp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe("Offramp wallets", () => {
id: "ow_000000000000",
external_id: "your_external_id",
instance_id: "in_000000000000",
receiver_id: "re_000000000000",
customer_id: "re_000000000000",
bank_account_id: "ba_000000000000",
network: "tron",
address: "TALJN9zTTEL9TVBb4WuTt6wLvPqJZr3hvb",
Expand Down Expand Up @@ -92,7 +92,7 @@ describe("Offramp wallets", () => {
id: "ow_000000000000",
external_id: "your_external_id",
instance_id: "in_000000000000",
receiver_id: "re_000000000000",
customer_id: "re_000000000000",
bank_account_id: "ba_000000000000",
network: "tron",
address: "TALJN9zTTEL9TVBb4WuTt6wLvPqJZr3hvb",
Expand Down
2 changes: 1 addition & 1 deletion src/resources/wallets/offramp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type OfframpWallet = {
id: string;
external_id: string;
instance_id: string;
receiver_id: string;
customer_id: string;
bank_account_id: string;
network: OfframpWalletNetwork;
address: string;
Expand Down
Loading