@_bdas/sdk 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +16 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +68 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/merchant.d.ts +37 -0
- package/dist/merchant.d.ts.map +1 -0
- package/dist/merchant.js +37 -0
- package/dist/merchant.js.map +1 -0
- package/dist/payroll.d.ts +52 -0
- package/dist/payroll.d.ts.map +1 -0
- package/dist/payroll.js +49 -0
- package/dist/payroll.js.map +1 -0
- package/dist/types.d.ts +84 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +13 -0
- package/dist/types.js.map +1 -0
- package/package.json +35 -0
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface HttpClientConfig {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class HttpClient {
|
|
6
|
+
private readonly baseUrl;
|
|
7
|
+
private readonly apiKey;
|
|
8
|
+
constructor(config: HttpClientConfig);
|
|
9
|
+
private headers;
|
|
10
|
+
private handleResponse;
|
|
11
|
+
get<T>(path: string): Promise<T>;
|
|
12
|
+
post<T>(path: string, body?: unknown): Promise<T>;
|
|
13
|
+
patch<T>(path: string, body?: unknown): Promise<T>;
|
|
14
|
+
delete<T>(path: string): Promise<T>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,MAAM,EAAE,gBAAgB;IAKpC,OAAO,CAAC,OAAO;YAOD,cAAc;IA6BtB,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAQhC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IASjD,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IASlD,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CAO1C"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { BdasApiError } from "./types.js";
|
|
2
|
+
export class HttpClient {
|
|
3
|
+
baseUrl;
|
|
4
|
+
apiKey;
|
|
5
|
+
constructor(config) {
|
|
6
|
+
this.baseUrl = config.baseUrl.replace(/\/$/, "");
|
|
7
|
+
this.apiKey = config.apiKey;
|
|
8
|
+
}
|
|
9
|
+
headers() {
|
|
10
|
+
return {
|
|
11
|
+
"Content-Type": "application/json",
|
|
12
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
async handleResponse(res) {
|
|
16
|
+
if (res.ok) {
|
|
17
|
+
return res.json();
|
|
18
|
+
}
|
|
19
|
+
let message = res.statusText;
|
|
20
|
+
let code = String(res.status);
|
|
21
|
+
try {
|
|
22
|
+
const body = (await res.json());
|
|
23
|
+
// API returns { error: { code, message, status } }
|
|
24
|
+
const err = body.error ?? body;
|
|
25
|
+
if (err.message) {
|
|
26
|
+
message = err.message;
|
|
27
|
+
}
|
|
28
|
+
if (err.code) {
|
|
29
|
+
code = err.code;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
// ignore parse errors — use defaults
|
|
34
|
+
}
|
|
35
|
+
throw new BdasApiError(message, code, res.status);
|
|
36
|
+
}
|
|
37
|
+
async get(path) {
|
|
38
|
+
const res = await fetch(`${this.baseUrl}/v1${path}`, {
|
|
39
|
+
method: "GET",
|
|
40
|
+
headers: this.headers(),
|
|
41
|
+
});
|
|
42
|
+
return this.handleResponse(res);
|
|
43
|
+
}
|
|
44
|
+
async post(path, body) {
|
|
45
|
+
const res = await fetch(`${this.baseUrl}/v1${path}`, {
|
|
46
|
+
method: "POST",
|
|
47
|
+
headers: this.headers(),
|
|
48
|
+
body: body === undefined ? undefined : JSON.stringify(body),
|
|
49
|
+
});
|
|
50
|
+
return this.handleResponse(res);
|
|
51
|
+
}
|
|
52
|
+
async patch(path, body) {
|
|
53
|
+
const res = await fetch(`${this.baseUrl}/v1${path}`, {
|
|
54
|
+
method: "PATCH",
|
|
55
|
+
headers: this.headers(),
|
|
56
|
+
body: body === undefined ? undefined : JSON.stringify(body),
|
|
57
|
+
});
|
|
58
|
+
return this.handleResponse(res);
|
|
59
|
+
}
|
|
60
|
+
async delete(path) {
|
|
61
|
+
const res = await fetch(`${this.baseUrl}/v1${path}`, {
|
|
62
|
+
method: "DELETE",
|
|
63
|
+
headers: this.headers(),
|
|
64
|
+
});
|
|
65
|
+
return this.handleResponse(res);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAO1C,MAAM,OAAO,UAAU;IACJ,OAAO,CAAS;IAChB,MAAM,CAAS;IAEhC,YAAY,MAAwB;QAClC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAA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.js";
|
|
3
|
+
export type { HttpClientConfig } from "./client.js";
|
|
4
|
+
export { HttpClient } from "./client.js";
|
|
5
|
+
export { MerchantClient } from "./merchant.js";
|
|
6
|
+
export { PayrollClient } from "./payroll.js";
|
|
7
|
+
export type { Batch, BatchItem, CommitResult, Compaction, CreateEmployeeParams, Deposit, Employee, MerkleProof, PayrollDeposit, PreparedDeposit, Stats, UpdateEmployeeParams, Withdrawal, WithdrawalResult, } from "./types.js";
|
|
8
|
+
export { BdasApiError } from "./types.js";
|
|
9
|
+
export interface BdasClientConfig {
|
|
10
|
+
apiKey: string;
|
|
11
|
+
/** Defaults to https://bdas-api.fly.dev */
|
|
12
|
+
baseUrl?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function createBdasClient(config: BdasClientConfig): {
|
|
15
|
+
merchant: MerchantClient;
|
|
16
|
+
payroll: PayrollClient;
|
|
17
|
+
health: () => Promise<{
|
|
18
|
+
status: string;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
21
|
+
export type BdasClient = ReturnType<typeof createBdasClient>;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,YAAY,EACV,KAAK,EACL,SAAS,EACT,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,OAAO,EACP,QAAQ,EACR,WAAW,EACX,cAAc,EACd,eAAe,EACf,KAAK,EACL,oBAAoB,EACpB,UAAU,EACV,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAID,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB;;;;gBAKpB,MAAM;;EAE1C;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// @_bdas/sdk - Server-side SDK for BDAS API
|
|
2
|
+
import { HttpClient } from "./client.js";
|
|
3
|
+
import { MerchantClient } from "./merchant.js";
|
|
4
|
+
import { PayrollClient } from "./payroll.js";
|
|
5
|
+
export { HttpClient } from "./client.js";
|
|
6
|
+
export { MerchantClient } from "./merchant.js";
|
|
7
|
+
export { PayrollClient } from "./payroll.js";
|
|
8
|
+
export { BdasApiError } from "./types.js";
|
|
9
|
+
const DEFAULT_BASE_URL = "https://bdas-api.fly.dev";
|
|
10
|
+
export function createBdasClient(config) {
|
|
11
|
+
const http = new HttpClient({ apiKey: config.apiKey, baseUrl: config.baseUrl ?? DEFAULT_BASE_URL });
|
|
12
|
+
return {
|
|
13
|
+
merchant: new MerchantClient(http),
|
|
14
|
+
payroll: new PayrollClient(http),
|
|
15
|
+
health: () => http.get("/health"),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAiB7C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAQ1C,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAEpD,MAAM,UAAU,gBAAgB,CAAC,MAAwB;IACvD,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,gBAAgB,EAAE,CAAC,CAAC;IACpG,OAAO;QACL,QAAQ,EAAE,IAAI,cAAc,CAAC,IAAI,CAAC;QAClC,OAAO,EAAE,IAAI,aAAa,CAAC,IAAI,CAAC;QAChC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAqB,SAAS,CAAC;KACtD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { HttpClient } from "./client.js";
|
|
2
|
+
import type { Compaction, Deposit, PreparedDeposit, Stats, Withdrawal, WithdrawalResult } from "./types.js";
|
|
3
|
+
export declare class MerchantClient {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
prepareDeposit(amounts: string[]): Promise<{
|
|
7
|
+
deposits: PreparedDeposit[];
|
|
8
|
+
}>;
|
|
9
|
+
listDeposits(): Promise<{
|
|
10
|
+
deposits: Deposit[];
|
|
11
|
+
}>;
|
|
12
|
+
getDeposit(id: number): Promise<{
|
|
13
|
+
deposit: Deposit;
|
|
14
|
+
}>;
|
|
15
|
+
resetAll(): Promise<{
|
|
16
|
+
deleted: number;
|
|
17
|
+
}>;
|
|
18
|
+
triggerCompaction(): Promise<{
|
|
19
|
+
compaction: Compaction;
|
|
20
|
+
}>;
|
|
21
|
+
listCompactions(): Promise<{
|
|
22
|
+
compactions: Compaction[];
|
|
23
|
+
}>;
|
|
24
|
+
withdraw(recipient: string, depositId: number): Promise<{
|
|
25
|
+
withdrawal: WithdrawalResult;
|
|
26
|
+
}>;
|
|
27
|
+
batchWithdraw(recipient: string, depositIds: number[]): Promise<{
|
|
28
|
+
withdrawals: WithdrawalResult[];
|
|
29
|
+
}>;
|
|
30
|
+
listWithdrawals(): Promise<{
|
|
31
|
+
withdrawals: Withdrawal[];
|
|
32
|
+
}>;
|
|
33
|
+
getStats(): Promise<{
|
|
34
|
+
stats: Stats;
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=merchant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merchant.d.ts","sourceRoot":"","sources":["../src/merchant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE5G,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAEvC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,eAAe,EAAE,CAAA;KAAE,CAAC;IAI3E,YAAY,IAAI,OAAO,CAAC;QAAE,QAAQ,EAAE,OAAO,EAAE,CAAA;KAAE,CAAC;IAIhD,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAIrD,QAAQ,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAIxC,iBAAiB,IAAI,OAAO,CAAC;QAAE,UAAU,EAAE,UAAU,CAAA;KAAE,CAAC;IAIxD,eAAe,IAAI,OAAO,CAAC;QAAE,WAAW,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC;IAIzD,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,gBAAgB,CAAA;KAAE,CAAC;IAIzF,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAAE,WAAW,EAAE,gBAAgB,EAAE,CAAA;KAAE,CAAC;IAIpG,eAAe,IAAI,OAAO,CAAC;QAAE,WAAW,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC;IAIzD,QAAQ,IAAI,OAAO,CAAC;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC;CAG5C"}
|
package/dist/merchant.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export class MerchantClient {
|
|
2
|
+
http;
|
|
3
|
+
constructor(http) {
|
|
4
|
+
this.http = http;
|
|
5
|
+
}
|
|
6
|
+
async prepareDeposit(amounts) {
|
|
7
|
+
return this.http.post("/merchant/deposits/prepare", { amounts });
|
|
8
|
+
}
|
|
9
|
+
async listDeposits() {
|
|
10
|
+
return this.http.get("/merchant/deposits");
|
|
11
|
+
}
|
|
12
|
+
async getDeposit(id) {
|
|
13
|
+
return this.http.get(`/merchant/deposits/${id}`);
|
|
14
|
+
}
|
|
15
|
+
async resetAll() {
|
|
16
|
+
return this.http.delete("/merchant/deposits");
|
|
17
|
+
}
|
|
18
|
+
async triggerCompaction() {
|
|
19
|
+
return this.http.post("/merchant/compactions");
|
|
20
|
+
}
|
|
21
|
+
async listCompactions() {
|
|
22
|
+
return this.http.get("/merchant/compactions");
|
|
23
|
+
}
|
|
24
|
+
async withdraw(recipient, depositId) {
|
|
25
|
+
return this.http.post("/merchant/withdrawals", { recipient, depositId });
|
|
26
|
+
}
|
|
27
|
+
async batchWithdraw(recipient, depositIds) {
|
|
28
|
+
return this.http.post("/merchant/withdrawals/batch", { recipient, depositIds });
|
|
29
|
+
}
|
|
30
|
+
async listWithdrawals() {
|
|
31
|
+
return this.http.get("/merchant/withdrawals");
|
|
32
|
+
}
|
|
33
|
+
async getStats() {
|
|
34
|
+
return this.http.get("/merchant/stats");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=merchant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merchant.js","sourceRoot":"","sources":["../src/merchant.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,cAAc;IACI;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,KAAK,CAAC,cAAc,CAAC,OAAiB;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,EAAU;QACzB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,SAAiB,EAAE,SAAiB;QACjD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,SAAiB,EAAE,UAAoB;QACzD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,6BAA6B,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { HttpClient } from "./client.js";
|
|
2
|
+
import type { Batch, BatchItem, CommitResult, CreateEmployeeParams, Employee, MerkleProof, PayrollDeposit, UpdateEmployeeParams, Withdrawal } from "./types.js";
|
|
3
|
+
export declare class PayrollClient {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
createEmployee(params: CreateEmployeeParams): Promise<{
|
|
7
|
+
employee: Employee;
|
|
8
|
+
}>;
|
|
9
|
+
listEmployees(): Promise<{
|
|
10
|
+
employees: Employee[];
|
|
11
|
+
}>;
|
|
12
|
+
getEmployee(id: number): Promise<{
|
|
13
|
+
employee: Employee;
|
|
14
|
+
}>;
|
|
15
|
+
updateEmployee(id: number, params: UpdateEmployeeParams): Promise<{
|
|
16
|
+
employee: Employee;
|
|
17
|
+
}>;
|
|
18
|
+
deleteEmployee(id: number): Promise<{
|
|
19
|
+
success: true;
|
|
20
|
+
}>;
|
|
21
|
+
createBatch(items: BatchItem[]): Promise<{
|
|
22
|
+
batch: Batch;
|
|
23
|
+
items: BatchItem[];
|
|
24
|
+
}>;
|
|
25
|
+
listBatches(): Promise<{
|
|
26
|
+
batches: Batch[];
|
|
27
|
+
}>;
|
|
28
|
+
getBatch(id: number): Promise<{
|
|
29
|
+
batch: Batch;
|
|
30
|
+
items: BatchItem[];
|
|
31
|
+
}>;
|
|
32
|
+
commitBatch(id: number): Promise<{
|
|
33
|
+
result: CommitResult;
|
|
34
|
+
}>;
|
|
35
|
+
listDeposits(): Promise<{
|
|
36
|
+
deposits: PayrollDeposit[];
|
|
37
|
+
}>;
|
|
38
|
+
getDeposit(id: number): Promise<{
|
|
39
|
+
deposit: PayrollDeposit;
|
|
40
|
+
merkleProof?: MerkleProof;
|
|
41
|
+
}>;
|
|
42
|
+
withdraw(depositId: number, recipient: string): Promise<{
|
|
43
|
+
withdrawal: Withdrawal;
|
|
44
|
+
}>;
|
|
45
|
+
batchWithdraw(depositIds: number[], recipient: string): Promise<{
|
|
46
|
+
withdrawals: Withdrawal[];
|
|
47
|
+
}>;
|
|
48
|
+
listWithdrawals(): Promise<{
|
|
49
|
+
withdrawals: Withdrawal[];
|
|
50
|
+
}>;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=payroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payroll.d.ts","sourceRoot":"","sources":["../src/payroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EACV,KAAK,EACL,SAAS,EACT,YAAY,EACZ,oBAAoB,EACpB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAEvC,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,QAAQ,CAAA;KAAE,CAAC;IAI7E,aAAa,IAAI,OAAO,CAAC;QAAE,SAAS,EAAE,QAAQ,EAAE,CAAA;KAAE,CAAC;IAInD,WAAW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I9F,eAAe,IAAI,OAAO,CAAC;QAAE,WAAW,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC;CAGhE"}
|
package/dist/payroll.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export class PayrollClient {
|
|
2
|
+
http;
|
|
3
|
+
constructor(http) {
|
|
4
|
+
this.http = http;
|
|
5
|
+
}
|
|
6
|
+
async createEmployee(params) {
|
|
7
|
+
return this.http.post("/payroll/employees", params);
|
|
8
|
+
}
|
|
9
|
+
async listEmployees() {
|
|
10
|
+
return this.http.get("/payroll/employees");
|
|
11
|
+
}
|
|
12
|
+
async getEmployee(id) {
|
|
13
|
+
return this.http.get(`/payroll/employees/${id}`);
|
|
14
|
+
}
|
|
15
|
+
async updateEmployee(id, params) {
|
|
16
|
+
return this.http.patch(`/payroll/employees/${id}`, params);
|
|
17
|
+
}
|
|
18
|
+
async deleteEmployee(id) {
|
|
19
|
+
return this.http.delete(`/payroll/employees/${id}`);
|
|
20
|
+
}
|
|
21
|
+
async createBatch(items) {
|
|
22
|
+
return this.http.post("/payroll/batches", { items });
|
|
23
|
+
}
|
|
24
|
+
async listBatches() {
|
|
25
|
+
return this.http.get("/payroll/batches");
|
|
26
|
+
}
|
|
27
|
+
async getBatch(id) {
|
|
28
|
+
return this.http.get(`/payroll/batches/${id}`);
|
|
29
|
+
}
|
|
30
|
+
async commitBatch(id) {
|
|
31
|
+
return this.http.patch(`/payroll/batches/${id}`);
|
|
32
|
+
}
|
|
33
|
+
async listDeposits() {
|
|
34
|
+
return this.http.get("/payroll/deposits");
|
|
35
|
+
}
|
|
36
|
+
async getDeposit(id) {
|
|
37
|
+
return this.http.get(`/payroll/deposits/${id}`);
|
|
38
|
+
}
|
|
39
|
+
async withdraw(depositId, recipient) {
|
|
40
|
+
return this.http.post("/payroll/withdrawals", { depositId, recipient });
|
|
41
|
+
}
|
|
42
|
+
async batchWithdraw(depositIds, recipient) {
|
|
43
|
+
return this.http.post("/payroll/withdrawals/batch", { depositIds, recipient });
|
|
44
|
+
}
|
|
45
|
+
async listWithdrawals() {
|
|
46
|
+
return this.http.get("/payroll/withdrawals");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=payroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payroll.js","sourceRoot":"","sources":["../src/payroll.ts"],"names":[],"mappings":"AAaA,MAAM,OAAO,aAAa;IACK;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,KAAK,CAAC,cAAc,CAAC,MAA4B;QAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,EAAU;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,EAAU,EAAE,MAA4B;QAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,sBAAsB,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,EAAU;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAkB;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,WAAW;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAAU;QACvB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,EAAU;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,EAAU;QACzB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,SAAiB,EAAE,SAAiB;QACjD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,UAAoB,EAAE,SAAiB;QACzD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IAC/C,CAAC;CACF"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export declare class BdasApiError extends Error {
|
|
2
|
+
readonly code: string;
|
|
3
|
+
readonly status: number;
|
|
4
|
+
constructor(message: string, code: string, status: number);
|
|
5
|
+
}
|
|
6
|
+
export interface PreparedDeposit {
|
|
7
|
+
address: string;
|
|
8
|
+
amount: string;
|
|
9
|
+
id: number;
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface Deposit {
|
|
13
|
+
amount: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
id: number;
|
|
16
|
+
status: string;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface Compaction {
|
|
20
|
+
createdAt: string;
|
|
21
|
+
id: number;
|
|
22
|
+
status: string;
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}
|
|
25
|
+
export interface WithdrawalResult {
|
|
26
|
+
txHash: string;
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
}
|
|
29
|
+
export interface Withdrawal {
|
|
30
|
+
amount: string;
|
|
31
|
+
createdAt: string;
|
|
32
|
+
id: number;
|
|
33
|
+
recipient: string;
|
|
34
|
+
status: string;
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
}
|
|
37
|
+
export interface Stats {
|
|
38
|
+
totalDeposits: number;
|
|
39
|
+
totalWithdrawals: number;
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}
|
|
42
|
+
export interface Employee {
|
|
43
|
+
createdAt: string;
|
|
44
|
+
fullName: string;
|
|
45
|
+
id: number;
|
|
46
|
+
workEmail: string;
|
|
47
|
+
[key: string]: unknown;
|
|
48
|
+
}
|
|
49
|
+
export interface BatchItem {
|
|
50
|
+
amount: string;
|
|
51
|
+
employeeId: number;
|
|
52
|
+
[key: string]: unknown;
|
|
53
|
+
}
|
|
54
|
+
export interface Batch {
|
|
55
|
+
createdAt: string;
|
|
56
|
+
id: number;
|
|
57
|
+
status: string;
|
|
58
|
+
[key: string]: unknown;
|
|
59
|
+
}
|
|
60
|
+
export interface CommitResult {
|
|
61
|
+
txHash: string;
|
|
62
|
+
[key: string]: unknown;
|
|
63
|
+
}
|
|
64
|
+
export interface PayrollDeposit {
|
|
65
|
+
amount: string;
|
|
66
|
+
createdAt: string;
|
|
67
|
+
id: number;
|
|
68
|
+
status: string;
|
|
69
|
+
[key: string]: unknown;
|
|
70
|
+
}
|
|
71
|
+
export interface MerkleProof {
|
|
72
|
+
proof: string[];
|
|
73
|
+
root: string;
|
|
74
|
+
[key: string]: unknown;
|
|
75
|
+
}
|
|
76
|
+
export interface CreateEmployeeParams {
|
|
77
|
+
fullName: string;
|
|
78
|
+
workEmail: string;
|
|
79
|
+
}
|
|
80
|
+
export interface UpdateEmployeeParams {
|
|
81
|
+
fullName?: string;
|
|
82
|
+
workEmail?: string;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAM1D;AAID,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AA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I,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Shared types for @_bdas/sdk
|
|
2
|
+
// ─── Error ───────────────────────────────────────────────────────────────────
|
|
3
|
+
export class BdasApiError extends Error {
|
|
4
|
+
code;
|
|
5
|
+
status;
|
|
6
|
+
constructor(message, code, status) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.name = "BdasApiError";
|
|
9
|
+
this.code = code;
|
|
10
|
+
this.status = status;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAE9B,gFAAgF;AAEhF,MAAM,OAAO,YAAa,SAAQ,KAAK;IAC5B,IAAI,CAAS;IACb,MAAM,CAAS;IAExB,YAAY,OAAe,EAAE,IAAY,EAAE,MAAc;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@_bdas/sdk",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "Server-side SDK for the BDAS private payment API",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "bun x tsc -p tsconfig.build.json",
|
|
20
|
+
"test": "bun test",
|
|
21
|
+
"typecheck": "bun x tsc --noEmit"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"typescript": "5.9.3"
|
|
25
|
+
},
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/boundless-xyz/bdas-monorepo",
|
|
30
|
+
"directory": "packages/sdk"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
}
|
|
35
|
+
}
|