@streamflow/distributor 11.0.0-alpha.p334.45cbb4e → 11.0.0-alpha.p334.ea83918
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/cjs/index.cjs +10 -4
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/solana/index.cjs +10 -4
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/cjs/solana/index.d.cts +12 -17
- package/dist/esm/index.js +10 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/index.d.ts +12 -17
- package/dist/esm/solana/index.js +10 -4
- package/dist/esm/solana/index.js.map +1 -1
- package/package.json +4 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
var web3_js = require('@solana/web3.js');
|
|
4
4
|
var BN = require('bn.js');
|
|
5
5
|
require('@solana/wallet-adapter-base');
|
|
6
|
-
var common = require('@streamflow/common');
|
|
7
6
|
var anchor = require('@coral-xyz/anchor');
|
|
8
7
|
var splToken = require('@solana/spl-token');
|
|
8
|
+
var common = require('@streamflow/common');
|
|
9
9
|
var buffer = require('buffer');
|
|
10
10
|
|
|
11
11
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -4803,7 +4803,13 @@ var BaseDistributorClient = class {
|
|
|
4803
4803
|
async getFees(pubkey) {
|
|
4804
4804
|
const feeConfig = await this.getFeeConfig();
|
|
4805
4805
|
const nowTs = new BN__default.default(Math.trunc(Date.now() / 1e3));
|
|
4806
|
-
|
|
4806
|
+
const filteredPartners = feeConfig.partners.filter(
|
|
4807
|
+
(partner) => partner.pubkey.equals(pubkey) && (partner.expiryTs.eqn(0) || partner.expiryTs.gt(nowTs))
|
|
4808
|
+
);
|
|
4809
|
+
if (filteredPartners.length > 1) {
|
|
4810
|
+
throw new Error("More than one partner found, fees fetching is not possible.");
|
|
4811
|
+
}
|
|
4812
|
+
return filteredPartners[0] ?? null;
|
|
4807
4813
|
}
|
|
4808
4814
|
prepareClaimFeeInstruction(payer, fee = AIRDROP_CLAIM_FEE) {
|
|
4809
4815
|
return web3_js.SystemProgram.transfer({
|
|
@@ -4871,7 +4877,7 @@ var SolanaDistributorClient = class extends BaseDistributorClient {
|
|
|
4871
4877
|
// total_amount_locked
|
|
4872
4878
|
data.claimsClosableByClaimant ?? null,
|
|
4873
4879
|
data.claimsLimit ?? null
|
|
4874
|
-
).accounts(accounts).instruction();
|
|
4880
|
+
).accounts(accounts).accountsPartial({ partnerOracle: this.partnerOracleProgramId, partnerOracleConfig: this.feeConfigPublicKey }).instruction();
|
|
4875
4881
|
}
|
|
4876
4882
|
async getClawbackInstruction(accounts) {
|
|
4877
4883
|
return this.merkleDistributorProgram.methods.clawback().accounts(accounts).instruction();
|
|
@@ -4948,7 +4954,7 @@ var SolanaAlignedDistributorClient = class extends BaseDistributorClient {
|
|
|
4948
4954
|
mint,
|
|
4949
4955
|
tokenProgram,
|
|
4950
4956
|
priceOracle: oracle
|
|
4951
|
-
}).instruction();
|
|
4957
|
+
}).accountsPartial({ partnerOracle: this.partnerOracleProgramId, partnerOracleConfig: this.feeConfigPublicKey }).instruction();
|
|
4952
4958
|
}
|
|
4953
4959
|
async getClawbackInstruction(accounts) {
|
|
4954
4960
|
const { distributor, from, to, mint, tokenProgram, admin } = accounts;
|