@triadxyz/triad-protocol 4.3.9 → 4.4.0
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/customer.d.ts +5 -0
- package/dist/customer.js +20 -0
- package/package.json +1 -1
package/dist/customer.d.ts
CHANGED
|
@@ -37,4 +37,9 @@ export default class Customer {
|
|
|
37
37
|
* @param args.payoutFeeBps - The payout fee in basis points of the customer
|
|
38
38
|
*/
|
|
39
39
|
updateCustomer({ customerId, marketFeeBps, payoutFeeBps }: UpdateCustomerArgs): Promise<string | import("@solana/web3.js").VersionedTransaction>;
|
|
40
|
+
/**
|
|
41
|
+
* Collect Customer Fee
|
|
42
|
+
* @param customerId - The ID of the customer
|
|
43
|
+
*/
|
|
44
|
+
collectCustomerFee(customerId: number): Promise<string | import("@solana/web3.js").VersionedTransaction>;
|
|
40
45
|
}
|
package/dist/customer.js
CHANGED
|
@@ -106,5 +106,25 @@ class Customer {
|
|
|
106
106
|
return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Collect Customer Fee
|
|
111
|
+
* @param customerId - The ID of the customer
|
|
112
|
+
*/
|
|
113
|
+
collectCustomerFee(customerId) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
const customer = yield this.getCustomerById(customerId);
|
|
116
|
+
const ixs = [
|
|
117
|
+
yield this.program.methods
|
|
118
|
+
.collectCustomerFee()
|
|
119
|
+
.accounts({
|
|
120
|
+
signer: this.program.provider.publicKey,
|
|
121
|
+
customer: customer.address,
|
|
122
|
+
feeRecipient: customer.feeRecipient
|
|
123
|
+
})
|
|
124
|
+
.instruction()
|
|
125
|
+
];
|
|
126
|
+
return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
109
129
|
}
|
|
110
130
|
exports.default = Customer;
|