@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
|
@@ -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 }; }
|
|
@@ -4774,7 +4774,13 @@ var BaseDistributorClient = class {
|
|
|
4774
4774
|
async getFees(pubkey) {
|
|
4775
4775
|
const feeConfig = await this.getFeeConfig();
|
|
4776
4776
|
const nowTs = new BN__default.default(Math.trunc(Date.now() / 1e3));
|
|
4777
|
-
|
|
4777
|
+
const filteredPartners = feeConfig.partners.filter(
|
|
4778
|
+
(partner) => partner.pubkey.equals(pubkey) && (partner.expiryTs.eqn(0) || partner.expiryTs.gt(nowTs))
|
|
4779
|
+
);
|
|
4780
|
+
if (filteredPartners.length > 1) {
|
|
4781
|
+
throw new Error("More than one partner found, fees fetching is not possible.");
|
|
4782
|
+
}
|
|
4783
|
+
return filteredPartners[0] ?? null;
|
|
4778
4784
|
}
|
|
4779
4785
|
prepareClaimFeeInstruction(payer, fee = AIRDROP_CLAIM_FEE) {
|
|
4780
4786
|
return web3_js.SystemProgram.transfer({
|
|
@@ -4842,7 +4848,7 @@ var SolanaDistributorClient = class extends BaseDistributorClient {
|
|
|
4842
4848
|
// total_amount_locked
|
|
4843
4849
|
data.claimsClosableByClaimant ?? null,
|
|
4844
4850
|
data.claimsLimit ?? null
|
|
4845
|
-
).accounts(accounts).instruction();
|
|
4851
|
+
).accounts(accounts).accountsPartial({ partnerOracle: this.partnerOracleProgramId, partnerOracleConfig: this.feeConfigPublicKey }).instruction();
|
|
4846
4852
|
}
|
|
4847
4853
|
async getClawbackInstruction(accounts) {
|
|
4848
4854
|
return this.merkleDistributorProgram.methods.clawback().accounts(accounts).instruction();
|
|
@@ -4919,7 +4925,7 @@ var SolanaAlignedDistributorClient = class extends BaseDistributorClient {
|
|
|
4919
4925
|
mint,
|
|
4920
4926
|
tokenProgram,
|
|
4921
4927
|
priceOracle: oracle
|
|
4922
|
-
}).instruction();
|
|
4928
|
+
}).accountsPartial({ partnerOracle: this.partnerOracleProgramId, partnerOracleConfig: this.feeConfigPublicKey }).instruction();
|
|
4923
4929
|
}
|
|
4924
4930
|
async getClawbackInstruction(accounts) {
|
|
4925
4931
|
const { distributor, from, to, mint, tokenProgram, admin } = accounts;
|