diff --git a/lerna.json b/lerna.json index 08b99594..0884cde6 100644 --- a/lerna.json +++ b/lerna.json @@ -2,6 +2,6 @@ "packages": [ "packages/*" ], - "version": "6.2.1", + "version": "6.3.0", "$schema": "node_modules/lerna/schemas/lerna-schema.json" } diff --git a/package.json b/package.json index fd7177b5..36b38d91 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "pack": "lerna run pack", "test": "lerna run test", "lint": "lerna run lint", + "version-all": "lerna version --force-publish", "publish": "lerna publish from-package --yes", "local-publish": "lerna publish --no-git-tag-version --no-push --registry=\"http://localhost:4873/\" from-package --yes", "local-unpublish": "lerna exec -- npm unpublish --registry=\"http://localhost:4873/\" \"\\${LERNA_PACKAGE_NAME}@\\$(npm view \\$LERNA_PACKAGE_NAME version)\"", diff --git a/packages/common/package.json b/packages/common/package.json index 5ae310d6..76984576 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@streamflow/common", - "version": "6.2.1", + "version": "6.3.0", "description": "Common utilities and types used by streamflow packages.", "homepage": "https://github.com/streamflow-finance/js-sdk/", "main": "dist/index.js", diff --git a/packages/distributor/package.json b/packages/distributor/package.json index 9480c1de..fec73832 100644 --- a/packages/distributor/package.json +++ b/packages/distributor/package.json @@ -1,6 +1,6 @@ { "name": "@streamflow/distributor", - "version": "6.2.1", + "version": "6.3.0", "description": "JavaScript SDK to interact with Streamflow Airdrop protocol.", "homepage": "https://github.com/streamflow-finance/js-sdk/", "main": "dist/index.js", diff --git a/packages/distributor/solana/client.ts b/packages/distributor/solana/client.ts index 244e3cad..5dfddac7 100644 --- a/packages/distributor/solana/client.ts +++ b/packages/distributor/solana/client.ts @@ -42,7 +42,12 @@ import { newDistributor, } from "./generated/instructions"; import { ClaimStatus, MerkleDistributor } from "./generated/accounts"; -import { getClaimantStatusPda, getDistributorPda, wrappedSignAndExecuteTransaction } from "./utils"; +import { + getClaimantStatusPda, + getDistributorPda, + getEventAuthorityPda, + wrappedSignAndExecuteTransaction, +} from "./utils"; interface IInitOptions { clusterUrl: string; @@ -169,6 +174,7 @@ export default class SolanaDistributorClient { ); const invokerTokens = await ata(distributor.mint, invoker.publicKey, tokenProgramId); const claimStatusPublicKey = getClaimantStatusPda(this.programId, distributorPublicKey, invoker.publicKey); + const eventAuthorityPublicKey = getEventAuthorityPda(this.programId); const claimStatus = await ClaimStatus.fetch(this.connection, claimStatusPublicKey); const accounts: ClaimLockedAccounts | NewClaimAccounts = { @@ -180,6 +186,8 @@ export default class SolanaDistributorClient { mint: distributor.mint, tokenProgram: tokenProgramId, systemProgram: SystemProgram.programId, + eventAuthority: eventAuthorityPublicKey, + program: this.programId, }; if (!claimStatus) { diff --git a/packages/distributor/solana/generated/instructions/claimLocked.ts b/packages/distributor/solana/generated/instructions/claimLocked.ts index b2523d8a..d3468699 100644 --- a/packages/distributor/solana/generated/instructions/claimLocked.ts +++ b/packages/distributor/solana/generated/instructions/claimLocked.ts @@ -22,6 +22,8 @@ export interface ClaimLockedAccounts { mint: PublicKey; /** SPL [Token] program. */ tokenProgram: PublicKey; + eventAuthority: PublicKey; + program: PublicKey; } export function claimLocked(accounts: ClaimLockedAccounts, programId: PublicKey = PROGRAM_ID) { @@ -33,6 +35,8 @@ export function claimLocked(accounts: ClaimLockedAccounts, programId: PublicKey { pubkey: accounts.claimant, isSigner: true, isWritable: true }, { pubkey: accounts.mint, isSigner: false, isWritable: false }, { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false }, + { pubkey: accounts.eventAuthority, isSigner: false, isWritable: false }, + { pubkey: accounts.program, isSigner: false, isWritable: false }, ]; const identifier = Buffer.from([34, 206, 181, 23, 11, 207, 147, 90]); const data = identifier; diff --git a/packages/distributor/solana/generated/instructions/closeClaim.ts b/packages/distributor/solana/generated/instructions/closeClaim.ts index 12e50b18..820a2a87 100644 --- a/packages/distributor/solana/generated/instructions/closeClaim.ts +++ b/packages/distributor/solana/generated/instructions/closeClaim.ts @@ -14,6 +14,8 @@ export interface CloseClaimAccounts { claimStatus: PublicKey; /** The [System] program. */ systemProgram: PublicKey; + eventAuthority: PublicKey; + program: PublicKey; } export function closeClaim(accounts: CloseClaimAccounts, programId: PublicKey = PROGRAM_ID) { @@ -23,6 +25,8 @@ export function closeClaim(accounts: CloseClaimAccounts, programId: PublicKey = { pubkey: accounts.claimant, isSigner: false, isWritable: false }, { pubkey: accounts.claimStatus, isSigner: false, isWritable: true }, { pubkey: accounts.systemProgram, isSigner: false, isWritable: false }, + { pubkey: accounts.eventAuthority, isSigner: false, isWritable: false }, + { pubkey: accounts.program, isSigner: false, isWritable: false }, ]; const identifier = Buffer.from([42, 177, 165, 35, 213, 179, 211, 19]); const data = identifier; diff --git a/packages/distributor/solana/generated/instructions/newClaim.ts b/packages/distributor/solana/generated/instructions/newClaim.ts index a52af6cd..3e3103d5 100644 --- a/packages/distributor/solana/generated/instructions/newClaim.ts +++ b/packages/distributor/solana/generated/instructions/newClaim.ts @@ -27,6 +27,8 @@ export interface NewClaimAccounts { tokenProgram: PublicKey; /** The [System] program. */ systemProgram: PublicKey; + eventAuthority: PublicKey; + program: PublicKey; } export const layout = borsh.struct([ @@ -45,6 +47,8 @@ export function newClaim(args: NewClaimArgs, accounts: NewClaimAccounts, program { pubkey: accounts.mint, isSigner: false, isWritable: false }, { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false }, { pubkey: accounts.systemProgram, isSigner: false, isWritable: false }, + { pubkey: accounts.eventAuthority, isSigner: false, isWritable: false }, + { pubkey: accounts.program, isSigner: false, isWritable: false }, ]; const identifier = Buffer.from([78, 177, 98, 123, 210, 21, 187, 83]); const buffer = Buffer.alloc(1000); diff --git a/packages/distributor/solana/utils.ts b/packages/distributor/solana/utils.ts index 80b6a652..a18b8089 100644 --- a/packages/distributor/solana/utils.ts +++ b/packages/distributor/solana/utils.ts @@ -25,6 +25,14 @@ export function getClaimantStatusPda(programId: PublicKey, distributor: PublicKe return PublicKey.findProgramAddressSync(seeds, programId)[0]; } +export function getEventAuthorityPda(programId: PublicKey): PublicKey { + // Constructing the seed for the PDA + const seeds = [Buffer.from("__event_authority")]; + + // Finding the PDA + return PublicKey.findProgramAddressSync(seeds, programId)[0]; +} + export async function wrappedSignAndExecuteTransaction( connection: Connection, invoker: Keypair | SignerWalletAdapter, diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index d0b0c145..8c97d61c 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@streamflow/eslint-config", - "version": "6.0.0", + "version": "6.3.0", "license": "ISC", "main": "index.js", "files": [ diff --git a/packages/stream/package.json b/packages/stream/package.json index eb69f2d7..385c7982 100644 --- a/packages/stream/package.json +++ b/packages/stream/package.json @@ -1,6 +1,6 @@ { "name": "@streamflow/stream", - "version": "6.2.1", + "version": "6.3.0", "description": "JavaScript SDK to interact with Streamflow protocol.", "homepage": "https://github.com/streamflow-finance/js-sdk/", "main": "dist/index.js",