Skip to content

Commit fba6885

Browse files
Merge pull request #213 from getAlby/update-keysend-args
feat: update keysend args
2 parents 23a5965 + 8e9eb13 commit fba6885

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/client.ts

+11-3
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,18 @@ export class Client {
186186
let endpoint, request_body;
187187
if (Array.isArray(args)) {
188188
endpoint = "/payments/keysend/multi";
189-
request_body = { keysends: args };
189+
request_body = {
190+
keysends: args.map((args) => ({
191+
...args,
192+
custom_records: args.customRecords,
193+
})),
194+
};
190195
} else {
191196
endpoint = "/payments/keysend";
192-
request_body = args;
197+
request_body = {
198+
...args,
199+
custom_records: args.customRecords,
200+
};
193201
}
194202
return rest({
195203
auth: this.auth,
@@ -259,7 +267,7 @@ export class Client {
259267
const params = {
260268
destination:
261269
"030a58b8653d32b99200a2334cfe913e51dc7d155aa0116c176657a4f1722677a3",
262-
customRecords: {
270+
custom_records: {
263271
"696969": args.account,
264272
},
265273
amount: args.amount,

src/helpers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ export function keysendParamsFromBoostagram(
1717
return {
1818
destination: boostagramParams.recipient.address,
1919
amount: boostagramParams.amount,
20-
customRecords: customRecords,
20+
custom_records: customRecords,
2121
};
2222
}

0 commit comments

Comments
 (0)