From 4c1e968e77e6b9ec44e364541459b0ba124b61b0 Mon Sep 17 00:00:00 2001 From: Mircea Gavriliu Date: Mon, 20 Oct 2025 11:21:55 +0300 Subject: [PATCH 1/3] feat: add solana idls --- src/solana/idl/airdrops/index.ts | 1 + .../airdrops/v1.0/SablierMerkleInstantV10.ts | 1049 +++++++ .../v1.0/SablierMerkleInstantV10Type.ts | 1207 ++++++++ src/solana/idl/airdrops/v1.0/index.ts | 2 + src/solana/idl/index.ts | 2 + src/solana/idl/lockup/index.ts | 1 + .../idl/lockup/v1.0/SablierLockupLinearV10.ts | 2227 ++++++++++++++ .../lockup/v1.0/SablierLockupLinearV10Type.ts | 2685 +++++++++++++++++ src/solana/idl/lockup/v1.0/index.ts | 2 + src/solana/index.ts | 1 + 10 files changed, 7177 insertions(+) create mode 100644 src/solana/idl/airdrops/index.ts create mode 100644 src/solana/idl/airdrops/v1.0/SablierMerkleInstantV10.ts create mode 100644 src/solana/idl/airdrops/v1.0/SablierMerkleInstantV10Type.ts create mode 100644 src/solana/idl/airdrops/v1.0/index.ts create mode 100644 src/solana/idl/index.ts create mode 100644 src/solana/idl/lockup/index.ts create mode 100644 src/solana/idl/lockup/v1.0/SablierLockupLinearV10.ts create mode 100644 src/solana/idl/lockup/v1.0/SablierLockupLinearV10Type.ts create mode 100644 src/solana/idl/lockup/v1.0/index.ts create mode 100644 src/solana/index.ts diff --git a/src/solana/idl/airdrops/index.ts b/src/solana/idl/airdrops/index.ts new file mode 100644 index 0000000..04d5b36 --- /dev/null +++ b/src/solana/idl/airdrops/index.ts @@ -0,0 +1 @@ +export * from "./v1.0"; diff --git a/src/solana/idl/airdrops/v1.0/SablierMerkleInstantV10.ts b/src/solana/idl/airdrops/v1.0/SablierMerkleInstantV10.ts new file mode 100644 index 0000000..b351a9e --- /dev/null +++ b/src/solana/idl/airdrops/v1.0/SablierMerkleInstantV10.ts @@ -0,0 +1,1049 @@ +export default { + accounts: [ + { + discriminator: [50, 40, 49, 11, 157, 220, 229, 192], + name: "Campaign", + }, + { + discriminator: [223, 233, 11, 229, 124, 165, 207, 28], + name: "ClaimReceipt", + }, + { + discriminator: [238, 239, 123, 238, 89, 1, 168, 253], + name: "Treasury", + }, + ], + address: "7XrxoQejBoGouW4V3aozTSwub7xSDjYqB4Go7YLjF9rV", + docs: ["Sablier Merkle Instant program for creating and managing Merkle tree-based airdrop campaigns."], + errors: [ + { + code: 6000, + msg: "Campaign has expired!", + name: "CampaignExpired", + }, + { + code: 6001, + msg: "Invalid Merkle proof!", + name: "InvalidMerkleProof", + }, + { + code: 6002, + msg: "Campaign has not started yet!", + name: "CampaignNotStarted", + }, + { + code: 6003, + msg: "Clawback not allowed past the grace period and before campaign expiration!", + name: "ClawbackNotAllowed", + }, + { + code: 6004, + msg: "Can't collect zero fees!", + name: "CantCollectZeroFees", + }, + ], + events: [ + { + discriminator: [133, 98, 9, 238, 133, 207, 191, 113], + name: "Claim", + }, + { + discriminator: [239, 144, 30, 69, 80, 59, 142, 64], + name: "Clawback", + }, + { + discriminator: [88, 178, 212, 72, 110, 4, 68, 143], + name: "CreateCampaign", + }, + { + discriminator: [233, 23, 117, 225, 107, 178, 254, 8], + name: "FeesCollected", + }, + ], + instructions: [ + { + accounts: [ + { + docs: ["Read account: the account storing the campaign data."], + name: "campaign", + }, + ], + args: [], + discriminator: [188, 126, 110, 5, 183, 113, 158, 3], + docs: [ + "Retrieves the campaign details.", + "", + "# Accounts Expected", + "", + "- `campaign` The account that stores the campaign details.", + ], + name: "campaign_view", + returns: { + defined: { + name: "Campaign", + }, + }, + }, + { + accounts: [ + { + docs: ["Write account: the signer of the claim who will pay the claim fee."], + name: "claimer", + signer: true, + writable: true, + }, + { + docs: ["Read account: the recipient of the airdrop."], + name: "recipient", + }, + { + docs: ["Create if needed account: the ATA for airdrop token owned by the recipient."], + name: "recipient_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "recipient", + }, + { + kind: "account", + path: "airdrop_token_program", + }, + { + kind: "account", + path: "airdrop_token_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Write account: the treasury account that will receive the claim fee."], + name: "treasury", + pda: { + seeds: [ + { + kind: "const", + value: [116, 114, 101, 97, 115, 117, 114, 121], + }, + ], + }, + writable: true, + }, + { + docs: ["Read account: the mint account of the airdrop token."], + name: "airdrop_token_mint", + }, + { + docs: ["Write account: the account storing the campaign data."], + name: "campaign", + writable: true, + }, + { + docs: ["Write account: the campaign's ATA for the airdrop token."], + name: "campaign_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "campaign", + }, + { + kind: "account", + path: "airdrop_token_program", + }, + { + kind: "account", + path: "airdrop_token_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Create account: the claim receipt."], + name: "claim_receipt", + pda: { + seeds: [ + { + kind: "const", + value: [99, 108, 97, 105, 109, 95, 114, 101, 99, 101, 105, 112, 116], + }, + { + kind: "account", + path: "campaign", + }, + { + kind: "arg", + path: "index", + }, + ], + }, + writable: true, + }, + { + docs: ["Program account: the Token program of the airdrop token."], + name: "airdrop_token_program", + }, + { + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + docs: ["Program account: the Associated Token program."], + name: "associated_token_program", + }, + { + docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], + name: "chainlink_program", + }, + { + docs: ["Read account: The account providing the SOL/USD price feed data."], + name: "chainlink_sol_usd_feed", + }, + { + address: "11111111111111111111111111111111", + docs: ["Program account: the System program."], + name: "system_program", + }, + ], + args: [ + { + name: "index", + type: "u32", + }, + { + name: "amount", + type: "u64", + }, + { + name: "merkle_proof", + type: { + vec: { + array: ["u8", 32], + }, + }, + }, + ], + discriminator: [62, 198, 214, 193, 213, 159, 108, 210], + docs: [ + "Claims airdrop on behalf of eligible recipient and transfers it to the recipient ATA.", + "", + "# Accounts Expected", + "", + "- `claimer` The transaction signer.", + "- `campaign` The account that stores the campaign details.", + "- `recipient` The address of the airdrop recipient.", + "- `airdrop_token_mint` The mint of the airdropped token.", + "- `airdrop_token_program` The Token Program of the airdropped token.", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + "", + "# Parameters", + "", + "- `index` The index of the recipient in the Merkle tree.", + "- `amount` The amount allocated to the recipient.", + "- `merkle_proof` The proof of inclusion in the Merkle tree.", + "", + "# Notes", + "", + "- The instruction charges a fee in the native token (SOL), equivalent to $2 USD.", + "- Emits a [`crate::utils::events::Claim`] event.", + "", + "# Requirements", + "", + "- The current time must be greater than or equal to the campaign start time.", + "", + "- The campaign must not have expired.", + "- The recipient's airdrop has not been claimed yet.", + "- The Merkle proof must be valid.", + "- `chainlink_program` and `chainlink_sol_usd_feed` must match the ones stored in the treasury.", + ], + name: "claim", + }, + { + accounts: [ + { + docs: ["Read account: the treasury account that receives the claim fee."], + name: "treasury", + pda: { + seeds: [ + { + kind: "const", + value: [116, 114, 101, 97, 115, 117, 114, 121], + }, + ], + }, + }, + { + docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], + name: "chainlink_program", + }, + { + docs: ["Read account: The account providing the SOL/USD price feed data."], + name: "chainlink_sol_usd_feed", + }, + ], + args: [], + discriminator: [255, 199, 146, 222, 145, 180, 58, 231], + docs: [ + "Calculates the claim fee in lamports, which is equivalent to $2 USD.", + "", + "# Accounts Expected:", + "", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + ], + name: "claim_fee_in_lamports", + returns: "u64", + }, + { + accounts: [ + { + docs: ["Write account: the campaign creator who will claw back the tokens."], + name: "campaign_creator", + signer: true, + writable: true, + }, + { + docs: ["Read account: the clawback recipient."], + name: "clawback_recipient", + }, + { + docs: ["Create if needed account: the clawback recipient's ATA for the airdrop token."], + name: "clawback_recipient_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "clawback_recipient", + }, + { + kind: "account", + path: "airdrop_token_program", + }, + { + kind: "account", + path: "airdrop_token_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Read account: the mint account of the airdrop token."], + name: "airdrop_token_mint", + }, + { + docs: ["Read account: the account storing the campaign data."], + name: "campaign", + }, + { + docs: ["Write account: the campaign's ATA for the airdrop token."], + name: "campaign_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "campaign", + }, + { + kind: "account", + path: "airdrop_token_program", + }, + { + kind: "account", + path: "airdrop_token_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Program account: the Token program of the airdrop token."], + name: "airdrop_token_program", + }, + { + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + docs: ["Program account: the Associated Token program."], + name: "associated_token_program", + }, + { + address: "11111111111111111111111111111111", + docs: ["Program account: the System program."], + name: "system_program", + }, + ], + args: [ + { + name: "amount", + type: "u64", + }, + ], + discriminator: [111, 92, 142, 79, 33, 234, 82, 27], + docs: [ + "Claws back the unclaimed tokens from the campaign.", + "", + "# Accounts Expected", + "", + "- `campaign` The account that stores the campaign details.", + "- `campaign_creator` The transaction signer.", + "- `airdrop_token_mint` The mint of the airdropped token.", + "- `airdrop_token_program` The Token Program of the airdropped token.", + "", + "# Parameters", + "", + "- `amount` The amount to claw back.", + "", + "# Notes", + "", + "- Emits a [`crate::utils::events::Clawback`] event.", + "", + "# Requirements", + "", + "- The signer must be the actual campaign creator.", + "- No claim must be made, OR the current timestamp must not exceed 7 days after the first claim, OR the campaign", + "must be expired.", + ], + name: "clawback", + }, + { + accounts: [ + { + docs: ["Write account: the account authorized to collect fees from the treasury."], + name: "fee_collector", + signer: true, + }, + { + docs: ["Write account: the address that will receive the collected fees."], + name: "fee_recipient", + writable: true, + }, + { + docs: ["Write account: the treasury account that holds the fees."], + name: "treasury", + pda: { + seeds: [ + { + kind: "const", + value: [116, 114, 101, 97, 115, 117, 114, 121], + }, + ], + }, + writable: true, + }, + ], + args: [], + discriminator: [164, 152, 207, 99, 30, 186, 19, 182], + docs: [ + "Collects the fees accumulated in the treasury by transferring them to the fee recipient.", + "", + "# Accounts Expected", + "", + "- `fee_collector` The transaction signer and the fee collector.", + "- `fee_recipient` The address receiving the collected fees.", + "", + "# Notes", + "", + '- To calculate the "collectable amount", the rent-exempt minimum balance and a 0.001 SOL buffer are deducted', + "from the treasury SOL balance.", + "- Emits a [`crate::utils::events::FeesCollected`] event.", + "", + "# Requirements", + "", + "- `fee_collector` must be authorized for fee collection.", + '- The "collectable amount" must be greater than zero.', + ], + name: "collect_fees", + }, + { + accounts: [ + { + docs: ["Write account: the creator of the campaign."], + name: "creator", + signer: true, + writable: true, + }, + { + docs: ["Read account: the mint account of the airdrop token."], + name: "airdrop_token_mint", + }, + { + docs: ["Create account: the account storing the campaign data."], + name: "campaign", + pda: { + seeds: [ + { + kind: "const", + value: [99, 97, 109, 112, 97, 105, 103, 110], + }, + { + kind: "account", + path: "creator", + }, + { + kind: "arg", + path: "merkle_root", + }, + { + kind: "arg", + path: "campaign_start_time", + }, + { + kind: "arg", + path: "expiration_time", + }, + { + kind: "arg", + path: "name", + }, + { + kind: "account", + path: "airdrop_token_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Create account: the campaign's ATA for the airdrop token."], + name: "campaign_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "campaign", + }, + { + kind: "account", + path: "airdrop_token_program", + }, + { + kind: "account", + path: "airdrop_token_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Program account: the Token program of the airdrop token."], + name: "airdrop_token_program", + }, + { + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + docs: ["Program account: the Associated Token program."], + name: "associated_token_program", + }, + { + address: "11111111111111111111111111111111", + docs: ["Program account: the System program."], + name: "system_program", + }, + ], + args: [ + { + name: "merkle_root", + type: { + array: ["u8", 32], + }, + }, + { + name: "campaign_start_time", + type: "u64", + }, + { + name: "expiration_time", + type: "u64", + }, + { + name: "name", + type: "string", + }, + { + name: "ipfs_cid", + type: "string", + }, + { + name: "aggregate_amount", + type: "u64", + }, + { + name: "recipient_count", + type: "u32", + }, + ], + discriminator: [111, 131, 187, 98, 160, 193, 114, 244], + docs: [ + "Creates a Merkle Instant airdrop campaign.", + "", + "# Accounts Expected", + "", + "- `creator` The transaction signer and the campaign creator.", + "- `airdrop_token_mint` The mint of the airdropped token.", + "- `airdrop_token_program` The Token Program of the airdropped token.", + "", + "# Parameters", + "", + "- `merkle_root` The Merkle root of the claim data.", + "- `campaign_start_time` The time when the campaign starts, in seconds since the Unix epoch.", + "- `expiration_time` The time when the campaign expires, in seconds since the Unix epoch.", + "A value of zero means the campaign does not expire.", + "- `name` The name of the campaign.", + "- `ipfs_cid` The content identifier for indexing the campaign on IPFS. An empty value may break some UI", + "features that depend upon the IPFS CID.", + "- `aggregate_amount` The total amount of tokens to be distributed to all recipients.", + "- `recipient_count` The total number of recipient addresses eligible for the airdrop.", + "", + "# Notes", + "", + "- Emits a [`crate::utils::events::CreateCampaign`] event.", + ], + name: "create_campaign", + }, + { + accounts: [ + { + docs: ["Read account: the account storing the campaign data."], + name: "campaign", + }, + ], + args: [], + discriminator: [135, 101, 171, 220, 86, 97, 104, 199], + docs: [ + "Returns a flag indicating whether the campaign has started.", + "", + "# Accounts expected:", + "", + "- `campaign` The account that stores the campaign details.", + ], + name: "has_campaign_started", + returns: "bool", + }, + { + accounts: [ + { + docs: ["Read account: the account storing the campaign data."], + name: "campaign", + }, + { + docs: ["Read account: the claim receipt."], + name: "claim_receipt", + pda: { + seeds: [ + { + kind: "const", + value: [99, 108, 97, 105, 109, 95, 114, 101, 99, 101, 105, 112, 116], + }, + { + kind: "account", + path: "campaign", + }, + { + kind: "arg", + path: "_index", + }, + ], + }, + }, + ], + args: [ + { + name: "_index", + type: "u32", + }, + ], + discriminator: [182, 195, 167, 56, 232, 3, 223, 102], + docs: [ + "Returns a flag indicating whether a claim has been made for the given index.", + "", + "# Accounts Expected", + "", + "- `campaign` The account that stores the campaign details.", + "", + "# Parameters", + "", + "- `_index` The index of the recipient in the Merkle tree.", + ], + name: "has_claimed", + returns: "bool", + }, + { + accounts: [ + { + docs: ["Read account: the account storing the campaign data."], + name: "campaign", + }, + ], + args: [], + discriminator: [24, 138, 30, 86, 92, 38, 143, 129], + docs: [ + "Returns a flag indicating whether the campaign has expired.", + "", + "# Accounts Expected", + "", + "- `campaign` The account that stores the campaign details.", + ], + name: "has_expired", + returns: "bool", + }, + { + accounts: [ + { + docs: ["Read account: the account storing the campaign data."], + name: "campaign", + }, + ], + args: [], + discriminator: [223, 150, 181, 32, 240, 136, 73, 236], + docs: [ + "Returns a flag indicating whether the grace period of the campaign has passed.", + "", + "# Accounts Expected", + "", + "- `campaign` The account that stores the campaign details.", + "", + "# Notes", + "", + "- A return value of `false` indicates: No claim has been made yet, OR the current timestamp does not exceed", + "seven days after the first claim.", + ], + name: "has_grace_period_passed", + returns: "bool", + }, + { + accounts: [ + { + docs: ["Write account: the initializer of the program."], + name: "initializer", + signer: true, + writable: true, + }, + { + docs: ["Create account: the treasury account that will hold the fees."], + name: "treasury", + pda: { + seeds: [ + { + kind: "const", + value: [116, 114, 101, 97, 115, 117, 114, 121], + }, + ], + }, + writable: true, + }, + { + address: "11111111111111111111111111111111", + docs: ["Program account: the System program."], + name: "system_program", + }, + ], + args: [ + { + name: "fee_collector", + type: "pubkey", + }, + { + name: "chainlink_program", + type: "pubkey", + }, + { + name: "chainlink_sol_usd_feed", + type: "pubkey", + }, + ], + discriminator: [175, 175, 109, 31, 13, 152, 155, 237], + docs: [ + "Initializes the program with the provided fee collector address.", + "", + "# Accounts Expected", + "", + "- `initializer` The transaction signer.", + "", + "# Parameters", + "", + "- `fee_collector` The address that will have the authority to collect fees.", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + ], + name: "initialize", + }, + { + accounts: [ + { + docs: ["Read account: the account storing the treasury details."], + name: "treasury", + pda: { + seeds: [ + { + kind: "const", + value: [116, 114, 101, 97, 115, 117, 114, 121], + }, + ], + }, + }, + ], + args: [], + discriminator: [247, 160, 213, 237, 247, 121, 164, 82], + docs: ["Returns the treasury details."], + name: "treasury_view", + returns: { + defined: { + name: "Treasury", + }, + }, + }, + ], + metadata: { + description: "Created with Anchor", + name: "sablier_merkle_instant", + spec: "0.1.0", + version: "0.1.0", + }, + types: [ + { + docs: ["Groups all the data for a Merkle Instant campaign."], + name: "Campaign", + type: { + fields: [ + { + name: "airdrop_token_mint", + type: "pubkey", + }, + { + name: "bump", + type: "u8", + }, + { + name: "campaign_start_time", + type: "u64", + }, + { + name: "creator", + type: "pubkey", + }, + { + name: "expiration_time", + type: "u64", + }, + { + name: "first_claim_time", + type: "u64", + }, + { + name: "ipfs_cid", + type: "string", + }, + { + name: "merkle_root", + type: { + array: ["u8", 32], + }, + }, + { + name: "name", + type: "string", + }, + ], + kind: "struct", + }, + }, + { + name: "Claim", + type: { + fields: [ + { + name: "amount", + type: "u64", + }, + { + name: "campaign", + type: "pubkey", + }, + { + name: "claimer", + type: "pubkey", + }, + { + name: "claim_receipt", + type: "pubkey", + }, + { + name: "fee_in_lamports", + type: "u64", + }, + { + name: "index", + type: "u32", + }, + { + name: "recipient", + type: "pubkey", + }, + ], + kind: "struct", + }, + }, + { + name: "ClaimReceipt", + type: { + fields: [], + kind: "struct", + }, + }, + { + name: "Clawback", + type: { + fields: [ + { + name: "amount", + type: "u64", + }, + { + name: "campaign", + type: "pubkey", + }, + { + name: "campaign_creator", + type: "pubkey", + }, + { + name: "clawback_recipient", + type: "pubkey", + }, + ], + kind: "struct", + }, + }, + { + name: "CreateCampaign", + type: { + fields: [ + { + name: "aggregate_amount", + type: "u64", + }, + { + name: "campaign", + type: "pubkey", + }, + { + name: "campaign_name", + type: "string", + }, + { + name: "campaign_start_time", + type: "u64", + }, + { + name: "creator", + type: "pubkey", + }, + { + name: "expiration_time", + type: "u64", + }, + { + name: "ipfs_cid", + type: "string", + }, + { + name: "merkle_root", + type: { + array: ["u8", 32], + }, + }, + { + name: "recipient_count", + type: "u32", + }, + { + name: "token_decimals", + type: "u8", + }, + { + name: "token_mint", + type: "pubkey", + }, + ], + kind: "struct", + }, + }, + { + name: "FeesCollected", + type: { + fields: [ + { + name: "fee_amount", + type: "u64", + }, + { + name: "fee_collector", + type: "pubkey", + }, + { + name: "fee_recipient", + type: "pubkey", + }, + ], + kind: "struct", + }, + }, + { + name: "Treasury", + type: { + fields: [ + { + name: "bump", + type: "u8", + }, + { + name: "fee_collector", + type: "pubkey", + }, + { + name: "chainlink_program", + type: "pubkey", + }, + { + name: "chainlink_sol_usd_feed", + type: "pubkey", + }, + ], + kind: "struct", + }, + }, + ], +}; diff --git a/src/solana/idl/airdrops/v1.0/SablierMerkleInstantV10Type.ts b/src/solana/idl/airdrops/v1.0/SablierMerkleInstantV10Type.ts new file mode 100644 index 0000000..bd6563f --- /dev/null +++ b/src/solana/idl/airdrops/v1.0/SablierMerkleInstantV10Type.ts @@ -0,0 +1,1207 @@ +/** + * Program IDL in camelCase format in order to be used in JS/TS. + * + * Note that this is only a type helper and is not the actual IDL. The original + * IDL can be found at `target/idl/sablier_merkle_instant.json`. + */ +type Idl = { + address: "7XrxoQejBoGouW4V3aozTSwub7xSDjYqB4Go7YLjF9rV"; + metadata: { + name: "sablierMerkleInstant"; + version: "0.1.0"; + spec: "0.1.0"; + description: "Created with Anchor"; + }; + docs: ["Sablier Merkle Instant program for creating and managing Merkle tree-based airdrop campaigns."]; + instructions: [ + { + name: "campaignView"; + docs: [ + "Retrieves the campaign details.", + "", + "# Accounts Expected", + "", + "- `campaign` The account that stores the campaign details.", + ]; + discriminator: [188, 126, 110, 5, 183, 113, 158, 3]; + accounts: [ + { + name: "campaign"; + docs: ["Read account: the account storing the campaign data."]; + }, + ]; + args: []; + returns: { + defined: { + name: "campaign"; + }; + }; + }, + { + name: "claim"; + docs: [ + "Claims airdrop on behalf of eligible recipient and transfers it to the recipient ATA.", + "", + "# Accounts Expected", + "", + "- `claimer` The transaction signer.", + "- `campaign` The account that stores the campaign details.", + "- `recipient` The address of the airdrop recipient.", + "- `airdrop_token_mint` The mint of the airdropped token.", + "- `airdrop_token_program` The Token Program of the airdropped token.", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + "", + "# Parameters", + "", + "- `index` The index of the recipient in the Merkle tree.", + "- `amount` The amount allocated to the recipient.", + "- `merkle_proof` The proof of inclusion in the Merkle tree.", + "", + "# Notes", + "", + "- The instruction charges a fee in the native token (SOL), equivalent to $2 USD.", + "- Emits a [`crate::utils::events::Claim`] event.", + "", + "# Requirements", + "", + "- The current time must be greater than or equal to the campaign start time.", + "", + "- The campaign must not have expired.", + "- The recipient's airdrop has not been claimed yet.", + "- The Merkle proof must be valid.", + "- `chainlink_program` and `chainlink_sol_usd_feed` must match the ones stored in the treasury.", + ]; + discriminator: [62, 198, 214, 193, 213, 159, 108, 210]; + accounts: [ + { + name: "claimer"; + docs: ["Write account: the signer of the claim who will pay the claim fee."]; + writable: true; + signer: true; + }, + { + name: "recipient"; + docs: ["Read account: the recipient of the airdrop."]; + }, + { + name: "recipientAta"; + docs: ["Create if needed account: the ATA for airdrop token owned by the recipient."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "recipient"; + }, + { + kind: "account"; + path: "airdropTokenProgram"; + }, + { + kind: "account"; + path: "airdropTokenMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "treasury"; + docs: ["Write account: the treasury account that will receive the claim fee."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [116, 114, 101, 97, 115, 117, 114, 121]; + }, + ]; + }; + }, + { + name: "airdropTokenMint"; + docs: ["Read account: the mint account of the airdrop token."]; + }, + { + name: "campaign"; + docs: ["Write account: the account storing the campaign data."]; + writable: true; + }, + { + name: "campaignAta"; + docs: ["Write account: the campaign's ATA for the airdrop token."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "campaign"; + }, + { + kind: "account"; + path: "airdropTokenProgram"; + }, + { + kind: "account"; + path: "airdropTokenMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "claimReceipt"; + docs: ["Create account: the claim receipt."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [99, 108, 97, 105, 109, 95, 114, 101, 99, 101, 105, 112, 116]; + }, + { + kind: "account"; + path: "campaign"; + }, + { + kind: "arg"; + path: "index"; + }, + ]; + }; + }, + { + name: "airdropTokenProgram"; + docs: ["Program account: the Token program of the airdrop token."]; + }, + { + name: "associatedTokenProgram"; + docs: ["Program account: the Associated Token program."]; + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"; + }, + { + name: "chainlinkProgram"; + docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."]; + }, + { + name: "chainlinkSolUsdFeed"; + docs: ["Read account: The account providing the SOL/USD price feed data."]; + }, + { + name: "systemProgram"; + docs: ["Program account: the System program."]; + address: "11111111111111111111111111111111"; + }, + ]; + args: [ + { + name: "index"; + type: "u32"; + }, + { + name: "amount"; + type: "u64"; + }, + { + name: "merkleProof"; + type: { + vec: { + array: ["u8", 32]; + }; + }; + }, + ]; + }, + { + name: "claimFeeInLamports"; + docs: [ + "Calculates the claim fee in lamports, which is equivalent to $2 USD.", + "", + "# Accounts Expected:", + "", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + ]; + discriminator: [255, 199, 146, 222, 145, 180, 58, 231]; + accounts: [ + { + name: "treasury"; + docs: ["Read account: the treasury account that receives the claim fee."]; + pda: { + seeds: [ + { + kind: "const"; + value: [116, 114, 101, 97, 115, 117, 114, 121]; + }, + ]; + }; + }, + { + name: "chainlinkProgram"; + docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."]; + }, + { + name: "chainlinkSolUsdFeed"; + docs: ["Read account: The account providing the SOL/USD price feed data."]; + }, + ]; + args: []; + returns: "u64"; + }, + { + name: "clawback"; + docs: [ + "Claws back the unclaimed tokens from the campaign.", + "", + "# Accounts Expected", + "", + "- `campaign` The account that stores the campaign details.", + "- `campaign_creator` The transaction signer.", + "- `airdrop_token_mint` The mint of the airdropped token.", + "- `airdrop_token_program` The Token Program of the airdropped token.", + "", + "# Parameters", + "", + "- `amount` The amount to claw back.", + "", + "# Notes", + "", + "- Emits a [`crate::utils::events::Clawback`] event.", + "", + "# Requirements", + "", + "- The signer must be the actual campaign creator.", + "- No claim must be made, OR the current timestamp must not exceed 7 days after the first claim, OR the campaign", + "must be expired.", + ]; + discriminator: [111, 92, 142, 79, 33, 234, 82, 27]; + accounts: [ + { + name: "campaignCreator"; + docs: ["Write account: the campaign creator who will claw back the tokens."]; + writable: true; + signer: true; + }, + { + name: "clawbackRecipient"; + docs: ["Read account: the clawback recipient."]; + }, + { + name: "clawbackRecipientAta"; + docs: ["Create if needed account: the clawback recipient's ATA for the airdrop token."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "clawbackRecipient"; + }, + { + kind: "account"; + path: "airdropTokenProgram"; + }, + { + kind: "account"; + path: "airdropTokenMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "airdropTokenMint"; + docs: ["Read account: the mint account of the airdrop token."]; + }, + { + name: "campaign"; + docs: ["Read account: the account storing the campaign data."]; + }, + { + name: "campaignAta"; + docs: ["Write account: the campaign's ATA for the airdrop token."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "campaign"; + }, + { + kind: "account"; + path: "airdropTokenProgram"; + }, + { + kind: "account"; + path: "airdropTokenMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "airdropTokenProgram"; + docs: ["Program account: the Token program of the airdrop token."]; + }, + { + name: "associatedTokenProgram"; + docs: ["Program account: the Associated Token program."]; + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"; + }, + { + name: "systemProgram"; + docs: ["Program account: the System program."]; + address: "11111111111111111111111111111111"; + }, + ]; + args: [ + { + name: "amount"; + type: "u64"; + }, + ]; + }, + { + name: "collectFees"; + docs: [ + "Collects the fees accumulated in the treasury by transferring them to the fee recipient.", + "", + "# Accounts Expected", + "", + "- `fee_collector` The transaction signer and the fee collector.", + "- `fee_recipient` The address receiving the collected fees.", + "", + "# Notes", + "", + '- To calculate the "collectable amount", the rent-exempt minimum balance and a 0.001 SOL buffer are deducted', + "from the treasury SOL balance.", + "- Emits a [`crate::utils::events::FeesCollected`] event.", + "", + "# Requirements", + "", + "- `fee_collector` must be authorized for fee collection.", + '- The "collectable amount" must be greater than zero.', + ]; + discriminator: [164, 152, 207, 99, 30, 186, 19, 182]; + accounts: [ + { + name: "feeCollector"; + docs: ["Write account: the account authorized to collect fees from the treasury."]; + signer: true; + }, + { + name: "feeRecipient"; + docs: ["Write account: the address that will receive the collected fees."]; + writable: true; + }, + { + name: "treasury"; + docs: ["Write account: the treasury account that holds the fees."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [116, 114, 101, 97, 115, 117, 114, 121]; + }, + ]; + }; + }, + ]; + args: []; + }, + { + name: "createCampaign"; + docs: [ + "Creates a Merkle Instant airdrop campaign.", + "", + "# Accounts Expected", + "", + "- `creator` The transaction signer and the campaign creator.", + "- `airdrop_token_mint` The mint of the airdropped token.", + "- `airdrop_token_program` The Token Program of the airdropped token.", + "", + "# Parameters", + "", + "- `merkle_root` The Merkle root of the claim data.", + "- `campaign_start_time` The time when the campaign starts, in seconds since the Unix epoch.", + "- `expiration_time` The time when the campaign expires, in seconds since the Unix epoch.", + "A value of zero means the campaign does not expire.", + "- `name` The name of the campaign.", + "- `ipfs_cid` The content identifier for indexing the campaign on IPFS. An empty value may break some UI", + "features that depend upon the IPFS CID.", + "- `aggregate_amount` The total amount of tokens to be distributed to all recipients.", + "- `recipient_count` The total number of recipient addresses eligible for the airdrop.", + "", + "# Notes", + "", + "- Emits a [`crate::utils::events::CreateCampaign`] event.", + ]; + discriminator: [111, 131, 187, 98, 160, 193, 114, 244]; + accounts: [ + { + name: "creator"; + docs: ["Write account: the creator of the campaign."]; + writable: true; + signer: true; + }, + { + name: "airdropTokenMint"; + docs: ["Read account: the mint account of the airdrop token."]; + }, + { + name: "campaign"; + docs: ["Create account: the account storing the campaign data."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [99, 97, 109, 112, 97, 105, 103, 110]; + }, + { + kind: "account"; + path: "creator"; + }, + { + kind: "arg"; + path: "merkleRoot"; + }, + { + kind: "arg"; + path: "campaignStartTime"; + }, + { + kind: "arg"; + path: "expirationTime"; + }, + { + kind: "arg"; + path: "name"; + }, + { + kind: "account"; + path: "airdropTokenMint"; + }, + ]; + }; + }, + { + name: "campaignAta"; + docs: ["Create account: the campaign's ATA for the airdrop token."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "campaign"; + }, + { + kind: "account"; + path: "airdropTokenProgram"; + }, + { + kind: "account"; + path: "airdropTokenMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "airdropTokenProgram"; + docs: ["Program account: the Token program of the airdrop token."]; + }, + { + name: "associatedTokenProgram"; + docs: ["Program account: the Associated Token program."]; + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"; + }, + { + name: "systemProgram"; + docs: ["Program account: the System program."]; + address: "11111111111111111111111111111111"; + }, + ]; + args: [ + { + name: "merkleRoot"; + type: { + array: ["u8", 32]; + }; + }, + { + name: "campaignStartTime"; + type: "u64"; + }, + { + name: "expirationTime"; + type: "u64"; + }, + { + name: "name"; + type: "string"; + }, + { + name: "ipfsCid"; + type: "string"; + }, + { + name: "aggregateAmount"; + type: "u64"; + }, + { + name: "recipientCount"; + type: "u32"; + }, + ]; + }, + { + name: "hasCampaignStarted"; + docs: [ + "Returns a flag indicating whether the campaign has started.", + "", + "# Accounts expected:", + "", + "- `campaign` The account that stores the campaign details.", + ]; + discriminator: [135, 101, 171, 220, 86, 97, 104, 199]; + accounts: [ + { + name: "campaign"; + docs: ["Read account: the account storing the campaign data."]; + }, + ]; + args: []; + returns: "bool"; + }, + { + name: "hasClaimed"; + docs: [ + "Returns a flag indicating whether a claim has been made for the given index.", + "", + "# Accounts Expected", + "", + "- `campaign` The account that stores the campaign details.", + "", + "# Parameters", + "", + "- `_index` The index of the recipient in the Merkle tree.", + ]; + discriminator: [182, 195, 167, 56, 232, 3, 223, 102]; + accounts: [ + { + name: "campaign"; + docs: ["Read account: the account storing the campaign data."]; + }, + { + name: "claimReceipt"; + docs: ["Read account: the claim receipt."]; + pda: { + seeds: [ + { + kind: "const"; + value: [99, 108, 97, 105, 109, 95, 114, 101, 99, 101, 105, 112, 116]; + }, + { + kind: "account"; + path: "campaign"; + }, + { + kind: "arg"; + path: "index"; + }, + ]; + }; + }, + ]; + args: [ + { + name: "index"; + type: "u32"; + }, + ]; + returns: "bool"; + }, + { + name: "hasExpired"; + docs: [ + "Returns a flag indicating whether the campaign has expired.", + "", + "# Accounts Expected", + "", + "- `campaign` The account that stores the campaign details.", + ]; + discriminator: [24, 138, 30, 86, 92, 38, 143, 129]; + accounts: [ + { + name: "campaign"; + docs: ["Read account: the account storing the campaign data."]; + }, + ]; + args: []; + returns: "bool"; + }, + { + name: "hasGracePeriodPassed"; + docs: [ + "Returns a flag indicating whether the grace period of the campaign has passed.", + "", + "# Accounts Expected", + "", + "- `campaign` The account that stores the campaign details.", + "", + "# Notes", + "", + "- A return value of `false` indicates: No claim has been made yet, OR the current timestamp does not exceed", + "seven days after the first claim.", + ]; + discriminator: [223, 150, 181, 32, 240, 136, 73, 236]; + accounts: [ + { + name: "campaign"; + docs: ["Read account: the account storing the campaign data."]; + }, + ]; + args: []; + returns: "bool"; + }, + { + name: "initialize"; + docs: [ + "Initializes the program with the provided fee collector address.", + "", + "# Accounts Expected", + "", + "- `initializer` The transaction signer.", + "", + "# Parameters", + "", + "- `fee_collector` The address that will have the authority to collect fees.", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + ]; + discriminator: [175, 175, 109, 31, 13, 152, 155, 237]; + accounts: [ + { + name: "initializer"; + docs: ["Write account: the initializer of the program."]; + writable: true; + signer: true; + }, + { + name: "treasury"; + docs: ["Create account: the treasury account that will hold the fees."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [116, 114, 101, 97, 115, 117, 114, 121]; + }, + ]; + }; + }, + { + name: "systemProgram"; + docs: ["Program account: the System program."]; + address: "11111111111111111111111111111111"; + }, + ]; + args: [ + { + name: "feeCollector"; + type: "pubkey"; + }, + { + name: "chainlinkProgram"; + type: "pubkey"; + }, + { + name: "chainlinkSolUsdFeed"; + type: "pubkey"; + }, + ]; + }, + { + name: "treasuryView"; + docs: ["Returns the treasury details."]; + discriminator: [247, 160, 213, 237, 247, 121, 164, 82]; + accounts: [ + { + name: "treasury"; + docs: ["Read account: the account storing the treasury details."]; + pda: { + seeds: [ + { + kind: "const"; + value: [116, 114, 101, 97, 115, 117, 114, 121]; + }, + ]; + }; + }, + ]; + args: []; + returns: { + defined: { + name: "treasury"; + }; + }; + }, + ]; + accounts: [ + { + name: "campaign"; + discriminator: [50, 40, 49, 11, 157, 220, 229, 192]; + }, + { + name: "claimReceipt"; + discriminator: [223, 233, 11, 229, 124, 165, 207, 28]; + }, + { + name: "treasury"; + discriminator: [238, 239, 123, 238, 89, 1, 168, 253]; + }, + ]; + events: [ + { + name: "claim"; + discriminator: [133, 98, 9, 238, 133, 207, 191, 113]; + }, + { + name: "clawback"; + discriminator: [239, 144, 30, 69, 80, 59, 142, 64]; + }, + { + name: "createCampaign"; + discriminator: [88, 178, 212, 72, 110, 4, 68, 143]; + }, + { + name: "feesCollected"; + discriminator: [233, 23, 117, 225, 107, 178, 254, 8]; + }, + ]; + errors: [ + { + code: 6000; + name: "campaignExpired"; + msg: "Campaign has expired!"; + }, + { + code: 6001; + name: "invalidMerkleProof"; + msg: "Invalid Merkle proof!"; + }, + { + code: 6002; + name: "campaignNotStarted"; + msg: "Campaign has not started yet!"; + }, + { + code: 6003; + name: "clawbackNotAllowed"; + msg: "Clawback not allowed past the grace period and before campaign expiration!"; + }, + { + code: 6004; + name: "cantCollectZeroFees"; + msg: "Can't collect zero fees!"; + }, + ]; + types: [ + { + name: "campaign"; + docs: ["Groups all the data for a Merkle Instant campaign."]; + type: { + kind: "struct"; + fields: [ + { + name: "airdropTokenMint"; + type: "pubkey"; + }, + { + name: "bump"; + type: "u8"; + }, + { + name: "campaignStartTime"; + type: "u64"; + }, + { + name: "creator"; + type: "pubkey"; + }, + { + name: "expirationTime"; + type: "u64"; + }, + { + name: "firstClaimTime"; + type: "u64"; + }, + { + name: "ipfsCid"; + type: "string"; + }, + { + name: "merkleRoot"; + type: { + array: ["u8", 32]; + }; + }, + { + name: "name"; + type: "string"; + }, + ]; + }; + }, + { + name: "claim"; + type: { + kind: "struct"; + fields: [ + { + name: "amount"; + type: "u64"; + }, + { + name: "campaign"; + type: "pubkey"; + }, + { + name: "claimer"; + type: "pubkey"; + }, + { + name: "claimReceipt"; + type: "pubkey"; + }, + { + name: "feeInLamports"; + type: "u64"; + }, + { + name: "index"; + type: "u32"; + }, + { + name: "recipient"; + type: "pubkey"; + }, + ]; + }; + }, + { + name: "claimReceipt"; + type: { + kind: "struct"; + fields: []; + }; + }, + { + name: "clawback"; + type: { + kind: "struct"; + fields: [ + { + name: "amount"; + type: "u64"; + }, + { + name: "campaign"; + type: "pubkey"; + }, + { + name: "campaignCreator"; + type: "pubkey"; + }, + { + name: "clawbackRecipient"; + type: "pubkey"; + }, + ]; + }; + }, + { + name: "createCampaign"; + type: { + kind: "struct"; + fields: [ + { + name: "aggregateAmount"; + type: "u64"; + }, + { + name: "campaign"; + type: "pubkey"; + }, + { + name: "campaignName"; + type: "string"; + }, + { + name: "campaignStartTime"; + type: "u64"; + }, + { + name: "creator"; + type: "pubkey"; + }, + { + name: "expirationTime"; + type: "u64"; + }, + { + name: "ipfsCid"; + type: "string"; + }, + { + name: "merkleRoot"; + type: { + array: ["u8", 32]; + }; + }, + { + name: "recipientCount"; + type: "u32"; + }, + { + name: "tokenDecimals"; + type: "u8"; + }, + { + name: "tokenMint"; + type: "pubkey"; + }, + ]; + }; + }, + { + name: "feesCollected"; + type: { + kind: "struct"; + fields: [ + { + name: "feeAmount"; + type: "u64"; + }, + { + name: "feeCollector"; + type: "pubkey"; + }, + { + name: "feeRecipient"; + type: "pubkey"; + }, + ]; + }; + }, + { + name: "treasury"; + type: { + kind: "struct"; + fields: [ + { + name: "bump"; + type: "u8"; + }, + { + name: "feeCollector"; + type: "pubkey"; + }, + { + name: "chainlinkProgram"; + type: "pubkey"; + }, + { + name: "chainlinkSolUsdFeed"; + type: "pubkey"; + }, + ]; + }; + }, + ]; +}; + +export default Idl; diff --git a/src/solana/idl/airdrops/v1.0/index.ts b/src/solana/idl/airdrops/v1.0/index.ts new file mode 100644 index 0000000..35e465c --- /dev/null +++ b/src/solana/idl/airdrops/v1.0/index.ts @@ -0,0 +1,2 @@ +export { default as SablierMerkleInstantV10IDL } from "./SablierMerkleInstantV10"; +export type { default as SablierMerkleInstantV10Type } from "./SablierMerkleInstantV10Type"; diff --git a/src/solana/idl/index.ts b/src/solana/idl/index.ts new file mode 100644 index 0000000..7c6a478 --- /dev/null +++ b/src/solana/idl/index.ts @@ -0,0 +1,2 @@ +export * from "./airdrops"; +export * from "./lockup"; diff --git a/src/solana/idl/lockup/index.ts b/src/solana/idl/lockup/index.ts new file mode 100644 index 0000000..04d5b36 --- /dev/null +++ b/src/solana/idl/lockup/index.ts @@ -0,0 +1 @@ +export * from "./v1.0"; diff --git a/src/solana/idl/lockup/v1.0/SablierLockupLinearV10.ts b/src/solana/idl/lockup/v1.0/SablierLockupLinearV10.ts new file mode 100644 index 0000000..57fa4c9 --- /dev/null +++ b/src/solana/idl/lockup/v1.0/SablierLockupLinearV10.ts @@ -0,0 +1,2227 @@ +export default { + accounts: [ + { + discriminator: [159, 26, 37, 150, 44, 84, 171, 172], + name: "NftCollectionData", + }, + { + discriminator: [61, 89, 148, 141, 154, 81, 86, 113], + name: "StreamData", + }, + { + discriminator: [238, 239, 123, 238, 89, 1, 168, 253], + name: "Treasury", + }, + ], + address: "4EauRKrNErKfsR4XetEZJNmvACGHbHnHV4R5dvJuqupC", + docs: ["Sablier Lockup program for creating and managing token streams."], + errors: [ + { + code: 6000, + msg: "Can't perform the action on a depleted stream!", + name: "StreamDepleted", + }, + { + code: 6001, + msg: "Can't renounce an already-renounced Stream!", + name: "StreamCanceled", + }, + { + code: 6002, + msg: "Can't cancel a non-cancelable Stream!", + name: "StreamIsNotCancelable", + }, + { + code: 6003, + msg: "Can't cancel a settled Stream!", + name: "StreamSettled", + }, + { + code: 6004, + msg: "Can't collect zero fees!", + name: "CantCollectZeroFees", + }, + { + code: 6005, + msg: "Invalid cliff time of the Stream!", + name: "CliffTimeNotLessThanEndTime", + }, + { + code: 6006, + msg: "Cliff time zero but unlock amount not zero!", + name: "CliffTimeZeroUnlockAmountNotZero", + }, + { + code: 6007, + msg: "Invalid deposit amount!", + name: "DepositAmountZero", + }, + { + code: 6008, + msg: "Start time must be less than cliff time!", + name: "StartTimeNotLessThanCliffTime", + }, + { + code: 6009, + msg: "Start time must be less than end time!", + name: "StartTimeNotLessThanEndTime", + }, + { + code: 6010, + msg: "Start time can't be zero!", + name: "StartTimeZero", + }, + { + code: 6011, + msg: "Unlock amounts sum is greater than deposit amount!", + name: "UnlockAmountsSumTooHigh", + }, + { + code: 6012, + msg: "Can't renounce a non-cancelable Stream!", + name: "StreamAlreadyNonCancelable", + }, + { + code: 6013, + msg: "Attempting to withdraw more than available in the stream!", + name: "Overdraw", + }, + { + code: 6014, + msg: "Can't withdraw a zero amount!", + name: "WithdrawAmountZero", + }, + ], + events: [ + { + discriminator: [82, 106, 117, 112, 153, 245, 190, 66], + name: "CancelLockupStream", + }, + { + discriminator: [234, 181, 19, 52, 67, 64, 151, 173], + name: "CreateLockupLinearStream", + }, + { + discriminator: [233, 23, 117, 225, 107, 178, 254, 8], + name: "FeesCollected", + }, + { + discriminator: [28, 66, 144, 150, 118, 56, 81, 93], + name: "RenounceLockupStream", + }, + { + discriminator: [232, 101, 27, 150, 85, 222, 243, 9], + name: "WithdrawFromLockupStream", + }, + ], + instructions: [ + { + accounts: [ + { + docs: ["Write account: the sender of the stream who can cancel it."], + name: "sender", + signer: true, + writable: true, + }, + { + docs: ["Create if needed account: the deposited token ATA owned by the sender."], + name: "sender_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "sender", + }, + { + kind: "account", + path: "deposited_token_program", + }, + { + kind: "account", + path: "deposited_token_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Read account: the mint account of the deposited token."], + name: "deposited_token_mint", + }, + { + docs: ["Write account: the stream data account storing stream details."], + name: "stream_data", + pda: { + seeds: [ + { + kind: "const", + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], + }, + { + kind: "account", + path: "stream_nft_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Write account: the deposited token ATA owned by the stream data account."], + name: "stream_data_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "stream_data", + }, + { + kind: "account", + path: "deposited_token_program", + }, + { + kind: "account", + path: "deposited_token_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Read account: the mint account for the stream NFT."], + name: "stream_nft_mint", + }, + { + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + docs: ["Program account: the Associated Token program."], + name: "associated_token_program", + }, + { + docs: ["Program account: the Token program of the deposited token."], + name: "deposited_token_program", + }, + { + address: "11111111111111111111111111111111", + docs: ["Program account: the System program."], + name: "system_program", + }, + ], + args: [], + discriminator: [232, 219, 223, 41, 219, 236, 220, 190], + docs: [ + "Cancels the stream and refunds any remaining tokens to the sender ATA.", + "", + "# Accounts Expected", + "", + "- `sender` The transaction signer and the stream's sender.", + "- `deposited_token_mint` The mint of the deposited token.", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "- `deposited_token_program` The Token Program of the deposited token.", + "", + "# Notes", + "", + "- If there are any tokens left for the recipient to withdraw, the stream is marked as canceled. Otherwise, the", + "stream is marked as depleted.", + "- If the sender does not have an ATA for the deposited token, it is created.", + "- Emits a [`crate::utils::events::CancelLockupStream`] event.", + "", + "# Requirements", + "", + "- The signer must be the stream's sender.", + "- The `stream_nft_mint` must exist.", + "- The stream must be cancelable.", + "- The stream must be Pending or Streaming.", + ], + name: "cancel", + }, + { + accounts: [ + { + docs: ["Write account: the account authorized to collect fees from the treasury."], + name: "fee_collector", + signer: true, + }, + { + docs: ["Write account: the address that will receive the collected fees."], + name: "fee_recipient", + writable: true, + }, + { + docs: ["Write account: the treasury account that holds the fees."], + name: "treasury", + pda: { + seeds: [ + { + kind: "const", + value: [116, 114, 101, 97, 115, 117, 114, 121], + }, + ], + }, + writable: true, + }, + ], + args: [], + discriminator: [164, 152, 207, 99, 30, 186, 19, 182], + docs: [ + "Collects the fees accumulated in the treasury by transferring them to the fee recipient.", + "", + "# Accounts Expected", + "", + "- `fee_collector` The transaction signer and the fee collector.", + "- `fee_recipient` The address receiving the collected fees.", + "", + "# Notes", + "", + "- Leaves a buffer of 0.001 SOL to ensure the account remains rent-exempt after the fee collection.", + "- Emits a [`crate::utils::events::FeesCollected`] event.", + "", + "# Requirements", + "", + "- `fee_collector` must be authorized for fee collection.", + ], + name: "collect_fees", + }, + { + accounts: [ + { + docs: ["Write account: the creator and funder of the stream."], + name: "creator", + signer: true, + writable: true, + }, + { + docs: ["Write account: the creator's ATA for the deposit token."], + name: "creator_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "creator", + }, + { + kind: "account", + path: "deposit_token_program", + }, + { + kind: "account", + path: "deposit_token_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Read account: the recipient of the stream."], + name: "recipient", + }, + { + docs: ["Read account: the sender of the stream."], + name: "sender", + }, + { + docs: ["Write account: the NFT collection data storing the total supply."], + name: "nft_collection_data", + pda: { + seeds: [ + { + kind: "const", + value: [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 100, 97, 116, 97], + }, + ], + }, + writable: true, + }, + { + docs: ["Write account: the master edition account for the NFT collection."], + name: "nft_collection_master_edition", + pda: { + program: { + kind: "account", + path: "token_metadata_program", + }, + seeds: [ + { + kind: "const", + value: [109, 101, 116, 97, 100, 97, 116, 97], + }, + { + kind: "account", + path: "token_metadata_program", + }, + { + kind: "account", + path: "nft_collection_mint", + }, + { + kind: "const", + value: [101, 100, 105, 116, 105, 111, 110], + }, + ], + }, + }, + { + docs: ["Write account: the metadata account for the NFT collection."], + name: "nft_collection_metadata", + pda: { + program: { + kind: "account", + path: "token_metadata_program", + }, + seeds: [ + { + kind: "const", + value: [109, 101, 116, 97, 100, 97, 116, 97], + }, + { + kind: "account", + path: "token_metadata_program", + }, + { + kind: "account", + path: "nft_collection_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Read account: the mint account for the NFT collection."], + name: "nft_collection_mint", + pda: { + seeds: [ + { + kind: "const", + value: [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 109, 105, 110, 116], + }, + ], + }, + }, + { + docs: ["Read account: the mint account for the deposit token."], + name: "deposit_token_mint", + }, + { + docs: ["Create account: the mint account for the stream NFT."], + name: "stream_nft_mint", + pda: { + seeds: [ + { + kind: "const", + value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116], + }, + { + kind: "account", + path: "sender", + }, + { + kind: "arg", + path: "salt", + }, + ], + }, + writable: true, + }, + { + docs: ["Create account: the ATA for the stream NFT owned by the recipient."], + name: "recipient_stream_nft_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "recipient", + }, + { + kind: "account", + path: "nft_token_program", + }, + { + kind: "account", + path: "stream_nft_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Create account: the account that will store the stream data."], + name: "stream_data", + pda: { + seeds: [ + { + kind: "const", + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], + }, + { + kind: "account", + path: "stream_nft_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Create account: the ATA for deposit tokens owned by stream data account."], + name: "stream_data_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "stream_data", + }, + { + kind: "account", + path: "deposit_token_program", + }, + { + kind: "account", + path: "deposit_token_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Create account: the master edition account for the stream NFT."], + name: "stream_nft_master_edition", + pda: { + program: { + kind: "account", + path: "token_metadata_program", + }, + seeds: [ + { + kind: "const", + value: [109, 101, 116, 97, 100, 97, 116, 97], + }, + { + kind: "account", + path: "token_metadata_program", + }, + { + kind: "account", + path: "stream_nft_mint", + }, + { + kind: "const", + value: [101, 100, 105, 116, 105, 111, 110], + }, + ], + }, + writable: true, + }, + { + docs: ["Create account: the metadata account for the stream NFT."], + name: "stream_nft_metadata", + pda: { + program: { + kind: "account", + path: "token_metadata_program", + }, + seeds: [ + { + kind: "const", + value: [109, 101, 116, 97, 100, 97, 116, 97], + }, + { + kind: "account", + path: "token_metadata_program", + }, + { + kind: "account", + path: "stream_nft_mint", + }, + ], + }, + writable: true, + }, + { + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + docs: ["Program account: the Associated Token program."], + name: "associated_token_program", + }, + { + docs: ["Program account: the Token program of the deposit token."], + name: "deposit_token_program", + }, + { + docs: ["Program account: the Token program of the stream NFT."], + name: "nft_token_program", + }, + { + address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", + docs: ["Program account: the Token Metadata program."], + name: "token_metadata_program", + }, + { + address: "11111111111111111111111111111111", + docs: ["Program account: the System program."], + name: "system_program", + }, + { + address: "SysvarRent111111111111111111111111111111111", + docs: ["Sysvar account: Rent."], + name: "rent", + }, + ], + args: [ + { + name: "salt", + type: "u128", + }, + { + name: "deposit_amount", + type: "u64", + }, + { + name: "cliff_duration", + type: "u64", + }, + { + name: "total_duration", + type: "u64", + }, + { + name: "start_unlock_amount", + type: "u64", + }, + { + name: "cliff_unlock_amount", + type: "u64", + }, + { + name: "is_cancelable", + type: "bool", + }, + ], + discriminator: [87, 17, 170, 167, 156, 152, 169, 61], + docs: [ + "Creates a stream by setting the start time to the current timestamp, and the end time to the sum of the", + "current timestamp and the total duration The stream is funded by the signer and wrapped in a Metaplex NFT.", + "", + "# Accounts Expected", + "", + "Refer to the accounts in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", + "", + "# Parameters", + "", + "Refer to the parameters in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", + "", + "# Notes", + "", + "Refer to the notes in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", + "", + "# Requirements", + "", + "Refer to the requirements in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", + ], + name: "create_with_durations_ll", + }, + { + accounts: [ + { + docs: ["Write account: the creator and funder of the stream."], + name: "creator", + signer: true, + writable: true, + }, + { + docs: ["Write account: the creator's ATA for the deposit token."], + name: "creator_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "creator", + }, + { + kind: "account", + path: "deposit_token_program", + }, + { + kind: "account", + path: "deposit_token_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Read account: the recipient of the stream."], + name: "recipient", + }, + { + docs: ["Read account: the sender of the stream."], + name: "sender", + }, + { + docs: ["Write account: the NFT collection data storing the total supply."], + name: "nft_collection_data", + pda: { + seeds: [ + { + kind: "const", + value: [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 100, 97, 116, 97], + }, + ], + }, + writable: true, + }, + { + docs: ["Write account: the master edition account for the NFT collection."], + name: "nft_collection_master_edition", + pda: { + program: { + kind: "account", + path: "token_metadata_program", + }, + seeds: [ + { + kind: "const", + value: [109, 101, 116, 97, 100, 97, 116, 97], + }, + { + kind: "account", + path: "token_metadata_program", + }, + { + kind: "account", + path: "nft_collection_mint", + }, + { + kind: "const", + value: [101, 100, 105, 116, 105, 111, 110], + }, + ], + }, + }, + { + docs: ["Write account: the metadata account for the NFT collection."], + name: "nft_collection_metadata", + pda: { + program: { + kind: "account", + path: "token_metadata_program", + }, + seeds: [ + { + kind: "const", + value: [109, 101, 116, 97, 100, 97, 116, 97], + }, + { + kind: "account", + path: "token_metadata_program", + }, + { + kind: "account", + path: "nft_collection_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Read account: the mint account for the NFT collection."], + name: "nft_collection_mint", + pda: { + seeds: [ + { + kind: "const", + value: [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 109, 105, 110, 116], + }, + ], + }, + }, + { + docs: ["Read account: the mint account for the deposit token."], + name: "deposit_token_mint", + }, + { + docs: ["Create account: the mint account for the stream NFT."], + name: "stream_nft_mint", + pda: { + seeds: [ + { + kind: "const", + value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116], + }, + { + kind: "account", + path: "sender", + }, + { + kind: "arg", + path: "salt", + }, + ], + }, + writable: true, + }, + { + docs: ["Create account: the ATA for the stream NFT owned by the recipient."], + name: "recipient_stream_nft_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "recipient", + }, + { + kind: "account", + path: "nft_token_program", + }, + { + kind: "account", + path: "stream_nft_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Create account: the account that will store the stream data."], + name: "stream_data", + pda: { + seeds: [ + { + kind: "const", + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], + }, + { + kind: "account", + path: "stream_nft_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Create account: the ATA for deposit tokens owned by stream data account."], + name: "stream_data_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "stream_data", + }, + { + kind: "account", + path: "deposit_token_program", + }, + { + kind: "account", + path: "deposit_token_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Create account: the master edition account for the stream NFT."], + name: "stream_nft_master_edition", + pda: { + program: { + kind: "account", + path: "token_metadata_program", + }, + seeds: [ + { + kind: "const", + value: [109, 101, 116, 97, 100, 97, 116, 97], + }, + { + kind: "account", + path: "token_metadata_program", + }, + { + kind: "account", + path: "stream_nft_mint", + }, + { + kind: "const", + value: [101, 100, 105, 116, 105, 111, 110], + }, + ], + }, + writable: true, + }, + { + docs: ["Create account: the metadata account for the stream NFT."], + name: "stream_nft_metadata", + pda: { + program: { + kind: "account", + path: "token_metadata_program", + }, + seeds: [ + { + kind: "const", + value: [109, 101, 116, 97, 100, 97, 116, 97], + }, + { + kind: "account", + path: "token_metadata_program", + }, + { + kind: "account", + path: "stream_nft_mint", + }, + ], + }, + writable: true, + }, + { + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + docs: ["Program account: the Associated Token program."], + name: "associated_token_program", + }, + { + docs: ["Program account: the Token program of the deposit token."], + name: "deposit_token_program", + }, + { + docs: ["Program account: the Token program of the stream NFT."], + name: "nft_token_program", + }, + { + address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", + docs: ["Program account: the Token Metadata program."], + name: "token_metadata_program", + }, + { + address: "11111111111111111111111111111111", + docs: ["Program account: the System program."], + name: "system_program", + }, + { + address: "SysvarRent111111111111111111111111111111111", + docs: ["Sysvar account: Rent."], + name: "rent", + }, + ], + args: [ + { + name: "salt", + type: "u128", + }, + { + name: "deposit_amount", + type: "u64", + }, + { + name: "start_time", + type: "u64", + }, + { + name: "cliff_time", + type: "u64", + }, + { + name: "end_time", + type: "u64", + }, + { + name: "start_unlock_amount", + type: "u64", + }, + { + name: "cliff_unlock_amount", + type: "u64", + }, + { + name: "is_cancelable", + type: "bool", + }, + ], + discriminator: [150, 165, 147, 28, 68, 41, 48, 41], + docs: [ + "Creates a stream with the provided start and end times. The stream is funded by the signer and wrapped in", + "a Metaplex NFT.", + "", + "# Accounts Expected", + "", + "- `creator` The transaction signer.", + "- `sender` The account that will have authority to cancel or renounce the stream.", + "- `deposit_token_mint` The mint of the tokens to be deposited.", + "- `recipient` The address receiving the tokens, as well as the NFT owner.", + "- `deposit_token_program` The Token Program of the deposit token.", + "- `nft_token_program` The Token Program of the NFT.", + "", + "# Parameters", + "", + "- `salt` A unique salt used to derive the address of the stream NFT mint.", + "- `deposit_amount` The deposit amount, denoted in units of the token's decimals.", + "- `start_time` The Unix timestamp indicating the stream's start.", + "- `cliff_time` The Unix timestamp indicating the stream's cliff.", + "- `end_time` The Unix timestamp indicating the stream's end.", + "- `start_unlock_amount` The amount to be unlocked at the start time.", + "- `cliff_unlock_amount` The amount to be unlocked at the cliff time.", + "- `is_cancelable` Indicates if the stream is cancelable.", + "", + "# Notes", + "", + "- The passed sender of the stream doesn't have to be the same as its creator.", + "- A cliff time of zero means there is no cliff.", + "- As long as the times are ordered, it is not an error for the start or the cliff time to be in the past.", + "- The stream recipient is given solely by the ownership of the stream NFT, which is minted to the passed", + "`recipient`.", + "- Emits a [`crate::utils::events::CreateLockupLinearStream`] event.", + "", + "# Requirements", + "", + "- `deposit_amount` must be greater than zero.", + "- `start_time` must be greater than zero and less than `end_time`.", + "- If set, `cliff_time` must be greater than `start_time` and less than `end_time`.", + "- The sum of `start_unlock_amount` and `cliff_unlock_amount` must be less than or equal to deposit amount.", + "- If `cliff_time` is not set, the `cliff_unlock_amount` amount must be zero.", + ], + name: "create_with_timestamps_ll", + }, + { + accounts: [ + { + docs: ["Write account: the initializer of the program."], + name: "initializer", + signer: true, + writable: true, + }, + { + docs: ["Create account: the treasury account that will hold the fees."], + name: "treasury", + pda: { + seeds: [ + { + kind: "const", + value: [116, 114, 101, 97, 115, 117, 114, 121], + }, + ], + }, + writable: true, + }, + { + docs: ["Create account: the NFT collection data account storing collection metadata."], + name: "nft_collection_data", + pda: { + seeds: [ + { + kind: "const", + value: [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 100, 97, 116, 97], + }, + ], + }, + writable: true, + }, + { + docs: ["Create account: the master edition account for the NFT collection."], + name: "nft_collection_master_edition", + pda: { + program: { + kind: "account", + path: "token_metadata_program", + }, + seeds: [ + { + kind: "const", + value: [109, 101, 116, 97, 100, 97, 116, 97], + }, + { + kind: "account", + path: "token_metadata_program", + }, + { + kind: "account", + path: "nft_collection_mint", + }, + { + kind: "const", + value: [101, 100, 105, 116, 105, 111, 110], + }, + ], + }, + writable: true, + }, + { + docs: ["Create account: the metadata account for the NFT collection."], + name: "nft_collection_metadata", + pda: { + program: { + kind: "account", + path: "token_metadata_program", + }, + seeds: [ + { + kind: "const", + value: [109, 101, 116, 97, 100, 97, 116, 97], + }, + { + kind: "account", + path: "token_metadata_program", + }, + { + kind: "account", + path: "nft_collection_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Create account: the mint account for the NFT collection."], + name: "nft_collection_mint", + pda: { + seeds: [ + { + kind: "const", + value: [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 109, 105, 110, 116], + }, + ], + }, + writable: true, + }, + { + docs: ["Create account: the ATA for the NFT collection owned by treasury."], + name: "nft_collection_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "treasury", + }, + { + kind: "account", + path: "nft_token_program", + }, + { + kind: "account", + path: "nft_collection_mint", + }, + ], + }, + writable: true, + }, + { + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + docs: ["Program account: the Associated Token program."], + name: "associated_token_program", + }, + { + docs: ["Program account: the Token program of the collection NFT."], + name: "nft_token_program", + }, + { + address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", + docs: ["Program account: the Token Metadata program."], + name: "token_metadata_program", + }, + { + address: "SysvarRent111111111111111111111111111111111", + docs: ["Sysvar account: Rent."], + name: "rent", + }, + { + address: "11111111111111111111111111111111", + docs: ["Program account: the System program."], + name: "system_program", + }, + ], + args: [ + { + name: "fee_collector", + type: "pubkey", + }, + { + name: "chainlink_program", + type: "pubkey", + }, + { + name: "chainlink_sol_usd_feed", + type: "pubkey", + }, + ], + discriminator: [175, 175, 109, 31, 13, 152, 155, 237], + docs: [ + "Initializes the program with the provided fee collector address by creating a Metaplex NFT collection.", + "", + "# Accounts Expected", + "", + "- `initializer` The transaction signer.", + "- `nft_token_program` The Token Program of the NFT collection.", + "", + "# Parameters:", + "", + "- `fee_collector`: The address that will have the authority to collect fees.", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + ], + name: "initialize", + }, + { + accounts: [ + { + docs: ["Read account: the account storing stream details."], + name: "stream_data", + pda: { + seeds: [ + { + kind: "const", + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], + }, + { + kind: "account", + path: "stream_nft_mint", + }, + ], + }, + }, + { + docs: ["Read account: the mint account for the stream NFT."], + name: "stream_nft_mint", + }, + ], + args: [], + discriminator: [160, 136, 114, 120, 234, 178, 146, 58], + docs: [ + "Calculates the amount that the sender would be refunded if the stream were canceled, denoted in units of the", + "token's decimals.", + "", + "# Accounts Expected", + "", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "", + "# Requirements", + "", + "- The stream does not exist.", + ], + name: "refundable_amount_of", + returns: "u64", + }, + { + accounts: [ + { + docs: ["Write account: the sender of the stream."], + name: "sender", + signer: true, + }, + { + docs: ["Write account: the stream data account storing stream details."], + name: "stream_data", + pda: { + seeds: [ + { + kind: "const", + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], + }, + { + kind: "account", + path: "stream_nft_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Read account: the mint account for the stream NFT."], + name: "stream_nft_mint", + }, + ], + args: [], + discriminator: [241, 157, 138, 210, 8, 235, 187, 123], + docs: [ + "Removes the right of the stream's sender to cancel the stream.", + "", + "# Accounts Expected", + "", + "- `sender` The transaction signer and the stream's sender.", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "", + "# Notes", + "", + "- Emits a [`crate::utils::events::RenounceLockupStream`] event.", + ], + name: "renounce", + }, + { + accounts: [ + { + docs: ["Read account: the account storing stream details."], + name: "stream_data", + pda: { + seeds: [ + { + kind: "const", + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], + }, + { + kind: "account", + path: "stream_nft_mint", + }, + ], + }, + }, + { + docs: ["Read account: the mint account for the stream NFT."], + name: "stream_nft_mint", + }, + ], + args: [], + discriminator: [90, 214, 253, 237, 126, 236, 132, 237], + docs: [ + "Retrieves the stream's status.", + "", + "# Accounts Expected", + "", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "", + "# Requirements", + "", + "- The stream does not exist.", + ], + name: "status_of", + returns: { + defined: { + name: "StreamStatus", + }, + }, + }, + { + accounts: [ + { + docs: ["Read account: the mint account for the stream NFT."], + name: "stream_nft_mint", + pda: { + seeds: [ + { + kind: "const", + value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116], + }, + { + kind: "arg", + path: "_sender", + }, + { + kind: "arg", + path: "_salt", + }, + ], + }, + }, + ], + args: [ + { + name: "_sender", + type: "pubkey", + }, + { + name: "_salt", + type: "u128", + }, + ], + discriminator: [104, 209, 104, 97, 122, 35, 165, 195], + docs: [ + "Returns a flag indicating whether a stream based on the `_sender` and the `_salt` already exists.", + "", + "# Parameters", + "", + "- `_sender` The sender of the stream.", + "- `_salt` The unique salt used to derive the stream NFT mint address.", + ], + name: "stream_exists", + returns: "bool", + }, + { + accounts: [ + { + docs: ["Read account: the account storing stream details."], + name: "stream_data", + pda: { + seeds: [ + { + kind: "const", + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], + }, + { + kind: "account", + path: "stream_nft_mint", + }, + ], + }, + }, + { + docs: ["Read account: the mint account for the stream NFT."], + name: "stream_nft_mint", + }, + ], + args: [], + discriminator: [91, 69, 219, 48, 189, 26, 13, 33], + docs: [ + "Calculates the amount streamed to the recipient, denoted in units of the token's decimals.", + "", + "# Accounts Expected", + "", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "", + "# Notes", + "", + "- Upon cancellation of the stream, the amount streamed is calculated as the difference between the deposited", + "amount and the refunded amount. Ultimately, when the stream becomes depleted, the streamed amount is equivalent", + "to the total amount withdrawn.", + "", + "# Requirements", + "", + "- The stream does not exist.", + ], + name: "streamed_amount_of", + returns: "u64", + }, + { + accounts: [ + { + docs: ["Read account: the account storing the treasury details."], + name: "treasury", + pda: { + seeds: [ + { + kind: "const", + value: [116, 114, 101, 97, 115, 117, 114, 121], + }, + ], + }, + }, + ], + args: [], + discriminator: [247, 160, 213, 237, 247, 121, 164, 82], + docs: ["Returns the treasury details."], + name: "treasury_view", + returns: { + defined: { + name: "Treasury", + }, + }, + }, + { + accounts: [ + { + docs: ["Write account: the signer of the withdrawal who pays the withdrawal fee."], + name: "signer", + signer: true, + writable: true, + }, + { + docs: ["Read account: the recipient of the stream who owns the stream NFT."], + name: "stream_recipient", + }, + { + docs: ["Read account: the account that will receive the withdrawn tokens.", "recipient."], + name: "withdrawal_recipient", + }, + { + docs: ["Create if needed account: the ATA for deposited tokens owned by withdrawal recipient."], + name: "withdrawal_recipient_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "withdrawal_recipient", + }, + { + kind: "account", + path: "deposited_token_program", + }, + { + kind: "account", + path: "deposited_token_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Write account: the treasury account that receives the withdrawal fee."], + name: "treasury", + pda: { + seeds: [ + { + kind: "const", + value: [116, 114, 101, 97, 115, 117, 114, 121], + }, + ], + }, + writable: true, + }, + { + docs: ["Read account: the mint account for the deposited token."], + name: "deposited_token_mint", + }, + { + docs: ["Read account: the ATA for the stream NFT owned by recipient.", ""], + name: "recipient_stream_nft_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "stream_recipient", + }, + { + kind: "account", + path: "nft_token_program", + }, + { + kind: "account", + path: "stream_nft_mint", + }, + ], + }, + }, + { + docs: ["Write account: the account storing the stream data."], + name: "stream_data", + pda: { + seeds: [ + { + kind: "const", + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], + }, + { + kind: "account", + path: "stream_nft_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Write account: the ATA for deposited tokens owned by stream data."], + name: "stream_data_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "stream_data", + }, + { + kind: "account", + path: "deposited_token_program", + }, + { + kind: "account", + path: "deposited_token_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Read account: the mint account for the stream NFT."], + name: "stream_nft_mint", + }, + { + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + docs: ["Program account: the Associated Token program."], + name: "associated_token_program", + }, + { + docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], + name: "chainlink_program", + }, + { + docs: ["Read account: The account providing the SOL/USD price feed data."], + name: "chainlink_sol_usd_feed", + }, + { + docs: ["Program account: the Token program of the deposited token."], + name: "deposited_token_program", + }, + { + docs: ["Program account: the Token program of the stream NFT."], + name: "nft_token_program", + }, + { + address: "11111111111111111111111111111111", + docs: ["Program account: the System program."], + name: "system_program", + }, + ], + args: [ + { + name: "amount", + type: "u64", + }, + ], + discriminator: [183, 18, 70, 156, 148, 109, 161, 34], + docs: [ + "Withdraws the provided amount of tokens from the stream data ATA to the provided account.", + "", + "# Accounts Expected", + "", + "- `signer` The transaction signer.", + "- `deposited_token_mint` The mint of the deposited token.", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "- `withdrawal_recipient` The address of the recipient receiving the withdrawn tokens.", + "- `deposited_token_program` The Token Program of the deposited token.", + "- `nft_token_program` The Token Program of the NFT.", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + "", + "# Parameters", + "", + "- `amount` The amount to withdraw, denoted in units of the token's decimals.", + "", + "# Notes", + "", + "- If the withdrawal recipient does not have an ATA for the deposited token, one is created.", + "- The instruction charges a fee in the native token (SOL), equivalent to $1 USD.", + "- Emits [`crate::utils::events::WithdrawFromLockupStream`] event.", + "", + "# Requirements", + "", + "- `stream_nft_mint` must exist.", + "- `withdrawal_recipient` must be the recipient if the signer is not the stream's recipient.", + "- `amount` must be greater than zero and must not exceed the withdrawable amount.", + "- The stream must not be Depleted.", + "- `chainlink_program` and `chainlink_sol_usd_feed` must match the ones stored in the treasury.", + ], + name: "withdraw", + }, + { + accounts: [ + { + docs: ["Write account: the signer of the withdrawal who pays the withdrawal fee."], + name: "signer", + signer: true, + writable: true, + }, + { + docs: ["Read account: the recipient of the stream who owns the stream NFT."], + name: "stream_recipient", + }, + { + docs: ["Read account: the account that will receive the withdrawn tokens.", "recipient."], + name: "withdrawal_recipient", + }, + { + docs: ["Create if needed account: the ATA for deposited tokens owned by withdrawal recipient."], + name: "withdrawal_recipient_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "withdrawal_recipient", + }, + { + kind: "account", + path: "deposited_token_program", + }, + { + kind: "account", + path: "deposited_token_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Write account: the treasury account that receives the withdrawal fee."], + name: "treasury", + pda: { + seeds: [ + { + kind: "const", + value: [116, 114, 101, 97, 115, 117, 114, 121], + }, + ], + }, + writable: true, + }, + { + docs: ["Read account: the mint account for the deposited token."], + name: "deposited_token_mint", + }, + { + docs: ["Read account: the ATA for the stream NFT owned by recipient.", ""], + name: "recipient_stream_nft_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "stream_recipient", + }, + { + kind: "account", + path: "nft_token_program", + }, + { + kind: "account", + path: "stream_nft_mint", + }, + ], + }, + }, + { + docs: ["Write account: the account storing the stream data."], + name: "stream_data", + pda: { + seeds: [ + { + kind: "const", + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], + }, + { + kind: "account", + path: "stream_nft_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Write account: the ATA for deposited tokens owned by stream data."], + name: "stream_data_ata", + pda: { + program: { + kind: "const", + value: [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89, + ], + }, + seeds: [ + { + kind: "account", + path: "stream_data", + }, + { + kind: "account", + path: "deposited_token_program", + }, + { + kind: "account", + path: "deposited_token_mint", + }, + ], + }, + writable: true, + }, + { + docs: ["Read account: the mint account for the stream NFT."], + name: "stream_nft_mint", + }, + { + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + docs: ["Program account: the Associated Token program."], + name: "associated_token_program", + }, + { + docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], + name: "chainlink_program", + }, + { + docs: ["Read account: The account providing the SOL/USD price feed data."], + name: "chainlink_sol_usd_feed", + }, + { + docs: ["Program account: the Token program of the deposited token."], + name: "deposited_token_program", + }, + { + docs: ["Program account: the Token program of the stream NFT."], + name: "nft_token_program", + }, + { + address: "11111111111111111111111111111111", + docs: ["Program account: the System program."], + name: "system_program", + }, + ], + args: [], + discriminator: [32, 71, 46, 98, 105, 76, 85, 96], + docs: [ + "Withdraws the maximum withdrawable amount from the stream data ATA to the provided account.", + "", + "# Accounts Expected", + "", + "Refer to the accounts in [`fn@crate::sablier_lockup::withdraw`].", + "", + "# Notes", + "", + "Refer to the notes in [`fn@crate::sablier_lockup::withdraw`].", + "", + "# Requirements", + "", + "Refer to the requirements in [`fn@crate::sablier_lockup::withdraw`].", + ], + name: "withdraw_max", + }, + { + accounts: [ + { + docs: ["Read account: the account storing stream details."], + name: "stream_data", + pda: { + seeds: [ + { + kind: "const", + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], + }, + { + kind: "account", + path: "stream_nft_mint", + }, + ], + }, + }, + { + docs: ["Read account: the mint account for the stream NFT."], + name: "stream_nft_mint", + }, + ], + args: [], + discriminator: [30, 195, 140, 141, 173, 123, 253, 60], + docs: [ + "Calculates the amount that the recipient can withdraw from the stream, denoted in units of the token's", + "decimals.", + "", + "# Accounts Expected", + "", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "", + "# Requirements", + "", + "- The stream does not exist.", + ], + name: "withdrawable_amount_of", + returns: "u64", + }, + { + accounts: [ + { + docs: ["Read account: the treasury account that receives the withdrawal fee."], + name: "treasury", + pda: { + seeds: [ + { + kind: "const", + value: [116, 114, 101, 97, 115, 117, 114, 121], + }, + ], + }, + }, + { + docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], + name: "chainlink_program", + }, + { + docs: ["Read account: The account providing the SOL/USD price feed data."], + name: "chainlink_sol_usd_feed", + }, + ], + args: [], + discriminator: [55, 255, 88, 224, 223, 23, 97, 140], + docs: [ + "Calculates the withdrawal fee in lamports, which is equivalent to $1 USD.", + "", + "# Accounts Expected:", + "", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + ], + name: "withdrawal_fee_in_lamports", + returns: "u64", + }, + ], + metadata: { + description: "Created with Anchor", + name: "sablier_lockup", + spec: "0.1.0", + version: "0.1.0", + }, + types: [ + { + name: "Amounts", + type: { + fields: [ + { + name: "start_unlock", + type: "u64", + }, + { + name: "cliff_unlock", + type: "u64", + }, + { + name: "deposited", + type: "u64", + }, + { + name: "refunded", + type: "u64", + }, + { + name: "withdrawn", + type: "u64", + }, + ], + kind: "struct", + }, + }, + { + name: "CancelLockupStream", + type: { + fields: [ + { + name: "deposited_token_mint", + type: "pubkey", + }, + { + name: "recipient_amount", + type: "u64", + }, + { + name: "sender_amount", + type: "u64", + }, + { + name: "stream_data", + type: "pubkey", + }, + { + name: "stream_nft_mint", + type: "pubkey", + }, + ], + kind: "struct", + }, + }, + { + name: "CreateLockupLinearStream", + type: { + fields: [ + { + name: "deposit_token_decimals", + type: "u8", + }, + { + name: "deposit_token_mint", + type: "pubkey", + }, + { + name: "recipient", + type: "pubkey", + }, + { + name: "salt", + type: "u128", + }, + { + name: "stream_data", + type: "pubkey", + }, + { + name: "stream_nft_mint", + type: "pubkey", + }, + ], + kind: "struct", + }, + }, + { + name: "FeesCollected", + type: { + fields: [ + { + name: "fee_amount", + type: "u64", + }, + { + name: "fee_collector", + type: "pubkey", + }, + { + name: "fee_recipient", + type: "pubkey", + }, + ], + kind: "struct", + }, + }, + { + name: "NftCollectionData", + type: { + fields: [ + { + name: "total_supply", + type: "u64", + }, + { + name: "bump", + type: "u8", + }, + ], + kind: "struct", + }, + }, + { + name: "RenounceLockupStream", + type: { + fields: [ + { + name: "deposited_token_mint", + type: "pubkey", + }, + { + name: "stream_data", + type: "pubkey", + }, + { + name: "stream_nft_mint", + type: "pubkey", + }, + ], + kind: "struct", + }, + }, + { + name: "StreamData", + type: { + fields: [ + { + name: "amounts", + type: { + defined: { + name: "Amounts", + }, + }, + }, + { + name: "deposited_token_mint", + type: "pubkey", + }, + { + name: "bump", + type: "u8", + }, + { + name: "salt", + type: "u128", + }, + { + name: "is_cancelable", + type: "bool", + }, + { + name: "is_depleted", + type: "bool", + }, + { + name: "timestamps", + type: { + defined: { + name: "Timestamps", + }, + }, + }, + { + name: "sender", + type: "pubkey", + }, + { + name: "was_canceled", + type: "bool", + }, + ], + kind: "struct", + }, + }, + { + name: "StreamStatus", + type: { + kind: "enum", + variants: [ + { + name: "Pending", + }, + { + name: "Streaming", + }, + { + name: "Settled", + }, + { + name: "Canceled", + }, + { + name: "Depleted", + }, + ], + }, + }, + { + docs: ["Groups the timestamps for a Lockup stream."], + name: "Timestamps", + type: { + fields: [ + { + name: "cliff", + type: "u64", + }, + { + name: "end", + type: "u64", + }, + { + name: "start", + type: "u64", + }, + ], + kind: "struct", + }, + }, + { + name: "Treasury", + type: { + fields: [ + { + name: "bump", + type: "u8", + }, + { + name: "fee_collector", + type: "pubkey", + }, + { + name: "chainlink_program", + type: "pubkey", + }, + { + name: "chainlink_sol_usd_feed", + type: "pubkey", + }, + ], + kind: "struct", + }, + }, + { + name: "WithdrawFromLockupStream", + type: { + fields: [ + { + name: "deposited_token_mint", + type: "pubkey", + }, + { + name: "fee_in_lamports", + type: "u64", + }, + { + name: "stream_data", + type: "pubkey", + }, + { + name: "stream_nft_mint", + type: "pubkey", + }, + { + name: "withdrawn_amount", + type: "u64", + }, + ], + kind: "struct", + }, + }, + ], +}; diff --git a/src/solana/idl/lockup/v1.0/SablierLockupLinearV10Type.ts b/src/solana/idl/lockup/v1.0/SablierLockupLinearV10Type.ts new file mode 100644 index 0000000..574b7e9 --- /dev/null +++ b/src/solana/idl/lockup/v1.0/SablierLockupLinearV10Type.ts @@ -0,0 +1,2685 @@ +/** + * Program IDL in camelCase format in order to be used in JS/TS. + * + * Note that this is only a type helper and is not the actual IDL. The original + * IDL can be found at `target/idl/sablier_lockup.json`. + */ +type Idl = { + address: "4EauRKrNErKfsR4XetEZJNmvACGHbHnHV4R5dvJuqupC"; + metadata: { + name: "sablierLockup"; + version: "0.1.0"; + spec: "0.1.0"; + description: "Created with Anchor"; + }; + docs: ["Sablier Lockup program for creating and managing token streams."]; + instructions: [ + { + name: "cancel"; + docs: [ + "Cancels the stream and refunds any remaining tokens to the sender ATA.", + "", + "# Accounts Expected", + "", + "- `sender` The transaction signer and the stream's sender.", + "- `deposited_token_mint` The mint of the deposited token.", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "- `deposited_token_program` The Token Program of the deposited token.", + "", + "# Notes", + "", + "- If there are any tokens left for the recipient to withdraw, the stream is marked as canceled. Otherwise, the", + "stream is marked as depleted.", + "- If the sender does not have an ATA for the deposited token, it is created.", + "- Emits a [`crate::utils::events::CancelLockupStream`] event.", + "", + "# Requirements", + "", + "- The signer must be the stream's sender.", + "- The `stream_nft_mint` must exist.", + "- The stream must be cancelable.", + "- The stream must be Pending or Streaming.", + ]; + discriminator: [232, 219, 223, 41, 219, 236, 220, 190]; + accounts: [ + { + name: "sender"; + docs: ["Write account: the sender of the stream who can cancel it."]; + writable: true; + signer: true; + }, + { + name: "senderAta"; + docs: ["Create if needed account: the deposited token ATA owned by the sender."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "sender"; + }, + { + kind: "account"; + path: "depositedTokenProgram"; + }, + { + kind: "account"; + path: "depositedTokenMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "depositedTokenMint"; + docs: ["Read account: the mint account of the deposited token."]; + }, + { + name: "streamData"; + docs: ["Write account: the stream data account storing stream details."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + ]; + }; + }, + { + name: "streamDataAta"; + docs: ["Write account: the deposited token ATA owned by the stream data account."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "streamData"; + }, + { + kind: "account"; + path: "depositedTokenProgram"; + }, + { + kind: "account"; + path: "depositedTokenMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "streamNftMint"; + docs: ["Read account: the mint account for the stream NFT."]; + }, + { + name: "associatedTokenProgram"; + docs: ["Program account: the Associated Token program."]; + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"; + }, + { + name: "depositedTokenProgram"; + docs: ["Program account: the Token program of the deposited token."]; + }, + { + name: "systemProgram"; + docs: ["Program account: the System program."]; + address: "11111111111111111111111111111111"; + }, + ]; + args: []; + }, + { + name: "collectFees"; + docs: [ + "Collects the fees accumulated in the treasury by transferring them to the fee recipient.", + "", + "# Accounts Expected", + "", + "- `fee_collector` The transaction signer and the fee collector.", + "- `fee_recipient` The address receiving the collected fees.", + "", + "# Notes", + "", + "- Leaves a buffer of 0.001 SOL to ensure the account remains rent-exempt after the fee collection.", + "- Emits a [`crate::utils::events::FeesCollected`] event.", + "", + "# Requirements", + "", + "- `fee_collector` must be authorized for fee collection.", + ]; + discriminator: [164, 152, 207, 99, 30, 186, 19, 182]; + accounts: [ + { + name: "feeCollector"; + docs: ["Write account: the account authorized to collect fees from the treasury."]; + signer: true; + }, + { + name: "feeRecipient"; + docs: ["Write account: the address that will receive the collected fees."]; + writable: true; + }, + { + name: "treasury"; + docs: ["Write account: the treasury account that holds the fees."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [116, 114, 101, 97, 115, 117, 114, 121]; + }, + ]; + }; + }, + ]; + args: []; + }, + { + name: "createWithDurationsLl"; + docs: [ + "Creates a stream by setting the start time to the current timestamp, and the end time to the sum of the", + "current timestamp and the total duration The stream is funded by the signer and wrapped in a Metaplex NFT.", + "", + "# Accounts Expected", + "", + "Refer to the accounts in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", + "", + "# Parameters", + "", + "Refer to the parameters in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", + "", + "# Notes", + "", + "Refer to the notes in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", + "", + "# Requirements", + "", + "Refer to the requirements in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", + ]; + discriminator: [87, 17, 170, 167, 156, 152, 169, 61]; + accounts: [ + { + name: "creator"; + docs: ["Write account: the creator and funder of the stream."]; + writable: true; + signer: true; + }, + { + name: "creatorAta"; + docs: ["Write account: the creator's ATA for the deposit token."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "creator"; + }, + { + kind: "account"; + path: "depositTokenProgram"; + }, + { + kind: "account"; + path: "depositTokenMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "recipient"; + docs: ["Read account: the recipient of the stream."]; + }, + { + name: "sender"; + docs: ["Read account: the sender of the stream."]; + }, + { + name: "nftCollectionData"; + docs: ["Write account: the NFT collection data storing the total supply."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 100, 97, 116, 97]; + }, + ]; + }; + }, + { + name: "nftCollectionMasterEdition"; + docs: ["Write account: the master edition account for the NFT collection."]; + pda: { + seeds: [ + { + kind: "const"; + value: [109, 101, 116, 97, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "tokenMetadataProgram"; + }, + { + kind: "account"; + path: "nftCollectionMint"; + }, + { + kind: "const"; + value: [101, 100, 105, 116, 105, 111, 110]; + }, + ]; + program: { + kind: "account"; + path: "tokenMetadataProgram"; + }; + }; + }, + { + name: "nftCollectionMetadata"; + docs: ["Write account: the metadata account for the NFT collection."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [109, 101, 116, 97, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "tokenMetadataProgram"; + }, + { + kind: "account"; + path: "nftCollectionMint"; + }, + ]; + program: { + kind: "account"; + path: "tokenMetadataProgram"; + }; + }; + }, + { + name: "nftCollectionMint"; + docs: ["Read account: the mint account for the NFT collection."]; + pda: { + seeds: [ + { + kind: "const"; + value: [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 109, 105, 110, 116]; + }, + ]; + }; + }, + { + name: "depositTokenMint"; + docs: ["Read account: the mint account for the deposit token."]; + }, + { + name: "streamNftMint"; + docs: ["Create account: the mint account for the stream NFT."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116]; + }, + { + kind: "account"; + path: "sender"; + }, + { + kind: "arg"; + path: "salt"; + }, + ]; + }; + }, + { + name: "recipientStreamNftAta"; + docs: ["Create account: the ATA for the stream NFT owned by the recipient."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "recipient"; + }, + { + kind: "account"; + path: "nftTokenProgram"; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "streamData"; + docs: ["Create account: the account that will store the stream data."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + ]; + }; + }, + { + name: "streamDataAta"; + docs: ["Create account: the ATA for deposit tokens owned by stream data account."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "streamData"; + }, + { + kind: "account"; + path: "depositTokenProgram"; + }, + { + kind: "account"; + path: "depositTokenMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "streamNftMasterEdition"; + docs: ["Create account: the master edition account for the stream NFT."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [109, 101, 116, 97, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "tokenMetadataProgram"; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + { + kind: "const"; + value: [101, 100, 105, 116, 105, 111, 110]; + }, + ]; + program: { + kind: "account"; + path: "tokenMetadataProgram"; + }; + }; + }, + { + name: "streamNftMetadata"; + docs: ["Create account: the metadata account for the stream NFT."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [109, 101, 116, 97, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "tokenMetadataProgram"; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + ]; + program: { + kind: "account"; + path: "tokenMetadataProgram"; + }; + }; + }, + { + name: "associatedTokenProgram"; + docs: ["Program account: the Associated Token program."]; + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"; + }, + { + name: "depositTokenProgram"; + docs: ["Program account: the Token program of the deposit token."]; + }, + { + name: "nftTokenProgram"; + docs: ["Program account: the Token program of the stream NFT."]; + }, + { + name: "tokenMetadataProgram"; + docs: ["Program account: the Token Metadata program."]; + address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"; + }, + { + name: "systemProgram"; + docs: ["Program account: the System program."]; + address: "11111111111111111111111111111111"; + }, + { + name: "rent"; + docs: ["Sysvar account: Rent."]; + address: "SysvarRent111111111111111111111111111111111"; + }, + ]; + args: [ + { + name: "salt"; + type: "u128"; + }, + { + name: "depositAmount"; + type: "u64"; + }, + { + name: "cliffDuration"; + type: "u64"; + }, + { + name: "totalDuration"; + type: "u64"; + }, + { + name: "startUnlockAmount"; + type: "u64"; + }, + { + name: "cliffUnlockAmount"; + type: "u64"; + }, + { + name: "isCancelable"; + type: "bool"; + }, + ]; + }, + { + name: "createWithTimestampsLl"; + docs: [ + "Creates a stream with the provided start and end times. The stream is funded by the signer and wrapped in", + "a Metaplex NFT.", + "", + "# Accounts Expected", + "", + "- `creator` The transaction signer.", + "- `sender` The account that will have authority to cancel or renounce the stream.", + "- `deposit_token_mint` The mint of the tokens to be deposited.", + "- `recipient` The address receiving the tokens, as well as the NFT owner.", + "- `deposit_token_program` The Token Program of the deposit token.", + "- `nft_token_program` The Token Program of the NFT.", + "", + "# Parameters", + "", + "- `salt` A unique salt used to derive the address of the stream NFT mint.", + "- `deposit_amount` The deposit amount, denoted in units of the token's decimals.", + "- `start_time` The Unix timestamp indicating the stream's start.", + "- `cliff_time` The Unix timestamp indicating the stream's cliff.", + "- `end_time` The Unix timestamp indicating the stream's end.", + "- `start_unlock_amount` The amount to be unlocked at the start time.", + "- `cliff_unlock_amount` The amount to be unlocked at the cliff time.", + "- `is_cancelable` Indicates if the stream is cancelable.", + "", + "# Notes", + "", + "- The passed sender of the stream doesn't have to be the same as its creator.", + "- A cliff time of zero means there is no cliff.", + "- As long as the times are ordered, it is not an error for the start or the cliff time to be in the past.", + "- The stream recipient is given solely by the ownership of the stream NFT, which is minted to the passed", + "`recipient`.", + "- Emits a [`crate::utils::events::CreateLockupLinearStream`] event.", + "", + "# Requirements", + "", + "- `deposit_amount` must be greater than zero.", + "- `start_time` must be greater than zero and less than `end_time`.", + "- If set, `cliff_time` must be greater than `start_time` and less than `end_time`.", + "- The sum of `start_unlock_amount` and `cliff_unlock_amount` must be less than or equal to deposit amount.", + "- If `cliff_time` is not set, the `cliff_unlock_amount` amount must be zero.", + ]; + discriminator: [150, 165, 147, 28, 68, 41, 48, 41]; + accounts: [ + { + name: "creator"; + docs: ["Write account: the creator and funder of the stream."]; + writable: true; + signer: true; + }, + { + name: "creatorAta"; + docs: ["Write account: the creator's ATA for the deposit token."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "creator"; + }, + { + kind: "account"; + path: "depositTokenProgram"; + }, + { + kind: "account"; + path: "depositTokenMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "recipient"; + docs: ["Read account: the recipient of the stream."]; + }, + { + name: "sender"; + docs: ["Read account: the sender of the stream."]; + }, + { + name: "nftCollectionData"; + docs: ["Write account: the NFT collection data storing the total supply."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 100, 97, 116, 97]; + }, + ]; + }; + }, + { + name: "nftCollectionMasterEdition"; + docs: ["Write account: the master edition account for the NFT collection."]; + pda: { + seeds: [ + { + kind: "const"; + value: [109, 101, 116, 97, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "tokenMetadataProgram"; + }, + { + kind: "account"; + path: "nftCollectionMint"; + }, + { + kind: "const"; + value: [101, 100, 105, 116, 105, 111, 110]; + }, + ]; + program: { + kind: "account"; + path: "tokenMetadataProgram"; + }; + }; + }, + { + name: "nftCollectionMetadata"; + docs: ["Write account: the metadata account for the NFT collection."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [109, 101, 116, 97, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "tokenMetadataProgram"; + }, + { + kind: "account"; + path: "nftCollectionMint"; + }, + ]; + program: { + kind: "account"; + path: "tokenMetadataProgram"; + }; + }; + }, + { + name: "nftCollectionMint"; + docs: ["Read account: the mint account for the NFT collection."]; + pda: { + seeds: [ + { + kind: "const"; + value: [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 109, 105, 110, 116]; + }, + ]; + }; + }, + { + name: "depositTokenMint"; + docs: ["Read account: the mint account for the deposit token."]; + }, + { + name: "streamNftMint"; + docs: ["Create account: the mint account for the stream NFT."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116]; + }, + { + kind: "account"; + path: "sender"; + }, + { + kind: "arg"; + path: "salt"; + }, + ]; + }; + }, + { + name: "recipientStreamNftAta"; + docs: ["Create account: the ATA for the stream NFT owned by the recipient."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "recipient"; + }, + { + kind: "account"; + path: "nftTokenProgram"; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "streamData"; + docs: ["Create account: the account that will store the stream data."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + ]; + }; + }, + { + name: "streamDataAta"; + docs: ["Create account: the ATA for deposit tokens owned by stream data account."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "streamData"; + }, + { + kind: "account"; + path: "depositTokenProgram"; + }, + { + kind: "account"; + path: "depositTokenMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "streamNftMasterEdition"; + docs: ["Create account: the master edition account for the stream NFT."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [109, 101, 116, 97, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "tokenMetadataProgram"; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + { + kind: "const"; + value: [101, 100, 105, 116, 105, 111, 110]; + }, + ]; + program: { + kind: "account"; + path: "tokenMetadataProgram"; + }; + }; + }, + { + name: "streamNftMetadata"; + docs: ["Create account: the metadata account for the stream NFT."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [109, 101, 116, 97, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "tokenMetadataProgram"; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + ]; + program: { + kind: "account"; + path: "tokenMetadataProgram"; + }; + }; + }, + { + name: "associatedTokenProgram"; + docs: ["Program account: the Associated Token program."]; + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"; + }, + { + name: "depositTokenProgram"; + docs: ["Program account: the Token program of the deposit token."]; + }, + { + name: "nftTokenProgram"; + docs: ["Program account: the Token program of the stream NFT."]; + }, + { + name: "tokenMetadataProgram"; + docs: ["Program account: the Token Metadata program."]; + address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"; + }, + { + name: "systemProgram"; + docs: ["Program account: the System program."]; + address: "11111111111111111111111111111111"; + }, + { + name: "rent"; + docs: ["Sysvar account: Rent."]; + address: "SysvarRent111111111111111111111111111111111"; + }, + ]; + args: [ + { + name: "salt"; + type: "u128"; + }, + { + name: "depositAmount"; + type: "u64"; + }, + { + name: "startTime"; + type: "u64"; + }, + { + name: "cliffTime"; + type: "u64"; + }, + { + name: "endTime"; + type: "u64"; + }, + { + name: "startUnlockAmount"; + type: "u64"; + }, + { + name: "cliffUnlockAmount"; + type: "u64"; + }, + { + name: "isCancelable"; + type: "bool"; + }, + ]; + }, + { + name: "initialize"; + docs: [ + "Initializes the program with the provided fee collector address by creating a Metaplex NFT collection.", + "", + "# Accounts Expected", + "", + "- `initializer` The transaction signer.", + "- `nft_token_program` The Token Program of the NFT collection.", + "", + "# Parameters:", + "", + "- `fee_collector`: The address that will have the authority to collect fees.", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + ]; + discriminator: [175, 175, 109, 31, 13, 152, 155, 237]; + accounts: [ + { + name: "initializer"; + docs: ["Write account: the initializer of the program."]; + writable: true; + signer: true; + }, + { + name: "treasury"; + docs: ["Create account: the treasury account that will hold the fees."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [116, 114, 101, 97, 115, 117, 114, 121]; + }, + ]; + }; + }, + { + name: "nftCollectionData"; + docs: ["Create account: the NFT collection data account storing collection metadata."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 100, 97, 116, 97]; + }, + ]; + }; + }, + { + name: "nftCollectionMasterEdition"; + docs: ["Create account: the master edition account for the NFT collection."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [109, 101, 116, 97, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "tokenMetadataProgram"; + }, + { + kind: "account"; + path: "nftCollectionMint"; + }, + { + kind: "const"; + value: [101, 100, 105, 116, 105, 111, 110]; + }, + ]; + program: { + kind: "account"; + path: "tokenMetadataProgram"; + }; + }; + }, + { + name: "nftCollectionMetadata"; + docs: ["Create account: the metadata account for the NFT collection."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [109, 101, 116, 97, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "tokenMetadataProgram"; + }, + { + kind: "account"; + path: "nftCollectionMint"; + }, + ]; + program: { + kind: "account"; + path: "tokenMetadataProgram"; + }; + }; + }, + { + name: "nftCollectionMint"; + docs: ["Create account: the mint account for the NFT collection."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 109, 105, 110, 116]; + }, + ]; + }; + }, + { + name: "nftCollectionAta"; + docs: ["Create account: the ATA for the NFT collection owned by treasury."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "treasury"; + }, + { + kind: "account"; + path: "nftTokenProgram"; + }, + { + kind: "account"; + path: "nftCollectionMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "associatedTokenProgram"; + docs: ["Program account: the Associated Token program."]; + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"; + }, + { + name: "nftTokenProgram"; + docs: ["Program account: the Token program of the collection NFT."]; + }, + { + name: "tokenMetadataProgram"; + docs: ["Program account: the Token Metadata program."]; + address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"; + }, + { + name: "rent"; + docs: ["Sysvar account: Rent."]; + address: "SysvarRent111111111111111111111111111111111"; + }, + { + name: "systemProgram"; + docs: ["Program account: the System program."]; + address: "11111111111111111111111111111111"; + }, + ]; + args: [ + { + name: "feeCollector"; + type: "pubkey"; + }, + { + name: "chainlinkProgram"; + type: "pubkey"; + }, + { + name: "chainlinkSolUsdFeed"; + type: "pubkey"; + }, + ]; + }, + { + name: "refundableAmountOf"; + docs: [ + "Calculates the amount that the sender would be refunded if the stream were canceled, denoted in units of the", + "token's decimals.", + "", + "# Accounts Expected", + "", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "", + "# Requirements", + "", + "- The stream does not exist.", + ]; + discriminator: [160, 136, 114, 120, 234, 178, 146, 58]; + accounts: [ + { + name: "streamData"; + docs: ["Read account: the account storing stream details."]; + pda: { + seeds: [ + { + kind: "const"; + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + ]; + }; + }, + { + name: "streamNftMint"; + docs: ["Read account: the mint account for the stream NFT."]; + }, + ]; + args: []; + returns: "u64"; + }, + { + name: "renounce"; + docs: [ + "Removes the right of the stream's sender to cancel the stream.", + "", + "# Accounts Expected", + "", + "- `sender` The transaction signer and the stream's sender.", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "", + "# Notes", + "", + "- Emits a [`crate::utils::events::RenounceLockupStream`] event.", + ]; + discriminator: [241, 157, 138, 210, 8, 235, 187, 123]; + accounts: [ + { + name: "sender"; + docs: ["Write account: the sender of the stream."]; + signer: true; + }, + { + name: "streamData"; + docs: ["Write account: the stream data account storing stream details."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + ]; + }; + }, + { + name: "streamNftMint"; + docs: ["Read account: the mint account for the stream NFT."]; + }, + ]; + args: []; + }, + { + name: "statusOf"; + docs: [ + "Retrieves the stream's status.", + "", + "# Accounts Expected", + "", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "", + "# Requirements", + "", + "- The stream does not exist.", + ]; + discriminator: [90, 214, 253, 237, 126, 236, 132, 237]; + accounts: [ + { + name: "streamData"; + docs: ["Read account: the account storing stream details."]; + pda: { + seeds: [ + { + kind: "const"; + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + ]; + }; + }, + { + name: "streamNftMint"; + docs: ["Read account: the mint account for the stream NFT."]; + }, + ]; + args: []; + returns: { + defined: { + name: "streamStatus"; + }; + }; + }, + { + name: "streamExists"; + docs: [ + "Returns a flag indicating whether a stream based on the `_sender` and the `_salt` already exists.", + "", + "# Parameters", + "", + "- `_sender` The sender of the stream.", + "- `_salt` The unique salt used to derive the stream NFT mint address.", + ]; + discriminator: [104, 209, 104, 97, 122, 35, 165, 195]; + accounts: [ + { + name: "streamNftMint"; + docs: ["Read account: the mint account for the stream NFT."]; + pda: { + seeds: [ + { + kind: "const"; + value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116]; + }, + { + kind: "arg"; + path: "sender"; + }, + { + kind: "arg"; + path: "salt"; + }, + ]; + }; + }, + ]; + args: [ + { + name: "sender"; + type: "pubkey"; + }, + { + name: "salt"; + type: "u128"; + }, + ]; + returns: "bool"; + }, + { + name: "streamedAmountOf"; + docs: [ + "Calculates the amount streamed to the recipient, denoted in units of the token's decimals.", + "", + "# Accounts Expected", + "", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "", + "# Notes", + "", + "- Upon cancellation of the stream, the amount streamed is calculated as the difference between the deposited", + "amount and the refunded amount. Ultimately, when the stream becomes depleted, the streamed amount is equivalent", + "to the total amount withdrawn.", + "", + "# Requirements", + "", + "- The stream does not exist.", + ]; + discriminator: [91, 69, 219, 48, 189, 26, 13, 33]; + accounts: [ + { + name: "streamData"; + docs: ["Read account: the account storing stream details."]; + pda: { + seeds: [ + { + kind: "const"; + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + ]; + }; + }, + { + name: "streamNftMint"; + docs: ["Read account: the mint account for the stream NFT."]; + }, + ]; + args: []; + returns: "u64"; + }, + { + name: "treasuryView"; + docs: ["Returns the treasury details."]; + discriminator: [247, 160, 213, 237, 247, 121, 164, 82]; + accounts: [ + { + name: "treasury"; + docs: ["Read account: the account storing the treasury details."]; + pda: { + seeds: [ + { + kind: "const"; + value: [116, 114, 101, 97, 115, 117, 114, 121]; + }, + ]; + }; + }, + ]; + args: []; + returns: { + defined: { + name: "treasury"; + }; + }; + }, + { + name: "withdraw"; + docs: [ + "Withdraws the provided amount of tokens from the stream data ATA to the provided account.", + "", + "# Accounts Expected", + "", + "- `signer` The transaction signer.", + "- `deposited_token_mint` The mint of the deposited token.", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "- `withdrawal_recipient` The address of the recipient receiving the withdrawn tokens.", + "- `deposited_token_program` The Token Program of the deposited token.", + "- `nft_token_program` The Token Program of the NFT.", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + "", + "# Parameters", + "", + "- `amount` The amount to withdraw, denoted in units of the token's decimals.", + "", + "# Notes", + "", + "- If the withdrawal recipient does not have an ATA for the deposited token, one is created.", + "- The instruction charges a fee in the native token (SOL), equivalent to $1 USD.", + "- Emits [`crate::utils::events::WithdrawFromLockupStream`] event.", + "", + "# Requirements", + "", + "- `stream_nft_mint` must exist.", + "- `withdrawal_recipient` must be the recipient if the signer is not the stream's recipient.", + "- `amount` must be greater than zero and must not exceed the withdrawable amount.", + "- The stream must not be Depleted.", + "- `chainlink_program` and `chainlink_sol_usd_feed` must match the ones stored in the treasury.", + ]; + discriminator: [183, 18, 70, 156, 148, 109, 161, 34]; + accounts: [ + { + name: "signer"; + docs: ["Write account: the signer of the withdrawal who pays the withdrawal fee."]; + writable: true; + signer: true; + }, + { + name: "streamRecipient"; + docs: ["Read account: the recipient of the stream who owns the stream NFT."]; + }, + { + name: "withdrawalRecipient"; + docs: ["Read account: the account that will receive the withdrawn tokens.", "recipient."]; + }, + { + name: "withdrawalRecipientAta"; + docs: ["Create if needed account: the ATA for deposited tokens owned by withdrawal recipient."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "withdrawalRecipient"; + }, + { + kind: "account"; + path: "depositedTokenProgram"; + }, + { + kind: "account"; + path: "depositedTokenMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "treasury"; + docs: ["Write account: the treasury account that receives the withdrawal fee."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [116, 114, 101, 97, 115, 117, 114, 121]; + }, + ]; + }; + }, + { + name: "depositedTokenMint"; + docs: ["Read account: the mint account for the deposited token."]; + }, + { + name: "recipientStreamNftAta"; + docs: ["Read account: the ATA for the stream NFT owned by recipient.", ""]; + pda: { + seeds: [ + { + kind: "account"; + path: "streamRecipient"; + }, + { + kind: "account"; + path: "nftTokenProgram"; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "streamData"; + docs: ["Write account: the account storing the stream data."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + ]; + }; + }, + { + name: "streamDataAta"; + docs: ["Write account: the ATA for deposited tokens owned by stream data."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "streamData"; + }, + { + kind: "account"; + path: "depositedTokenProgram"; + }, + { + kind: "account"; + path: "depositedTokenMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "streamNftMint"; + docs: ["Read account: the mint account for the stream NFT."]; + }, + { + name: "associatedTokenProgram"; + docs: ["Program account: the Associated Token program."]; + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"; + }, + { + name: "chainlinkProgram"; + docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."]; + }, + { + name: "chainlinkSolUsdFeed"; + docs: ["Read account: The account providing the SOL/USD price feed data."]; + }, + { + name: "depositedTokenProgram"; + docs: ["Program account: the Token program of the deposited token."]; + }, + { + name: "nftTokenProgram"; + docs: ["Program account: the Token program of the stream NFT."]; + }, + { + name: "systemProgram"; + docs: ["Program account: the System program."]; + address: "11111111111111111111111111111111"; + }, + ]; + args: [ + { + name: "amount"; + type: "u64"; + }, + ]; + }, + { + name: "withdrawMax"; + docs: [ + "Withdraws the maximum withdrawable amount from the stream data ATA to the provided account.", + "", + "# Accounts Expected", + "", + "Refer to the accounts in [`fn@crate::sablier_lockup::withdraw`].", + "", + "# Notes", + "", + "Refer to the notes in [`fn@crate::sablier_lockup::withdraw`].", + "", + "# Requirements", + "", + "Refer to the requirements in [`fn@crate::sablier_lockup::withdraw`].", + ]; + discriminator: [32, 71, 46, 98, 105, 76, 85, 96]; + accounts: [ + { + name: "signer"; + docs: ["Write account: the signer of the withdrawal who pays the withdrawal fee."]; + writable: true; + signer: true; + }, + { + name: "streamRecipient"; + docs: ["Read account: the recipient of the stream who owns the stream NFT."]; + }, + { + name: "withdrawalRecipient"; + docs: ["Read account: the account that will receive the withdrawn tokens.", "recipient."]; + }, + { + name: "withdrawalRecipientAta"; + docs: ["Create if needed account: the ATA for deposited tokens owned by withdrawal recipient."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "withdrawalRecipient"; + }, + { + kind: "account"; + path: "depositedTokenProgram"; + }, + { + kind: "account"; + path: "depositedTokenMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "treasury"; + docs: ["Write account: the treasury account that receives the withdrawal fee."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [116, 114, 101, 97, 115, 117, 114, 121]; + }, + ]; + }; + }, + { + name: "depositedTokenMint"; + docs: ["Read account: the mint account for the deposited token."]; + }, + { + name: "recipientStreamNftAta"; + docs: ["Read account: the ATA for the stream NFT owned by recipient.", ""]; + pda: { + seeds: [ + { + kind: "account"; + path: "streamRecipient"; + }, + { + kind: "account"; + path: "nftTokenProgram"; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "streamData"; + docs: ["Write account: the account storing the stream data."]; + writable: true; + pda: { + seeds: [ + { + kind: "const"; + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + ]; + }; + }, + { + name: "streamDataAta"; + docs: ["Write account: the ATA for deposited tokens owned by stream data."]; + writable: true; + pda: { + seeds: [ + { + kind: "account"; + path: "streamData"; + }, + { + kind: "account"; + path: "depositedTokenProgram"; + }, + { + kind: "account"; + path: "depositedTokenMint"; + }, + ]; + program: { + kind: "const"; + value: [ + 140, + 151, + 37, + 143, + 78, + 36, + 137, + 241, + 187, + 61, + 16, + 41, + 20, + 142, + 13, + 131, + 11, + 90, + 19, + 153, + 218, + 255, + 16, + 132, + 4, + 142, + 123, + 216, + 219, + 233, + 248, + 89, + ]; + }; + }; + }, + { + name: "streamNftMint"; + docs: ["Read account: the mint account for the stream NFT."]; + }, + { + name: "associatedTokenProgram"; + docs: ["Program account: the Associated Token program."]; + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"; + }, + { + name: "chainlinkProgram"; + docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."]; + }, + { + name: "chainlinkSolUsdFeed"; + docs: ["Read account: The account providing the SOL/USD price feed data."]; + }, + { + name: "depositedTokenProgram"; + docs: ["Program account: the Token program of the deposited token."]; + }, + { + name: "nftTokenProgram"; + docs: ["Program account: the Token program of the stream NFT."]; + }, + { + name: "systemProgram"; + docs: ["Program account: the System program."]; + address: "11111111111111111111111111111111"; + }, + ]; + args: []; + }, + { + name: "withdrawableAmountOf"; + docs: [ + "Calculates the amount that the recipient can withdraw from the stream, denoted in units of the token's", + "decimals.", + "", + "# Accounts Expected", + "", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "", + "# Requirements", + "", + "- The stream does not exist.", + ]; + discriminator: [30, 195, 140, 141, 173, 123, 253, 60]; + accounts: [ + { + name: "streamData"; + docs: ["Read account: the account storing stream details."]; + pda: { + seeds: [ + { + kind: "const"; + value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; + }, + { + kind: "account"; + path: "streamNftMint"; + }, + ]; + }; + }, + { + name: "streamNftMint"; + docs: ["Read account: the mint account for the stream NFT."]; + }, + ]; + args: []; + returns: "u64"; + }, + { + name: "withdrawalFeeInLamports"; + docs: [ + "Calculates the withdrawal fee in lamports, which is equivalent to $1 USD.", + "", + "# Accounts Expected:", + "", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + ]; + discriminator: [55, 255, 88, 224, 223, 23, 97, 140]; + accounts: [ + { + name: "treasury"; + docs: ["Read account: the treasury account that receives the withdrawal fee."]; + pda: { + seeds: [ + { + kind: "const"; + value: [116, 114, 101, 97, 115, 117, 114, 121]; + }, + ]; + }; + }, + { + name: "chainlinkProgram"; + docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."]; + }, + { + name: "chainlinkSolUsdFeed"; + docs: ["Read account: The account providing the SOL/USD price feed data."]; + }, + ]; + args: []; + returns: "u64"; + }, + ]; + accounts: [ + { + name: "nftCollectionData"; + discriminator: [159, 26, 37, 150, 44, 84, 171, 172]; + }, + { + name: "streamData"; + discriminator: [61, 89, 148, 141, 154, 81, 86, 113]; + }, + { + name: "treasury"; + discriminator: [238, 239, 123, 238, 89, 1, 168, 253]; + }, + ]; + events: [ + { + name: "cancelLockupStream"; + discriminator: [82, 106, 117, 112, 153, 245, 190, 66]; + }, + { + name: "createLockupLinearStream"; + discriminator: [234, 181, 19, 52, 67, 64, 151, 173]; + }, + { + name: "feesCollected"; + discriminator: [233, 23, 117, 225, 107, 178, 254, 8]; + }, + { + name: "renounceLockupStream"; + discriminator: [28, 66, 144, 150, 118, 56, 81, 93]; + }, + { + name: "withdrawFromLockupStream"; + discriminator: [232, 101, 27, 150, 85, 222, 243, 9]; + }, + ]; + errors: [ + { + code: 6000; + name: "streamDepleted"; + msg: "Can't perform the action on a depleted stream!"; + }, + { + code: 6001; + name: "streamCanceled"; + msg: "Can't renounce an already-renounced Stream!"; + }, + { + code: 6002; + name: "streamIsNotCancelable"; + msg: "Can't cancel a non-cancelable Stream!"; + }, + { + code: 6003; + name: "streamSettled"; + msg: "Can't cancel a settled Stream!"; + }, + { + code: 6004; + name: "cantCollectZeroFees"; + msg: "Can't collect zero fees!"; + }, + { + code: 6005; + name: "cliffTimeNotLessThanEndTime"; + msg: "Invalid cliff time of the Stream!"; + }, + { + code: 6006; + name: "cliffTimeZeroUnlockAmountNotZero"; + msg: "Cliff time zero but unlock amount not zero!"; + }, + { + code: 6007; + name: "depositAmountZero"; + msg: "Invalid deposit amount!"; + }, + { + code: 6008; + name: "startTimeNotLessThanCliffTime"; + msg: "Start time must be less than cliff time!"; + }, + { + code: 6009; + name: "startTimeNotLessThanEndTime"; + msg: "Start time must be less than end time!"; + }, + { + code: 6010; + name: "startTimeZero"; + msg: "Start time can't be zero!"; + }, + { + code: 6011; + name: "unlockAmountsSumTooHigh"; + msg: "Unlock amounts sum is greater than deposit amount!"; + }, + { + code: 6012; + name: "streamAlreadyNonCancelable"; + msg: "Can't renounce a non-cancelable Stream!"; + }, + { + code: 6013; + name: "overdraw"; + msg: "Attempting to withdraw more than available in the stream!"; + }, + { + code: 6014; + name: "withdrawAmountZero"; + msg: "Can't withdraw a zero amount!"; + }, + ]; + types: [ + { + name: "amounts"; + type: { + kind: "struct"; + fields: [ + { + name: "startUnlock"; + type: "u64"; + }, + { + name: "cliffUnlock"; + type: "u64"; + }, + { + name: "deposited"; + type: "u64"; + }, + { + name: "refunded"; + type: "u64"; + }, + { + name: "withdrawn"; + type: "u64"; + }, + ]; + }; + }, + { + name: "cancelLockupStream"; + type: { + kind: "struct"; + fields: [ + { + name: "depositedTokenMint"; + type: "pubkey"; + }, + { + name: "recipientAmount"; + type: "u64"; + }, + { + name: "senderAmount"; + type: "u64"; + }, + { + name: "streamData"; + type: "pubkey"; + }, + { + name: "streamNftMint"; + type: "pubkey"; + }, + ]; + }; + }, + { + name: "createLockupLinearStream"; + type: { + kind: "struct"; + fields: [ + { + name: "depositTokenDecimals"; + type: "u8"; + }, + { + name: "depositTokenMint"; + type: "pubkey"; + }, + { + name: "recipient"; + type: "pubkey"; + }, + { + name: "salt"; + type: "u128"; + }, + { + name: "streamData"; + type: "pubkey"; + }, + { + name: "streamNftMint"; + type: "pubkey"; + }, + ]; + }; + }, + { + name: "feesCollected"; + type: { + kind: "struct"; + fields: [ + { + name: "feeAmount"; + type: "u64"; + }, + { + name: "feeCollector"; + type: "pubkey"; + }, + { + name: "feeRecipient"; + type: "pubkey"; + }, + ]; + }; + }, + { + name: "nftCollectionData"; + type: { + kind: "struct"; + fields: [ + { + name: "totalSupply"; + type: "u64"; + }, + { + name: "bump"; + type: "u8"; + }, + ]; + }; + }, + { + name: "renounceLockupStream"; + type: { + kind: "struct"; + fields: [ + { + name: "depositedTokenMint"; + type: "pubkey"; + }, + { + name: "streamData"; + type: "pubkey"; + }, + { + name: "streamNftMint"; + type: "pubkey"; + }, + ]; + }; + }, + { + name: "streamData"; + type: { + kind: "struct"; + fields: [ + { + name: "amounts"; + type: { + defined: { + name: "amounts"; + }; + }; + }, + { + name: "depositedTokenMint"; + type: "pubkey"; + }, + { + name: "bump"; + type: "u8"; + }, + { + name: "salt"; + type: "u128"; + }, + { + name: "isCancelable"; + type: "bool"; + }, + { + name: "isDepleted"; + type: "bool"; + }, + { + name: "timestamps"; + type: { + defined: { + name: "timestamps"; + }; + }; + }, + { + name: "sender"; + type: "pubkey"; + }, + { + name: "wasCanceled"; + type: "bool"; + }, + ]; + }; + }, + { + name: "streamStatus"; + type: { + kind: "enum"; + variants: [ + { + name: "pending"; + }, + { + name: "streaming"; + }, + { + name: "settled"; + }, + { + name: "canceled"; + }, + { + name: "depleted"; + }, + ]; + }; + }, + { + name: "timestamps"; + docs: ["Groups the timestamps for a Lockup stream."]; + type: { + kind: "struct"; + fields: [ + { + name: "cliff"; + type: "u64"; + }, + { + name: "end"; + type: "u64"; + }, + { + name: "start"; + type: "u64"; + }, + ]; + }; + }, + { + name: "treasury"; + type: { + kind: "struct"; + fields: [ + { + name: "bump"; + type: "u8"; + }, + { + name: "feeCollector"; + type: "pubkey"; + }, + { + name: "chainlinkProgram"; + type: "pubkey"; + }, + { + name: "chainlinkSolUsdFeed"; + type: "pubkey"; + }, + ]; + }; + }, + { + name: "withdrawFromLockupStream"; + type: { + kind: "struct"; + fields: [ + { + name: "depositedTokenMint"; + type: "pubkey"; + }, + { + name: "feeInLamports"; + type: "u64"; + }, + { + name: "streamData"; + type: "pubkey"; + }, + { + name: "streamNftMint"; + type: "pubkey"; + }, + { + name: "withdrawnAmount"; + type: "u64"; + }, + ]; + }; + }, + ]; +}; + +export default Idl; diff --git a/src/solana/idl/lockup/v1.0/index.ts b/src/solana/idl/lockup/v1.0/index.ts new file mode 100644 index 0000000..e861f0e --- /dev/null +++ b/src/solana/idl/lockup/v1.0/index.ts @@ -0,0 +1,2 @@ +export { default as SablierLockupLinearV10IDL } from "./SablierLockupLinearV10"; +export type { default as SablierLockupLinearV10Type } from "./SablierLockupLinearV10Type"; diff --git a/src/solana/index.ts b/src/solana/index.ts new file mode 100644 index 0000000..657df4d --- /dev/null +++ b/src/solana/index.ts @@ -0,0 +1 @@ +export * from "./idl"; From 42d5a8cbcccc80926f4057a41fd1bc4e035afbc1 Mon Sep 17 00:00:00 2001 From: Paul Razvan Berg Date: Wed, 5 Nov 2025 11:03:35 +0200 Subject: [PATCH 2/3] style: apply formatter never expand in Solana IDLs --- biome.jsonc | 2 +- ...eInstantV10.ts => SablierMerkleInstant.ts} | 660 ++------ ...V10Type.ts => SablierMerkleInstantType.ts} | 665 ++------ src/solana/idl/airdrops/v1.0/index.ts | 4 +- ...kupLinearV10.ts => SablierLockupLinear.ts} | 1357 ++++------------ ...rV10Type.ts => SablierLockupLinearType.ts} | 1363 ++++------------- src/solana/idl/lockup/v1.0/index.ts | 4 +- 7 files changed, 769 insertions(+), 3286 deletions(-) rename src/solana/idl/airdrops/v1.0/{SablierMerkleInstantV10.ts => SablierMerkleInstant.ts} (55%) rename src/solana/idl/airdrops/v1.0/{SablierMerkleInstantV10Type.ts => SablierMerkleInstantType.ts} (58%) rename src/solana/idl/lockup/v1.0/{SablierLockupLinearV10.ts => SablierLockupLinear.ts} (55%) rename src/solana/idl/lockup/v1.0/{SablierLockupLinearV10Type.ts => SablierLockupLinearType.ts} (59%) diff --git a/biome.jsonc b/biome.jsonc index 51df67a..1873df7 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -16,7 +16,7 @@ } }, { - "includes": ["src/evm/releases/**/abi/**/*.ts"], + "includes": ["src/evm/releases/**/abi/**/*.ts", "src/solana/idl/**/*.ts"], "javascript": { "formatter": { "expand": "never" // Never expand objects in the ABI to save number of lines diff --git a/src/solana/idl/airdrops/v1.0/SablierMerkleInstantV10.ts b/src/solana/idl/airdrops/v1.0/SablierMerkleInstant.ts similarity index 55% rename from src/solana/idl/airdrops/v1.0/SablierMerkleInstantV10.ts rename to src/solana/idl/airdrops/v1.0/SablierMerkleInstant.ts index b351a9e..dabcba2 100644 --- a/src/solana/idl/airdrops/v1.0/SablierMerkleInstantV10.ts +++ b/src/solana/idl/airdrops/v1.0/SablierMerkleInstant.ts @@ -1,73 +1,31 @@ -export default { +export const sablierMerkleInstantIdl = { accounts: [ - { - discriminator: [50, 40, 49, 11, 157, 220, 229, 192], - name: "Campaign", - }, - { - discriminator: [223, 233, 11, 229, 124, 165, 207, 28], - name: "ClaimReceipt", - }, - { - discriminator: [238, 239, 123, 238, 89, 1, 168, 253], - name: "Treasury", - }, + { discriminator: [50, 40, 49, 11, 157, 220, 229, 192], name: "Campaign" }, + { discriminator: [223, 233, 11, 229, 124, 165, 207, 28], name: "ClaimReceipt" }, + { discriminator: [238, 239, 123, 238, 89, 1, 168, 253], name: "Treasury" }, ], address: "7XrxoQejBoGouW4V3aozTSwub7xSDjYqB4Go7YLjF9rV", docs: ["Sablier Merkle Instant program for creating and managing Merkle tree-based airdrop campaigns."], errors: [ - { - code: 6000, - msg: "Campaign has expired!", - name: "CampaignExpired", - }, - { - code: 6001, - msg: "Invalid Merkle proof!", - name: "InvalidMerkleProof", - }, - { - code: 6002, - msg: "Campaign has not started yet!", - name: "CampaignNotStarted", - }, + { code: 6000, msg: "Campaign has expired!", name: "CampaignExpired" }, + { code: 6001, msg: "Invalid Merkle proof!", name: "InvalidMerkleProof" }, + { code: 6002, msg: "Campaign has not started yet!", name: "CampaignNotStarted" }, { code: 6003, msg: "Clawback not allowed past the grace period and before campaign expiration!", name: "ClawbackNotAllowed", }, - { - code: 6004, - msg: "Can't collect zero fees!", - name: "CantCollectZeroFees", - }, + { code: 6004, msg: "Can't collect zero fees!", name: "CantCollectZeroFees" }, ], events: [ - { - discriminator: [133, 98, 9, 238, 133, 207, 191, 113], - name: "Claim", - }, - { - discriminator: [239, 144, 30, 69, 80, 59, 142, 64], - name: "Clawback", - }, - { - discriminator: [88, 178, 212, 72, 110, 4, 68, 143], - name: "CreateCampaign", - }, - { - discriminator: [233, 23, 117, 225, 107, 178, 254, 8], - name: "FeesCollected", - }, + { discriminator: [133, 98, 9, 238, 133, 207, 191, 113], name: "Claim" }, + { discriminator: [239, 144, 30, 69, 80, 59, 142, 64], name: "Clawback" }, + { discriminator: [88, 178, 212, 72, 110, 4, 68, 143], name: "CreateCampaign" }, + { discriminator: [233, 23, 117, 225, 107, 178, 254, 8], name: "FeesCollected" }, ], instructions: [ { - accounts: [ - { - docs: ["Read account: the account storing the campaign data."], - name: "campaign", - }, - ], + accounts: [{ docs: ["Read account: the account storing the campaign data."], name: "campaign" }], args: [], discriminator: [188, 126, 110, 5, 183, 113, 158, 3], docs: [ @@ -78,11 +36,7 @@ export default { "- `campaign` The account that stores the campaign details.", ], name: "campaign_view", - returns: { - defined: { - name: "Campaign", - }, - }, + returns: { defined: { name: "Campaign" } }, }, { accounts: [ @@ -92,10 +46,7 @@ export default { signer: true, writable: true, }, - { - docs: ["Read account: the recipient of the airdrop."], - name: "recipient", - }, + { docs: ["Read account: the recipient of the airdrop."], name: "recipient" }, { docs: ["Create if needed account: the ATA for airdrop token owned by the recipient."], name: "recipient_ata", @@ -108,18 +59,9 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "recipient", - }, - { - kind: "account", - path: "airdrop_token_program", - }, - { - kind: "account", - path: "airdrop_token_mint", - }, + { kind: "account", path: "recipient" }, + { kind: "account", path: "airdrop_token_program" }, + { kind: "account", path: "airdrop_token_mint" }, ], }, writable: true, @@ -127,25 +69,11 @@ export default { { docs: ["Write account: the treasury account that will receive the claim fee."], name: "treasury", - pda: { - seeds: [ - { - kind: "const", - value: [116, 114, 101, 97, 115, 117, 114, 121], - }, - ], - }, - writable: true, - }, - { - docs: ["Read account: the mint account of the airdrop token."], - name: "airdrop_token_mint", - }, - { - docs: ["Write account: the account storing the campaign data."], - name: "campaign", + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, writable: true, }, + { docs: ["Read account: the mint account of the airdrop token."], name: "airdrop_token_mint" }, + { docs: ["Write account: the account storing the campaign data."], name: "campaign", writable: true }, { docs: ["Write account: the campaign's ATA for the airdrop token."], name: "campaign_ata", @@ -158,18 +86,9 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "campaign", - }, - { - kind: "account", - path: "airdrop_token_program", - }, - { - kind: "account", - path: "airdrop_token_mint", - }, + { kind: "account", path: "campaign" }, + { kind: "account", path: "airdrop_token_program" }, + { kind: "account", path: "airdrop_token_mint" }, ], }, writable: true, @@ -179,26 +98,14 @@ export default { name: "claim_receipt", pda: { seeds: [ - { - kind: "const", - value: [99, 108, 97, 105, 109, 95, 114, 101, 99, 101, 105, 112, 116], - }, - { - kind: "account", - path: "campaign", - }, - { - kind: "arg", - path: "index", - }, + { kind: "const", value: [99, 108, 97, 105, 109, 95, 114, 101, 99, 101, 105, 112, 116] }, + { kind: "account", path: "campaign" }, + { kind: "arg", path: "index" }, ], }, writable: true, }, - { - docs: ["Program account: the Token program of the airdrop token."], - name: "airdrop_token_program", - }, + { docs: ["Program account: the Token program of the airdrop token."], name: "airdrop_token_program" }, { address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", docs: ["Program account: the Associated Token program."], @@ -208,10 +115,7 @@ export default { docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], name: "chainlink_program", }, - { - docs: ["Read account: The account providing the SOL/USD price feed data."], - name: "chainlink_sol_usd_feed", - }, + { docs: ["Read account: The account providing the SOL/USD price feed data."], name: "chainlink_sol_usd_feed" }, { address: "11111111111111111111111111111111", docs: ["Program account: the System program."], @@ -219,22 +123,9 @@ export default { }, ], args: [ - { - name: "index", - type: "u32", - }, - { - name: "amount", - type: "u64", - }, - { - name: "merkle_proof", - type: { - vec: { - array: ["u8", 32], - }, - }, - }, + { name: "index", type: "u32" }, + { name: "amount", type: "u64" }, + { name: "merkle_proof", type: { vec: { array: ["u8", 32] } } }, ], discriminator: [62, 198, 214, 193, 213, 159, 108, 210], docs: [ @@ -277,23 +168,13 @@ export default { { docs: ["Read account: the treasury account that receives the claim fee."], name: "treasury", - pda: { - seeds: [ - { - kind: "const", - value: [116, 114, 101, 97, 115, 117, 114, 121], - }, - ], - }, + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, }, { docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], name: "chainlink_program", }, - { - docs: ["Read account: The account providing the SOL/USD price feed data."], - name: "chainlink_sol_usd_feed", - }, + { docs: ["Read account: The account providing the SOL/USD price feed data."], name: "chainlink_sol_usd_feed" }, ], args: [], discriminator: [255, 199, 146, 222, 145, 180, 58, 231], @@ -316,10 +197,7 @@ export default { signer: true, writable: true, }, - { - docs: ["Read account: the clawback recipient."], - name: "clawback_recipient", - }, + { docs: ["Read account: the clawback recipient."], name: "clawback_recipient" }, { docs: ["Create if needed account: the clawback recipient's ATA for the airdrop token."], name: "clawback_recipient_ata", @@ -332,30 +210,15 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "clawback_recipient", - }, - { - kind: "account", - path: "airdrop_token_program", - }, - { - kind: "account", - path: "airdrop_token_mint", - }, + { kind: "account", path: "clawback_recipient" }, + { kind: "account", path: "airdrop_token_program" }, + { kind: "account", path: "airdrop_token_mint" }, ], }, writable: true, }, - { - docs: ["Read account: the mint account of the airdrop token."], - name: "airdrop_token_mint", - }, - { - docs: ["Read account: the account storing the campaign data."], - name: "campaign", - }, + { docs: ["Read account: the mint account of the airdrop token."], name: "airdrop_token_mint" }, + { docs: ["Read account: the account storing the campaign data."], name: "campaign" }, { docs: ["Write account: the campaign's ATA for the airdrop token."], name: "campaign_ata", @@ -368,26 +231,14 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "campaign", - }, - { - kind: "account", - path: "airdrop_token_program", - }, - { - kind: "account", - path: "airdrop_token_mint", - }, + { kind: "account", path: "campaign" }, + { kind: "account", path: "airdrop_token_program" }, + { kind: "account", path: "airdrop_token_mint" }, ], }, writable: true, }, - { - docs: ["Program account: the Token program of the airdrop token."], - name: "airdrop_token_program", - }, + { docs: ["Program account: the Token program of the airdrop token."], name: "airdrop_token_program" }, { address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", docs: ["Program account: the Associated Token program."], @@ -399,12 +250,7 @@ export default { name: "system_program", }, ], - args: [ - { - name: "amount", - type: "u64", - }, - ], + args: [{ name: "amount", type: "u64" }], discriminator: [111, 92, 142, 79, 33, 234, 82, 27], docs: [ "Claws back the unclaimed tokens from the campaign.", @@ -447,14 +293,7 @@ export default { { docs: ["Write account: the treasury account that holds the fees."], name: "treasury", - pda: { - seeds: [ - { - kind: "const", - value: [116, 114, 101, 97, 115, 117, 114, 121], - }, - ], - }, + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, writable: true, }, ], @@ -483,49 +322,20 @@ export default { }, { accounts: [ - { - docs: ["Write account: the creator of the campaign."], - name: "creator", - signer: true, - writable: true, - }, - { - docs: ["Read account: the mint account of the airdrop token."], - name: "airdrop_token_mint", - }, + { docs: ["Write account: the creator of the campaign."], name: "creator", signer: true, writable: true }, + { docs: ["Read account: the mint account of the airdrop token."], name: "airdrop_token_mint" }, { docs: ["Create account: the account storing the campaign data."], name: "campaign", pda: { seeds: [ - { - kind: "const", - value: [99, 97, 109, 112, 97, 105, 103, 110], - }, - { - kind: "account", - path: "creator", - }, - { - kind: "arg", - path: "merkle_root", - }, - { - kind: "arg", - path: "campaign_start_time", - }, - { - kind: "arg", - path: "expiration_time", - }, - { - kind: "arg", - path: "name", - }, - { - kind: "account", - path: "airdrop_token_mint", - }, + { kind: "const", value: [99, 97, 109, 112, 97, 105, 103, 110] }, + { kind: "account", path: "creator" }, + { kind: "arg", path: "merkle_root" }, + { kind: "arg", path: "campaign_start_time" }, + { kind: "arg", path: "expiration_time" }, + { kind: "arg", path: "name" }, + { kind: "account", path: "airdrop_token_mint" }, ], }, writable: true, @@ -542,26 +352,14 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "campaign", - }, - { - kind: "account", - path: "airdrop_token_program", - }, - { - kind: "account", - path: "airdrop_token_mint", - }, + { kind: "account", path: "campaign" }, + { kind: "account", path: "airdrop_token_program" }, + { kind: "account", path: "airdrop_token_mint" }, ], }, writable: true, }, - { - docs: ["Program account: the Token program of the airdrop token."], - name: "airdrop_token_program", - }, + { docs: ["Program account: the Token program of the airdrop token."], name: "airdrop_token_program" }, { address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", docs: ["Program account: the Associated Token program."], @@ -574,36 +372,13 @@ export default { }, ], args: [ - { - name: "merkle_root", - type: { - array: ["u8", 32], - }, - }, - { - name: "campaign_start_time", - type: "u64", - }, - { - name: "expiration_time", - type: "u64", - }, - { - name: "name", - type: "string", - }, - { - name: "ipfs_cid", - type: "string", - }, - { - name: "aggregate_amount", - type: "u64", - }, - { - name: "recipient_count", - type: "u32", - }, + { name: "merkle_root", type: { array: ["u8", 32] } }, + { name: "campaign_start_time", type: "u64" }, + { name: "expiration_time", type: "u64" }, + { name: "name", type: "string" }, + { name: "ipfs_cid", type: "string" }, + { name: "aggregate_amount", type: "u64" }, + { name: "recipient_count", type: "u32" }, ], discriminator: [111, 131, 187, 98, 160, 193, 114, 244], docs: [ @@ -634,12 +409,7 @@ export default { name: "create_campaign", }, { - accounts: [ - { - docs: ["Read account: the account storing the campaign data."], - name: "campaign", - }, - ], + accounts: [{ docs: ["Read account: the account storing the campaign data."], name: "campaign" }], args: [], discriminator: [135, 101, 171, 220, 86, 97, 104, 199], docs: [ @@ -654,37 +424,20 @@ export default { }, { accounts: [ - { - docs: ["Read account: the account storing the campaign data."], - name: "campaign", - }, + { docs: ["Read account: the account storing the campaign data."], name: "campaign" }, { docs: ["Read account: the claim receipt."], name: "claim_receipt", pda: { seeds: [ - { - kind: "const", - value: [99, 108, 97, 105, 109, 95, 114, 101, 99, 101, 105, 112, 116], - }, - { - kind: "account", - path: "campaign", - }, - { - kind: "arg", - path: "_index", - }, + { kind: "const", value: [99, 108, 97, 105, 109, 95, 114, 101, 99, 101, 105, 112, 116] }, + { kind: "account", path: "campaign" }, + { kind: "arg", path: "_index" }, ], }, }, ], - args: [ - { - name: "_index", - type: "u32", - }, - ], + args: [{ name: "_index", type: "u32" }], discriminator: [182, 195, 167, 56, 232, 3, 223, 102], docs: [ "Returns a flag indicating whether a claim has been made for the given index.", @@ -701,12 +454,7 @@ export default { returns: "bool", }, { - accounts: [ - { - docs: ["Read account: the account storing the campaign data."], - name: "campaign", - }, - ], + accounts: [{ docs: ["Read account: the account storing the campaign data."], name: "campaign" }], args: [], discriminator: [24, 138, 30, 86, 92, 38, 143, 129], docs: [ @@ -720,12 +468,7 @@ export default { returns: "bool", }, { - accounts: [ - { - docs: ["Read account: the account storing the campaign data."], - name: "campaign", - }, - ], + accounts: [{ docs: ["Read account: the account storing the campaign data."], name: "campaign" }], args: [], discriminator: [223, 150, 181, 32, 240, 136, 73, 236], docs: [ @@ -745,23 +488,11 @@ export default { }, { accounts: [ - { - docs: ["Write account: the initializer of the program."], - name: "initializer", - signer: true, - writable: true, - }, + { docs: ["Write account: the initializer of the program."], name: "initializer", signer: true, writable: true }, { docs: ["Create account: the treasury account that will hold the fees."], name: "treasury", - pda: { - seeds: [ - { - kind: "const", - value: [116, 114, 101, 97, 115, 117, 114, 121], - }, - ], - }, + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, writable: true, }, { @@ -771,18 +502,9 @@ export default { }, ], args: [ - { - name: "fee_collector", - type: "pubkey", - }, - { - name: "chainlink_program", - type: "pubkey", - }, - { - name: "chainlink_sol_usd_feed", - type: "pubkey", - }, + { name: "fee_collector", type: "pubkey" }, + { name: "chainlink_program", type: "pubkey" }, + { name: "chainlink_sol_usd_feed", type: "pubkey" }, ], discriminator: [175, 175, 109, 31, 13, 152, 155, 237], docs: [ @@ -805,77 +527,32 @@ export default { { docs: ["Read account: the account storing the treasury details."], name: "treasury", - pda: { - seeds: [ - { - kind: "const", - value: [116, 114, 101, 97, 115, 117, 114, 121], - }, - ], - }, + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, }, ], args: [], discriminator: [247, 160, 213, 237, 247, 121, 164, 82], docs: ["Returns the treasury details."], name: "treasury_view", - returns: { - defined: { - name: "Treasury", - }, - }, + returns: { defined: { name: "Treasury" } }, }, ], - metadata: { - description: "Created with Anchor", - name: "sablier_merkle_instant", - spec: "0.1.0", - version: "0.1.0", - }, + metadata: { description: "Created with Anchor", name: "sablier_merkle_instant", spec: "0.1.0", version: "0.1.0" }, types: [ { docs: ["Groups all the data for a Merkle Instant campaign."], name: "Campaign", type: { fields: [ - { - name: "airdrop_token_mint", - type: "pubkey", - }, - { - name: "bump", - type: "u8", - }, - { - name: "campaign_start_time", - type: "u64", - }, - { - name: "creator", - type: "pubkey", - }, - { - name: "expiration_time", - type: "u64", - }, - { - name: "first_claim_time", - type: "u64", - }, - { - name: "ipfs_cid", - type: "string", - }, - { - name: "merkle_root", - type: { - array: ["u8", 32], - }, - }, - { - name: "name", - type: "string", - }, + { name: "airdrop_token_mint", type: "pubkey" }, + { name: "bump", type: "u8" }, + { name: "campaign_start_time", type: "u64" }, + { name: "creator", type: "pubkey" }, + { name: "expiration_time", type: "u64" }, + { name: "first_claim_time", type: "u64" }, + { name: "ipfs_cid", type: "string" }, + { name: "merkle_root", type: { array: ["u8", 32] } }, + { name: "name", type: "string" }, ], kind: "struct", }, @@ -884,65 +561,26 @@ export default { name: "Claim", type: { fields: [ - { - name: "amount", - type: "u64", - }, - { - name: "campaign", - type: "pubkey", - }, - { - name: "claimer", - type: "pubkey", - }, - { - name: "claim_receipt", - type: "pubkey", - }, - { - name: "fee_in_lamports", - type: "u64", - }, - { - name: "index", - type: "u32", - }, - { - name: "recipient", - type: "pubkey", - }, + { name: "amount", type: "u64" }, + { name: "campaign", type: "pubkey" }, + { name: "claimer", type: "pubkey" }, + { name: "claim_receipt", type: "pubkey" }, + { name: "fee_in_lamports", type: "u64" }, + { name: "index", type: "u32" }, + { name: "recipient", type: "pubkey" }, ], kind: "struct", }, }, - { - name: "ClaimReceipt", - type: { - fields: [], - kind: "struct", - }, - }, + { name: "ClaimReceipt", type: { fields: [], kind: "struct" } }, { name: "Clawback", type: { fields: [ - { - name: "amount", - type: "u64", - }, - { - name: "campaign", - type: "pubkey", - }, - { - name: "campaign_creator", - type: "pubkey", - }, - { - name: "clawback_recipient", - type: "pubkey", - }, + { name: "amount", type: "u64" }, + { name: "campaign", type: "pubkey" }, + { name: "campaign_creator", type: "pubkey" }, + { name: "clawback_recipient", type: "pubkey" }, ], kind: "struct", }, @@ -951,52 +589,17 @@ export default { name: "CreateCampaign", type: { fields: [ - { - name: "aggregate_amount", - type: "u64", - }, - { - name: "campaign", - type: "pubkey", - }, - { - name: "campaign_name", - type: "string", - }, - { - name: "campaign_start_time", - type: "u64", - }, - { - name: "creator", - type: "pubkey", - }, - { - name: "expiration_time", - type: "u64", - }, - { - name: "ipfs_cid", - type: "string", - }, - { - name: "merkle_root", - type: { - array: ["u8", 32], - }, - }, - { - name: "recipient_count", - type: "u32", - }, - { - name: "token_decimals", - type: "u8", - }, - { - name: "token_mint", - type: "pubkey", - }, + { name: "aggregate_amount", type: "u64" }, + { name: "campaign", type: "pubkey" }, + { name: "campaign_name", type: "string" }, + { name: "campaign_start_time", type: "u64" }, + { name: "creator", type: "pubkey" }, + { name: "expiration_time", type: "u64" }, + { name: "ipfs_cid", type: "string" }, + { name: "merkle_root", type: { array: ["u8", 32] } }, + { name: "recipient_count", type: "u32" }, + { name: "token_decimals", type: "u8" }, + { name: "token_mint", type: "pubkey" }, ], kind: "struct", }, @@ -1005,18 +608,9 @@ export default { name: "FeesCollected", type: { fields: [ - { - name: "fee_amount", - type: "u64", - }, - { - name: "fee_collector", - type: "pubkey", - }, - { - name: "fee_recipient", - type: "pubkey", - }, + { name: "fee_amount", type: "u64" }, + { name: "fee_collector", type: "pubkey" }, + { name: "fee_recipient", type: "pubkey" }, ], kind: "struct", }, @@ -1025,22 +619,10 @@ export default { name: "Treasury", type: { fields: [ - { - name: "bump", - type: "u8", - }, - { - name: "fee_collector", - type: "pubkey", - }, - { - name: "chainlink_program", - type: "pubkey", - }, - { - name: "chainlink_sol_usd_feed", - type: "pubkey", - }, + { name: "bump", type: "u8" }, + { name: "fee_collector", type: "pubkey" }, + { name: "chainlink_program", type: "pubkey" }, + { name: "chainlink_sol_usd_feed", type: "pubkey" }, ], kind: "struct", }, diff --git a/src/solana/idl/airdrops/v1.0/SablierMerkleInstantV10Type.ts b/src/solana/idl/airdrops/v1.0/SablierMerkleInstantType.ts similarity index 58% rename from src/solana/idl/airdrops/v1.0/SablierMerkleInstantV10Type.ts rename to src/solana/idl/airdrops/v1.0/SablierMerkleInstantType.ts index bd6563f..9100a30 100644 --- a/src/solana/idl/airdrops/v1.0/SablierMerkleInstantV10Type.ts +++ b/src/solana/idl/airdrops/v1.0/SablierMerkleInstantType.ts @@ -1,17 +1,11 @@ /** * Program IDL in camelCase format in order to be used in JS/TS. * - * Note that this is only a type helper and is not the actual IDL. The original - * IDL can be found at `target/idl/sablier_merkle_instant.json`. + * Note that this is only a type helper and is not the actual IDL. */ -type Idl = { +export type Idl = { address: "7XrxoQejBoGouW4V3aozTSwub7xSDjYqB4Go7YLjF9rV"; - metadata: { - name: "sablierMerkleInstant"; - version: "0.1.0"; - spec: "0.1.0"; - description: "Created with Anchor"; - }; + metadata: { name: "sablierMerkleInstant"; version: "0.1.0"; spec: "0.1.0"; description: "Created with Anchor" }; docs: ["Sablier Merkle Instant program for creating and managing Merkle tree-based airdrop campaigns."]; instructions: [ { @@ -24,18 +18,9 @@ type Idl = { "- `campaign` The account that stores the campaign details.", ]; discriminator: [188, 126, 110, 5, 183, 113, 158, 3]; - accounts: [ - { - name: "campaign"; - docs: ["Read account: the account storing the campaign data."]; - }, - ]; + accounts: [{ name: "campaign"; docs: ["Read account: the account storing the campaign data."] }]; args: []; - returns: { - defined: { - name: "campaign"; - }; - }; + returns: { defined: { name: "campaign" } }; }, { name: "claim"; @@ -80,28 +65,16 @@ type Idl = { writable: true; signer: true; }, - { - name: "recipient"; - docs: ["Read account: the recipient of the airdrop."]; - }, + { name: "recipient"; docs: ["Read account: the recipient of the airdrop."] }, { name: "recipientAta"; docs: ["Create if needed account: the ATA for airdrop token owned by the recipient."]; writable: true; pda: { seeds: [ - { - kind: "account"; - path: "recipient"; - }, - { - kind: "account"; - path: "airdropTokenProgram"; - }, - { - kind: "account"; - path: "airdropTokenMint"; - }, + { kind: "account"; path: "recipient" }, + { kind: "account"; path: "airdropTokenProgram" }, + { kind: "account"; path: "airdropTokenMint" }, ]; program: { kind: "const"; @@ -146,42 +119,19 @@ type Idl = { name: "treasury"; docs: ["Write account: the treasury account that will receive the claim fee."]; writable: true; - pda: { - seeds: [ - { - kind: "const"; - value: [116, 114, 101, 97, 115, 117, 114, 121]; - }, - ]; - }; - }, - { - name: "airdropTokenMint"; - docs: ["Read account: the mint account of the airdrop token."]; - }, - { - name: "campaign"; - docs: ["Write account: the account storing the campaign data."]; - writable: true; + pda: { seeds: [{ kind: "const"; value: [116, 114, 101, 97, 115, 117, 114, 121] }] }; }, + { name: "airdropTokenMint"; docs: ["Read account: the mint account of the airdrop token."] }, + { name: "campaign"; docs: ["Write account: the account storing the campaign data."]; writable: true }, { name: "campaignAta"; docs: ["Write account: the campaign's ATA for the airdrop token."]; writable: true; pda: { seeds: [ - { - kind: "account"; - path: "campaign"; - }, - { - kind: "account"; - path: "airdropTokenProgram"; - }, - { - kind: "account"; - path: "airdropTokenMint"; - }, + { kind: "account"; path: "campaign" }, + { kind: "account"; path: "airdropTokenProgram" }, + { kind: "account"; path: "airdropTokenMint" }, ]; program: { kind: "const"; @@ -228,25 +178,13 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "const"; - value: [99, 108, 97, 105, 109, 95, 114, 101, 99, 101, 105, 112, 116]; - }, - { - kind: "account"; - path: "campaign"; - }, - { - kind: "arg"; - path: "index"; - }, + { kind: "const"; value: [99, 108, 97, 105, 109, 95, 114, 101, 99, 101, 105, 112, 116] }, + { kind: "account"; path: "campaign" }, + { kind: "arg"; path: "index" }, ]; }; }, - { - name: "airdropTokenProgram"; - docs: ["Program account: the Token program of the airdrop token."]; - }, + { name: "airdropTokenProgram"; docs: ["Program account: the Token program of the airdrop token."] }, { name: "associatedTokenProgram"; docs: ["Program account: the Associated Token program."]; @@ -256,10 +194,7 @@ type Idl = { name: "chainlinkProgram"; docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."]; }, - { - name: "chainlinkSolUsdFeed"; - docs: ["Read account: The account providing the SOL/USD price feed data."]; - }, + { name: "chainlinkSolUsdFeed"; docs: ["Read account: The account providing the SOL/USD price feed data."] }, { name: "systemProgram"; docs: ["Program account: the System program."]; @@ -267,22 +202,9 @@ type Idl = { }, ]; args: [ - { - name: "index"; - type: "u32"; - }, - { - name: "amount"; - type: "u64"; - }, - { - name: "merkleProof"; - type: { - vec: { - array: ["u8", 32]; - }; - }; - }, + { name: "index"; type: "u32" }, + { name: "amount"; type: "u64" }, + { name: "merkleProof"; type: { vec: { array: ["u8", 32] } } }, ]; }, { @@ -300,23 +222,13 @@ type Idl = { { name: "treasury"; docs: ["Read account: the treasury account that receives the claim fee."]; - pda: { - seeds: [ - { - kind: "const"; - value: [116, 114, 101, 97, 115, 117, 114, 121]; - }, - ]; - }; + pda: { seeds: [{ kind: "const"; value: [116, 114, 101, 97, 115, 117, 114, 121] }] }; }, { name: "chainlinkProgram"; docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."]; }, - { - name: "chainlinkSolUsdFeed"; - docs: ["Read account: The account providing the SOL/USD price feed data."]; - }, + { name: "chainlinkSolUsdFeed"; docs: ["Read account: The account providing the SOL/USD price feed data."] }, ]; args: []; returns: "u64"; @@ -355,28 +267,16 @@ type Idl = { writable: true; signer: true; }, - { - name: "clawbackRecipient"; - docs: ["Read account: the clawback recipient."]; - }, + { name: "clawbackRecipient"; docs: ["Read account: the clawback recipient."] }, { name: "clawbackRecipientAta"; docs: ["Create if needed account: the clawback recipient's ATA for the airdrop token."]; writable: true; pda: { seeds: [ - { - kind: "account"; - path: "clawbackRecipient"; - }, - { - kind: "account"; - path: "airdropTokenProgram"; - }, - { - kind: "account"; - path: "airdropTokenMint"; - }, + { kind: "account"; path: "clawbackRecipient" }, + { kind: "account"; path: "airdropTokenProgram" }, + { kind: "account"; path: "airdropTokenMint" }, ]; program: { kind: "const"; @@ -417,32 +317,17 @@ type Idl = { }; }; }, - { - name: "airdropTokenMint"; - docs: ["Read account: the mint account of the airdrop token."]; - }, - { - name: "campaign"; - docs: ["Read account: the account storing the campaign data."]; - }, + { name: "airdropTokenMint"; docs: ["Read account: the mint account of the airdrop token."] }, + { name: "campaign"; docs: ["Read account: the account storing the campaign data."] }, { name: "campaignAta"; docs: ["Write account: the campaign's ATA for the airdrop token."]; writable: true; pda: { seeds: [ - { - kind: "account"; - path: "campaign"; - }, - { - kind: "account"; - path: "airdropTokenProgram"; - }, - { - kind: "account"; - path: "airdropTokenMint"; - }, + { kind: "account"; path: "campaign" }, + { kind: "account"; path: "airdropTokenProgram" }, + { kind: "account"; path: "airdropTokenMint" }, ]; program: { kind: "const"; @@ -483,10 +368,7 @@ type Idl = { }; }; }, - { - name: "airdropTokenProgram"; - docs: ["Program account: the Token program of the airdrop token."]; - }, + { name: "airdropTokenProgram"; docs: ["Program account: the Token program of the airdrop token."] }, { name: "associatedTokenProgram"; docs: ["Program account: the Associated Token program."]; @@ -498,12 +380,7 @@ type Idl = { address: "11111111111111111111111111111111"; }, ]; - args: [ - { - name: "amount"; - type: "u64"; - }, - ]; + args: [{ name: "amount"; type: "u64" }]; }, { name: "collectFees"; @@ -542,14 +419,7 @@ type Idl = { name: "treasury"; docs: ["Write account: the treasury account that holds the fees."]; writable: true; - pda: { - seeds: [ - { - kind: "const"; - value: [116, 114, 101, 97, 115, 117, 114, 121]; - }, - ]; - }; + pda: { seeds: [{ kind: "const"; value: [116, 114, 101, 97, 115, 117, 114, 121] }] }; }, ]; args: []; @@ -583,50 +453,21 @@ type Idl = { ]; discriminator: [111, 131, 187, 98, 160, 193, 114, 244]; accounts: [ - { - name: "creator"; - docs: ["Write account: the creator of the campaign."]; - writable: true; - signer: true; - }, - { - name: "airdropTokenMint"; - docs: ["Read account: the mint account of the airdrop token."]; - }, + { name: "creator"; docs: ["Write account: the creator of the campaign."]; writable: true; signer: true }, + { name: "airdropTokenMint"; docs: ["Read account: the mint account of the airdrop token."] }, { name: "campaign"; docs: ["Create account: the account storing the campaign data."]; writable: true; pda: { seeds: [ - { - kind: "const"; - value: [99, 97, 109, 112, 97, 105, 103, 110]; - }, - { - kind: "account"; - path: "creator"; - }, - { - kind: "arg"; - path: "merkleRoot"; - }, - { - kind: "arg"; - path: "campaignStartTime"; - }, - { - kind: "arg"; - path: "expirationTime"; - }, - { - kind: "arg"; - path: "name"; - }, - { - kind: "account"; - path: "airdropTokenMint"; - }, + { kind: "const"; value: [99, 97, 109, 112, 97, 105, 103, 110] }, + { kind: "account"; path: "creator" }, + { kind: "arg"; path: "merkleRoot" }, + { kind: "arg"; path: "campaignStartTime" }, + { kind: "arg"; path: "expirationTime" }, + { kind: "arg"; path: "name" }, + { kind: "account"; path: "airdropTokenMint" }, ]; }; }, @@ -636,18 +477,9 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "account"; - path: "campaign"; - }, - { - kind: "account"; - path: "airdropTokenProgram"; - }, - { - kind: "account"; - path: "airdropTokenMint"; - }, + { kind: "account"; path: "campaign" }, + { kind: "account"; path: "airdropTokenProgram" }, + { kind: "account"; path: "airdropTokenMint" }, ]; program: { kind: "const"; @@ -688,10 +520,7 @@ type Idl = { }; }; }, - { - name: "airdropTokenProgram"; - docs: ["Program account: the Token program of the airdrop token."]; - }, + { name: "airdropTokenProgram"; docs: ["Program account: the Token program of the airdrop token."] }, { name: "associatedTokenProgram"; docs: ["Program account: the Associated Token program."]; @@ -704,36 +533,13 @@ type Idl = { }, ]; args: [ - { - name: "merkleRoot"; - type: { - array: ["u8", 32]; - }; - }, - { - name: "campaignStartTime"; - type: "u64"; - }, - { - name: "expirationTime"; - type: "u64"; - }, - { - name: "name"; - type: "string"; - }, - { - name: "ipfsCid"; - type: "string"; - }, - { - name: "aggregateAmount"; - type: "u64"; - }, - { - name: "recipientCount"; - type: "u32"; - }, + { name: "merkleRoot"; type: { array: ["u8", 32] } }, + { name: "campaignStartTime"; type: "u64" }, + { name: "expirationTime"; type: "u64" }, + { name: "name"; type: "string" }, + { name: "ipfsCid"; type: "string" }, + { name: "aggregateAmount"; type: "u64" }, + { name: "recipientCount"; type: "u32" }, ]; }, { @@ -746,12 +552,7 @@ type Idl = { "- `campaign` The account that stores the campaign details.", ]; discriminator: [135, 101, 171, 220, 86, 97, 104, 199]; - accounts: [ - { - name: "campaign"; - docs: ["Read account: the account storing the campaign data."]; - }, - ]; + accounts: [{ name: "campaign"; docs: ["Read account: the account storing the campaign data."] }]; args: []; returns: "bool"; }, @@ -770,37 +571,20 @@ type Idl = { ]; discriminator: [182, 195, 167, 56, 232, 3, 223, 102]; accounts: [ - { - name: "campaign"; - docs: ["Read account: the account storing the campaign data."]; - }, + { name: "campaign"; docs: ["Read account: the account storing the campaign data."] }, { name: "claimReceipt"; docs: ["Read account: the claim receipt."]; pda: { seeds: [ - { - kind: "const"; - value: [99, 108, 97, 105, 109, 95, 114, 101, 99, 101, 105, 112, 116]; - }, - { - kind: "account"; - path: "campaign"; - }, - { - kind: "arg"; - path: "index"; - }, + { kind: "const"; value: [99, 108, 97, 105, 109, 95, 114, 101, 99, 101, 105, 112, 116] }, + { kind: "account"; path: "campaign" }, + { kind: "arg"; path: "index" }, ]; }; }, ]; - args: [ - { - name: "index"; - type: "u32"; - }, - ]; + args: [{ name: "index"; type: "u32" }]; returns: "bool"; }, { @@ -813,12 +597,7 @@ type Idl = { "- `campaign` The account that stores the campaign details.", ]; discriminator: [24, 138, 30, 86, 92, 38, 143, 129]; - accounts: [ - { - name: "campaign"; - docs: ["Read account: the account storing the campaign data."]; - }, - ]; + accounts: [{ name: "campaign"; docs: ["Read account: the account storing the campaign data."] }]; args: []; returns: "bool"; }, @@ -837,12 +616,7 @@ type Idl = { "seven days after the first claim.", ]; discriminator: [223, 150, 181, 32, 240, 136, 73, 236]; - accounts: [ - { - name: "campaign"; - docs: ["Read account: the account storing the campaign data."]; - }, - ]; + accounts: [{ name: "campaign"; docs: ["Read account: the account storing the campaign data."] }]; args: []; returns: "bool"; }, @@ -863,24 +637,12 @@ type Idl = { ]; discriminator: [175, 175, 109, 31, 13, 152, 155, 237]; accounts: [ - { - name: "initializer"; - docs: ["Write account: the initializer of the program."]; - writable: true; - signer: true; - }, + { name: "initializer"; docs: ["Write account: the initializer of the program."]; writable: true; signer: true }, { name: "treasury"; docs: ["Create account: the treasury account that will hold the fees."]; writable: true; - pda: { - seeds: [ - { - kind: "const"; - value: [116, 114, 101, 97, 115, 117, 114, 121]; - }, - ]; - }; + pda: { seeds: [{ kind: "const"; value: [116, 114, 101, 97, 115, 117, 114, 121] }] }; }, { name: "systemProgram"; @@ -889,18 +651,9 @@ type Idl = { }, ]; args: [ - { - name: "feeCollector"; - type: "pubkey"; - }, - { - name: "chainlinkProgram"; - type: "pubkey"; - }, - { - name: "chainlinkSolUsdFeed"; - type: "pubkey"; - }, + { name: "feeCollector"; type: "pubkey" }, + { name: "chainlinkProgram"; type: "pubkey" }, + { name: "chainlinkSolUsdFeed"; type: "pubkey" }, ]; }, { @@ -911,82 +664,34 @@ type Idl = { { name: "treasury"; docs: ["Read account: the account storing the treasury details."]; - pda: { - seeds: [ - { - kind: "const"; - value: [116, 114, 101, 97, 115, 117, 114, 121]; - }, - ]; - }; + pda: { seeds: [{ kind: "const"; value: [116, 114, 101, 97, 115, 117, 114, 121] }] }; }, ]; args: []; - returns: { - defined: { - name: "treasury"; - }; - }; + returns: { defined: { name: "treasury" } }; }, ]; accounts: [ - { - name: "campaign"; - discriminator: [50, 40, 49, 11, 157, 220, 229, 192]; - }, - { - name: "claimReceipt"; - discriminator: [223, 233, 11, 229, 124, 165, 207, 28]; - }, - { - name: "treasury"; - discriminator: [238, 239, 123, 238, 89, 1, 168, 253]; - }, + { name: "campaign"; discriminator: [50, 40, 49, 11, 157, 220, 229, 192] }, + { name: "claimReceipt"; discriminator: [223, 233, 11, 229, 124, 165, 207, 28] }, + { name: "treasury"; discriminator: [238, 239, 123, 238, 89, 1, 168, 253] }, ]; events: [ - { - name: "claim"; - discriminator: [133, 98, 9, 238, 133, 207, 191, 113]; - }, - { - name: "clawback"; - discriminator: [239, 144, 30, 69, 80, 59, 142, 64]; - }, - { - name: "createCampaign"; - discriminator: [88, 178, 212, 72, 110, 4, 68, 143]; - }, - { - name: "feesCollected"; - discriminator: [233, 23, 117, 225, 107, 178, 254, 8]; - }, + { name: "claim"; discriminator: [133, 98, 9, 238, 133, 207, 191, 113] }, + { name: "clawback"; discriminator: [239, 144, 30, 69, 80, 59, 142, 64] }, + { name: "createCampaign"; discriminator: [88, 178, 212, 72, 110, 4, 68, 143] }, + { name: "feesCollected"; discriminator: [233, 23, 117, 225, 107, 178, 254, 8] }, ]; errors: [ - { - code: 6000; - name: "campaignExpired"; - msg: "Campaign has expired!"; - }, - { - code: 6001; - name: "invalidMerkleProof"; - msg: "Invalid Merkle proof!"; - }, - { - code: 6002; - name: "campaignNotStarted"; - msg: "Campaign has not started yet!"; - }, + { code: 6000; name: "campaignExpired"; msg: "Campaign has expired!" }, + { code: 6001; name: "invalidMerkleProof"; msg: "Invalid Merkle proof!" }, + { code: 6002; name: "campaignNotStarted"; msg: "Campaign has not started yet!" }, { code: 6003; name: "clawbackNotAllowed"; msg: "Clawback not allowed past the grace period and before campaign expiration!"; }, - { - code: 6004; - name: "cantCollectZeroFees"; - msg: "Can't collect zero fees!"; - }, + { code: 6004; name: "cantCollectZeroFees"; msg: "Can't collect zero fees!" }, ]; types: [ { @@ -995,44 +700,15 @@ type Idl = { type: { kind: "struct"; fields: [ - { - name: "airdropTokenMint"; - type: "pubkey"; - }, - { - name: "bump"; - type: "u8"; - }, - { - name: "campaignStartTime"; - type: "u64"; - }, - { - name: "creator"; - type: "pubkey"; - }, - { - name: "expirationTime"; - type: "u64"; - }, - { - name: "firstClaimTime"; - type: "u64"; - }, - { - name: "ipfsCid"; - type: "string"; - }, - { - name: "merkleRoot"; - type: { - array: ["u8", 32]; - }; - }, - { - name: "name"; - type: "string"; - }, + { name: "airdropTokenMint"; type: "pubkey" }, + { name: "bump"; type: "u8" }, + { name: "campaignStartTime"; type: "u64" }, + { name: "creator"; type: "pubkey" }, + { name: "expirationTime"; type: "u64" }, + { name: "firstClaimTime"; type: "u64" }, + { name: "ipfsCid"; type: "string" }, + { name: "merkleRoot"; type: { array: ["u8", 32] } }, + { name: "name"; type: "string" }, ]; }; }, @@ -1041,65 +717,26 @@ type Idl = { type: { kind: "struct"; fields: [ - { - name: "amount"; - type: "u64"; - }, - { - name: "campaign"; - type: "pubkey"; - }, - { - name: "claimer"; - type: "pubkey"; - }, - { - name: "claimReceipt"; - type: "pubkey"; - }, - { - name: "feeInLamports"; - type: "u64"; - }, - { - name: "index"; - type: "u32"; - }, - { - name: "recipient"; - type: "pubkey"; - }, + { name: "amount"; type: "u64" }, + { name: "campaign"; type: "pubkey" }, + { name: "claimer"; type: "pubkey" }, + { name: "claimReceipt"; type: "pubkey" }, + { name: "feeInLamports"; type: "u64" }, + { name: "index"; type: "u32" }, + { name: "recipient"; type: "pubkey" }, ]; }; }, - { - name: "claimReceipt"; - type: { - kind: "struct"; - fields: []; - }; - }, + { name: "claimReceipt"; type: { kind: "struct"; fields: [] } }, { name: "clawback"; type: { kind: "struct"; fields: [ - { - name: "amount"; - type: "u64"; - }, - { - name: "campaign"; - type: "pubkey"; - }, - { - name: "campaignCreator"; - type: "pubkey"; - }, - { - name: "clawbackRecipient"; - type: "pubkey"; - }, + { name: "amount"; type: "u64" }, + { name: "campaign"; type: "pubkey" }, + { name: "campaignCreator"; type: "pubkey" }, + { name: "clawbackRecipient"; type: "pubkey" }, ]; }; }, @@ -1108,52 +745,17 @@ type Idl = { type: { kind: "struct"; fields: [ - { - name: "aggregateAmount"; - type: "u64"; - }, - { - name: "campaign"; - type: "pubkey"; - }, - { - name: "campaignName"; - type: "string"; - }, - { - name: "campaignStartTime"; - type: "u64"; - }, - { - name: "creator"; - type: "pubkey"; - }, - { - name: "expirationTime"; - type: "u64"; - }, - { - name: "ipfsCid"; - type: "string"; - }, - { - name: "merkleRoot"; - type: { - array: ["u8", 32]; - }; - }, - { - name: "recipientCount"; - type: "u32"; - }, - { - name: "tokenDecimals"; - type: "u8"; - }, - { - name: "tokenMint"; - type: "pubkey"; - }, + { name: "aggregateAmount"; type: "u64" }, + { name: "campaign"; type: "pubkey" }, + { name: "campaignName"; type: "string" }, + { name: "campaignStartTime"; type: "u64" }, + { name: "creator"; type: "pubkey" }, + { name: "expirationTime"; type: "u64" }, + { name: "ipfsCid"; type: "string" }, + { name: "merkleRoot"; type: { array: ["u8", 32] } }, + { name: "recipientCount"; type: "u32" }, + { name: "tokenDecimals"; type: "u8" }, + { name: "tokenMint"; type: "pubkey" }, ]; }; }, @@ -1162,18 +764,9 @@ type Idl = { type: { kind: "struct"; fields: [ - { - name: "feeAmount"; - type: "u64"; - }, - { - name: "feeCollector"; - type: "pubkey"; - }, - { - name: "feeRecipient"; - type: "pubkey"; - }, + { name: "feeAmount"; type: "u64" }, + { name: "feeCollector"; type: "pubkey" }, + { name: "feeRecipient"; type: "pubkey" }, ]; }; }, @@ -1182,26 +775,12 @@ type Idl = { type: { kind: "struct"; fields: [ - { - name: "bump"; - type: "u8"; - }, - { - name: "feeCollector"; - type: "pubkey"; - }, - { - name: "chainlinkProgram"; - type: "pubkey"; - }, - { - name: "chainlinkSolUsdFeed"; - type: "pubkey"; - }, + { name: "bump"; type: "u8" }, + { name: "feeCollector"; type: "pubkey" }, + { name: "chainlinkProgram"; type: "pubkey" }, + { name: "chainlinkSolUsdFeed"; type: "pubkey" }, ]; }; }, ]; }; - -export default Idl; diff --git a/src/solana/idl/airdrops/v1.0/index.ts b/src/solana/idl/airdrops/v1.0/index.ts index 35e465c..5260b87 100644 --- a/src/solana/idl/airdrops/v1.0/index.ts +++ b/src/solana/idl/airdrops/v1.0/index.ts @@ -1,2 +1,2 @@ -export { default as SablierMerkleInstantV10IDL } from "./SablierMerkleInstantV10"; -export type { default as SablierMerkleInstantV10Type } from "./SablierMerkleInstantV10Type"; +export { sablierMerkleInstantIdl as SablierMerkleInstantIDL } from "./SablierMerkleInstant"; +export type { Idl as SablierMerkleInstantType } from "./SablierMerkleInstantType"; diff --git a/src/solana/idl/lockup/v1.0/SablierLockupLinearV10.ts b/src/solana/idl/lockup/v1.0/SablierLockupLinear.ts similarity index 55% rename from src/solana/idl/lockup/v1.0/SablierLockupLinearV10.ts rename to src/solana/idl/lockup/v1.0/SablierLockupLinear.ts index 57fa4c9..8f9ba57 100644 --- a/src/solana/idl/lockup/v1.0/SablierLockupLinearV10.ts +++ b/src/solana/idl/lockup/v1.0/SablierLockupLinear.ts @@ -1,118 +1,34 @@ -export default { +export const sablierLockupLinearIDL = { accounts: [ - { - discriminator: [159, 26, 37, 150, 44, 84, 171, 172], - name: "NftCollectionData", - }, - { - discriminator: [61, 89, 148, 141, 154, 81, 86, 113], - name: "StreamData", - }, - { - discriminator: [238, 239, 123, 238, 89, 1, 168, 253], - name: "Treasury", - }, + { discriminator: [159, 26, 37, 150, 44, 84, 171, 172], name: "NftCollectionData" }, + { discriminator: [61, 89, 148, 141, 154, 81, 86, 113], name: "StreamData" }, + { discriminator: [238, 239, 123, 238, 89, 1, 168, 253], name: "Treasury" }, ], address: "4EauRKrNErKfsR4XetEZJNmvACGHbHnHV4R5dvJuqupC", docs: ["Sablier Lockup program for creating and managing token streams."], errors: [ - { - code: 6000, - msg: "Can't perform the action on a depleted stream!", - name: "StreamDepleted", - }, - { - code: 6001, - msg: "Can't renounce an already-renounced Stream!", - name: "StreamCanceled", - }, - { - code: 6002, - msg: "Can't cancel a non-cancelable Stream!", - name: "StreamIsNotCancelable", - }, - { - code: 6003, - msg: "Can't cancel a settled Stream!", - name: "StreamSettled", - }, - { - code: 6004, - msg: "Can't collect zero fees!", - name: "CantCollectZeroFees", - }, - { - code: 6005, - msg: "Invalid cliff time of the Stream!", - name: "CliffTimeNotLessThanEndTime", - }, - { - code: 6006, - msg: "Cliff time zero but unlock amount not zero!", - name: "CliffTimeZeroUnlockAmountNotZero", - }, - { - code: 6007, - msg: "Invalid deposit amount!", - name: "DepositAmountZero", - }, - { - code: 6008, - msg: "Start time must be less than cliff time!", - name: "StartTimeNotLessThanCliffTime", - }, - { - code: 6009, - msg: "Start time must be less than end time!", - name: "StartTimeNotLessThanEndTime", - }, - { - code: 6010, - msg: "Start time can't be zero!", - name: "StartTimeZero", - }, - { - code: 6011, - msg: "Unlock amounts sum is greater than deposit amount!", - name: "UnlockAmountsSumTooHigh", - }, - { - code: 6012, - msg: "Can't renounce a non-cancelable Stream!", - name: "StreamAlreadyNonCancelable", - }, - { - code: 6013, - msg: "Attempting to withdraw more than available in the stream!", - name: "Overdraw", - }, - { - code: 6014, - msg: "Can't withdraw a zero amount!", - name: "WithdrawAmountZero", - }, + { code: 6000, msg: "Can't perform the action on a depleted stream!", name: "StreamDepleted" }, + { code: 6001, msg: "Can't renounce an already-renounced Stream!", name: "StreamCanceled" }, + { code: 6002, msg: "Can't cancel a non-cancelable Stream!", name: "StreamIsNotCancelable" }, + { code: 6003, msg: "Can't cancel a settled Stream!", name: "StreamSettled" }, + { code: 6004, msg: "Can't collect zero fees!", name: "CantCollectZeroFees" }, + { code: 6005, msg: "Invalid cliff time of the Stream!", name: "CliffTimeNotLessThanEndTime" }, + { code: 6006, msg: "Cliff time zero but unlock amount not zero!", name: "CliffTimeZeroUnlockAmountNotZero" }, + { code: 6007, msg: "Invalid deposit amount!", name: "DepositAmountZero" }, + { code: 6008, msg: "Start time must be less than cliff time!", name: "StartTimeNotLessThanCliffTime" }, + { code: 6009, msg: "Start time must be less than end time!", name: "StartTimeNotLessThanEndTime" }, + { code: 6010, msg: "Start time can't be zero!", name: "StartTimeZero" }, + { code: 6011, msg: "Unlock amounts sum is greater than deposit amount!", name: "UnlockAmountsSumTooHigh" }, + { code: 6012, msg: "Can't renounce a non-cancelable Stream!", name: "StreamAlreadyNonCancelable" }, + { code: 6013, msg: "Attempting to withdraw more than available in the stream!", name: "Overdraw" }, + { code: 6014, msg: "Can't withdraw a zero amount!", name: "WithdrawAmountZero" }, ], events: [ - { - discriminator: [82, 106, 117, 112, 153, 245, 190, 66], - name: "CancelLockupStream", - }, - { - discriminator: [234, 181, 19, 52, 67, 64, 151, 173], - name: "CreateLockupLinearStream", - }, - { - discriminator: [233, 23, 117, 225, 107, 178, 254, 8], - name: "FeesCollected", - }, - { - discriminator: [28, 66, 144, 150, 118, 56, 81, 93], - name: "RenounceLockupStream", - }, - { - discriminator: [232, 101, 27, 150, 85, 222, 243, 9], - name: "WithdrawFromLockupStream", - }, + { discriminator: [82, 106, 117, 112, 153, 245, 190, 66], name: "CancelLockupStream" }, + { discriminator: [234, 181, 19, 52, 67, 64, 151, 173], name: "CreateLockupLinearStream" }, + { discriminator: [233, 23, 117, 225, 107, 178, 254, 8], name: "FeesCollected" }, + { discriminator: [28, 66, 144, 150, 118, 56, 81, 93], name: "RenounceLockupStream" }, + { discriminator: [232, 101, 27, 150, 85, 222, 243, 9], name: "WithdrawFromLockupStream" }, ], instructions: [ { @@ -135,39 +51,21 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "sender", - }, - { - kind: "account", - path: "deposited_token_program", - }, - { - kind: "account", - path: "deposited_token_mint", - }, + { kind: "account", path: "sender" }, + { kind: "account", path: "deposited_token_program" }, + { kind: "account", path: "deposited_token_mint" }, ], }, writable: true, }, - { - docs: ["Read account: the mint account of the deposited token."], - name: "deposited_token_mint", - }, + { docs: ["Read account: the mint account of the deposited token."], name: "deposited_token_mint" }, { docs: ["Write account: the stream data account storing stream details."], name: "stream_data", pda: { seeds: [ - { - kind: "const", - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], - }, - { - kind: "account", - path: "stream_nft_mint", - }, + { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account", path: "stream_nft_mint" }, ], }, writable: true, @@ -184,35 +82,20 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "stream_data", - }, - { - kind: "account", - path: "deposited_token_program", - }, - { - kind: "account", - path: "deposited_token_mint", - }, + { kind: "account", path: "stream_data" }, + { kind: "account", path: "deposited_token_program" }, + { kind: "account", path: "deposited_token_mint" }, ], }, writable: true, }, - { - docs: ["Read account: the mint account for the stream NFT."], - name: "stream_nft_mint", - }, + { docs: ["Read account: the mint account for the stream NFT."], name: "stream_nft_mint" }, { address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", docs: ["Program account: the Associated Token program."], name: "associated_token_program", }, - { - docs: ["Program account: the Token program of the deposited token."], - name: "deposited_token_program", - }, + { docs: ["Program account: the Token program of the deposited token."], name: "deposited_token_program" }, { address: "11111111111111111111111111111111", docs: ["Program account: the System program."], @@ -262,14 +145,7 @@ export default { { docs: ["Write account: the treasury account that holds the fees."], name: "treasury", - pda: { - seeds: [ - { - kind: "const", - value: [116, 114, 101, 97, 115, 117, 114, 121], - }, - ], - }, + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, writable: true, }, ], @@ -314,30 +190,15 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "creator", - }, - { - kind: "account", - path: "deposit_token_program", - }, - { - kind: "account", - path: "deposit_token_mint", - }, + { kind: "account", path: "creator" }, + { kind: "account", path: "deposit_token_program" }, + { kind: "account", path: "deposit_token_mint" }, ], }, writable: true, }, - { - docs: ["Read account: the recipient of the stream."], - name: "recipient", - }, - { - docs: ["Read account: the sender of the stream."], - name: "sender", - }, + { docs: ["Read account: the recipient of the stream."], name: "recipient" }, + { docs: ["Read account: the sender of the stream."], name: "sender" }, { docs: ["Write account: the NFT collection data storing the total supply."], name: "nft_collection_data", @@ -355,27 +216,12 @@ export default { docs: ["Write account: the master edition account for the NFT collection."], name: "nft_collection_master_edition", pda: { - program: { - kind: "account", - path: "token_metadata_program", - }, + program: { kind: "account", path: "token_metadata_program" }, seeds: [ - { - kind: "const", - value: [109, 101, 116, 97, 100, 97, 116, 97], - }, - { - kind: "account", - path: "token_metadata_program", - }, - { - kind: "account", - path: "nft_collection_mint", - }, - { - kind: "const", - value: [101, 100, 105, 116, 105, 111, 110], - }, + { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account", path: "token_metadata_program" }, + { kind: "account", path: "nft_collection_mint" }, + { kind: "const", value: [101, 100, 105, 116, 105, 111, 110] }, ], }, }, @@ -383,23 +229,11 @@ export default { docs: ["Write account: the metadata account for the NFT collection."], name: "nft_collection_metadata", pda: { - program: { - kind: "account", - path: "token_metadata_program", - }, + program: { kind: "account", path: "token_metadata_program" }, seeds: [ - { - kind: "const", - value: [109, 101, 116, 97, 100, 97, 116, 97], - }, - { - kind: "account", - path: "token_metadata_program", - }, - { - kind: "account", - path: "nft_collection_mint", - }, + { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account", path: "token_metadata_program" }, + { kind: "account", path: "nft_collection_mint" }, ], }, writable: true, @@ -416,27 +250,15 @@ export default { ], }, }, - { - docs: ["Read account: the mint account for the deposit token."], - name: "deposit_token_mint", - }, + { docs: ["Read account: the mint account for the deposit token."], name: "deposit_token_mint" }, { docs: ["Create account: the mint account for the stream NFT."], name: "stream_nft_mint", pda: { seeds: [ - { - kind: "const", - value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116], - }, - { - kind: "account", - path: "sender", - }, - { - kind: "arg", - path: "salt", - }, + { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116] }, + { kind: "account", path: "sender" }, + { kind: "arg", path: "salt" }, ], }, writable: true, @@ -453,18 +275,9 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "recipient", - }, - { - kind: "account", - path: "nft_token_program", - }, - { - kind: "account", - path: "stream_nft_mint", - }, + { kind: "account", path: "recipient" }, + { kind: "account", path: "nft_token_program" }, + { kind: "account", path: "stream_nft_mint" }, ], }, writable: true, @@ -474,14 +287,8 @@ export default { name: "stream_data", pda: { seeds: [ - { - kind: "const", - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], - }, - { - kind: "account", - path: "stream_nft_mint", - }, + { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account", path: "stream_nft_mint" }, ], }, writable: true, @@ -498,18 +305,9 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "stream_data", - }, - { - kind: "account", - path: "deposit_token_program", - }, - { - kind: "account", - path: "deposit_token_mint", - }, + { kind: "account", path: "stream_data" }, + { kind: "account", path: "deposit_token_program" }, + { kind: "account", path: "deposit_token_mint" }, ], }, writable: true, @@ -518,27 +316,12 @@ export default { docs: ["Create account: the master edition account for the stream NFT."], name: "stream_nft_master_edition", pda: { - program: { - kind: "account", - path: "token_metadata_program", - }, + program: { kind: "account", path: "token_metadata_program" }, seeds: [ - { - kind: "const", - value: [109, 101, 116, 97, 100, 97, 116, 97], - }, - { - kind: "account", - path: "token_metadata_program", - }, - { - kind: "account", - path: "stream_nft_mint", - }, - { - kind: "const", - value: [101, 100, 105, 116, 105, 111, 110], - }, + { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account", path: "token_metadata_program" }, + { kind: "account", path: "stream_nft_mint" }, + { kind: "const", value: [101, 100, 105, 116, 105, 111, 110] }, ], }, writable: true, @@ -547,23 +330,11 @@ export default { docs: ["Create account: the metadata account for the stream NFT."], name: "stream_nft_metadata", pda: { - program: { - kind: "account", - path: "token_metadata_program", - }, + program: { kind: "account", path: "token_metadata_program" }, seeds: [ - { - kind: "const", - value: [109, 101, 116, 97, 100, 97, 116, 97], - }, - { - kind: "account", - path: "token_metadata_program", - }, - { - kind: "account", - path: "stream_nft_mint", - }, + { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account", path: "token_metadata_program" }, + { kind: "account", path: "stream_nft_mint" }, ], }, writable: true, @@ -573,14 +344,8 @@ export default { docs: ["Program account: the Associated Token program."], name: "associated_token_program", }, - { - docs: ["Program account: the Token program of the deposit token."], - name: "deposit_token_program", - }, - { - docs: ["Program account: the Token program of the stream NFT."], - name: "nft_token_program", - }, + { docs: ["Program account: the Token program of the deposit token."], name: "deposit_token_program" }, + { docs: ["Program account: the Token program of the stream NFT."], name: "nft_token_program" }, { address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", docs: ["Program account: the Token Metadata program."], @@ -591,41 +356,16 @@ export default { docs: ["Program account: the System program."], name: "system_program", }, - { - address: "SysvarRent111111111111111111111111111111111", - docs: ["Sysvar account: Rent."], - name: "rent", - }, + { address: "SysvarRent111111111111111111111111111111111", docs: ["Sysvar account: Rent."], name: "rent" }, ], args: [ - { - name: "salt", - type: "u128", - }, - { - name: "deposit_amount", - type: "u64", - }, - { - name: "cliff_duration", - type: "u64", - }, - { - name: "total_duration", - type: "u64", - }, - { - name: "start_unlock_amount", - type: "u64", - }, - { - name: "cliff_unlock_amount", - type: "u64", - }, - { - name: "is_cancelable", - type: "bool", - }, + { name: "salt", type: "u128" }, + { name: "deposit_amount", type: "u64" }, + { name: "cliff_duration", type: "u64" }, + { name: "total_duration", type: "u64" }, + { name: "start_unlock_amount", type: "u64" }, + { name: "cliff_unlock_amount", type: "u64" }, + { name: "is_cancelable", type: "bool" }, ], discriminator: [87, 17, 170, 167, 156, 152, 169, 61], docs: [ @@ -670,30 +410,15 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "creator", - }, - { - kind: "account", - path: "deposit_token_program", - }, - { - kind: "account", - path: "deposit_token_mint", - }, + { kind: "account", path: "creator" }, + { kind: "account", path: "deposit_token_program" }, + { kind: "account", path: "deposit_token_mint" }, ], }, writable: true, }, - { - docs: ["Read account: the recipient of the stream."], - name: "recipient", - }, - { - docs: ["Read account: the sender of the stream."], - name: "sender", - }, + { docs: ["Read account: the recipient of the stream."], name: "recipient" }, + { docs: ["Read account: the sender of the stream."], name: "sender" }, { docs: ["Write account: the NFT collection data storing the total supply."], name: "nft_collection_data", @@ -711,27 +436,12 @@ export default { docs: ["Write account: the master edition account for the NFT collection."], name: "nft_collection_master_edition", pda: { - program: { - kind: "account", - path: "token_metadata_program", - }, + program: { kind: "account", path: "token_metadata_program" }, seeds: [ - { - kind: "const", - value: [109, 101, 116, 97, 100, 97, 116, 97], - }, - { - kind: "account", - path: "token_metadata_program", - }, - { - kind: "account", - path: "nft_collection_mint", - }, - { - kind: "const", - value: [101, 100, 105, 116, 105, 111, 110], - }, + { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account", path: "token_metadata_program" }, + { kind: "account", path: "nft_collection_mint" }, + { kind: "const", value: [101, 100, 105, 116, 105, 111, 110] }, ], }, }, @@ -739,23 +449,11 @@ export default { docs: ["Write account: the metadata account for the NFT collection."], name: "nft_collection_metadata", pda: { - program: { - kind: "account", - path: "token_metadata_program", - }, + program: { kind: "account", path: "token_metadata_program" }, seeds: [ - { - kind: "const", - value: [109, 101, 116, 97, 100, 97, 116, 97], - }, - { - kind: "account", - path: "token_metadata_program", - }, - { - kind: "account", - path: "nft_collection_mint", - }, + { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account", path: "token_metadata_program" }, + { kind: "account", path: "nft_collection_mint" }, ], }, writable: true, @@ -772,27 +470,15 @@ export default { ], }, }, - { - docs: ["Read account: the mint account for the deposit token."], - name: "deposit_token_mint", - }, + { docs: ["Read account: the mint account for the deposit token."], name: "deposit_token_mint" }, { docs: ["Create account: the mint account for the stream NFT."], name: "stream_nft_mint", pda: { seeds: [ - { - kind: "const", - value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116], - }, - { - kind: "account", - path: "sender", - }, - { - kind: "arg", - path: "salt", - }, + { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116] }, + { kind: "account", path: "sender" }, + { kind: "arg", path: "salt" }, ], }, writable: true, @@ -809,18 +495,9 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "recipient", - }, - { - kind: "account", - path: "nft_token_program", - }, - { - kind: "account", - path: "stream_nft_mint", - }, + { kind: "account", path: "recipient" }, + { kind: "account", path: "nft_token_program" }, + { kind: "account", path: "stream_nft_mint" }, ], }, writable: true, @@ -830,14 +507,8 @@ export default { name: "stream_data", pda: { seeds: [ - { - kind: "const", - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], - }, - { - kind: "account", - path: "stream_nft_mint", - }, + { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account", path: "stream_nft_mint" }, ], }, writable: true, @@ -854,18 +525,9 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "stream_data", - }, - { - kind: "account", - path: "deposit_token_program", - }, - { - kind: "account", - path: "deposit_token_mint", - }, + { kind: "account", path: "stream_data" }, + { kind: "account", path: "deposit_token_program" }, + { kind: "account", path: "deposit_token_mint" }, ], }, writable: true, @@ -874,27 +536,12 @@ export default { docs: ["Create account: the master edition account for the stream NFT."], name: "stream_nft_master_edition", pda: { - program: { - kind: "account", - path: "token_metadata_program", - }, + program: { kind: "account", path: "token_metadata_program" }, seeds: [ - { - kind: "const", - value: [109, 101, 116, 97, 100, 97, 116, 97], - }, - { - kind: "account", - path: "token_metadata_program", - }, - { - kind: "account", - path: "stream_nft_mint", - }, - { - kind: "const", - value: [101, 100, 105, 116, 105, 111, 110], - }, + { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account", path: "token_metadata_program" }, + { kind: "account", path: "stream_nft_mint" }, + { kind: "const", value: [101, 100, 105, 116, 105, 111, 110] }, ], }, writable: true, @@ -903,23 +550,11 @@ export default { docs: ["Create account: the metadata account for the stream NFT."], name: "stream_nft_metadata", pda: { - program: { - kind: "account", - path: "token_metadata_program", - }, + program: { kind: "account", path: "token_metadata_program" }, seeds: [ - { - kind: "const", - value: [109, 101, 116, 97, 100, 97, 116, 97], - }, - { - kind: "account", - path: "token_metadata_program", - }, - { - kind: "account", - path: "stream_nft_mint", - }, + { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account", path: "token_metadata_program" }, + { kind: "account", path: "stream_nft_mint" }, ], }, writable: true, @@ -929,14 +564,8 @@ export default { docs: ["Program account: the Associated Token program."], name: "associated_token_program", }, - { - docs: ["Program account: the Token program of the deposit token."], - name: "deposit_token_program", - }, - { - docs: ["Program account: the Token program of the stream NFT."], - name: "nft_token_program", - }, + { docs: ["Program account: the Token program of the deposit token."], name: "deposit_token_program" }, + { docs: ["Program account: the Token program of the stream NFT."], name: "nft_token_program" }, { address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", docs: ["Program account: the Token Metadata program."], @@ -947,45 +576,17 @@ export default { docs: ["Program account: the System program."], name: "system_program", }, - { - address: "SysvarRent111111111111111111111111111111111", - docs: ["Sysvar account: Rent."], - name: "rent", - }, + { address: "SysvarRent111111111111111111111111111111111", docs: ["Sysvar account: Rent."], name: "rent" }, ], args: [ - { - name: "salt", - type: "u128", - }, - { - name: "deposit_amount", - type: "u64", - }, - { - name: "start_time", - type: "u64", - }, - { - name: "cliff_time", - type: "u64", - }, - { - name: "end_time", - type: "u64", - }, - { - name: "start_unlock_amount", - type: "u64", - }, - { - name: "cliff_unlock_amount", - type: "u64", - }, - { - name: "is_cancelable", - type: "bool", - }, + { name: "salt", type: "u128" }, + { name: "deposit_amount", type: "u64" }, + { name: "start_time", type: "u64" }, + { name: "cliff_time", type: "u64" }, + { name: "end_time", type: "u64" }, + { name: "start_unlock_amount", type: "u64" }, + { name: "cliff_unlock_amount", type: "u64" }, + { name: "is_cancelable", type: "bool" }, ], discriminator: [150, 165, 147, 28, 68, 41, 48, 41], docs: [ @@ -1033,23 +634,11 @@ export default { }, { accounts: [ - { - docs: ["Write account: the initializer of the program."], - name: "initializer", - signer: true, - writable: true, - }, + { docs: ["Write account: the initializer of the program."], name: "initializer", signer: true, writable: true }, { docs: ["Create account: the treasury account that will hold the fees."], name: "treasury", - pda: { - seeds: [ - { - kind: "const", - value: [116, 114, 101, 97, 115, 117, 114, 121], - }, - ], - }, + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, writable: true, }, { @@ -1067,29 +656,14 @@ export default { }, { docs: ["Create account: the master edition account for the NFT collection."], - name: "nft_collection_master_edition", - pda: { - program: { - kind: "account", - path: "token_metadata_program", - }, - seeds: [ - { - kind: "const", - value: [109, 101, 116, 97, 100, 97, 116, 97], - }, - { - kind: "account", - path: "token_metadata_program", - }, - { - kind: "account", - path: "nft_collection_mint", - }, - { - kind: "const", - value: [101, 100, 105, 116, 105, 111, 110], - }, + name: "nft_collection_master_edition", + pda: { + program: { kind: "account", path: "token_metadata_program" }, + seeds: [ + { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account", path: "token_metadata_program" }, + { kind: "account", path: "nft_collection_mint" }, + { kind: "const", value: [101, 100, 105, 116, 105, 111, 110] }, ], }, writable: true, @@ -1098,23 +672,11 @@ export default { docs: ["Create account: the metadata account for the NFT collection."], name: "nft_collection_metadata", pda: { - program: { - kind: "account", - path: "token_metadata_program", - }, + program: { kind: "account", path: "token_metadata_program" }, seeds: [ - { - kind: "const", - value: [109, 101, 116, 97, 100, 97, 116, 97], - }, - { - kind: "account", - path: "token_metadata_program", - }, - { - kind: "account", - path: "nft_collection_mint", - }, + { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account", path: "token_metadata_program" }, + { kind: "account", path: "nft_collection_mint" }, ], }, writable: true, @@ -1144,18 +706,9 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "treasury", - }, - { - kind: "account", - path: "nft_token_program", - }, - { - kind: "account", - path: "nft_collection_mint", - }, + { kind: "account", path: "treasury" }, + { kind: "account", path: "nft_token_program" }, + { kind: "account", path: "nft_collection_mint" }, ], }, writable: true, @@ -1165,20 +718,13 @@ export default { docs: ["Program account: the Associated Token program."], name: "associated_token_program", }, - { - docs: ["Program account: the Token program of the collection NFT."], - name: "nft_token_program", - }, + { docs: ["Program account: the Token program of the collection NFT."], name: "nft_token_program" }, { address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", docs: ["Program account: the Token Metadata program."], name: "token_metadata_program", }, - { - address: "SysvarRent111111111111111111111111111111111", - docs: ["Sysvar account: Rent."], - name: "rent", - }, + { address: "SysvarRent111111111111111111111111111111111", docs: ["Sysvar account: Rent."], name: "rent" }, { address: "11111111111111111111111111111111", docs: ["Program account: the System program."], @@ -1186,18 +732,9 @@ export default { }, ], args: [ - { - name: "fee_collector", - type: "pubkey", - }, - { - name: "chainlink_program", - type: "pubkey", - }, - { - name: "chainlink_sol_usd_feed", - type: "pubkey", - }, + { name: "fee_collector", type: "pubkey" }, + { name: "chainlink_program", type: "pubkey" }, + { name: "chainlink_sol_usd_feed", type: "pubkey" }, ], discriminator: [175, 175, 109, 31, 13, 152, 155, 237], docs: [ @@ -1223,21 +760,12 @@ export default { name: "stream_data", pda: { seeds: [ - { - kind: "const", - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], - }, - { - kind: "account", - path: "stream_nft_mint", - }, + { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account", path: "stream_nft_mint" }, ], }, }, - { - docs: ["Read account: the mint account for the stream NFT."], - name: "stream_nft_mint", - }, + { docs: ["Read account: the mint account for the stream NFT."], name: "stream_nft_mint" }, ], args: [], discriminator: [160, 136, 114, 120, 234, 178, 146, 58], @@ -1258,32 +786,19 @@ export default { }, { accounts: [ - { - docs: ["Write account: the sender of the stream."], - name: "sender", - signer: true, - }, + { docs: ["Write account: the sender of the stream."], name: "sender", signer: true }, { docs: ["Write account: the stream data account storing stream details."], name: "stream_data", pda: { seeds: [ - { - kind: "const", - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], - }, - { - kind: "account", - path: "stream_nft_mint", - }, + { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account", path: "stream_nft_mint" }, ], }, writable: true, }, - { - docs: ["Read account: the mint account for the stream NFT."], - name: "stream_nft_mint", - }, + { docs: ["Read account: the mint account for the stream NFT."], name: "stream_nft_mint" }, ], args: [], discriminator: [241, 157, 138, 210, 8, 235, 187, 123], @@ -1308,21 +823,12 @@ export default { name: "stream_data", pda: { seeds: [ - { - kind: "const", - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], - }, - { - kind: "account", - path: "stream_nft_mint", - }, + { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account", path: "stream_nft_mint" }, ], }, }, - { - docs: ["Read account: the mint account for the stream NFT."], - name: "stream_nft_mint", - }, + { docs: ["Read account: the mint account for the stream NFT."], name: "stream_nft_mint" }, ], args: [], discriminator: [90, 214, 253, 237, 126, 236, 132, 237], @@ -1338,11 +844,7 @@ export default { "- The stream does not exist.", ], name: "status_of", - returns: { - defined: { - name: "StreamStatus", - }, - }, + returns: { defined: { name: "StreamStatus" } }, }, { accounts: [ @@ -1351,31 +853,16 @@ export default { name: "stream_nft_mint", pda: { seeds: [ - { - kind: "const", - value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116], - }, - { - kind: "arg", - path: "_sender", - }, - { - kind: "arg", - path: "_salt", - }, + { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116] }, + { kind: "arg", path: "_sender" }, + { kind: "arg", path: "_salt" }, ], }, }, ], args: [ - { - name: "_sender", - type: "pubkey", - }, - { - name: "_salt", - type: "u128", - }, + { name: "_sender", type: "pubkey" }, + { name: "_salt", type: "u128" }, ], discriminator: [104, 209, 104, 97, 122, 35, 165, 195], docs: [ @@ -1396,21 +883,12 @@ export default { name: "stream_data", pda: { seeds: [ - { - kind: "const", - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], - }, - { - kind: "account", - path: "stream_nft_mint", - }, + { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account", path: "stream_nft_mint" }, ], }, }, - { - docs: ["Read account: the mint account for the stream NFT."], - name: "stream_nft_mint", - }, + { docs: ["Read account: the mint account for the stream NFT."], name: "stream_nft_mint" }, ], args: [], discriminator: [91, 69, 219, 48, 189, 26, 13, 33], @@ -1439,25 +917,14 @@ export default { { docs: ["Read account: the account storing the treasury details."], name: "treasury", - pda: { - seeds: [ - { - kind: "const", - value: [116, 114, 101, 97, 115, 117, 114, 121], - }, - ], - }, + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, }, ], args: [], discriminator: [247, 160, 213, 237, 247, 121, 164, 82], docs: ["Returns the treasury details."], name: "treasury_view", - returns: { - defined: { - name: "Treasury", - }, - }, + returns: { defined: { name: "Treasury" } }, }, { accounts: [ @@ -1467,10 +934,7 @@ export default { signer: true, writable: true, }, - { - docs: ["Read account: the recipient of the stream who owns the stream NFT."], - name: "stream_recipient", - }, + { docs: ["Read account: the recipient of the stream who owns the stream NFT."], name: "stream_recipient" }, { docs: ["Read account: the account that will receive the withdrawn tokens.", "recipient."], name: "withdrawal_recipient", @@ -1487,18 +951,9 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "withdrawal_recipient", - }, - { - kind: "account", - path: "deposited_token_program", - }, - { - kind: "account", - path: "deposited_token_mint", - }, + { kind: "account", path: "withdrawal_recipient" }, + { kind: "account", path: "deposited_token_program" }, + { kind: "account", path: "deposited_token_mint" }, ], }, writable: true, @@ -1506,20 +961,10 @@ export default { { docs: ["Write account: the treasury account that receives the withdrawal fee."], name: "treasury", - pda: { - seeds: [ - { - kind: "const", - value: [116, 114, 101, 97, 115, 117, 114, 121], - }, - ], - }, + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, writable: true, }, - { - docs: ["Read account: the mint account for the deposited token."], - name: "deposited_token_mint", - }, + { docs: ["Read account: the mint account for the deposited token."], name: "deposited_token_mint" }, { docs: ["Read account: the ATA for the stream NFT owned by recipient.", ""], name: "recipient_stream_nft_ata", @@ -1532,18 +977,9 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "stream_recipient", - }, - { - kind: "account", - path: "nft_token_program", - }, - { - kind: "account", - path: "stream_nft_mint", - }, + { kind: "account", path: "stream_recipient" }, + { kind: "account", path: "nft_token_program" }, + { kind: "account", path: "stream_nft_mint" }, ], }, }, @@ -1552,14 +988,8 @@ export default { name: "stream_data", pda: { seeds: [ - { - kind: "const", - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], - }, - { - kind: "account", - path: "stream_nft_mint", - }, + { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account", path: "stream_nft_mint" }, ], }, writable: true, @@ -1576,26 +1006,14 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "stream_data", - }, - { - kind: "account", - path: "deposited_token_program", - }, - { - kind: "account", - path: "deposited_token_mint", - }, + { kind: "account", path: "stream_data" }, + { kind: "account", path: "deposited_token_program" }, + { kind: "account", path: "deposited_token_mint" }, ], }, writable: true, }, - { - docs: ["Read account: the mint account for the stream NFT."], - name: "stream_nft_mint", - }, + { docs: ["Read account: the mint account for the stream NFT."], name: "stream_nft_mint" }, { address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", docs: ["Program account: the Associated Token program."], @@ -1605,30 +1023,16 @@ export default { docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], name: "chainlink_program", }, - { - docs: ["Read account: The account providing the SOL/USD price feed data."], - name: "chainlink_sol_usd_feed", - }, - { - docs: ["Program account: the Token program of the deposited token."], - name: "deposited_token_program", - }, - { - docs: ["Program account: the Token program of the stream NFT."], - name: "nft_token_program", - }, + { docs: ["Read account: The account providing the SOL/USD price feed data."], name: "chainlink_sol_usd_feed" }, + { docs: ["Program account: the Token program of the deposited token."], name: "deposited_token_program" }, + { docs: ["Program account: the Token program of the stream NFT."], name: "nft_token_program" }, { address: "11111111111111111111111111111111", docs: ["Program account: the System program."], name: "system_program", }, ], - args: [ - { - name: "amount", - type: "u64", - }, - ], + args: [{ name: "amount", type: "u64" }], discriminator: [183, 18, 70, 156, 148, 109, 161, 34], docs: [ "Withdraws the provided amount of tokens from the stream data ATA to the provided account.", @@ -1672,10 +1076,7 @@ export default { signer: true, writable: true, }, - { - docs: ["Read account: the recipient of the stream who owns the stream NFT."], - name: "stream_recipient", - }, + { docs: ["Read account: the recipient of the stream who owns the stream NFT."], name: "stream_recipient" }, { docs: ["Read account: the account that will receive the withdrawn tokens.", "recipient."], name: "withdrawal_recipient", @@ -1692,18 +1093,9 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "withdrawal_recipient", - }, - { - kind: "account", - path: "deposited_token_program", - }, - { - kind: "account", - path: "deposited_token_mint", - }, + { kind: "account", path: "withdrawal_recipient" }, + { kind: "account", path: "deposited_token_program" }, + { kind: "account", path: "deposited_token_mint" }, ], }, writable: true, @@ -1711,20 +1103,10 @@ export default { { docs: ["Write account: the treasury account that receives the withdrawal fee."], name: "treasury", - pda: { - seeds: [ - { - kind: "const", - value: [116, 114, 101, 97, 115, 117, 114, 121], - }, - ], - }, + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, writable: true, }, - { - docs: ["Read account: the mint account for the deposited token."], - name: "deposited_token_mint", - }, + { docs: ["Read account: the mint account for the deposited token."], name: "deposited_token_mint" }, { docs: ["Read account: the ATA for the stream NFT owned by recipient.", ""], name: "recipient_stream_nft_ata", @@ -1737,18 +1119,9 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "stream_recipient", - }, - { - kind: "account", - path: "nft_token_program", - }, - { - kind: "account", - path: "stream_nft_mint", - }, + { kind: "account", path: "stream_recipient" }, + { kind: "account", path: "nft_token_program" }, + { kind: "account", path: "stream_nft_mint" }, ], }, }, @@ -1757,14 +1130,8 @@ export default { name: "stream_data", pda: { seeds: [ - { - kind: "const", - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], - }, - { - kind: "account", - path: "stream_nft_mint", - }, + { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account", path: "stream_nft_mint" }, ], }, writable: true, @@ -1781,26 +1148,14 @@ export default { ], }, seeds: [ - { - kind: "account", - path: "stream_data", - }, - { - kind: "account", - path: "deposited_token_program", - }, - { - kind: "account", - path: "deposited_token_mint", - }, + { kind: "account", path: "stream_data" }, + { kind: "account", path: "deposited_token_program" }, + { kind: "account", path: "deposited_token_mint" }, ], }, writable: true, }, - { - docs: ["Read account: the mint account for the stream NFT."], - name: "stream_nft_mint", - }, + { docs: ["Read account: the mint account for the stream NFT."], name: "stream_nft_mint" }, { address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", docs: ["Program account: the Associated Token program."], @@ -1810,18 +1165,9 @@ export default { docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], name: "chainlink_program", }, - { - docs: ["Read account: The account providing the SOL/USD price feed data."], - name: "chainlink_sol_usd_feed", - }, - { - docs: ["Program account: the Token program of the deposited token."], - name: "deposited_token_program", - }, - { - docs: ["Program account: the Token program of the stream NFT."], - name: "nft_token_program", - }, + { docs: ["Read account: The account providing the SOL/USD price feed data."], name: "chainlink_sol_usd_feed" }, + { docs: ["Program account: the Token program of the deposited token."], name: "deposited_token_program" }, + { docs: ["Program account: the Token program of the stream NFT."], name: "nft_token_program" }, { address: "11111111111111111111111111111111", docs: ["Program account: the System program."], @@ -1854,21 +1200,12 @@ export default { name: "stream_data", pda: { seeds: [ - { - kind: "const", - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97], - }, - { - kind: "account", - path: "stream_nft_mint", - }, + { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account", path: "stream_nft_mint" }, ], }, }, - { - docs: ["Read account: the mint account for the stream NFT."], - name: "stream_nft_mint", - }, + { docs: ["Read account: the mint account for the stream NFT."], name: "stream_nft_mint" }, ], args: [], discriminator: [30, 195, 140, 141, 173, 123, 253, 60], @@ -1892,23 +1229,13 @@ export default { { docs: ["Read account: the treasury account that receives the withdrawal fee."], name: "treasury", - pda: { - seeds: [ - { - kind: "const", - value: [116, 114, 101, 97, 115, 117, 114, 121], - }, - ], - }, + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, }, { docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], name: "chainlink_program", }, - { - docs: ["Read account: The account providing the SOL/USD price feed data."], - name: "chainlink_sol_usd_feed", - }, + { docs: ["Read account: The account providing the SOL/USD price feed data."], name: "chainlink_sol_usd_feed" }, ], args: [], discriminator: [55, 255, 88, 224, 223, 23, 97, 140], @@ -1924,37 +1251,17 @@ export default { returns: "u64", }, ], - metadata: { - description: "Created with Anchor", - name: "sablier_lockup", - spec: "0.1.0", - version: "0.1.0", - }, + metadata: { description: "Created with Anchor", name: "sablier_lockup", spec: "0.1.0", version: "0.1.0" }, types: [ { name: "Amounts", type: { fields: [ - { - name: "start_unlock", - type: "u64", - }, - { - name: "cliff_unlock", - type: "u64", - }, - { - name: "deposited", - type: "u64", - }, - { - name: "refunded", - type: "u64", - }, - { - name: "withdrawn", - type: "u64", - }, + { name: "start_unlock", type: "u64" }, + { name: "cliff_unlock", type: "u64" }, + { name: "deposited", type: "u64" }, + { name: "refunded", type: "u64" }, + { name: "withdrawn", type: "u64" }, ], kind: "struct", }, @@ -1963,26 +1270,11 @@ export default { name: "CancelLockupStream", type: { fields: [ - { - name: "deposited_token_mint", - type: "pubkey", - }, - { - name: "recipient_amount", - type: "u64", - }, - { - name: "sender_amount", - type: "u64", - }, - { - name: "stream_data", - type: "pubkey", - }, - { - name: "stream_nft_mint", - type: "pubkey", - }, + { name: "deposited_token_mint", type: "pubkey" }, + { name: "recipient_amount", type: "u64" }, + { name: "sender_amount", type: "u64" }, + { name: "stream_data", type: "pubkey" }, + { name: "stream_nft_mint", type: "pubkey" }, ], kind: "struct", }, @@ -1991,30 +1283,12 @@ export default { name: "CreateLockupLinearStream", type: { fields: [ - { - name: "deposit_token_decimals", - type: "u8", - }, - { - name: "deposit_token_mint", - type: "pubkey", - }, - { - name: "recipient", - type: "pubkey", - }, - { - name: "salt", - type: "u128", - }, - { - name: "stream_data", - type: "pubkey", - }, - { - name: "stream_nft_mint", - type: "pubkey", - }, + { name: "deposit_token_decimals", type: "u8" }, + { name: "deposit_token_mint", type: "pubkey" }, + { name: "recipient", type: "pubkey" }, + { name: "salt", type: "u128" }, + { name: "stream_data", type: "pubkey" }, + { name: "stream_nft_mint", type: "pubkey" }, ], kind: "struct", }, @@ -2023,18 +1297,9 @@ export default { name: "FeesCollected", type: { fields: [ - { - name: "fee_amount", - type: "u64", - }, - { - name: "fee_collector", - type: "pubkey", - }, - { - name: "fee_recipient", - type: "pubkey", - }, + { name: "fee_amount", type: "u64" }, + { name: "fee_collector", type: "pubkey" }, + { name: "fee_recipient", type: "pubkey" }, ], kind: "struct", }, @@ -2043,14 +1308,8 @@ export default { name: "NftCollectionData", type: { fields: [ - { - name: "total_supply", - type: "u64", - }, - { - name: "bump", - type: "u8", - }, + { name: "total_supply", type: "u64" }, + { name: "bump", type: "u8" }, ], kind: "struct", }, @@ -2059,18 +1318,9 @@ export default { name: "RenounceLockupStream", type: { fields: [ - { - name: "deposited_token_mint", - type: "pubkey", - }, - { - name: "stream_data", - type: "pubkey", - }, - { - name: "stream_nft_mint", - type: "pubkey", - }, + { name: "deposited_token_mint", type: "pubkey" }, + { name: "stream_data", type: "pubkey" }, + { name: "stream_nft_mint", type: "pubkey" }, ], kind: "struct", }, @@ -2079,50 +1329,15 @@ export default { name: "StreamData", type: { fields: [ - { - name: "amounts", - type: { - defined: { - name: "Amounts", - }, - }, - }, - { - name: "deposited_token_mint", - type: "pubkey", - }, - { - name: "bump", - type: "u8", - }, - { - name: "salt", - type: "u128", - }, - { - name: "is_cancelable", - type: "bool", - }, - { - name: "is_depleted", - type: "bool", - }, - { - name: "timestamps", - type: { - defined: { - name: "Timestamps", - }, - }, - }, - { - name: "sender", - type: "pubkey", - }, - { - name: "was_canceled", - type: "bool", - }, + { name: "amounts", type: { defined: { name: "Amounts" } } }, + { name: "deposited_token_mint", type: "pubkey" }, + { name: "bump", type: "u8" }, + { name: "salt", type: "u128" }, + { name: "is_cancelable", type: "bool" }, + { name: "is_depleted", type: "bool" }, + { name: "timestamps", type: { defined: { name: "Timestamps" } } }, + { name: "sender", type: "pubkey" }, + { name: "was_canceled", type: "bool" }, ], kind: "struct", }, @@ -2132,21 +1347,11 @@ export default { type: { kind: "enum", variants: [ - { - name: "Pending", - }, - { - name: "Streaming", - }, - { - name: "Settled", - }, - { - name: "Canceled", - }, - { - name: "Depleted", - }, + { name: "Pending" }, + { name: "Streaming" }, + { name: "Settled" }, + { name: "Canceled" }, + { name: "Depleted" }, ], }, }, @@ -2155,18 +1360,9 @@ export default { name: "Timestamps", type: { fields: [ - { - name: "cliff", - type: "u64", - }, - { - name: "end", - type: "u64", - }, - { - name: "start", - type: "u64", - }, + { name: "cliff", type: "u64" }, + { name: "end", type: "u64" }, + { name: "start", type: "u64" }, ], kind: "struct", }, @@ -2175,22 +1371,10 @@ export default { name: "Treasury", type: { fields: [ - { - name: "bump", - type: "u8", - }, - { - name: "fee_collector", - type: "pubkey", - }, - { - name: "chainlink_program", - type: "pubkey", - }, - { - name: "chainlink_sol_usd_feed", - type: "pubkey", - }, + { name: "bump", type: "u8" }, + { name: "fee_collector", type: "pubkey" }, + { name: "chainlink_program", type: "pubkey" }, + { name: "chainlink_sol_usd_feed", type: "pubkey" }, ], kind: "struct", }, @@ -2199,26 +1383,11 @@ export default { name: "WithdrawFromLockupStream", type: { fields: [ - { - name: "deposited_token_mint", - type: "pubkey", - }, - { - name: "fee_in_lamports", - type: "u64", - }, - { - name: "stream_data", - type: "pubkey", - }, - { - name: "stream_nft_mint", - type: "pubkey", - }, - { - name: "withdrawn_amount", - type: "u64", - }, + { name: "deposited_token_mint", type: "pubkey" }, + { name: "fee_in_lamports", type: "u64" }, + { name: "stream_data", type: "pubkey" }, + { name: "stream_nft_mint", type: "pubkey" }, + { name: "withdrawn_amount", type: "u64" }, ], kind: "struct", }, diff --git a/src/solana/idl/lockup/v1.0/SablierLockupLinearV10Type.ts b/src/solana/idl/lockup/v1.0/SablierLockupLinearType.ts similarity index 59% rename from src/solana/idl/lockup/v1.0/SablierLockupLinearV10Type.ts rename to src/solana/idl/lockup/v1.0/SablierLockupLinearType.ts index 574b7e9..7a0100c 100644 --- a/src/solana/idl/lockup/v1.0/SablierLockupLinearV10Type.ts +++ b/src/solana/idl/lockup/v1.0/SablierLockupLinearType.ts @@ -1,17 +1,11 @@ /** * Program IDL in camelCase format in order to be used in JS/TS. * - * Note that this is only a type helper and is not the actual IDL. The original - * IDL can be found at `target/idl/sablier_lockup.json`. + * Note that this is only a type helper and is not the actual IDL. */ -type Idl = { +export type Idl = { address: "4EauRKrNErKfsR4XetEZJNmvACGHbHnHV4R5dvJuqupC"; - metadata: { - name: "sablierLockup"; - version: "0.1.0"; - spec: "0.1.0"; - description: "Created with Anchor"; - }; + metadata: { name: "sablierLockup"; version: "0.1.0"; spec: "0.1.0"; description: "Created with Anchor" }; docs: ["Sablier Lockup program for creating and managing token streams."]; instructions: [ { @@ -54,18 +48,9 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "account"; - path: "sender"; - }, - { - kind: "account"; - path: "depositedTokenProgram"; - }, - { - kind: "account"; - path: "depositedTokenMint"; - }, + { kind: "account"; path: "sender" }, + { kind: "account"; path: "depositedTokenProgram" }, + { kind: "account"; path: "depositedTokenMint" }, ]; program: { kind: "const"; @@ -106,24 +91,15 @@ type Idl = { }; }; }, - { - name: "depositedTokenMint"; - docs: ["Read account: the mint account of the deposited token."]; - }, + { name: "depositedTokenMint"; docs: ["Read account: the mint account of the deposited token."] }, { name: "streamData"; docs: ["Write account: the stream data account storing stream details."]; writable: true; pda: { seeds: [ - { - kind: "const"; - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "streamNftMint"; - }, + { kind: "const"; value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account"; path: "streamNftMint" }, ]; }; }, @@ -133,18 +109,9 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "account"; - path: "streamData"; - }, - { - kind: "account"; - path: "depositedTokenProgram"; - }, - { - kind: "account"; - path: "depositedTokenMint"; - }, + { kind: "account"; path: "streamData" }, + { kind: "account"; path: "depositedTokenProgram" }, + { kind: "account"; path: "depositedTokenMint" }, ]; program: { kind: "const"; @@ -185,19 +152,13 @@ type Idl = { }; }; }, - { - name: "streamNftMint"; - docs: ["Read account: the mint account for the stream NFT."]; - }, + { name: "streamNftMint"; docs: ["Read account: the mint account for the stream NFT."] }, { name: "associatedTokenProgram"; docs: ["Program account: the Associated Token program."]; address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"; }, - { - name: "depositedTokenProgram"; - docs: ["Program account: the Token program of the deposited token."]; - }, + { name: "depositedTokenProgram"; docs: ["Program account: the Token program of the deposited token."] }, { name: "systemProgram"; docs: ["Program account: the System program."]; @@ -241,14 +202,7 @@ type Idl = { name: "treasury"; docs: ["Write account: the treasury account that holds the fees."]; writable: true; - pda: { - seeds: [ - { - kind: "const"; - value: [116, 114, 101, 97, 115, 117, 114, 121]; - }, - ]; - }; + pda: { seeds: [{ kind: "const"; value: [116, 114, 101, 97, 115, 117, 114, 121] }] }; }, ]; args: []; @@ -289,18 +243,9 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "account"; - path: "creator"; - }, - { - kind: "account"; - path: "depositTokenProgram"; - }, - { - kind: "account"; - path: "depositTokenMint"; - }, + { kind: "account"; path: "creator" }, + { kind: "account"; path: "depositTokenProgram" }, + { kind: "account"; path: "depositTokenMint" }, ]; program: { kind: "const"; @@ -341,14 +286,8 @@ type Idl = { }; }; }, - { - name: "recipient"; - docs: ["Read account: the recipient of the stream."]; - }, - { - name: "sender"; - docs: ["Read account: the sender of the stream."]; - }, + { name: "recipient"; docs: ["Read account: the recipient of the stream."] }, + { name: "sender"; docs: ["Read account: the sender of the stream."] }, { name: "nftCollectionData"; docs: ["Write account: the NFT collection data storing the total supply."]; @@ -367,27 +306,12 @@ type Idl = { docs: ["Write account: the master edition account for the NFT collection."]; pda: { seeds: [ - { - kind: "const"; - value: [109, 101, 116, 97, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "tokenMetadataProgram"; - }, - { - kind: "account"; - path: "nftCollectionMint"; - }, - { - kind: "const"; - value: [101, 100, 105, 116, 105, 111, 110]; - }, + { kind: "const"; value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account"; path: "tokenMetadataProgram" }, + { kind: "account"; path: "nftCollectionMint" }, + { kind: "const"; value: [101, 100, 105, 116, 105, 111, 110] }, ]; - program: { - kind: "account"; - path: "tokenMetadataProgram"; - }; + program: { kind: "account"; path: "tokenMetadataProgram" }; }; }, { @@ -396,23 +320,11 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "const"; - value: [109, 101, 116, 97, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "tokenMetadataProgram"; - }, - { - kind: "account"; - path: "nftCollectionMint"; - }, + { kind: "const"; value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account"; path: "tokenMetadataProgram" }, + { kind: "account"; path: "nftCollectionMint" }, ]; - program: { - kind: "account"; - path: "tokenMetadataProgram"; - }; + program: { kind: "account"; path: "tokenMetadataProgram" }; }; }, { @@ -427,28 +339,16 @@ type Idl = { ]; }; }, - { - name: "depositTokenMint"; - docs: ["Read account: the mint account for the deposit token."]; - }, + { name: "depositTokenMint"; docs: ["Read account: the mint account for the deposit token."] }, { name: "streamNftMint"; docs: ["Create account: the mint account for the stream NFT."]; writable: true; pda: { seeds: [ - { - kind: "const"; - value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116]; - }, - { - kind: "account"; - path: "sender"; - }, - { - kind: "arg"; - path: "salt"; - }, + { kind: "const"; value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116] }, + { kind: "account"; path: "sender" }, + { kind: "arg"; path: "salt" }, ]; }; }, @@ -458,18 +358,9 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "account"; - path: "recipient"; - }, - { - kind: "account"; - path: "nftTokenProgram"; - }, - { - kind: "account"; - path: "streamNftMint"; - }, + { kind: "account"; path: "recipient" }, + { kind: "account"; path: "nftTokenProgram" }, + { kind: "account"; path: "streamNftMint" }, ]; program: { kind: "const"; @@ -516,14 +407,8 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "const"; - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "streamNftMint"; - }, + { kind: "const"; value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account"; path: "streamNftMint" }, ]; }; }, @@ -533,18 +418,9 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "account"; - path: "streamData"; - }, - { - kind: "account"; - path: "depositTokenProgram"; - }, - { - kind: "account"; - path: "depositTokenMint"; - }, + { kind: "account"; path: "streamData" }, + { kind: "account"; path: "depositTokenProgram" }, + { kind: "account"; path: "depositTokenMint" }, ]; program: { kind: "const"; @@ -591,27 +467,12 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "const"; - value: [109, 101, 116, 97, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "tokenMetadataProgram"; - }, - { - kind: "account"; - path: "streamNftMint"; - }, - { - kind: "const"; - value: [101, 100, 105, 116, 105, 111, 110]; - }, + { kind: "const"; value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account"; path: "tokenMetadataProgram" }, + { kind: "account"; path: "streamNftMint" }, + { kind: "const"; value: [101, 100, 105, 116, 105, 111, 110] }, ]; - program: { - kind: "account"; - path: "tokenMetadataProgram"; - }; + program: { kind: "account"; path: "tokenMetadataProgram" }; }; }, { @@ -620,23 +481,11 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "const"; - value: [109, 101, 116, 97, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "tokenMetadataProgram"; - }, - { - kind: "account"; - path: "streamNftMint"; - }, + { kind: "const"; value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account"; path: "tokenMetadataProgram" }, + { kind: "account"; path: "streamNftMint" }, ]; - program: { - kind: "account"; - path: "tokenMetadataProgram"; - }; + program: { kind: "account"; path: "tokenMetadataProgram" }; }; }, { @@ -644,14 +493,8 @@ type Idl = { docs: ["Program account: the Associated Token program."]; address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"; }, - { - name: "depositTokenProgram"; - docs: ["Program account: the Token program of the deposit token."]; - }, - { - name: "nftTokenProgram"; - docs: ["Program account: the Token program of the stream NFT."]; - }, + { name: "depositTokenProgram"; docs: ["Program account: the Token program of the deposit token."] }, + { name: "nftTokenProgram"; docs: ["Program account: the Token program of the stream NFT."] }, { name: "tokenMetadataProgram"; docs: ["Program account: the Token Metadata program."]; @@ -662,41 +505,16 @@ type Idl = { docs: ["Program account: the System program."]; address: "11111111111111111111111111111111"; }, - { - name: "rent"; - docs: ["Sysvar account: Rent."]; - address: "SysvarRent111111111111111111111111111111111"; - }, + { name: "rent"; docs: ["Sysvar account: Rent."]; address: "SysvarRent111111111111111111111111111111111" }, ]; args: [ - { - name: "salt"; - type: "u128"; - }, - { - name: "depositAmount"; - type: "u64"; - }, - { - name: "cliffDuration"; - type: "u64"; - }, - { - name: "totalDuration"; - type: "u64"; - }, - { - name: "startUnlockAmount"; - type: "u64"; - }, - { - name: "cliffUnlockAmount"; - type: "u64"; - }, - { - name: "isCancelable"; - type: "bool"; - }, + { name: "salt"; type: "u128" }, + { name: "depositAmount"; type: "u64" }, + { name: "cliffDuration"; type: "u64" }, + { name: "totalDuration"; type: "u64" }, + { name: "startUnlockAmount"; type: "u64" }, + { name: "cliffUnlockAmount"; type: "u64" }, + { name: "isCancelable"; type: "bool" }, ]; }, { @@ -756,18 +574,9 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "account"; - path: "creator"; - }, - { - kind: "account"; - path: "depositTokenProgram"; - }, - { - kind: "account"; - path: "depositTokenMint"; - }, + { kind: "account"; path: "creator" }, + { kind: "account"; path: "depositTokenProgram" }, + { kind: "account"; path: "depositTokenMint" }, ]; program: { kind: "const"; @@ -808,14 +617,8 @@ type Idl = { }; }; }, - { - name: "recipient"; - docs: ["Read account: the recipient of the stream."]; - }, - { - name: "sender"; - docs: ["Read account: the sender of the stream."]; - }, + { name: "recipient"; docs: ["Read account: the recipient of the stream."] }, + { name: "sender"; docs: ["Read account: the sender of the stream."] }, { name: "nftCollectionData"; docs: ["Write account: the NFT collection data storing the total supply."]; @@ -834,27 +637,12 @@ type Idl = { docs: ["Write account: the master edition account for the NFT collection."]; pda: { seeds: [ - { - kind: "const"; - value: [109, 101, 116, 97, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "tokenMetadataProgram"; - }, - { - kind: "account"; - path: "nftCollectionMint"; - }, - { - kind: "const"; - value: [101, 100, 105, 116, 105, 111, 110]; - }, + { kind: "const"; value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account"; path: "tokenMetadataProgram" }, + { kind: "account"; path: "nftCollectionMint" }, + { kind: "const"; value: [101, 100, 105, 116, 105, 111, 110] }, ]; - program: { - kind: "account"; - path: "tokenMetadataProgram"; - }; + program: { kind: "account"; path: "tokenMetadataProgram" }; }; }, { @@ -863,23 +651,11 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "const"; - value: [109, 101, 116, 97, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "tokenMetadataProgram"; - }, - { - kind: "account"; - path: "nftCollectionMint"; - }, + { kind: "const"; value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account"; path: "tokenMetadataProgram" }, + { kind: "account"; path: "nftCollectionMint" }, ]; - program: { - kind: "account"; - path: "tokenMetadataProgram"; - }; + program: { kind: "account"; path: "tokenMetadataProgram" }; }; }, { @@ -894,28 +670,16 @@ type Idl = { ]; }; }, - { - name: "depositTokenMint"; - docs: ["Read account: the mint account for the deposit token."]; - }, + { name: "depositTokenMint"; docs: ["Read account: the mint account for the deposit token."] }, { name: "streamNftMint"; docs: ["Create account: the mint account for the stream NFT."]; writable: true; pda: { seeds: [ - { - kind: "const"; - value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116]; - }, - { - kind: "account"; - path: "sender"; - }, - { - kind: "arg"; - path: "salt"; - }, + { kind: "const"; value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116] }, + { kind: "account"; path: "sender" }, + { kind: "arg"; path: "salt" }, ]; }; }, @@ -925,18 +689,9 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "account"; - path: "recipient"; - }, - { - kind: "account"; - path: "nftTokenProgram"; - }, - { - kind: "account"; - path: "streamNftMint"; - }, + { kind: "account"; path: "recipient" }, + { kind: "account"; path: "nftTokenProgram" }, + { kind: "account"; path: "streamNftMint" }, ]; program: { kind: "const"; @@ -983,14 +738,8 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "const"; - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "streamNftMint"; - }, + { kind: "const"; value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account"; path: "streamNftMint" }, ]; }; }, @@ -1000,18 +749,9 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "account"; - path: "streamData"; - }, - { - kind: "account"; - path: "depositTokenProgram"; - }, - { - kind: "account"; - path: "depositTokenMint"; - }, + { kind: "account"; path: "streamData" }, + { kind: "account"; path: "depositTokenProgram" }, + { kind: "account"; path: "depositTokenMint" }, ]; program: { kind: "const"; @@ -1058,27 +798,12 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "const"; - value: [109, 101, 116, 97, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "tokenMetadataProgram"; - }, - { - kind: "account"; - path: "streamNftMint"; - }, - { - kind: "const"; - value: [101, 100, 105, 116, 105, 111, 110]; - }, + { kind: "const"; value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account"; path: "tokenMetadataProgram" }, + { kind: "account"; path: "streamNftMint" }, + { kind: "const"; value: [101, 100, 105, 116, 105, 111, 110] }, ]; - program: { - kind: "account"; - path: "tokenMetadataProgram"; - }; + program: { kind: "account"; path: "tokenMetadataProgram" }; }; }, { @@ -1087,23 +812,11 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "const"; - value: [109, 101, 116, 97, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "tokenMetadataProgram"; - }, - { - kind: "account"; - path: "streamNftMint"; - }, + { kind: "const"; value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account"; path: "tokenMetadataProgram" }, + { kind: "account"; path: "streamNftMint" }, ]; - program: { - kind: "account"; - path: "tokenMetadataProgram"; - }; + program: { kind: "account"; path: "tokenMetadataProgram" }; }; }, { @@ -1111,14 +824,8 @@ type Idl = { docs: ["Program account: the Associated Token program."]; address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"; }, - { - name: "depositTokenProgram"; - docs: ["Program account: the Token program of the deposit token."]; - }, - { - name: "nftTokenProgram"; - docs: ["Program account: the Token program of the stream NFT."]; - }, + { name: "depositTokenProgram"; docs: ["Program account: the Token program of the deposit token."] }, + { name: "nftTokenProgram"; docs: ["Program account: the Token program of the stream NFT."] }, { name: "tokenMetadataProgram"; docs: ["Program account: the Token Metadata program."]; @@ -1129,45 +836,17 @@ type Idl = { docs: ["Program account: the System program."]; address: "11111111111111111111111111111111"; }, - { - name: "rent"; - docs: ["Sysvar account: Rent."]; - address: "SysvarRent111111111111111111111111111111111"; - }, + { name: "rent"; docs: ["Sysvar account: Rent."]; address: "SysvarRent111111111111111111111111111111111" }, ]; args: [ - { - name: "salt"; - type: "u128"; - }, - { - name: "depositAmount"; - type: "u64"; - }, - { - name: "startTime"; - type: "u64"; - }, - { - name: "cliffTime"; - type: "u64"; - }, - { - name: "endTime"; - type: "u64"; - }, - { - name: "startUnlockAmount"; - type: "u64"; - }, - { - name: "cliffUnlockAmount"; - type: "u64"; - }, - { - name: "isCancelable"; - type: "bool"; - }, + { name: "salt"; type: "u128" }, + { name: "depositAmount"; type: "u64" }, + { name: "startTime"; type: "u64" }, + { name: "cliffTime"; type: "u64" }, + { name: "endTime"; type: "u64" }, + { name: "startUnlockAmount"; type: "u64" }, + { name: "cliffUnlockAmount"; type: "u64" }, + { name: "isCancelable"; type: "bool" }, ]; }, { @@ -1188,24 +867,12 @@ type Idl = { ]; discriminator: [175, 175, 109, 31, 13, 152, 155, 237]; accounts: [ - { - name: "initializer"; - docs: ["Write account: the initializer of the program."]; - writable: true; - signer: true; - }, + { name: "initializer"; docs: ["Write account: the initializer of the program."]; writable: true; signer: true }, { name: "treasury"; docs: ["Create account: the treasury account that will hold the fees."]; writable: true; - pda: { - seeds: [ - { - kind: "const"; - value: [116, 114, 101, 97, 115, 117, 114, 121]; - }, - ]; - }; + pda: { seeds: [{ kind: "const"; value: [116, 114, 101, 97, 115, 117, 114, 121] }] }; }, { name: "nftCollectionData"; @@ -1226,27 +893,12 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "const"; - value: [109, 101, 116, 97, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "tokenMetadataProgram"; - }, - { - kind: "account"; - path: "nftCollectionMint"; - }, - { - kind: "const"; - value: [101, 100, 105, 116, 105, 111, 110]; - }, + { kind: "const"; value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account"; path: "tokenMetadataProgram" }, + { kind: "account"; path: "nftCollectionMint" }, + { kind: "const"; value: [101, 100, 105, 116, 105, 111, 110] }, ]; - program: { - kind: "account"; - path: "tokenMetadataProgram"; - }; + program: { kind: "account"; path: "tokenMetadataProgram" }; }; }, { @@ -1255,23 +907,11 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "const"; - value: [109, 101, 116, 97, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "tokenMetadataProgram"; - }, - { - kind: "account"; - path: "nftCollectionMint"; - }, - ]; - program: { - kind: "account"; - path: "tokenMetadataProgram"; - }; + { kind: "const"; value: [109, 101, 116, 97, 100, 97, 116, 97] }, + { kind: "account"; path: "tokenMetadataProgram" }, + { kind: "account"; path: "nftCollectionMint" }, + ]; + program: { kind: "account"; path: "tokenMetadataProgram" }; }; }, { @@ -1293,18 +933,9 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "account"; - path: "treasury"; - }, - { - kind: "account"; - path: "nftTokenProgram"; - }, - { - kind: "account"; - path: "nftCollectionMint"; - }, + { kind: "account"; path: "treasury" }, + { kind: "account"; path: "nftTokenProgram" }, + { kind: "account"; path: "nftCollectionMint" }, ]; program: { kind: "const"; @@ -1350,20 +981,13 @@ type Idl = { docs: ["Program account: the Associated Token program."]; address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"; }, - { - name: "nftTokenProgram"; - docs: ["Program account: the Token program of the collection NFT."]; - }, + { name: "nftTokenProgram"; docs: ["Program account: the Token program of the collection NFT."] }, { name: "tokenMetadataProgram"; docs: ["Program account: the Token Metadata program."]; address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"; }, - { - name: "rent"; - docs: ["Sysvar account: Rent."]; - address: "SysvarRent111111111111111111111111111111111"; - }, + { name: "rent"; docs: ["Sysvar account: Rent."]; address: "SysvarRent111111111111111111111111111111111" }, { name: "systemProgram"; docs: ["Program account: the System program."]; @@ -1371,18 +995,9 @@ type Idl = { }, ]; args: [ - { - name: "feeCollector"; - type: "pubkey"; - }, - { - name: "chainlinkProgram"; - type: "pubkey"; - }, - { - name: "chainlinkSolUsdFeed"; - type: "pubkey"; - }, + { name: "feeCollector"; type: "pubkey" }, + { name: "chainlinkProgram"; type: "pubkey" }, + { name: "chainlinkSolUsdFeed"; type: "pubkey" }, ]; }, { @@ -1406,21 +1021,12 @@ type Idl = { docs: ["Read account: the account storing stream details."]; pda: { seeds: [ - { - kind: "const"; - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "streamNftMint"; - }, + { kind: "const"; value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account"; path: "streamNftMint" }, ]; }; }, - { - name: "streamNftMint"; - docs: ["Read account: the mint account for the stream NFT."]; - }, + { name: "streamNftMint"; docs: ["Read account: the mint account for the stream NFT."] }, ]; args: []; returns: "u64"; @@ -1441,32 +1047,19 @@ type Idl = { ]; discriminator: [241, 157, 138, 210, 8, 235, 187, 123]; accounts: [ - { - name: "sender"; - docs: ["Write account: the sender of the stream."]; - signer: true; - }, + { name: "sender"; docs: ["Write account: the sender of the stream."]; signer: true }, { name: "streamData"; docs: ["Write account: the stream data account storing stream details."]; writable: true; pda: { seeds: [ - { - kind: "const"; - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "streamNftMint"; - }, + { kind: "const"; value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account"; path: "streamNftMint" }, ]; }; }, - { - name: "streamNftMint"; - docs: ["Read account: the mint account for the stream NFT."]; - }, + { name: "streamNftMint"; docs: ["Read account: the mint account for the stream NFT."] }, ]; args: []; }, @@ -1490,28 +1083,15 @@ type Idl = { docs: ["Read account: the account storing stream details."]; pda: { seeds: [ - { - kind: "const"; - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "streamNftMint"; - }, + { kind: "const"; value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account"; path: "streamNftMint" }, ]; }; }, - { - name: "streamNftMint"; - docs: ["Read account: the mint account for the stream NFT."]; - }, + { name: "streamNftMint"; docs: ["Read account: the mint account for the stream NFT."] }, ]; args: []; - returns: { - defined: { - name: "streamStatus"; - }; - }; + returns: { defined: { name: "streamStatus" } }; }, { name: "streamExists"; @@ -1530,32 +1110,14 @@ type Idl = { docs: ["Read account: the mint account for the stream NFT."]; pda: { seeds: [ - { - kind: "const"; - value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116]; - }, - { - kind: "arg"; - path: "sender"; - }, - { - kind: "arg"; - path: "salt"; - }, + { kind: "const"; value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116] }, + { kind: "arg"; path: "sender" }, + { kind: "arg"; path: "salt" }, ]; }; }, ]; - args: [ - { - name: "sender"; - type: "pubkey"; - }, - { - name: "salt"; - type: "u128"; - }, - ]; + args: [{ name: "sender"; type: "pubkey" }, { name: "salt"; type: "u128" }]; returns: "bool"; }, { @@ -1584,21 +1146,12 @@ type Idl = { docs: ["Read account: the account storing stream details."]; pda: { seeds: [ - { - kind: "const"; - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "streamNftMint"; - }, + { kind: "const"; value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account"; path: "streamNftMint" }, ]; }; }, - { - name: "streamNftMint"; - docs: ["Read account: the mint account for the stream NFT."]; - }, + { name: "streamNftMint"; docs: ["Read account: the mint account for the stream NFT."] }, ]; args: []; returns: "u64"; @@ -1611,22 +1164,11 @@ type Idl = { { name: "treasury"; docs: ["Read account: the account storing the treasury details."]; - pda: { - seeds: [ - { - kind: "const"; - value: [116, 114, 101, 97, 115, 117, 114, 121]; - }, - ]; - }; + pda: { seeds: [{ kind: "const"; value: [116, 114, 101, 97, 115, 117, 114, 121] }] }; }, ]; args: []; - returns: { - defined: { - name: "treasury"; - }; - }; + returns: { defined: { name: "treasury" } }; }, { name: "withdraw"; @@ -1670,10 +1212,7 @@ type Idl = { writable: true; signer: true; }, - { - name: "streamRecipient"; - docs: ["Read account: the recipient of the stream who owns the stream NFT."]; - }, + { name: "streamRecipient"; docs: ["Read account: the recipient of the stream who owns the stream NFT."] }, { name: "withdrawalRecipient"; docs: ["Read account: the account that will receive the withdrawn tokens.", "recipient."]; @@ -1684,18 +1223,9 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "account"; - path: "withdrawalRecipient"; - }, - { - kind: "account"; - path: "depositedTokenProgram"; - }, - { - kind: "account"; - path: "depositedTokenMint"; - }, + { kind: "account"; path: "withdrawalRecipient" }, + { kind: "account"; path: "depositedTokenProgram" }, + { kind: "account"; path: "depositedTokenMint" }, ]; program: { kind: "const"; @@ -1740,36 +1270,17 @@ type Idl = { name: "treasury"; docs: ["Write account: the treasury account that receives the withdrawal fee."]; writable: true; - pda: { - seeds: [ - { - kind: "const"; - value: [116, 114, 101, 97, 115, 117, 114, 121]; - }, - ]; - }; - }, - { - name: "depositedTokenMint"; - docs: ["Read account: the mint account for the deposited token."]; + pda: { seeds: [{ kind: "const"; value: [116, 114, 101, 97, 115, 117, 114, 121] }] }; }, + { name: "depositedTokenMint"; docs: ["Read account: the mint account for the deposited token."] }, { name: "recipientStreamNftAta"; docs: ["Read account: the ATA for the stream NFT owned by recipient.", ""]; pda: { seeds: [ - { - kind: "account"; - path: "streamRecipient"; - }, - { - kind: "account"; - path: "nftTokenProgram"; - }, - { - kind: "account"; - path: "streamNftMint"; - }, + { kind: "account"; path: "streamRecipient" }, + { kind: "account"; path: "nftTokenProgram" }, + { kind: "account"; path: "streamNftMint" }, ]; program: { kind: "const"; @@ -1816,14 +1327,8 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "const"; - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "streamNftMint"; - }, + { kind: "const"; value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account"; path: "streamNftMint" }, ]; }; }, @@ -1833,18 +1338,9 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "account"; - path: "streamData"; - }, - { - kind: "account"; - path: "depositedTokenProgram"; - }, - { - kind: "account"; - path: "depositedTokenMint"; - }, + { kind: "account"; path: "streamData" }, + { kind: "account"; path: "depositedTokenProgram" }, + { kind: "account"; path: "depositedTokenMint" }, ]; program: { kind: "const"; @@ -1885,10 +1381,7 @@ type Idl = { }; }; }, - { - name: "streamNftMint"; - docs: ["Read account: the mint account for the stream NFT."]; - }, + { name: "streamNftMint"; docs: ["Read account: the mint account for the stream NFT."] }, { name: "associatedTokenProgram"; docs: ["Program account: the Associated Token program."]; @@ -1898,30 +1391,16 @@ type Idl = { name: "chainlinkProgram"; docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."]; }, - { - name: "chainlinkSolUsdFeed"; - docs: ["Read account: The account providing the SOL/USD price feed data."]; - }, - { - name: "depositedTokenProgram"; - docs: ["Program account: the Token program of the deposited token."]; - }, - { - name: "nftTokenProgram"; - docs: ["Program account: the Token program of the stream NFT."]; - }, + { name: "chainlinkSolUsdFeed"; docs: ["Read account: The account providing the SOL/USD price feed data."] }, + { name: "depositedTokenProgram"; docs: ["Program account: the Token program of the deposited token."] }, + { name: "nftTokenProgram"; docs: ["Program account: the Token program of the stream NFT."] }, { name: "systemProgram"; docs: ["Program account: the System program."]; address: "11111111111111111111111111111111"; }, ]; - args: [ - { - name: "amount"; - type: "u64"; - }, - ]; + args: [{ name: "amount"; type: "u64" }]; }, { name: "withdrawMax"; @@ -1948,10 +1427,7 @@ type Idl = { writable: true; signer: true; }, - { - name: "streamRecipient"; - docs: ["Read account: the recipient of the stream who owns the stream NFT."]; - }, + { name: "streamRecipient"; docs: ["Read account: the recipient of the stream who owns the stream NFT."] }, { name: "withdrawalRecipient"; docs: ["Read account: the account that will receive the withdrawn tokens.", "recipient."]; @@ -1962,18 +1438,9 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "account"; - path: "withdrawalRecipient"; - }, - { - kind: "account"; - path: "depositedTokenProgram"; - }, - { - kind: "account"; - path: "depositedTokenMint"; - }, + { kind: "account"; path: "withdrawalRecipient" }, + { kind: "account"; path: "depositedTokenProgram" }, + { kind: "account"; path: "depositedTokenMint" }, ]; program: { kind: "const"; @@ -2018,36 +1485,17 @@ type Idl = { name: "treasury"; docs: ["Write account: the treasury account that receives the withdrawal fee."]; writable: true; - pda: { - seeds: [ - { - kind: "const"; - value: [116, 114, 101, 97, 115, 117, 114, 121]; - }, - ]; - }; - }, - { - name: "depositedTokenMint"; - docs: ["Read account: the mint account for the deposited token."]; + pda: { seeds: [{ kind: "const"; value: [116, 114, 101, 97, 115, 117, 114, 121] }] }; }, + { name: "depositedTokenMint"; docs: ["Read account: the mint account for the deposited token."] }, { name: "recipientStreamNftAta"; docs: ["Read account: the ATA for the stream NFT owned by recipient.", ""]; pda: { seeds: [ - { - kind: "account"; - path: "streamRecipient"; - }, - { - kind: "account"; - path: "nftTokenProgram"; - }, - { - kind: "account"; - path: "streamNftMint"; - }, + { kind: "account"; path: "streamRecipient" }, + { kind: "account"; path: "nftTokenProgram" }, + { kind: "account"; path: "streamNftMint" }, ]; program: { kind: "const"; @@ -2094,14 +1542,8 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "const"; - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "streamNftMint"; - }, + { kind: "const"; value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account"; path: "streamNftMint" }, ]; }; }, @@ -2111,18 +1553,9 @@ type Idl = { writable: true; pda: { seeds: [ - { - kind: "account"; - path: "streamData"; - }, - { - kind: "account"; - path: "depositedTokenProgram"; - }, - { - kind: "account"; - path: "depositedTokenMint"; - }, + { kind: "account"; path: "streamData" }, + { kind: "account"; path: "depositedTokenProgram" }, + { kind: "account"; path: "depositedTokenMint" }, ]; program: { kind: "const"; @@ -2163,10 +1596,7 @@ type Idl = { }; }; }, - { - name: "streamNftMint"; - docs: ["Read account: the mint account for the stream NFT."]; - }, + { name: "streamNftMint"; docs: ["Read account: the mint account for the stream NFT."] }, { name: "associatedTokenProgram"; docs: ["Program account: the Associated Token program."]; @@ -2176,18 +1606,9 @@ type Idl = { name: "chainlinkProgram"; docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."]; }, - { - name: "chainlinkSolUsdFeed"; - docs: ["Read account: The account providing the SOL/USD price feed data."]; - }, - { - name: "depositedTokenProgram"; - docs: ["Program account: the Token program of the deposited token."]; - }, - { - name: "nftTokenProgram"; - docs: ["Program account: the Token program of the stream NFT."]; - }, + { name: "chainlinkSolUsdFeed"; docs: ["Read account: The account providing the SOL/USD price feed data."] }, + { name: "depositedTokenProgram"; docs: ["Program account: the Token program of the deposited token."] }, + { name: "nftTokenProgram"; docs: ["Program account: the Token program of the stream NFT."] }, { name: "systemProgram"; docs: ["Program account: the System program."]; @@ -2217,21 +1638,12 @@ type Idl = { docs: ["Read account: the account storing stream details."]; pda: { seeds: [ - { - kind: "const"; - value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97]; - }, - { - kind: "account"; - path: "streamNftMint"; - }, + { kind: "const"; value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account"; path: "streamNftMint" }, ]; }; }, - { - name: "streamNftMint"; - docs: ["Read account: the mint account for the stream NFT."]; - }, + { name: "streamNftMint"; docs: ["Read account: the mint account for the stream NFT."] }, ]; args: []; returns: "u64"; @@ -2251,140 +1663,46 @@ type Idl = { { name: "treasury"; docs: ["Read account: the treasury account that receives the withdrawal fee."]; - pda: { - seeds: [ - { - kind: "const"; - value: [116, 114, 101, 97, 115, 117, 114, 121]; - }, - ]; - }; + pda: { seeds: [{ kind: "const"; value: [116, 114, 101, 97, 115, 117, 114, 121] }] }; }, { name: "chainlinkProgram"; docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."]; }, - { - name: "chainlinkSolUsdFeed"; - docs: ["Read account: The account providing the SOL/USD price feed data."]; - }, + { name: "chainlinkSolUsdFeed"; docs: ["Read account: The account providing the SOL/USD price feed data."] }, ]; args: []; returns: "u64"; }, ]; accounts: [ - { - name: "nftCollectionData"; - discriminator: [159, 26, 37, 150, 44, 84, 171, 172]; - }, - { - name: "streamData"; - discriminator: [61, 89, 148, 141, 154, 81, 86, 113]; - }, - { - name: "treasury"; - discriminator: [238, 239, 123, 238, 89, 1, 168, 253]; - }, + { name: "nftCollectionData"; discriminator: [159, 26, 37, 150, 44, 84, 171, 172] }, + { name: "streamData"; discriminator: [61, 89, 148, 141, 154, 81, 86, 113] }, + { name: "treasury"; discriminator: [238, 239, 123, 238, 89, 1, 168, 253] }, ]; events: [ - { - name: "cancelLockupStream"; - discriminator: [82, 106, 117, 112, 153, 245, 190, 66]; - }, - { - name: "createLockupLinearStream"; - discriminator: [234, 181, 19, 52, 67, 64, 151, 173]; - }, - { - name: "feesCollected"; - discriminator: [233, 23, 117, 225, 107, 178, 254, 8]; - }, - { - name: "renounceLockupStream"; - discriminator: [28, 66, 144, 150, 118, 56, 81, 93]; - }, - { - name: "withdrawFromLockupStream"; - discriminator: [232, 101, 27, 150, 85, 222, 243, 9]; - }, + { name: "cancelLockupStream"; discriminator: [82, 106, 117, 112, 153, 245, 190, 66] }, + { name: "createLockupLinearStream"; discriminator: [234, 181, 19, 52, 67, 64, 151, 173] }, + { name: "feesCollected"; discriminator: [233, 23, 117, 225, 107, 178, 254, 8] }, + { name: "renounceLockupStream"; discriminator: [28, 66, 144, 150, 118, 56, 81, 93] }, + { name: "withdrawFromLockupStream"; discriminator: [232, 101, 27, 150, 85, 222, 243, 9] }, ]; errors: [ - { - code: 6000; - name: "streamDepleted"; - msg: "Can't perform the action on a depleted stream!"; - }, - { - code: 6001; - name: "streamCanceled"; - msg: "Can't renounce an already-renounced Stream!"; - }, - { - code: 6002; - name: "streamIsNotCancelable"; - msg: "Can't cancel a non-cancelable Stream!"; - }, - { - code: 6003; - name: "streamSettled"; - msg: "Can't cancel a settled Stream!"; - }, - { - code: 6004; - name: "cantCollectZeroFees"; - msg: "Can't collect zero fees!"; - }, - { - code: 6005; - name: "cliffTimeNotLessThanEndTime"; - msg: "Invalid cliff time of the Stream!"; - }, - { - code: 6006; - name: "cliffTimeZeroUnlockAmountNotZero"; - msg: "Cliff time zero but unlock amount not zero!"; - }, - { - code: 6007; - name: "depositAmountZero"; - msg: "Invalid deposit amount!"; - }, - { - code: 6008; - name: "startTimeNotLessThanCliffTime"; - msg: "Start time must be less than cliff time!"; - }, - { - code: 6009; - name: "startTimeNotLessThanEndTime"; - msg: "Start time must be less than end time!"; - }, - { - code: 6010; - name: "startTimeZero"; - msg: "Start time can't be zero!"; - }, - { - code: 6011; - name: "unlockAmountsSumTooHigh"; - msg: "Unlock amounts sum is greater than deposit amount!"; - }, - { - code: 6012; - name: "streamAlreadyNonCancelable"; - msg: "Can't renounce a non-cancelable Stream!"; - }, - { - code: 6013; - name: "overdraw"; - msg: "Attempting to withdraw more than available in the stream!"; - }, - { - code: 6014; - name: "withdrawAmountZero"; - msg: "Can't withdraw a zero amount!"; - }, + { code: 6000; name: "streamDepleted"; msg: "Can't perform the action on a depleted stream!" }, + { code: 6001; name: "streamCanceled"; msg: "Can't renounce an already-renounced Stream!" }, + { code: 6002; name: "streamIsNotCancelable"; msg: "Can't cancel a non-cancelable Stream!" }, + { code: 6003; name: "streamSettled"; msg: "Can't cancel a settled Stream!" }, + { code: 6004; name: "cantCollectZeroFees"; msg: "Can't collect zero fees!" }, + { code: 6005; name: "cliffTimeNotLessThanEndTime"; msg: "Invalid cliff time of the Stream!" }, + { code: 6006; name: "cliffTimeZeroUnlockAmountNotZero"; msg: "Cliff time zero but unlock amount not zero!" }, + { code: 6007; name: "depositAmountZero"; msg: "Invalid deposit amount!" }, + { code: 6008; name: "startTimeNotLessThanCliffTime"; msg: "Start time must be less than cliff time!" }, + { code: 6009; name: "startTimeNotLessThanEndTime"; msg: "Start time must be less than end time!" }, + { code: 6010; name: "startTimeZero"; msg: "Start time can't be zero!" }, + { code: 6011; name: "unlockAmountsSumTooHigh"; msg: "Unlock amounts sum is greater than deposit amount!" }, + { code: 6012; name: "streamAlreadyNonCancelable"; msg: "Can't renounce a non-cancelable Stream!" }, + { code: 6013; name: "overdraw"; msg: "Attempting to withdraw more than available in the stream!" }, + { code: 6014; name: "withdrawAmountZero"; msg: "Can't withdraw a zero amount!" }, ]; types: [ { @@ -2392,26 +1710,11 @@ type Idl = { type: { kind: "struct"; fields: [ - { - name: "startUnlock"; - type: "u64"; - }, - { - name: "cliffUnlock"; - type: "u64"; - }, - { - name: "deposited"; - type: "u64"; - }, - { - name: "refunded"; - type: "u64"; - }, - { - name: "withdrawn"; - type: "u64"; - }, + { name: "startUnlock"; type: "u64" }, + { name: "cliffUnlock"; type: "u64" }, + { name: "deposited"; type: "u64" }, + { name: "refunded"; type: "u64" }, + { name: "withdrawn"; type: "u64" }, ]; }; }, @@ -2420,26 +1723,11 @@ type Idl = { type: { kind: "struct"; fields: [ - { - name: "depositedTokenMint"; - type: "pubkey"; - }, - { - name: "recipientAmount"; - type: "u64"; - }, - { - name: "senderAmount"; - type: "u64"; - }, - { - name: "streamData"; - type: "pubkey"; - }, - { - name: "streamNftMint"; - type: "pubkey"; - }, + { name: "depositedTokenMint"; type: "pubkey" }, + { name: "recipientAmount"; type: "u64" }, + { name: "senderAmount"; type: "u64" }, + { name: "streamData"; type: "pubkey" }, + { name: "streamNftMint"; type: "pubkey" }, ]; }; }, @@ -2448,30 +1736,12 @@ type Idl = { type: { kind: "struct"; fields: [ - { - name: "depositTokenDecimals"; - type: "u8"; - }, - { - name: "depositTokenMint"; - type: "pubkey"; - }, - { - name: "recipient"; - type: "pubkey"; - }, - { - name: "salt"; - type: "u128"; - }, - { - name: "streamData"; - type: "pubkey"; - }, - { - name: "streamNftMint"; - type: "pubkey"; - }, + { name: "depositTokenDecimals"; type: "u8" }, + { name: "depositTokenMint"; type: "pubkey" }, + { name: "recipient"; type: "pubkey" }, + { name: "salt"; type: "u128" }, + { name: "streamData"; type: "pubkey" }, + { name: "streamNftMint"; type: "pubkey" }, ]; }; }, @@ -2480,54 +1750,24 @@ type Idl = { type: { kind: "struct"; fields: [ - { - name: "feeAmount"; - type: "u64"; - }, - { - name: "feeCollector"; - type: "pubkey"; - }, - { - name: "feeRecipient"; - type: "pubkey"; - }, + { name: "feeAmount"; type: "u64" }, + { name: "feeCollector"; type: "pubkey" }, + { name: "feeRecipient"; type: "pubkey" }, ]; }; }, { name: "nftCollectionData"; - type: { - kind: "struct"; - fields: [ - { - name: "totalSupply"; - type: "u64"; - }, - { - name: "bump"; - type: "u8"; - }, - ]; - }; + type: { kind: "struct"; fields: [{ name: "totalSupply"; type: "u64" }, { name: "bump"; type: "u8" }] }; }, { name: "renounceLockupStream"; type: { kind: "struct"; fields: [ - { - name: "depositedTokenMint"; - type: "pubkey"; - }, - { - name: "streamData"; - type: "pubkey"; - }, - { - name: "streamNftMint"; - type: "pubkey"; - }, + { name: "depositedTokenMint"; type: "pubkey" }, + { name: "streamData"; type: "pubkey" }, + { name: "streamNftMint"; type: "pubkey" }, ]; }; }, @@ -2536,50 +1776,15 @@ type Idl = { type: { kind: "struct"; fields: [ - { - name: "amounts"; - type: { - defined: { - name: "amounts"; - }; - }; - }, - { - name: "depositedTokenMint"; - type: "pubkey"; - }, - { - name: "bump"; - type: "u8"; - }, - { - name: "salt"; - type: "u128"; - }, - { - name: "isCancelable"; - type: "bool"; - }, - { - name: "isDepleted"; - type: "bool"; - }, - { - name: "timestamps"; - type: { - defined: { - name: "timestamps"; - }; - }; - }, - { - name: "sender"; - type: "pubkey"; - }, - { - name: "wasCanceled"; - type: "bool"; - }, + { name: "amounts"; type: { defined: { name: "amounts" } } }, + { name: "depositedTokenMint"; type: "pubkey" }, + { name: "bump"; type: "u8" }, + { name: "salt"; type: "u128" }, + { name: "isCancelable"; type: "bool" }, + { name: "isDepleted"; type: "bool" }, + { name: "timestamps"; type: { defined: { name: "timestamps" } } }, + { name: "sender"; type: "pubkey" }, + { name: "wasCanceled"; type: "bool" }, ]; }; }, @@ -2588,21 +1793,11 @@ type Idl = { type: { kind: "enum"; variants: [ - { - name: "pending"; - }, - { - name: "streaming"; - }, - { - name: "settled"; - }, - { - name: "canceled"; - }, - { - name: "depleted"; - }, + { name: "pending" }, + { name: "streaming" }, + { name: "settled" }, + { name: "canceled" }, + { name: "depleted" }, ]; }; }, @@ -2611,20 +1806,7 @@ type Idl = { docs: ["Groups the timestamps for a Lockup stream."]; type: { kind: "struct"; - fields: [ - { - name: "cliff"; - type: "u64"; - }, - { - name: "end"; - type: "u64"; - }, - { - name: "start"; - type: "u64"; - }, - ]; + fields: [{ name: "cliff"; type: "u64" }, { name: "end"; type: "u64" }, { name: "start"; type: "u64" }]; }; }, { @@ -2632,22 +1814,10 @@ type Idl = { type: { kind: "struct"; fields: [ - { - name: "bump"; - type: "u8"; - }, - { - name: "feeCollector"; - type: "pubkey"; - }, - { - name: "chainlinkProgram"; - type: "pubkey"; - }, - { - name: "chainlinkSolUsdFeed"; - type: "pubkey"; - }, + { name: "bump"; type: "u8" }, + { name: "feeCollector"; type: "pubkey" }, + { name: "chainlinkProgram"; type: "pubkey" }, + { name: "chainlinkSolUsdFeed"; type: "pubkey" }, ]; }; }, @@ -2656,30 +1826,13 @@ type Idl = { type: { kind: "struct"; fields: [ - { - name: "depositedTokenMint"; - type: "pubkey"; - }, - { - name: "feeInLamports"; - type: "u64"; - }, - { - name: "streamData"; - type: "pubkey"; - }, - { - name: "streamNftMint"; - type: "pubkey"; - }, - { - name: "withdrawnAmount"; - type: "u64"; - }, + { name: "depositedTokenMint"; type: "pubkey" }, + { name: "feeInLamports"; type: "u64" }, + { name: "streamData"; type: "pubkey" }, + { name: "streamNftMint"; type: "pubkey" }, + { name: "withdrawnAmount"; type: "u64" }, ]; }; }, ]; }; - -export default Idl; diff --git a/src/solana/idl/lockup/v1.0/index.ts b/src/solana/idl/lockup/v1.0/index.ts index e861f0e..1b54219 100644 --- a/src/solana/idl/lockup/v1.0/index.ts +++ b/src/solana/idl/lockup/v1.0/index.ts @@ -1,2 +1,2 @@ -export { default as SablierLockupLinearV10IDL } from "./SablierLockupLinearV10"; -export type { default as SablierLockupLinearV10Type } from "./SablierLockupLinearV10Type"; +export { sablierLockupLinearIDL as SablierLockupLinearIDL } from "./SablierLockupLinear"; +export type { Idl as SablierLockupLinearType } from "./SablierLockupLinearType"; From 4998522bb39fab2f696be516bde25b083e6677f6 Mon Sep 17 00:00:00 2001 From: Paul Razvan Berg Date: Wed, 5 Nov 2025 18:11:21 +0200 Subject: [PATCH 3/3] refactor(solana): reorganize IDL structure into modular directories Split flat IDL files into organized directory structure with separate concerns (types, errors, structs, JSON artifacts). Add IDL-specific Biome config and update tooling dependencies. --- biome.jsonc | 10 +- bun.lock | 118 +- package.json | 4 + src/solana/idl/airdrops/index.ts | 1 - .../v1.0/SablierMerkleInstant/errors.ts | 9 + .../idl-type.ts} | 7 +- .../v1.0/SablierMerkleInstant/idl.json | 1049 ++++++++ .../idl.ts} | 526 ++-- .../v1.0/SablierMerkleInstant/index.ts | 21 + .../v1.0/SablierMerkleInstant/structs.ts | 49 + src/solana/idl/airdrops/v1.0/index.ts | 2 - src/solana/idl/biome.jsonc | 21 + src/solana/idl/index.ts | 2 - src/solana/idl/lockup/index.ts | 1 - .../lockup/v1.0/SablierLockupLinear/errors.ts | 20 + .../idl-type.ts} | 7 +- .../lockup/v1.0/SablierLockupLinear/idl.json | 2227 +++++++++++++++++ .../idl.ts} | 1008 ++++---- .../lockup/v1.0/SablierLockupLinear/index.ts | 21 + .../v1.0/SablierLockupLinear/structs.ts | 58 + src/solana/idl/lockup/v1.0/index.ts | 2 - src/solana/index.ts | 1 - 22 files changed, 4374 insertions(+), 790 deletions(-) delete mode 100644 src/solana/idl/airdrops/index.ts create mode 100644 src/solana/idl/airdrops/v1.0/SablierMerkleInstant/errors.ts rename src/solana/idl/airdrops/v1.0/{SablierMerkleInstantType.ts => SablierMerkleInstant/idl-type.ts} (99%) create mode 100644 src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.json rename src/solana/idl/airdrops/v1.0/{SablierMerkleInstant.ts => SablierMerkleInstant/idl.ts} (87%) create mode 100644 src/solana/idl/airdrops/v1.0/SablierMerkleInstant/index.ts create mode 100644 src/solana/idl/airdrops/v1.0/SablierMerkleInstant/structs.ts delete mode 100644 src/solana/idl/airdrops/v1.0/index.ts create mode 100644 src/solana/idl/biome.jsonc delete mode 100644 src/solana/idl/index.ts delete mode 100644 src/solana/idl/lockup/index.ts create mode 100644 src/solana/idl/lockup/v1.0/SablierLockupLinear/errors.ts rename src/solana/idl/lockup/v1.0/{SablierLockupLinearType.ts => SablierLockupLinear/idl-type.ts} (99%) create mode 100644 src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.json rename src/solana/idl/lockup/v1.0/{SablierLockupLinear.ts => SablierLockupLinear/idl.ts} (88%) create mode 100644 src/solana/idl/lockup/v1.0/SablierLockupLinear/index.ts create mode 100644 src/solana/idl/lockup/v1.0/SablierLockupLinear/structs.ts delete mode 100644 src/solana/idl/lockup/v1.0/index.ts delete mode 100644 src/solana/index.ts diff --git a/biome.jsonc b/biome.jsonc index 1873df7..ade489d 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -1,6 +1,7 @@ { "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", "extends": ["@sablier/devkit/biome"], + "root": true, "files": { "includes": ["**/*.{js,json,jsonc,ts}", "!node_modules/**/*"] }, @@ -16,7 +17,14 @@ } }, { - "includes": ["src/evm/releases/**/abi/**/*.ts", "src/solana/idl/**/*.ts"], + "includes": ["src/evm/releases/**/abi/**/*.ts"], + "assist": { + "actions": { + "source": { + "useSortedKeys": "off" + } + } + }, "javascript": { "formatter": { "expand": "never" // Never expand objects in the ABI to save number of lines diff --git a/bun.lock b/bun.lock index 96b2355..0a35222 100644 --- a/bun.lock +++ b/bun.lock @@ -4,6 +4,8 @@ "": { "name": "sablier", "dependencies": { + "@coral-xyz/anchor": "^0.32.1", + "@solana/web3.js": "^1.98.4", "lodash": "^4.17.21", "viem": "^2.37.9", }, @@ -39,6 +41,8 @@ "packages": { "@adraffy/ens-normalize": ["@adraffy/ens-normalize@1.11.1", "", {}, "sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ=="], + "@babel/runtime": ["@babel/runtime@7.28.4", "", {}, "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ=="], + "@biomejs/biome": ["@biomejs/biome@2.3.3", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.3.3", "@biomejs/cli-darwin-x64": "2.3.3", "@biomejs/cli-linux-arm64": "2.3.3", "@biomejs/cli-linux-arm64-musl": "2.3.3", "@biomejs/cli-linux-x64": "2.3.3", "@biomejs/cli-linux-x64-musl": "2.3.3", "@biomejs/cli-win32-arm64": "2.3.3", "@biomejs/cli-win32-x64": "2.3.3" }, "bin": { "biome": "bin/biome" } }, "sha512-zn/P1pRBCpDdhi+VNSMnpczOz9DnqzOA2c48K8xgxjDODvi5O8gs3a2H233rck/5HXpkFj6TmyoqVvxirZUnvg=="], "@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.3.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-5+JtW6RKmjqL9un0UtHV0ezOslAyYBzyl5ZhYiu7GHesX2x8NCDl6tXYrenv9m7e1RLbkO5E5Kh04kseMtz6lw=="], @@ -59,6 +63,12 @@ "@colors/colors": ["@colors/colors@1.6.0", "", {}, "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA=="], + "@coral-xyz/anchor": ["@coral-xyz/anchor@0.32.1", "", { "dependencies": { "@coral-xyz/anchor-errors": "^0.31.1", "@coral-xyz/borsh": "^0.31.1", "@noble/hashes": "^1.3.1", "@solana/web3.js": "^1.69.0", "bn.js": "^5.1.2", "bs58": "^4.0.1", "buffer-layout": "^1.2.2", "camelcase": "^6.3.0", "cross-fetch": "^3.1.5", "eventemitter3": "^4.0.7", "pako": "^2.0.3", "superstruct": "^0.15.4", "toml": "^3.0.0" } }, "sha512-zAyxFtfeje2FbMA1wzgcdVs7Hng/MijPKpRijoySPCicnvcTQs/+dnPZ/cR+LcXM9v9UYSyW81uRNYZtN5G4yg=="], + + "@coral-xyz/anchor-errors": ["@coral-xyz/anchor-errors@0.31.1", "", {}, "sha512-NhNEku4F3zzUSBtrYz84FzYWm48+9OvmT1Hhnwr6GnPQry2dsEqH/ti/7ASjjpoFTWRnPXrjAIT1qM6Isop+LQ=="], + + "@coral-xyz/borsh": ["@coral-xyz/borsh@0.31.1", "", { "dependencies": { "bn.js": "^5.1.2", "buffer-layout": "^1.2.0" }, "peerDependencies": { "@solana/web3.js": "^1.69.0" } }, "sha512-9N8AU9F0ubriKfNE3g1WF0/4dtlGXoBN/hd1PvbNBamBNwRgHxH4P+o3Zt7rSEloW1HUs6LfZEchlx9fW7POYw=="], + "@dabh/diagnostics": ["@dabh/diagnostics@2.0.8", "", { "dependencies": { "@so-ric/colorspace": "^1.1.6", "enabled": "2.0.x", "kuler": "^2.0.0" } }, "sha512-R4MSXTVnuMzGD7bzHdW2ZhhdPC/igELENcq5IjEverBvq5hn1SXCWcsi6eSsdWP0/Ur+SItRRjAktmdoX/8R/Q=="], "@emnapi/core": ["@emnapi/core@1.5.0", "", { "dependencies": { "@emnapi/wasi-threads": "1.1.0", "tslib": "^2.4.0" } }, "sha512-sbP8GzB1WDzacS8fgNPpHlp6C9VZe+SJP3F90W9rLemaQj2PzIuTEl1qDOYQf58YIpyjViI24y9aPWCjEzY2cg=="], @@ -251,12 +261,26 @@ "@so-ric/colorspace": ["@so-ric/colorspace@1.1.6", "", { "dependencies": { "color": "^5.0.2", "text-hex": "1.0.x" } }, "sha512-/KiKkpHNOBgkFJwu9sh48LkHSMYGyuTcSFK/qMBdnOAlrRJzRSXAOFB5qwzaVQuDl8wAvHVMkaASQDReTahxuw=="], + "@solana/buffer-layout": ["@solana/buffer-layout@4.0.1", "", { "dependencies": { "buffer": "~6.0.3" } }, "sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA=="], + + "@solana/codecs-core": ["@solana/codecs-core@2.3.0", "", { "dependencies": { "@solana/errors": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-oG+VZzN6YhBHIoSKgS5ESM9VIGzhWjEHEGNPSibiDTxFhsFWxNaz8LbMDPjBUE69r9wmdGLkrQ+wVPbnJcZPvw=="], + + "@solana/codecs-numbers": ["@solana/codecs-numbers@2.3.0", "", { "dependencies": { "@solana/codecs-core": "2.3.0", "@solana/errors": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-jFvvwKJKffvG7Iz9dmN51OGB7JBcy2CJ6Xf3NqD/VP90xak66m/Lg48T01u5IQ/hc15mChVHiBm+HHuOFDUrQg=="], + + "@solana/errors": ["@solana/errors@2.3.0", "", { "dependencies": { "chalk": "^5.4.1", "commander": "^14.0.0" }, "peerDependencies": { "typescript": ">=5.3.3" }, "bin": { "errors": "bin/cli.mjs" } }, "sha512-66RI9MAbwYV0UtP7kGcTBVLxJgUxoZGm8Fbc0ah+lGiAw17Gugco6+9GrJCV83VyF2mDWyYnYM9qdI3yjgpnaQ=="], + + "@solana/web3.js": ["@solana/web3.js@1.98.4", "", { "dependencies": { "@babel/runtime": "^7.25.0", "@noble/curves": "^1.4.2", "@noble/hashes": "^1.4.0", "@solana/buffer-layout": "^4.0.1", "@solana/codecs-numbers": "^2.1.0", "agentkeepalive": "^4.5.0", "bn.js": "^5.2.1", "borsh": "^0.7.0", "bs58": "^4.0.1", "buffer": "6.0.3", "fast-stable-stringify": "^1.0.0", "jayson": "^4.1.1", "node-fetch": "^2.7.0", "rpc-websockets": "^9.0.2", "superstruct": "^2.0.2" } }, "sha512-vv9lfnvjUsRiq//+j5pBdXig0IQdtzA0BRZ3bXEP4KaIyF1CcaydWqgyzQgfZMNIsWNWmG+AUHwPy4AHOD6gpw=="], + + "@swc/helpers": ["@swc/helpers@0.5.17", "", { "dependencies": { "tslib": "^2.8.0" } }, "sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A=="], + "@tybys/wasm-util": ["@tybys/wasm-util@0.10.1", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg=="], "@types/bun": ["@types/bun@1.3.1", "", { "dependencies": { "bun-types": "1.3.1" } }, "sha512-4jNMk2/K9YJtfqwoAa28c8wK+T7nvJFOjxI4h/7sORWcypRNxBpr+TPNaCfVWq70tLCJsqoFwcf0oI0JU/fvMQ=="], "@types/chai": ["@types/chai@5.2.2", "", { "dependencies": { "@types/deep-eql": "*" } }, "sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg=="], + "@types/connect": ["@types/connect@3.4.38", "", { "dependencies": { "@types/node": "*" } }, "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug=="], + "@types/deep-eql": ["@types/deep-eql@4.0.2", "", {}, "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw=="], "@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="], @@ -273,6 +297,10 @@ "@types/triple-beam": ["@types/triple-beam@1.3.5", "", {}, "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw=="], + "@types/uuid": ["@types/uuid@8.3.4", "", {}, "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw=="], + + "@types/ws": ["@types/ws@7.4.7", "", { "dependencies": { "@types/node": "*" } }, "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww=="], + "@vitest/expect": ["@vitest/expect@3.2.4", "", { "dependencies": { "@types/chai": "^5.2.2", "@vitest/spy": "3.2.4", "@vitest/utils": "3.2.4", "chai": "^5.2.0", "tinyrainbow": "^2.0.0" } }, "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig=="], "@vitest/mocker": ["@vitest/mocker@3.2.4", "", { "dependencies": { "@vitest/spy": "3.2.4", "estree-walker": "^3.0.3", "magic-string": "^0.30.17" }, "peerDependencies": { "msw": "^2.4.9", "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" }, "optionalPeers": ["msw", "vite"] }, "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ=="], @@ -291,6 +319,8 @@ "abitype": ["abitype@1.1.0", "", { "peerDependencies": { "typescript": ">=5.0.4", "zod": "^3.22.0 || ^4.0.0" }, "optionalPeers": ["typescript", "zod"] }, "sha512-6Vh4HcRxNMLA0puzPjM5GBgT4aAcFGKZzSgAXvuZ27shJP6NEpielTuqbBmZILR5/xd0PizkBGy5hReKz9jl5A=="], + "agentkeepalive": ["agentkeepalive@4.6.0", "", { "dependencies": { "humanize-ms": "^1.2.1" } }, "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ=="], + "ansi-escapes": ["ansi-escapes@7.1.1", "", { "dependencies": { "environment": "^1.0.0" } }, "sha512-Zhl0ErHcSRUaVfGUeUdDuLgpkEo8KIFjB4Y9uAc46ScOpdDiU1Dbyplh7qWJeJ/ZHpbyMSM26+X3BySgnIz40Q=="], "ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], @@ -313,12 +343,28 @@ "balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], + "base-x": ["base-x@3.0.11", "", { "dependencies": { "safe-buffer": "^5.0.1" } }, "sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA=="], + + "base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="], + "binary-extensions": ["binary-extensions@2.3.0", "", {}, "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw=="], + "bn.js": ["bn.js@5.2.2", "", {}, "sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw=="], + + "borsh": ["borsh@0.7.0", "", { "dependencies": { "bn.js": "^5.2.0", "bs58": "^4.0.0", "text-encoding-utf-8": "^1.0.2" } }, "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA=="], + "brace-expansion": ["brace-expansion@1.1.12", "", { "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg=="], "braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="], + "bs58": ["bs58@4.0.1", "", { "dependencies": { "base-x": "^3.0.2" } }, "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw=="], + + "buffer": ["buffer@6.0.3", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA=="], + + "buffer-layout": ["buffer-layout@1.2.2", "", {}, "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA=="], + + "bufferutil": ["bufferutil@4.0.9", "", { "dependencies": { "node-gyp-build": "^4.3.0" } }, "sha512-WDtdLmJvAuNNPzByAYpRo2rF1Mmradw6gvWsQKf63476DDXmomT9zUiGypLcG4ibIM67vhAj8jJRdbmEws2Aqw=="], + "bun": ["bun@1.3.1", "", { "optionalDependencies": { "@oven/bun-darwin-aarch64": "1.3.1", "@oven/bun-darwin-x64": "1.3.1", "@oven/bun-darwin-x64-baseline": "1.3.1", "@oven/bun-linux-aarch64": "1.3.1", "@oven/bun-linux-aarch64-musl": "1.3.1", "@oven/bun-linux-x64": "1.3.1", "@oven/bun-linux-x64-baseline": "1.3.1", "@oven/bun-linux-x64-musl": "1.3.1", "@oven/bun-linux-x64-musl-baseline": "1.3.1", "@oven/bun-windows-x64": "1.3.1", "@oven/bun-windows-x64-baseline": "1.3.1" }, "os": [ "linux", "win32", "darwin", ], "cpu": [ "x64", "arm64", ], "bin": { "bun": "bin/bun.exe", "bunx": "bin/bunx.exe" } }, "sha512-enqkEb0RhNOgDzHQwv7uvnIhX3uSzmKzz779dL7kdH8SauyTdQvCz4O1UT2rU0UldQp2K9OlrJNdyDHayPEIvw=="], "bun-types": ["bun-types@1.3.1", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-NMrcy7smratanWJ2mMXdpatalovtxVggkj11bScuWuiOoXTiKIu2eVS1/7qbyI/4yHedtsn175n4Sm4JcdHLXw=="], @@ -327,6 +373,8 @@ "call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="], + "camelcase": ["camelcase@6.3.0", "", {}, "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA=="], + "chai": ["chai@5.3.3", "", { "dependencies": { "assertion-error": "^2.0.1", "check-error": "^2.1.1", "deep-eql": "^5.0.1", "loupe": "^3.1.0", "pathval": "^2.0.0" } }, "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw=="], "chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="], @@ -361,6 +409,8 @@ "core-util-is": ["core-util-is@1.0.3", "", {}, "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="], + "cross-fetch": ["cross-fetch@3.2.0", "", { "dependencies": { "node-fetch": "^2.7.0" } }, "sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q=="], + "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], "csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="], @@ -369,6 +419,8 @@ "deep-eql": ["deep-eql@5.0.2", "", {}, "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q=="], + "delay": ["delay@5.0.0", "", {}, "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw=="], + "delayed-stream": ["delayed-stream@1.0.0", "", {}, "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="], "dir-glob": ["dir-glob@3.0.1", "", { "dependencies": { "path-type": "^4.0.0" } }, "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA=="], @@ -391,20 +443,28 @@ "es-set-tostringtag": ["es-set-tostringtag@2.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA=="], + "es6-promise": ["es6-promise@4.2.8", "", {}, "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w=="], + + "es6-promisify": ["es6-promisify@5.0.0", "", { "dependencies": { "es6-promise": "^4.0.3" } }, "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ=="], + "esbuild": ["esbuild@0.25.10", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.25.10", "@esbuild/android-arm": "0.25.10", "@esbuild/android-arm64": "0.25.10", "@esbuild/android-x64": "0.25.10", "@esbuild/darwin-arm64": "0.25.10", "@esbuild/darwin-x64": "0.25.10", "@esbuild/freebsd-arm64": "0.25.10", "@esbuild/freebsd-x64": "0.25.10", "@esbuild/linux-arm": "0.25.10", "@esbuild/linux-arm64": "0.25.10", "@esbuild/linux-ia32": "0.25.10", "@esbuild/linux-loong64": "0.25.10", "@esbuild/linux-mips64el": "0.25.10", "@esbuild/linux-ppc64": "0.25.10", "@esbuild/linux-riscv64": "0.25.10", "@esbuild/linux-s390x": "0.25.10", "@esbuild/linux-x64": "0.25.10", "@esbuild/netbsd-arm64": "0.25.10", "@esbuild/netbsd-x64": "0.25.10", "@esbuild/openbsd-arm64": "0.25.10", "@esbuild/openbsd-x64": "0.25.10", "@esbuild/openharmony-arm64": "0.25.10", "@esbuild/sunos-x64": "0.25.10", "@esbuild/win32-arm64": "0.25.10", "@esbuild/win32-ia32": "0.25.10", "@esbuild/win32-x64": "0.25.10" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-9RiGKvCwaqxO2owP61uQ4BgNborAQskMR6QusfWzQqv7AZOg5oGehdY2pRJMTKuwxd1IDBP4rSbI5lHzU7SMsQ=="], "escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="], "estree-walker": ["estree-walker@3.0.3", "", { "dependencies": { "@types/estree": "^1.0.0" } }, "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g=="], - "eventemitter3": ["eventemitter3@5.0.1", "", {}, "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA=="], + "eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="], "execa": ["execa@8.0.1", "", { "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^8.0.1", "human-signals": "^5.0.0", "is-stream": "^3.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^5.1.0", "onetime": "^6.0.0", "signal-exit": "^4.1.0", "strip-final-newline": "^3.0.0" } }, "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg=="], "expect-type": ["expect-type@1.2.2", "", {}, "sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA=="], + "eyes": ["eyes@0.1.8", "", {}, "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ=="], + "fast-glob": ["fast-glob@3.3.3", "", { "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.8" } }, "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg=="], + "fast-stable-stringify": ["fast-stable-stringify@1.0.0", "", {}, "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag=="], + "fastq": ["fastq@1.19.1", "", { "dependencies": { "reusify": "^1.0.4" } }, "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ=="], "fd-package-json": ["fd-package-json@2.0.0", "", { "dependencies": { "walk-up-path": "^4.0.0" } }, "sha512-jKmm9YtsNXN789RS/0mSzOC1NUq9mkVd65vbSSVsKdjGvYXBuE4oWe2QOEoFeRmJg+lPuZxpmrfFclNhoRMneQ=="], @@ -467,8 +527,12 @@ "human-signals": ["human-signals@5.0.0", "", {}, "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ=="], + "humanize-ms": ["humanize-ms@1.2.1", "", { "dependencies": { "ms": "^2.0.0" } }, "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ=="], + "husky": ["husky@9.1.7", "", { "bin": { "husky": "bin.js" } }, "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA=="], + "ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="], + "ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="], "inflight": ["inflight@1.0.6", "", { "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA=="], @@ -491,14 +555,20 @@ "isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="], + "isomorphic-ws": ["isomorphic-ws@4.0.1", "", { "peerDependencies": { "ws": "*" } }, "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w=="], + "isows": ["isows@1.0.7", "", { "peerDependencies": { "ws": "*" } }, "sha512-I1fSfDCZL5P0v33sVqeTDSpcstAg/N+wF5HS033mogOVIp4B+oHC7oOCsA3axAbBSGTJ8QubbNmnIRN/h8U7hg=="], + "jayson": ["jayson@4.2.0", "", { "dependencies": { "@types/connect": "^3.4.33", "@types/node": "^12.12.54", "@types/ws": "^7.4.4", "commander": "^2.20.3", "delay": "^5.0.0", "es6-promisify": "^5.0.0", "eyes": "^0.1.8", "isomorphic-ws": "^4.0.1", "json-stringify-safe": "^5.0.1", "stream-json": "^1.9.1", "uuid": "^8.3.2", "ws": "^7.5.10" }, "bin": { "jayson": "bin/jayson.js" } }, "sha512-VfJ9t1YLwacIubLhONk0KFeosUBwstRWQ0IRT1KDjEjnVnSOVHC3uwugyV7L0c7R9lpVyrUGT2XWiBA1UTtpyg=="], + "jiti": ["jiti@2.6.1", "", { "bin": { "jiti": "lib/jiti-cli.mjs" } }, "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ=="], "js-tokens": ["js-tokens@9.0.1", "", {}, "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ=="], "js-yaml": ["js-yaml@4.1.0", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA=="], + "json-stringify-safe": ["json-stringify-safe@5.0.1", "", {}, "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA=="], + "jsonfile": ["jsonfile@6.2.0", "", { "dependencies": { "universalify": "^2.0.0" }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg=="], "knip": ["knip@5.64.1", "", { "dependencies": { "@nodelib/fs.walk": "^1.2.3", "fast-glob": "^3.3.3", "formatly": "^0.3.0", "jiti": "^2.6.0", "js-yaml": "^4.1.0", "minimist": "^1.2.8", "oxc-resolver": "^11.8.3", "picocolors": "^1.1.1", "picomatch": "^4.0.1", "smol-toml": "^1.4.1", "strip-json-comments": "5.0.2", "zod": "^4.1.11" }, "peerDependencies": { "@types/node": ">=18", "typescript": ">=5.0.4 <7" }, "bin": { "knip": "bin/knip.js", "knip-bun": "bin/knip-bun.js" } }, "sha512-80XnLsyeXuyxj1F4+NBtQFHxaRH0xWRw8EKwfQ6EkVZZ0bSz/kqqan08k/Qg8ajWsFPhFq+0S2RbLCBGIQtuOg=="], @@ -553,6 +623,10 @@ "napi-postinstall": ["napi-postinstall@0.3.3", "", { "bin": { "napi-postinstall": "lib/cli.js" } }, "sha512-uTp172LLXSxuSYHv/kou+f6KW3SMppU9ivthaVTXian9sOt3XM/zHYHpRZiLgQoxeWfYUnslNWQHF1+G71xcow=="], + "node-fetch": ["node-fetch@2.7.0", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="], + + "node-gyp-build": ["node-gyp-build@4.8.4", "", { "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", "node-gyp-build-test": "build-test.js" } }, "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ=="], + "noms": ["noms@0.0.0", "", { "dependencies": { "inherits": "^2.0.1", "readable-stream": "~1.0.31" } }, "sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow=="], "normalize-path": ["normalize-path@3.0.0", "", {}, "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA=="], @@ -569,6 +643,8 @@ "oxc-resolver": ["oxc-resolver@11.8.4", "", { "dependencies": { "napi-postinstall": "^0.3.0" }, "optionalDependencies": { "@oxc-resolver/binding-android-arm-eabi": "11.8.4", "@oxc-resolver/binding-android-arm64": "11.8.4", "@oxc-resolver/binding-darwin-arm64": "11.8.4", "@oxc-resolver/binding-darwin-x64": "11.8.4", "@oxc-resolver/binding-freebsd-x64": "11.8.4", "@oxc-resolver/binding-linux-arm-gnueabihf": "11.8.4", "@oxc-resolver/binding-linux-arm-musleabihf": "11.8.4", "@oxc-resolver/binding-linux-arm64-gnu": "11.8.4", "@oxc-resolver/binding-linux-arm64-musl": "11.8.4", "@oxc-resolver/binding-linux-ppc64-gnu": "11.8.4", "@oxc-resolver/binding-linux-riscv64-gnu": "11.8.4", "@oxc-resolver/binding-linux-riscv64-musl": "11.8.4", "@oxc-resolver/binding-linux-s390x-gnu": "11.8.4", "@oxc-resolver/binding-linux-x64-gnu": "11.8.4", "@oxc-resolver/binding-linux-x64-musl": "11.8.4", "@oxc-resolver/binding-wasm32-wasi": "11.8.4", "@oxc-resolver/binding-win32-arm64-msvc": "11.8.4", "@oxc-resolver/binding-win32-ia32-msvc": "11.8.4", "@oxc-resolver/binding-win32-x64-msvc": "11.8.4" } }, "sha512-qpimS3tHHEf+kgESMAme+q+rj7aCzMya00u9YdKOKyX2o7q4lozjPo6d7ZTTi979KHEcVOPWdNTueAKdeNq72w=="], + "pako": ["pako@2.1.0", "", {}, "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug=="], + "path-is-absolute": ["path-is-absolute@1.0.1", "", {}, "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg=="], "path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="], @@ -615,6 +691,8 @@ "rollup": ["rollup@4.52.3", "", { "dependencies": { "@types/estree": "1.0.8" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.52.3", "@rollup/rollup-android-arm64": "4.52.3", "@rollup/rollup-darwin-arm64": "4.52.3", "@rollup/rollup-darwin-x64": "4.52.3", "@rollup/rollup-freebsd-arm64": "4.52.3", "@rollup/rollup-freebsd-x64": "4.52.3", "@rollup/rollup-linux-arm-gnueabihf": "4.52.3", "@rollup/rollup-linux-arm-musleabihf": "4.52.3", "@rollup/rollup-linux-arm64-gnu": "4.52.3", "@rollup/rollup-linux-arm64-musl": "4.52.3", "@rollup/rollup-linux-loong64-gnu": "4.52.3", "@rollup/rollup-linux-ppc64-gnu": "4.52.3", "@rollup/rollup-linux-riscv64-gnu": "4.52.3", "@rollup/rollup-linux-riscv64-musl": "4.52.3", "@rollup/rollup-linux-s390x-gnu": "4.52.3", "@rollup/rollup-linux-x64-gnu": "4.52.3", "@rollup/rollup-linux-x64-musl": "4.52.3", "@rollup/rollup-openharmony-arm64": "4.52.3", "@rollup/rollup-win32-arm64-msvc": "4.52.3", "@rollup/rollup-win32-ia32-msvc": "4.52.3", "@rollup/rollup-win32-x64-gnu": "4.52.3", "@rollup/rollup-win32-x64-msvc": "4.52.3", "fsevents": "~2.3.2" }, "bin": { "rollup": "dist/bin/rollup" } }, "sha512-RIDh866U8agLgiIcdpB+COKnlCreHJLfIhWC3LVflku5YHfpnsIKigRZeFfMfCc4dVcqNVfQQ5gO/afOck064A=="], + "rpc-websockets": ["rpc-websockets@9.3.0", "", { "dependencies": { "@swc/helpers": "^0.5.11", "@types/uuid": "^8.3.4", "@types/ws": "^8.2.2", "buffer": "^6.0.3", "eventemitter3": "^5.0.1", "uuid": "^8.3.2", "ws": "^8.5.0" }, "optionalDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": "^5.0.2" } }, "sha512-Sf6b6tCpLa6FxgZV20FC1GotVjinFfMkWWfuYtZOdoExvoXQl9ed1J7NdbybLZshNDHjWNa38U186MwElN1VjA=="], + "run-parallel": ["run-parallel@1.2.0", "", { "dependencies": { "queue-microtask": "^1.2.2" } }, "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA=="], "safe-buffer": ["safe-buffer@5.1.2", "", {}, "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="], @@ -645,6 +723,10 @@ "std-env": ["std-env@3.9.0", "", {}, "sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw=="], + "stream-chain": ["stream-chain@2.2.5", "", {}, "sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA=="], + + "stream-json": ["stream-json@1.9.1", "", { "dependencies": { "stream-chain": "^2.2.5" } }, "sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw=="], + "string-argv": ["string-argv@0.3.2", "", {}, "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q=="], "string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], @@ -659,6 +741,10 @@ "strip-literal": ["strip-literal@3.1.0", "", { "dependencies": { "js-tokens": "^9.0.1" } }, "sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg=="], + "superstruct": ["superstruct@0.15.5", "", {}, "sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ=="], + + "text-encoding-utf-8": ["text-encoding-utf-8@1.0.2", "", {}, "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg=="], + "text-hex": ["text-hex@1.0.0", "", {}, "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg=="], "through2": ["through2@2.0.5", "", { "dependencies": { "readable-stream": "~2.3.6", "xtend": "~4.0.1" } }, "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ=="], @@ -677,8 +763,12 @@ "to-regex-range": ["to-regex-range@5.0.1", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="], + "toml": ["toml@3.0.0", "", {}, "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w=="], + "totalist": ["totalist@3.0.1", "", {}, "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ=="], + "tr46": ["tr46@0.0.3", "", {}, "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="], + "triple-beam": ["triple-beam@1.4.1", "", {}, "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg=="], "tsc-alias": ["tsc-alias@1.8.16", "", { "dependencies": { "chokidar": "^3.5.3", "commander": "^9.0.0", "get-tsconfig": "^4.10.0", "globby": "^11.0.4", "mylas": "^2.1.9", "normalize-path": "^3.0.0", "plimit-lit": "^1.2.6" }, "bin": { "tsc-alias": "dist/bin/index.js" } }, "sha512-QjCyu55NFyRSBAl6+MTFwplpFcnm2Pq01rR/uxfqJoLMm6X3O14KEGtaSDZpJYaE1bJBGDjD0eSuiIWPe2T58g=="], @@ -695,8 +785,12 @@ "untildify": ["untildify@4.0.0", "", {}, "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw=="], + "utf-8-validate": ["utf-8-validate@5.0.10", "", { "dependencies": { "node-gyp-build": "^4.3.0" } }, "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ=="], + "util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="], + "uuid": ["uuid@8.3.2", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="], + "viem": ["viem@2.37.9", "", { "dependencies": { "@noble/curves": "1.9.1", "@noble/hashes": "1.8.0", "@scure/bip32": "1.7.0", "@scure/bip39": "1.6.0", "abitype": "1.1.0", "isows": "1.0.7", "ox": "0.9.6", "ws": "8.18.3" }, "peerDependencies": { "typescript": ">=5.0.4" }, "optionalPeers": ["typescript"] }, "sha512-XXUOE5yJcjr9/M9kRoQcPMUfetwHprO9aTho6vNELjBKJIBx7rYq1fjvBw+xEnhsRjhh5lsORi6B0h8fYFB7NA=="], "vite": ["vite@7.1.7", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-VbA8ScMvAISJNJVbRDTJdCwqQoAareR/wutevKanhR2/1EkoXVZVkkORaYm/tNVCjP/UDTKtcw3bAkwOUdedmA=="], @@ -709,6 +803,10 @@ "walk-up-path": ["walk-up-path@4.0.0", "", {}, "sha512-3hu+tD8YzSLGuFYtPRb48vdhKMi0KQV5sn+uWr8+7dMEq/2G/dtLrdDinkLjqq5TIbIBjYJ4Ax/n3YiaW7QM8A=="], + "webidl-conversions": ["webidl-conversions@3.0.1", "", {}, "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="], + + "whatwg-url": ["whatwg-url@5.0.0", "", { "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw=="], + "which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="], "why-is-node-running": ["why-is-node-running@2.3.0", "", { "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" }, "bin": { "why-is-node-running": "cli.js" } }, "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w=="], @@ -735,16 +833,28 @@ "zod": ["zod@4.1.11", "", {}, "sha512-WPsqwxITS2tzx1bzhIKsEs19ABD5vmCVa4xBo2tq/SrV4RNZtfws1EnCWQXM6yh8bD08a1idvkB5MZSBiZsjwg=="], + "@solana/web3.js/superstruct": ["superstruct@2.0.2", "", {}, "sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A=="], + "anymatch/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], + "base-x/safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="], + "cli-truncate/string-width": ["string-width@7.2.0", "", { "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" } }, "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ=="], "cliui/wrap-ansi": ["wrap-ansi@7.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="], "execa/is-stream": ["is-stream@3.0.0", "", {}, "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA=="], + "jayson/@types/node": ["@types/node@12.20.55", "", {}, "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ=="], + + "jayson/commander": ["commander@2.20.3", "", {}, "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="], + + "jayson/ws": ["ws@7.5.10", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": "^5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ=="], + "lint-staged/commander": ["commander@13.1.0", "", {}, "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw=="], + "listr2/eventemitter3": ["eventemitter3@5.0.1", "", {}, "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA=="], + "log-update/slice-ansi": ["slice-ansi@7.1.2", "", { "dependencies": { "ansi-styles": "^6.2.1", "is-fullwidth-code-point": "^5.0.0" } }, "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w=="], "log-update/strip-ansi": ["strip-ansi@7.1.2", "", { "dependencies": { "ansi-regex": "^6.0.1" } }, "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA=="], @@ -755,10 +865,16 @@ "npm-run-path/path-key": ["path-key@4.0.0", "", {}, "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ=="], + "ox/eventemitter3": ["eventemitter3@5.0.1", "", {}, "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA=="], + "readdirp/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], "restore-cursor/onetime": ["onetime@7.0.0", "", { "dependencies": { "mimic-function": "^5.0.0" } }, "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ=="], + "rpc-websockets/@types/ws": ["@types/ws@8.18.1", "", { "dependencies": { "@types/node": "*" } }, "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg=="], + + "rpc-websockets/eventemitter3": ["eventemitter3@5.0.1", "", {}, "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA=="], + "slice-ansi/is-fullwidth-code-point": ["is-fullwidth-code-point@4.0.0", "", {}, "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ=="], "string_decoder/safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="], diff --git a/package.json b/package.json index fb48648..eaffa15 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,14 @@ "url": "https://sablier.com" }, "dependencies": { + "@coral-xyz/anchor": "^0.32.1", + "@solana/web3.js": "^1.98.4", "lodash": "^4.17.21", "viem": "^2.37.9" }, "peerDependencies": { + "@coral-xyz/anchor": "^0.30", + "@solana/web3.js": "^1.98", "viem": "^2.32" }, "devDependencies": { diff --git a/src/solana/idl/airdrops/index.ts b/src/solana/idl/airdrops/index.ts deleted file mode 100644 index 04d5b36..0000000 --- a/src/solana/idl/airdrops/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./v1.0"; diff --git a/src/solana/idl/airdrops/v1.0/SablierMerkleInstant/errors.ts b/src/solana/idl/airdrops/v1.0/SablierMerkleInstant/errors.ts new file mode 100644 index 0000000..2a5d5e5 --- /dev/null +++ b/src/solana/idl/airdrops/v1.0/SablierMerkleInstant/errors.ts @@ -0,0 +1,9 @@ +export const errorCodes = { + CampaignExpired: 6000, + InvalidMerkleProof: 6001, + CampaignNotStarted: 6002, + ClawbackNotAllowed: 6003, + CantCollectZeroFees: 6004, +} as const; + +export type ErrorNames = keyof typeof errorCodes; diff --git a/src/solana/idl/airdrops/v1.0/SablierMerkleInstantType.ts b/src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl-type.ts similarity index 99% rename from src/solana/idl/airdrops/v1.0/SablierMerkleInstantType.ts rename to src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl-type.ts index 9100a30..ae20c22 100644 --- a/src/solana/idl/airdrops/v1.0/SablierMerkleInstantType.ts +++ b/src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl-type.ts @@ -1,9 +1,4 @@ -/** - * Program IDL in camelCase format in order to be used in JS/TS. - * - * Note that this is only a type helper and is not the actual IDL. - */ -export type Idl = { +export type IDL = { address: "7XrxoQejBoGouW4V3aozTSwub7xSDjYqB4Go7YLjF9rV"; metadata: { name: "sablierMerkleInstant"; version: "0.1.0"; spec: "0.1.0"; description: "Created with Anchor" }; docs: ["Sablier Merkle Instant program for creating and managing Merkle tree-based airdrop campaigns."]; diff --git a/src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.json b/src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.json new file mode 100644 index 0000000..5636acb --- /dev/null +++ b/src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.json @@ -0,0 +1,1049 @@ +{ + "address": "7XrxoQejBoGouW4V3aozTSwub7xSDjYqB4Go7YLjF9rV", + "metadata": { + "name": "sablier_merkle_instant", + "version": "0.1.0", + "spec": "0.1.0", + "description": "Created with Anchor" + }, + "docs": ["Sablier Merkle Instant program for creating and managing Merkle tree-based airdrop campaigns."], + "instructions": [ + { + "name": "campaign_view", + "docs": [ + "Retrieves the campaign details.", + "", + "# Accounts Expected", + "", + "- `campaign` The account that stores the campaign details." + ], + "discriminator": [188, 126, 110, 5, 183, 113, 158, 3], + "accounts": [ + { + "name": "campaign", + "docs": ["Read account: the account storing the campaign data."] + } + ], + "args": [], + "returns": { + "defined": { + "name": "Campaign" + } + } + }, + { + "name": "claim", + "docs": [ + "Claims airdrop on behalf of eligible recipient and transfers it to the recipient ATA.", + "", + "# Accounts Expected", + "", + "- `claimer` The transaction signer.", + "- `campaign` The account that stores the campaign details.", + "- `recipient` The address of the airdrop recipient.", + "- `airdrop_token_mint` The mint of the airdropped token.", + "- `airdrop_token_program` The Token Program of the airdropped token.", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + "", + "# Parameters", + "", + "- `index` The index of the recipient in the Merkle tree.", + "- `amount` The amount allocated to the recipient.", + "- `merkle_proof` The proof of inclusion in the Merkle tree.", + "", + "# Notes", + "", + "- The instruction charges a fee in the native token (SOL), equivalent to $2 USD.", + "- Emits a [`crate::utils::events::Claim`] event.", + "", + "# Requirements", + "", + "- The current time must be greater than or equal to the campaign start time.", + "", + "- The campaign must not have expired.", + "- The recipient's airdrop has not been claimed yet.", + "- The Merkle proof must be valid.", + "- `chainlink_program` and `chainlink_sol_usd_feed` must match the ones stored in the treasury." + ], + "discriminator": [62, 198, 214, 193, 213, 159, 108, 210], + "accounts": [ + { + "name": "claimer", + "docs": ["Write account: the signer of the claim who will pay the claim fee."], + "writable": true, + "signer": true + }, + { + "name": "recipient", + "docs": ["Read account: the recipient of the airdrop."] + }, + { + "name": "recipient_ata", + "docs": ["Create if needed account: the ATA for airdrop token owned by the recipient."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "recipient" + }, + { + "kind": "account", + "path": "airdrop_token_program" + }, + { + "kind": "account", + "path": "airdrop_token_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "treasury", + "docs": ["Write account: the treasury account that will receive the claim fee."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [116, 114, 101, 97, 115, 117, 114, 121] + } + ] + } + }, + { + "name": "airdrop_token_mint", + "docs": ["Read account: the mint account of the airdrop token."] + }, + { + "name": "campaign", + "docs": ["Write account: the account storing the campaign data."], + "writable": true + }, + { + "name": "campaign_ata", + "docs": ["Write account: the campaign's ATA for the airdrop token."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "campaign" + }, + { + "kind": "account", + "path": "airdrop_token_program" + }, + { + "kind": "account", + "path": "airdrop_token_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "claim_receipt", + "docs": ["Create account: the claim receipt."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [99, 108, 97, 105, 109, 95, 114, 101, 99, 101, 105, 112, 116] + }, + { + "kind": "account", + "path": "campaign" + }, + { + "kind": "arg", + "path": "index" + } + ] + } + }, + { + "name": "airdrop_token_program", + "docs": ["Program account: the Token program of the airdrop token."] + }, + { + "name": "associated_token_program", + "docs": ["Program account: the Associated Token program."], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "chainlink_program", + "docs": ["Read account: The Chainlink program used to retrieve on-chain price feeds."] + }, + { + "name": "chainlink_sol_usd_feed", + "docs": ["Read account: The account providing the SOL/USD price feed data."] + }, + { + "name": "system_program", + "docs": ["Program account: the System program."], + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "index", + "type": "u32" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "merkle_proof", + "type": { + "vec": { + "array": ["u8", 32] + } + } + } + ] + }, + { + "name": "claim_fee_in_lamports", + "docs": [ + "Calculates the claim fee in lamports, which is equivalent to $2 USD.", + "", + "# Accounts Expected:", + "", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data." + ], + "discriminator": [255, 199, 146, 222, 145, 180, 58, 231], + "accounts": [ + { + "name": "treasury", + "docs": ["Read account: the treasury account that receives the claim fee."], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [116, 114, 101, 97, 115, 117, 114, 121] + } + ] + } + }, + { + "name": "chainlink_program", + "docs": ["Read account: The Chainlink program used to retrieve on-chain price feeds."] + }, + { + "name": "chainlink_sol_usd_feed", + "docs": ["Read account: The account providing the SOL/USD price feed data."] + } + ], + "args": [], + "returns": "u64" + }, + { + "name": "clawback", + "docs": [ + "Claws back the unclaimed tokens from the campaign.", + "", + "# Accounts Expected", + "", + "- `campaign` The account that stores the campaign details.", + "- `campaign_creator` The transaction signer.", + "- `airdrop_token_mint` The mint of the airdropped token.", + "- `airdrop_token_program` The Token Program of the airdropped token.", + "", + "# Parameters", + "", + "- `amount` The amount to claw back.", + "", + "# Notes", + "", + "- Emits a [`crate::utils::events::Clawback`] event.", + "", + "# Requirements", + "", + "- The signer must be the actual campaign creator.", + "- No claim must be made, OR the current timestamp must not exceed 7 days after the first claim, OR the campaign", + "must be expired." + ], + "discriminator": [111, 92, 142, 79, 33, 234, 82, 27], + "accounts": [ + { + "name": "campaign_creator", + "docs": ["Write account: the campaign creator who will claw back the tokens."], + "writable": true, + "signer": true + }, + { + "name": "clawback_recipient", + "docs": ["Read account: the clawback recipient."] + }, + { + "name": "clawback_recipient_ata", + "docs": ["Create if needed account: the clawback recipient's ATA for the airdrop token."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "clawback_recipient" + }, + { + "kind": "account", + "path": "airdrop_token_program" + }, + { + "kind": "account", + "path": "airdrop_token_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "airdrop_token_mint", + "docs": ["Read account: the mint account of the airdrop token."] + }, + { + "name": "campaign", + "docs": ["Read account: the account storing the campaign data."] + }, + { + "name": "campaign_ata", + "docs": ["Write account: the campaign's ATA for the airdrop token."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "campaign" + }, + { + "kind": "account", + "path": "airdrop_token_program" + }, + { + "kind": "account", + "path": "airdrop_token_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "airdrop_token_program", + "docs": ["Program account: the Token program of the airdrop token."] + }, + { + "name": "associated_token_program", + "docs": ["Program account: the Associated Token program."], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "system_program", + "docs": ["Program account: the System program."], + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "collect_fees", + "docs": [ + "Collects the fees accumulated in the treasury by transferring them to the fee recipient.", + "", + "# Accounts Expected", + "", + "- `fee_collector` The transaction signer and the fee collector.", + "- `fee_recipient` The address receiving the collected fees.", + "", + "# Notes", + "", + "- To calculate the \"collectable amount\", the rent-exempt minimum balance and a 0.001 SOL buffer are deducted", + "from the treasury SOL balance.", + "- Emits a [`crate::utils::events::FeesCollected`] event.", + "", + "# Requirements", + "", + "- `fee_collector` must be authorized for fee collection.", + "- The \"collectable amount\" must be greater than zero." + ], + "discriminator": [164, 152, 207, 99, 30, 186, 19, 182], + "accounts": [ + { + "name": "fee_collector", + "docs": ["Write account: the account authorized to collect fees from the treasury."], + "signer": true + }, + { + "name": "fee_recipient", + "docs": ["Write account: the address that will receive the collected fees."], + "writable": true + }, + { + "name": "treasury", + "docs": ["Write account: the treasury account that holds the fees."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [116, 114, 101, 97, 115, 117, 114, 121] + } + ] + } + } + ], + "args": [] + }, + { + "name": "create_campaign", + "docs": [ + "Creates a Merkle Instant airdrop campaign.", + "", + "# Accounts Expected", + "", + "- `creator` The transaction signer and the campaign creator.", + "- `airdrop_token_mint` The mint of the airdropped token.", + "- `airdrop_token_program` The Token Program of the airdropped token.", + "", + "# Parameters", + "", + "- `merkle_root` The Merkle root of the claim data.", + "- `campaign_start_time` The time when the campaign starts, in seconds since the Unix epoch.", + "- `expiration_time` The time when the campaign expires, in seconds since the Unix epoch.", + "A value of zero means the campaign does not expire.", + "- `name` The name of the campaign.", + "- `ipfs_cid` The content identifier for indexing the campaign on IPFS. An empty value may break some UI", + "features that depend upon the IPFS CID.", + "- `aggregate_amount` The total amount of tokens to be distributed to all recipients.", + "- `recipient_count` The total number of recipient addresses eligible for the airdrop.", + "", + "# Notes", + "", + "- Emits a [`crate::utils::events::CreateCampaign`] event." + ], + "discriminator": [111, 131, 187, 98, 160, 193, 114, 244], + "accounts": [ + { + "name": "creator", + "docs": ["Write account: the creator of the campaign."], + "writable": true, + "signer": true + }, + { + "name": "airdrop_token_mint", + "docs": ["Read account: the mint account of the airdrop token."] + }, + { + "name": "campaign", + "docs": ["Create account: the account storing the campaign data."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [99, 97, 109, 112, 97, 105, 103, 110] + }, + { + "kind": "account", + "path": "creator" + }, + { + "kind": "arg", + "path": "merkle_root" + }, + { + "kind": "arg", + "path": "campaign_start_time" + }, + { + "kind": "arg", + "path": "expiration_time" + }, + { + "kind": "arg", + "path": "name" + }, + { + "kind": "account", + "path": "airdrop_token_mint" + } + ] + } + }, + { + "name": "campaign_ata", + "docs": ["Create account: the campaign's ATA for the airdrop token."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "campaign" + }, + { + "kind": "account", + "path": "airdrop_token_program" + }, + { + "kind": "account", + "path": "airdrop_token_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "airdrop_token_program", + "docs": ["Program account: the Token program of the airdrop token."] + }, + { + "name": "associated_token_program", + "docs": ["Program account: the Associated Token program."], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "system_program", + "docs": ["Program account: the System program."], + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "merkle_root", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "campaign_start_time", + "type": "u64" + }, + { + "name": "expiration_time", + "type": "u64" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "ipfs_cid", + "type": "string" + }, + { + "name": "aggregate_amount", + "type": "u64" + }, + { + "name": "recipient_count", + "type": "u32" + } + ] + }, + { + "name": "has_campaign_started", + "docs": [ + "Returns a flag indicating whether the campaign has started.", + "", + "# Accounts expected:", + "", + "- `campaign` The account that stores the campaign details." + ], + "discriminator": [135, 101, 171, 220, 86, 97, 104, 199], + "accounts": [ + { + "name": "campaign", + "docs": ["Read account: the account storing the campaign data."] + } + ], + "args": [], + "returns": "bool" + }, + { + "name": "has_claimed", + "docs": [ + "Returns a flag indicating whether a claim has been made for the given index.", + "", + "# Accounts Expected", + "", + "- `campaign` The account that stores the campaign details.", + "", + "# Parameters", + "", + "- `_index` The index of the recipient in the Merkle tree." + ], + "discriminator": [182, 195, 167, 56, 232, 3, 223, 102], + "accounts": [ + { + "name": "campaign", + "docs": ["Read account: the account storing the campaign data."] + }, + { + "name": "claim_receipt", + "docs": ["Read account: the claim receipt."], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [99, 108, 97, 105, 109, 95, 114, 101, 99, 101, 105, 112, 116] + }, + { + "kind": "account", + "path": "campaign" + }, + { + "kind": "arg", + "path": "_index" + } + ] + } + } + ], + "args": [ + { + "name": "_index", + "type": "u32" + } + ], + "returns": "bool" + }, + { + "name": "has_expired", + "docs": [ + "Returns a flag indicating whether the campaign has expired.", + "", + "# Accounts Expected", + "", + "- `campaign` The account that stores the campaign details." + ], + "discriminator": [24, 138, 30, 86, 92, 38, 143, 129], + "accounts": [ + { + "name": "campaign", + "docs": ["Read account: the account storing the campaign data."] + } + ], + "args": [], + "returns": "bool" + }, + { + "name": "has_grace_period_passed", + "docs": [ + "Returns a flag indicating whether the grace period of the campaign has passed.", + "", + "# Accounts Expected", + "", + "- `campaign` The account that stores the campaign details.", + "", + "# Notes", + "", + "- A return value of `false` indicates: No claim has been made yet, OR the current timestamp does not exceed", + "seven days after the first claim." + ], + "discriminator": [223, 150, 181, 32, 240, 136, 73, 236], + "accounts": [ + { + "name": "campaign", + "docs": ["Read account: the account storing the campaign data."] + } + ], + "args": [], + "returns": "bool" + }, + { + "name": "initialize", + "docs": [ + "Initializes the program with the provided fee collector address.", + "", + "# Accounts Expected", + "", + "- `initializer` The transaction signer.", + "", + "# Parameters", + "", + "- `fee_collector` The address that will have the authority to collect fees.", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data." + ], + "discriminator": [175, 175, 109, 31, 13, 152, 155, 237], + "accounts": [ + { + "name": "initializer", + "docs": ["Write account: the initializer of the program."], + "writable": true, + "signer": true + }, + { + "name": "treasury", + "docs": ["Create account: the treasury account that will hold the fees."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [116, 114, 101, 97, 115, 117, 114, 121] + } + ] + } + }, + { + "name": "system_program", + "docs": ["Program account: the System program."], + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "fee_collector", + "type": "pubkey" + }, + { + "name": "chainlink_program", + "type": "pubkey" + }, + { + "name": "chainlink_sol_usd_feed", + "type": "pubkey" + } + ] + }, + { + "name": "treasury_view", + "docs": ["Returns the treasury details."], + "discriminator": [247, 160, 213, 237, 247, 121, 164, 82], + "accounts": [ + { + "name": "treasury", + "docs": ["Read account: the account storing the treasury details."], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [116, 114, 101, 97, 115, 117, 114, 121] + } + ] + } + } + ], + "args": [], + "returns": { + "defined": { + "name": "Treasury" + } + } + } + ], + "accounts": [ + { + "name": "Campaign", + "discriminator": [50, 40, 49, 11, 157, 220, 229, 192] + }, + { + "name": "ClaimReceipt", + "discriminator": [223, 233, 11, 229, 124, 165, 207, 28] + }, + { + "name": "Treasury", + "discriminator": [238, 239, 123, 238, 89, 1, 168, 253] + } + ], + "events": [ + { + "name": "Claim", + "discriminator": [133, 98, 9, 238, 133, 207, 191, 113] + }, + { + "name": "Clawback", + "discriminator": [239, 144, 30, 69, 80, 59, 142, 64] + }, + { + "name": "CreateCampaign", + "discriminator": [88, 178, 212, 72, 110, 4, 68, 143] + }, + { + "name": "FeesCollected", + "discriminator": [233, 23, 117, 225, 107, 178, 254, 8] + } + ], + "errors": [ + { + "code": 6000, + "name": "CampaignExpired", + "msg": "Campaign has expired!" + }, + { + "code": 6001, + "name": "InvalidMerkleProof", + "msg": "Invalid Merkle proof!" + }, + { + "code": 6002, + "name": "CampaignNotStarted", + "msg": "Campaign has not started yet!" + }, + { + "code": 6003, + "name": "ClawbackNotAllowed", + "msg": "Clawback not allowed past the grace period and before campaign expiration!" + }, + { + "code": 6004, + "name": "CantCollectZeroFees", + "msg": "Can't collect zero fees!" + } + ], + "types": [ + { + "name": "Campaign", + "docs": ["Groups all the data for a Merkle Instant campaign."], + "type": { + "kind": "struct", + "fields": [ + { + "name": "airdrop_token_mint", + "type": "pubkey" + }, + { + "name": "bump", + "type": "u8" + }, + { + "name": "campaign_start_time", + "type": "u64" + }, + { + "name": "creator", + "type": "pubkey" + }, + { + "name": "expiration_time", + "type": "u64" + }, + { + "name": "first_claim_time", + "type": "u64" + }, + { + "name": "ipfs_cid", + "type": "string" + }, + { + "name": "merkle_root", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + { + "name": "Claim", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "campaign", + "type": "pubkey" + }, + { + "name": "claimer", + "type": "pubkey" + }, + { + "name": "claim_receipt", + "type": "pubkey" + }, + { + "name": "fee_in_lamports", + "type": "u64" + }, + { + "name": "index", + "type": "u32" + }, + { + "name": "recipient", + "type": "pubkey" + } + ] + } + }, + { + "name": "ClaimReceipt", + "type": { + "kind": "struct", + "fields": [] + } + }, + { + "name": "Clawback", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "campaign", + "type": "pubkey" + }, + { + "name": "campaign_creator", + "type": "pubkey" + }, + { + "name": "clawback_recipient", + "type": "pubkey" + } + ] + } + }, + { + "name": "CreateCampaign", + "type": { + "kind": "struct", + "fields": [ + { + "name": "aggregate_amount", + "type": "u64" + }, + { + "name": "campaign", + "type": "pubkey" + }, + { + "name": "campaign_name", + "type": "string" + }, + { + "name": "campaign_start_time", + "type": "u64" + }, + { + "name": "creator", + "type": "pubkey" + }, + { + "name": "expiration_time", + "type": "u64" + }, + { + "name": "ipfs_cid", + "type": "string" + }, + { + "name": "merkle_root", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "recipient_count", + "type": "u32" + }, + { + "name": "token_decimals", + "type": "u8" + }, + { + "name": "token_mint", + "type": "pubkey" + } + ] + } + }, + { + "name": "FeesCollected", + "type": { + "kind": "struct", + "fields": [ + { + "name": "fee_amount", + "type": "u64" + }, + { + "name": "fee_collector", + "type": "pubkey" + }, + { + "name": "fee_recipient", + "type": "pubkey" + } + ] + } + }, + { + "name": "Treasury", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "type": "u8" + }, + { + "name": "fee_collector", + "type": "pubkey" + }, + { + "name": "chainlink_program", + "type": "pubkey" + }, + { + "name": "chainlink_sol_usd_feed", + "type": "pubkey" + } + ] + } + } + ] +} diff --git a/src/solana/idl/airdrops/v1.0/SablierMerkleInstant.ts b/src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.ts similarity index 87% rename from src/solana/idl/airdrops/v1.0/SablierMerkleInstant.ts rename to src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.ts index dabcba2..42bf7b9 100644 --- a/src/solana/idl/airdrops/v1.0/SablierMerkleInstant.ts +++ b/src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.ts @@ -1,33 +1,10 @@ -export const sablierMerkleInstantIdl = { - accounts: [ - { discriminator: [50, 40, 49, 11, 157, 220, 229, 192], name: "Campaign" }, - { discriminator: [223, 233, 11, 229, 124, 165, 207, 28], name: "ClaimReceipt" }, - { discriminator: [238, 239, 123, 238, 89, 1, 168, 253], name: "Treasury" }, - ], +export const idl = { address: "7XrxoQejBoGouW4V3aozTSwub7xSDjYqB4Go7YLjF9rV", + metadata: { name: "sablier_merkle_instant", version: "0.1.0", spec: "0.1.0", description: "Created with Anchor" }, docs: ["Sablier Merkle Instant program for creating and managing Merkle tree-based airdrop campaigns."], - errors: [ - { code: 6000, msg: "Campaign has expired!", name: "CampaignExpired" }, - { code: 6001, msg: "Invalid Merkle proof!", name: "InvalidMerkleProof" }, - { code: 6002, msg: "Campaign has not started yet!", name: "CampaignNotStarted" }, - { - code: 6003, - msg: "Clawback not allowed past the grace period and before campaign expiration!", - name: "ClawbackNotAllowed", - }, - { code: 6004, msg: "Can't collect zero fees!", name: "CantCollectZeroFees" }, - ], - events: [ - { discriminator: [133, 98, 9, 238, 133, 207, 191, 113], name: "Claim" }, - { discriminator: [239, 144, 30, 69, 80, 59, 142, 64], name: "Clawback" }, - { discriminator: [88, 178, 212, 72, 110, 4, 68, 143], name: "CreateCampaign" }, - { discriminator: [233, 23, 117, 225, 107, 178, 254, 8], name: "FeesCollected" }, - ], instructions: [ { - accounts: [{ docs: ["Read account: the account storing the campaign data."], name: "campaign" }], - args: [], - discriminator: [188, 126, 110, 5, 183, 113, 158, 3], + name: "campaign_view", docs: [ "Retrieves the campaign details.", "", @@ -35,22 +12,65 @@ export const sablierMerkleInstantIdl = { "", "- `campaign` The account that stores the campaign details.", ], - name: "campaign_view", + discriminator: [188, 126, 110, 5, 183, 113, 158, 3], + accounts: [{ name: "campaign", docs: ["Read account: the account storing the campaign data."] }], + args: [], returns: { defined: { name: "Campaign" } }, }, { + name: "claim", + docs: [ + "Claims airdrop on behalf of eligible recipient and transfers it to the recipient ATA.", + "", + "# Accounts Expected", + "", + "- `claimer` The transaction signer.", + "- `campaign` The account that stores the campaign details.", + "- `recipient` The address of the airdrop recipient.", + "- `airdrop_token_mint` The mint of the airdropped token.", + "- `airdrop_token_program` The Token Program of the airdropped token.", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + "", + "# Parameters", + "", + "- `index` The index of the recipient in the Merkle tree.", + "- `amount` The amount allocated to the recipient.", + "- `merkle_proof` The proof of inclusion in the Merkle tree.", + "", + "# Notes", + "", + "- The instruction charges a fee in the native token (SOL), equivalent to $2 USD.", + "- Emits a [`crate::utils::events::Claim`] event.", + "", + "# Requirements", + "", + "- The current time must be greater than or equal to the campaign start time.", + "", + "- The campaign must not have expired.", + "- The recipient's airdrop has not been claimed yet.", + "- The Merkle proof must be valid.", + "- `chainlink_program` and `chainlink_sol_usd_feed` must match the ones stored in the treasury.", + ], + discriminator: [62, 198, 214, 193, 213, 159, 108, 210], accounts: [ { - docs: ["Write account: the signer of the claim who will pay the claim fee."], name: "claimer", - signer: true, + docs: ["Write account: the signer of the claim who will pay the claim fee."], writable: true, + signer: true, }, - { docs: ["Read account: the recipient of the airdrop."], name: "recipient" }, + { name: "recipient", docs: ["Read account: the recipient of the airdrop."] }, { - docs: ["Create if needed account: the ATA for airdrop token owned by the recipient."], name: "recipient_ata", + docs: ["Create if needed account: the ATA for airdrop token owned by the recipient."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "recipient" }, + { kind: "account", path: "airdrop_token_program" }, + { kind: "account", path: "airdrop_token_mint" }, + ], program: { kind: "const", value: [ @@ -58,26 +78,26 @@ export const sablierMerkleInstantIdl = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "recipient" }, - { kind: "account", path: "airdrop_token_program" }, - { kind: "account", path: "airdrop_token_mint" }, - ], }, - writable: true, }, { - docs: ["Write account: the treasury account that will receive the claim fee."], name: "treasury", - pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, + docs: ["Write account: the treasury account that will receive the claim fee."], writable: true, + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, }, - { docs: ["Read account: the mint account of the airdrop token."], name: "airdrop_token_mint" }, - { docs: ["Write account: the account storing the campaign data."], name: "campaign", writable: true }, + { name: "airdrop_token_mint", docs: ["Read account: the mint account of the airdrop token."] }, + { name: "campaign", docs: ["Write account: the account storing the campaign data."], writable: true }, { - docs: ["Write account: the campaign's ATA for the airdrop token."], name: "campaign_ata", + docs: ["Write account: the campaign's ATA for the airdrop token."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "campaign" }, + { kind: "account", path: "airdrop_token_program" }, + { kind: "account", path: "airdrop_token_mint" }, + ], program: { kind: "const", value: [ @@ -85,17 +105,12 @@ export const sablierMerkleInstantIdl = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "campaign" }, - { kind: "account", path: "airdrop_token_program" }, - { kind: "account", path: "airdrop_token_mint" }, - ], }, - writable: true, }, { - docs: ["Create account: the claim receipt."], name: "claim_receipt", + docs: ["Create account: the claim receipt."], + writable: true, pda: { seeds: [ { kind: "const", value: [99, 108, 97, 105, 109, 95, 114, 101, 99, 101, 105, 112, 116] }, @@ -103,23 +118,22 @@ export const sablierMerkleInstantIdl = { { kind: "arg", path: "index" }, ], }, - writable: true, }, - { docs: ["Program account: the Token program of the airdrop token."], name: "airdrop_token_program" }, + { name: "airdrop_token_program", docs: ["Program account: the Token program of the airdrop token."] }, { - address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", - docs: ["Program account: the Associated Token program."], name: "associated_token_program", + docs: ["Program account: the Associated Token program."], + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", }, { - docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], name: "chainlink_program", + docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], }, - { docs: ["Read account: The account providing the SOL/USD price feed data."], name: "chainlink_sol_usd_feed" }, + { name: "chainlink_sol_usd_feed", docs: ["Read account: The account providing the SOL/USD price feed data."] }, { - address: "11111111111111111111111111111111", - docs: ["Program account: the System program."], name: "system_program", + docs: ["Program account: the System program."], + address: "11111111111111111111111111111111", }, ], args: [ @@ -127,81 +141,78 @@ export const sablierMerkleInstantIdl = { { name: "amount", type: "u64" }, { name: "merkle_proof", type: { vec: { array: ["u8", 32] } } }, ], - discriminator: [62, 198, 214, 193, 213, 159, 108, 210], + }, + { + name: "claim_fee_in_lamports", docs: [ - "Claims airdrop on behalf of eligible recipient and transfers it to the recipient ATA.", + "Calculates the claim fee in lamports, which is equivalent to $2 USD.", "", - "# Accounts Expected", + "# Accounts Expected:", "", - "- `claimer` The transaction signer.", - "- `campaign` The account that stores the campaign details.", - "- `recipient` The address of the airdrop recipient.", - "- `airdrop_token_mint` The mint of the airdropped token.", - "- `airdrop_token_program` The Token Program of the airdropped token.", "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", - "", - "# Parameters", - "", - "- `index` The index of the recipient in the Merkle tree.", - "- `amount` The amount allocated to the recipient.", - "- `merkle_proof` The proof of inclusion in the Merkle tree.", - "", - "# Notes", - "", - "- The instruction charges a fee in the native token (SOL), equivalent to $2 USD.", - "- Emits a [`crate::utils::events::Claim`] event.", - "", - "# Requirements", - "", - "- The current time must be greater than or equal to the campaign start time.", - "", - "- The campaign must not have expired.", - "- The recipient's airdrop has not been claimed yet.", - "- The Merkle proof must be valid.", - "- `chainlink_program` and `chainlink_sol_usd_feed` must match the ones stored in the treasury.", ], - name: "claim", - }, - { + discriminator: [255, 199, 146, 222, 145, 180, 58, 231], accounts: [ { - docs: ["Read account: the treasury account that receives the claim fee."], name: "treasury", + docs: ["Read account: the treasury account that receives the claim fee."], pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, }, { - docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], name: "chainlink_program", + docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], }, - { docs: ["Read account: The account providing the SOL/USD price feed data."], name: "chainlink_sol_usd_feed" }, + { name: "chainlink_sol_usd_feed", docs: ["Read account: The account providing the SOL/USD price feed data."] }, ], args: [], - discriminator: [255, 199, 146, 222, 145, 180, 58, 231], + returns: "u64", + }, + { + name: "clawback", docs: [ - "Calculates the claim fee in lamports, which is equivalent to $2 USD.", + "Claws back the unclaimed tokens from the campaign.", "", - "# Accounts Expected:", + "# Accounts Expected", "", - "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", - "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + "- `campaign` The account that stores the campaign details.", + "- `campaign_creator` The transaction signer.", + "- `airdrop_token_mint` The mint of the airdropped token.", + "- `airdrop_token_program` The Token Program of the airdropped token.", + "", + "# Parameters", + "", + "- `amount` The amount to claw back.", + "", + "# Notes", + "", + "- Emits a [`crate::utils::events::Clawback`] event.", + "", + "# Requirements", + "", + "- The signer must be the actual campaign creator.", + "- No claim must be made, OR the current timestamp must not exceed 7 days after the first claim, OR the campaign", + "must be expired.", ], - name: "claim_fee_in_lamports", - returns: "u64", - }, - { + discriminator: [111, 92, 142, 79, 33, 234, 82, 27], accounts: [ { - docs: ["Write account: the campaign creator who will claw back the tokens."], name: "campaign_creator", - signer: true, + docs: ["Write account: the campaign creator who will claw back the tokens."], writable: true, + signer: true, }, - { docs: ["Read account: the clawback recipient."], name: "clawback_recipient" }, + { name: "clawback_recipient", docs: ["Read account: the clawback recipient."] }, { - docs: ["Create if needed account: the clawback recipient's ATA for the airdrop token."], name: "clawback_recipient_ata", + docs: ["Create if needed account: the clawback recipient's ATA for the airdrop token."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "clawback_recipient" }, + { kind: "account", path: "airdrop_token_program" }, + { kind: "account", path: "airdrop_token_mint" }, + ], program: { kind: "const", value: [ @@ -209,20 +220,20 @@ export const sablierMerkleInstantIdl = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "clawback_recipient" }, - { kind: "account", path: "airdrop_token_program" }, - { kind: "account", path: "airdrop_token_mint" }, - ], }, - writable: true, }, - { docs: ["Read account: the mint account of the airdrop token."], name: "airdrop_token_mint" }, - { docs: ["Read account: the account storing the campaign data."], name: "campaign" }, + { name: "airdrop_token_mint", docs: ["Read account: the mint account of the airdrop token."] }, + { name: "campaign", docs: ["Read account: the account storing the campaign data."] }, { - docs: ["Write account: the campaign's ATA for the airdrop token."], name: "campaign_ata", + docs: ["Write account: the campaign's ATA for the airdrop token."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "campaign" }, + { kind: "account", path: "airdrop_token_program" }, + { kind: "account", path: "airdrop_token_mint" }, + ], program: { kind: "const", value: [ @@ -230,103 +241,99 @@ export const sablierMerkleInstantIdl = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "campaign" }, - { kind: "account", path: "airdrop_token_program" }, - { kind: "account", path: "airdrop_token_mint" }, - ], }, - writable: true, }, - { docs: ["Program account: the Token program of the airdrop token."], name: "airdrop_token_program" }, + { name: "airdrop_token_program", docs: ["Program account: the Token program of the airdrop token."] }, { - address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", - docs: ["Program account: the Associated Token program."], name: "associated_token_program", + docs: ["Program account: the Associated Token program."], + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", }, { - address: "11111111111111111111111111111111", - docs: ["Program account: the System program."], name: "system_program", + docs: ["Program account: the System program."], + address: "11111111111111111111111111111111", }, ], args: [{ name: "amount", type: "u64" }], - discriminator: [111, 92, 142, 79, 33, 234, 82, 27], + }, + { + name: "collect_fees", docs: [ - "Claws back the unclaimed tokens from the campaign.", + "Collects the fees accumulated in the treasury by transferring them to the fee recipient.", "", "# Accounts Expected", "", - "- `campaign` The account that stores the campaign details.", - "- `campaign_creator` The transaction signer.", - "- `airdrop_token_mint` The mint of the airdropped token.", - "- `airdrop_token_program` The Token Program of the airdropped token.", - "", - "# Parameters", - "", - "- `amount` The amount to claw back.", + "- `fee_collector` The transaction signer and the fee collector.", + "- `fee_recipient` The address receiving the collected fees.", "", "# Notes", "", - "- Emits a [`crate::utils::events::Clawback`] event.", + '- To calculate the "collectable amount", the rent-exempt minimum balance and a 0.001 SOL buffer are deducted', + "from the treasury SOL balance.", + "- Emits a [`crate::utils::events::FeesCollected`] event.", "", "# Requirements", "", - "- The signer must be the actual campaign creator.", - "- No claim must be made, OR the current timestamp must not exceed 7 days after the first claim, OR the campaign", - "must be expired.", + "- `fee_collector` must be authorized for fee collection.", + '- The "collectable amount" must be greater than zero.', ], - name: "clawback", - }, - { + discriminator: [164, 152, 207, 99, 30, 186, 19, 182], accounts: [ { - docs: ["Write account: the account authorized to collect fees from the treasury."], name: "fee_collector", + docs: ["Write account: the account authorized to collect fees from the treasury."], signer: true, }, { - docs: ["Write account: the address that will receive the collected fees."], name: "fee_recipient", + docs: ["Write account: the address that will receive the collected fees."], writable: true, }, { - docs: ["Write account: the treasury account that holds the fees."], name: "treasury", - pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, + docs: ["Write account: the treasury account that holds the fees."], writable: true, + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, }, ], args: [], - discriminator: [164, 152, 207, 99, 30, 186, 19, 182], + }, + { + name: "create_campaign", docs: [ - "Collects the fees accumulated in the treasury by transferring them to the fee recipient.", + "Creates a Merkle Instant airdrop campaign.", "", "# Accounts Expected", "", - "- `fee_collector` The transaction signer and the fee collector.", - "- `fee_recipient` The address receiving the collected fees.", + "- `creator` The transaction signer and the campaign creator.", + "- `airdrop_token_mint` The mint of the airdropped token.", + "- `airdrop_token_program` The Token Program of the airdropped token.", "", - "# Notes", + "# Parameters", "", - '- To calculate the "collectable amount", the rent-exempt minimum balance and a 0.001 SOL buffer are deducted', - "from the treasury SOL balance.", - "- Emits a [`crate::utils::events::FeesCollected`] event.", + "- `merkle_root` The Merkle root of the claim data.", + "- `campaign_start_time` The time when the campaign starts, in seconds since the Unix epoch.", + "- `expiration_time` The time when the campaign expires, in seconds since the Unix epoch.", + "A value of zero means the campaign does not expire.", + "- `name` The name of the campaign.", + "- `ipfs_cid` The content identifier for indexing the campaign on IPFS. An empty value may break some UI", + "features that depend upon the IPFS CID.", + "- `aggregate_amount` The total amount of tokens to be distributed to all recipients.", + "- `recipient_count` The total number of recipient addresses eligible for the airdrop.", "", - "# Requirements", + "# Notes", "", - "- `fee_collector` must be authorized for fee collection.", - '- The "collectable amount" must be greater than zero.', + "- Emits a [`crate::utils::events::CreateCampaign`] event.", ], - name: "collect_fees", - }, - { + discriminator: [111, 131, 187, 98, 160, 193, 114, 244], accounts: [ - { docs: ["Write account: the creator of the campaign."], name: "creator", signer: true, writable: true }, - { docs: ["Read account: the mint account of the airdrop token."], name: "airdrop_token_mint" }, + { name: "creator", docs: ["Write account: the creator of the campaign."], writable: true, signer: true }, + { name: "airdrop_token_mint", docs: ["Read account: the mint account of the airdrop token."] }, { - docs: ["Create account: the account storing the campaign data."], name: "campaign", + docs: ["Create account: the account storing the campaign data."], + writable: true, pda: { seeds: [ { kind: "const", value: [99, 97, 109, 112, 97, 105, 103, 110] }, @@ -338,12 +345,17 @@ export const sablierMerkleInstantIdl = { { kind: "account", path: "airdrop_token_mint" }, ], }, - writable: true, }, { - docs: ["Create account: the campaign's ATA for the airdrop token."], name: "campaign_ata", + docs: ["Create account: the campaign's ATA for the airdrop token."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "campaign" }, + { kind: "account", path: "airdrop_token_program" }, + { kind: "account", path: "airdrop_token_mint" }, + ], program: { kind: "const", value: [ @@ -351,24 +363,18 @@ export const sablierMerkleInstantIdl = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "campaign" }, - { kind: "account", path: "airdrop_token_program" }, - { kind: "account", path: "airdrop_token_mint" }, - ], }, - writable: true, }, - { docs: ["Program account: the Token program of the airdrop token."], name: "airdrop_token_program" }, + { name: "airdrop_token_program", docs: ["Program account: the Token program of the airdrop token."] }, { - address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", - docs: ["Program account: the Associated Token program."], name: "associated_token_program", + docs: ["Program account: the Associated Token program."], + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", }, { - address: "11111111111111111111111111111111", - docs: ["Program account: the System program."], name: "system_program", + docs: ["Program account: the System program."], + address: "11111111111111111111111111111111", }, ], args: [ @@ -380,38 +386,9 @@ export const sablierMerkleInstantIdl = { { name: "aggregate_amount", type: "u64" }, { name: "recipient_count", type: "u32" }, ], - discriminator: [111, 131, 187, 98, 160, 193, 114, 244], - docs: [ - "Creates a Merkle Instant airdrop campaign.", - "", - "# Accounts Expected", - "", - "- `creator` The transaction signer and the campaign creator.", - "- `airdrop_token_mint` The mint of the airdropped token.", - "- `airdrop_token_program` The Token Program of the airdropped token.", - "", - "# Parameters", - "", - "- `merkle_root` The Merkle root of the claim data.", - "- `campaign_start_time` The time when the campaign starts, in seconds since the Unix epoch.", - "- `expiration_time` The time when the campaign expires, in seconds since the Unix epoch.", - "A value of zero means the campaign does not expire.", - "- `name` The name of the campaign.", - "- `ipfs_cid` The content identifier for indexing the campaign on IPFS. An empty value may break some UI", - "features that depend upon the IPFS CID.", - "- `aggregate_amount` The total amount of tokens to be distributed to all recipients.", - "- `recipient_count` The total number of recipient addresses eligible for the airdrop.", - "", - "# Notes", - "", - "- Emits a [`crate::utils::events::CreateCampaign`] event.", - ], - name: "create_campaign", }, { - accounts: [{ docs: ["Read account: the account storing the campaign data."], name: "campaign" }], - args: [], - discriminator: [135, 101, 171, 220, 86, 97, 104, 199], + name: "has_campaign_started", docs: [ "Returns a flag indicating whether the campaign has started.", "", @@ -419,15 +396,30 @@ export const sablierMerkleInstantIdl = { "", "- `campaign` The account that stores the campaign details.", ], - name: "has_campaign_started", + discriminator: [135, 101, 171, 220, 86, 97, 104, 199], + accounts: [{ name: "campaign", docs: ["Read account: the account storing the campaign data."] }], + args: [], returns: "bool", }, { + name: "has_claimed", + docs: [ + "Returns a flag indicating whether a claim has been made for the given index.", + "", + "# Accounts Expected", + "", + "- `campaign` The account that stores the campaign details.", + "", + "# Parameters", + "", + "- `_index` The index of the recipient in the Merkle tree.", + ], + discriminator: [182, 195, 167, 56, 232, 3, 223, 102], accounts: [ - { docs: ["Read account: the account storing the campaign data."], name: "campaign" }, + { name: "campaign", docs: ["Read account: the account storing the campaign data."] }, { - docs: ["Read account: the claim receipt."], name: "claim_receipt", + docs: ["Read account: the claim receipt."], pda: { seeds: [ { kind: "const", value: [99, 108, 97, 105, 109, 95, 114, 101, 99, 101, 105, 112, 116] }, @@ -438,25 +430,10 @@ export const sablierMerkleInstantIdl = { }, ], args: [{ name: "_index", type: "u32" }], - discriminator: [182, 195, 167, 56, 232, 3, 223, 102], - docs: [ - "Returns a flag indicating whether a claim has been made for the given index.", - "", - "# Accounts Expected", - "", - "- `campaign` The account that stores the campaign details.", - "", - "# Parameters", - "", - "- `_index` The index of the recipient in the Merkle tree.", - ], - name: "has_claimed", returns: "bool", }, { - accounts: [{ docs: ["Read account: the account storing the campaign data."], name: "campaign" }], - args: [], - discriminator: [24, 138, 30, 86, 92, 38, 143, 129], + name: "has_expired", docs: [ "Returns a flag indicating whether the campaign has expired.", "", @@ -464,13 +441,13 @@ export const sablierMerkleInstantIdl = { "", "- `campaign` The account that stores the campaign details.", ], - name: "has_expired", + discriminator: [24, 138, 30, 86, 92, 38, 143, 129], + accounts: [{ name: "campaign", docs: ["Read account: the account storing the campaign data."] }], + args: [], returns: "bool", }, { - accounts: [{ docs: ["Read account: the account storing the campaign data."], name: "campaign" }], - args: [], - discriminator: [223, 150, 181, 32, 240, 136, 73, 236], + name: "has_grace_period_passed", docs: [ "Returns a flag indicating whether the grace period of the campaign has passed.", "", @@ -483,22 +460,39 @@ export const sablierMerkleInstantIdl = { "- A return value of `false` indicates: No claim has been made yet, OR the current timestamp does not exceed", "seven days after the first claim.", ], - name: "has_grace_period_passed", + discriminator: [223, 150, 181, 32, 240, 136, 73, 236], + accounts: [{ name: "campaign", docs: ["Read account: the account storing the campaign data."] }], + args: [], returns: "bool", }, { + name: "initialize", + docs: [ + "Initializes the program with the provided fee collector address.", + "", + "# Accounts Expected", + "", + "- `initializer` The transaction signer.", + "", + "# Parameters", + "", + "- `fee_collector` The address that will have the authority to collect fees.", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + ], + discriminator: [175, 175, 109, 31, 13, 152, 155, 237], accounts: [ - { docs: ["Write account: the initializer of the program."], name: "initializer", signer: true, writable: true }, + { name: "initializer", docs: ["Write account: the initializer of the program."], writable: true, signer: true }, { - docs: ["Create account: the treasury account that will hold the fees."], name: "treasury", - pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, + docs: ["Create account: the treasury account that will hold the fees."], writable: true, + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, }, { - address: "11111111111111111111111111111111", - docs: ["Program account: the System program."], name: "system_program", + docs: ["Program account: the System program."], + address: "11111111111111111111111111111111", }, ], args: [ @@ -506,43 +500,50 @@ export const sablierMerkleInstantIdl = { { name: "chainlink_program", type: "pubkey" }, { name: "chainlink_sol_usd_feed", type: "pubkey" }, ], - discriminator: [175, 175, 109, 31, 13, 152, 155, 237], - docs: [ - "Initializes the program with the provided fee collector address.", - "", - "# Accounts Expected", - "", - "- `initializer` The transaction signer.", - "", - "# Parameters", - "", - "- `fee_collector` The address that will have the authority to collect fees.", - "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", - "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", - ], - name: "initialize", }, { + name: "treasury_view", + docs: ["Returns the treasury details."], + discriminator: [247, 160, 213, 237, 247, 121, 164, 82], accounts: [ { - docs: ["Read account: the account storing the treasury details."], name: "treasury", + docs: ["Read account: the account storing the treasury details."], pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, }, ], args: [], - discriminator: [247, 160, 213, 237, 247, 121, 164, 82], - docs: ["Returns the treasury details."], - name: "treasury_view", returns: { defined: { name: "Treasury" } }, }, ], - metadata: { description: "Created with Anchor", name: "sablier_merkle_instant", spec: "0.1.0", version: "0.1.0" }, + accounts: [ + { name: "Campaign", discriminator: [50, 40, 49, 11, 157, 220, 229, 192] }, + { name: "ClaimReceipt", discriminator: [223, 233, 11, 229, 124, 165, 207, 28] }, + { name: "Treasury", discriminator: [238, 239, 123, 238, 89, 1, 168, 253] }, + ], + events: [ + { name: "Claim", discriminator: [133, 98, 9, 238, 133, 207, 191, 113] }, + { name: "Clawback", discriminator: [239, 144, 30, 69, 80, 59, 142, 64] }, + { name: "CreateCampaign", discriminator: [88, 178, 212, 72, 110, 4, 68, 143] }, + { name: "FeesCollected", discriminator: [233, 23, 117, 225, 107, 178, 254, 8] }, + ], + errors: [ + { code: 6000, name: "CampaignExpired", msg: "Campaign has expired!" }, + { code: 6001, name: "InvalidMerkleProof", msg: "Invalid Merkle proof!" }, + { code: 6002, name: "CampaignNotStarted", msg: "Campaign has not started yet!" }, + { + code: 6003, + name: "ClawbackNotAllowed", + msg: "Clawback not allowed past the grace period and before campaign expiration!", + }, + { code: 6004, name: "CantCollectZeroFees", msg: "Can't collect zero fees!" }, + ], types: [ { - docs: ["Groups all the data for a Merkle Instant campaign."], name: "Campaign", + docs: ["Groups all the data for a Merkle Instant campaign."], type: { + kind: "struct", fields: [ { name: "airdrop_token_mint", type: "pubkey" }, { name: "bump", type: "u8" }, @@ -554,12 +555,12 @@ export const sablierMerkleInstantIdl = { { name: "merkle_root", type: { array: ["u8", 32] } }, { name: "name", type: "string" }, ], - kind: "struct", }, }, { name: "Claim", type: { + kind: "struct", fields: [ { name: "amount", type: "u64" }, { name: "campaign", type: "pubkey" }, @@ -569,25 +570,25 @@ export const sablierMerkleInstantIdl = { { name: "index", type: "u32" }, { name: "recipient", type: "pubkey" }, ], - kind: "struct", }, }, - { name: "ClaimReceipt", type: { fields: [], kind: "struct" } }, + { name: "ClaimReceipt", type: { kind: "struct", fields: [] } }, { name: "Clawback", type: { + kind: "struct", fields: [ { name: "amount", type: "u64" }, { name: "campaign", type: "pubkey" }, { name: "campaign_creator", type: "pubkey" }, { name: "clawback_recipient", type: "pubkey" }, ], - kind: "struct", }, }, { name: "CreateCampaign", type: { + kind: "struct", fields: [ { name: "aggregate_amount", type: "u64" }, { name: "campaign", type: "pubkey" }, @@ -601,31 +602,30 @@ export const sablierMerkleInstantIdl = { { name: "token_decimals", type: "u8" }, { name: "token_mint", type: "pubkey" }, ], - kind: "struct", }, }, { name: "FeesCollected", type: { + kind: "struct", fields: [ { name: "fee_amount", type: "u64" }, { name: "fee_collector", type: "pubkey" }, { name: "fee_recipient", type: "pubkey" }, ], - kind: "struct", }, }, { name: "Treasury", type: { + kind: "struct", fields: [ { name: "bump", type: "u8" }, { name: "fee_collector", type: "pubkey" }, { name: "chainlink_program", type: "pubkey" }, { name: "chainlink_sol_usd_feed", type: "pubkey" }, ], - kind: "struct", }, }, ], -}; +} as const; diff --git a/src/solana/idl/airdrops/v1.0/SablierMerkleInstant/index.ts b/src/solana/idl/airdrops/v1.0/SablierMerkleInstant/index.ts new file mode 100644 index 0000000..8253359 --- /dev/null +++ b/src/solana/idl/airdrops/v1.0/SablierMerkleInstant/index.ts @@ -0,0 +1,21 @@ +/* -------------------------------------------------------------------------- */ +/* OBJECTS */ +/* -------------------------------------------------------------------------- */ + +import { errorCodes } from "./errors"; +import { idl } from "./idl"; +import * as structs from "./structs"; + +export const sablierMerkleInstant = { errorCodes, idl, structs }; + +/* -------------------------------------------------------------------------- */ +/* TYPES */ +/* -------------------------------------------------------------------------- */ + +import * as errors from "./errors"; +import * as idlType from "./idl-type"; + +export namespace SablierMerkleInstant { + export import IDL = idlType.IDL; + export import ErrorNames = errors.ErrorNames; +} diff --git a/src/solana/idl/airdrops/v1.0/SablierMerkleInstant/structs.ts b/src/solana/idl/airdrops/v1.0/SablierMerkleInstant/structs.ts new file mode 100644 index 0000000..bc4717d --- /dev/null +++ b/src/solana/idl/airdrops/v1.0/SablierMerkleInstant/structs.ts @@ -0,0 +1,49 @@ +import type { BN } from "@coral-xyz/anchor"; +import type { PublicKey } from "@solana/web3.js"; + +export type Campaign = { + airdropTokenMint: PublicKey; + bump: number; + campaignStartTime: BN; + creator: PublicKey; + expirationTime: BN; + firstClaimTime: BN; + ipfsCid: string; + merkleRoot: number[]; + name: string; +}; + +export type Claim = { + amount: BN; + campaign: PublicKey; + claimer: PublicKey; + claimReceipt: PublicKey; + feeInLamports: BN; + index: number; + recipient: PublicKey; +}; + +export type Clawback = { amount: BN; campaign: PublicKey; campaignCreator: PublicKey; clawbackRecipient: PublicKey }; + +export type CreateCampaign = { + aggregateAmount: BN; + campaign: PublicKey; + campaignName: string; + campaignStartTime: BN; + creator: PublicKey; + expirationTime: BN; + ipfsCid: string; + merkleRoot: number[]; + recipientCount: number; + tokenDecimals: number; + tokenMint: PublicKey; +}; + +export type FeesCollected = { feeAmount: BN; feeCollector: PublicKey; feeRecipient: PublicKey }; + +export type Treasury = { + bump: number; + feeCollector: PublicKey; + chainlinkProgram: PublicKey; + chainlinkSolUsdFeed: PublicKey; +}; diff --git a/src/solana/idl/airdrops/v1.0/index.ts b/src/solana/idl/airdrops/v1.0/index.ts deleted file mode 100644 index 5260b87..0000000 --- a/src/solana/idl/airdrops/v1.0/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { sablierMerkleInstantIdl as SablierMerkleInstantIDL } from "./SablierMerkleInstant"; -export type { Idl as SablierMerkleInstantType } from "./SablierMerkleInstantType"; diff --git a/src/solana/idl/biome.jsonc b/src/solana/idl/biome.jsonc new file mode 100644 index 0000000..8a5e55c --- /dev/null +++ b/src/solana/idl/biome.jsonc @@ -0,0 +1,21 @@ +{ + "$schema": "../../../node_modules/@biomejs/biome/configuration_schema.json", + "extends": "//", + "overrides": [ + { + "includes": ["**/*.{json,jsonc,ts}"], + "assist": { + "actions": { + "source": { + "useSortedKeys": "off" + } + } + }, + "javascript": { + "formatter": { + "expand": "never" // Never expand objects in the IDL to save number of lines + } + } + } + ] +} diff --git a/src/solana/idl/index.ts b/src/solana/idl/index.ts deleted file mode 100644 index 7c6a478..0000000 --- a/src/solana/idl/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./airdrops"; -export * from "./lockup"; diff --git a/src/solana/idl/lockup/index.ts b/src/solana/idl/lockup/index.ts deleted file mode 100644 index 04d5b36..0000000 --- a/src/solana/idl/lockup/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./v1.0"; diff --git a/src/solana/idl/lockup/v1.0/SablierLockupLinear/errors.ts b/src/solana/idl/lockup/v1.0/SablierLockupLinear/errors.ts new file mode 100644 index 0000000..8dbb2bd --- /dev/null +++ b/src/solana/idl/lockup/v1.0/SablierLockupLinear/errors.ts @@ -0,0 +1,20 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +export const errorCodes = { + StreamDepleted: 6000, + StreamCanceled: 6001, + StreamIsNotCancelable: 6002, + StreamSettled: 6003, + CantCollectZeroFees: 6004, + CliffTimeNotLessThanEndTime: 6005, + CliffTimeZeroUnlockAmountNotZero: 6006, + DepositAmountZero: 6007, + StartTimeNotLessThanCliffTime: 6008, + StartTimeNotLessThanEndTime: 6009, + StartTimeZero: 6010, + UnlockAmountsSumTooHigh: 6011, + StreamAlreadyNonCancelable: 6012, + Overdraw: 6013, + WithdrawAmountZero: 6014, +} as const; + +export type ErrorNames = keyof typeof errorCodes; diff --git a/src/solana/idl/lockup/v1.0/SablierLockupLinearType.ts b/src/solana/idl/lockup/v1.0/SablierLockupLinear/idl-type.ts similarity index 99% rename from src/solana/idl/lockup/v1.0/SablierLockupLinearType.ts rename to src/solana/idl/lockup/v1.0/SablierLockupLinear/idl-type.ts index 7a0100c..804584b 100644 --- a/src/solana/idl/lockup/v1.0/SablierLockupLinearType.ts +++ b/src/solana/idl/lockup/v1.0/SablierLockupLinear/idl-type.ts @@ -1,9 +1,4 @@ -/** - * Program IDL in camelCase format in order to be used in JS/TS. - * - * Note that this is only a type helper and is not the actual IDL. - */ -export type Idl = { +export type IDL = { address: "4EauRKrNErKfsR4XetEZJNmvACGHbHnHV4R5dvJuqupC"; metadata: { name: "sablierLockup"; version: "0.1.0"; spec: "0.1.0"; description: "Created with Anchor" }; docs: ["Sablier Lockup program for creating and managing token streams."]; diff --git a/src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.json b/src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.json new file mode 100644 index 0000000..fddb548 --- /dev/null +++ b/src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.json @@ -0,0 +1,2227 @@ +{ + "address": "4EauRKrNErKfsR4XetEZJNmvACGHbHnHV4R5dvJuqupC", + "metadata": { + "name": "sablier_lockup", + "version": "0.1.0", + "spec": "0.1.0", + "description": "Created with Anchor" + }, + "docs": ["Sablier Lockup program for creating and managing token streams."], + "instructions": [ + { + "name": "cancel", + "docs": [ + "Cancels the stream and refunds any remaining tokens to the sender ATA.", + "", + "# Accounts Expected", + "", + "- `sender` The transaction signer and the stream's sender.", + "- `deposited_token_mint` The mint of the deposited token.", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "- `deposited_token_program` The Token Program of the deposited token.", + "", + "# Notes", + "", + "- If there are any tokens left for the recipient to withdraw, the stream is marked as canceled. Otherwise, the", + "stream is marked as depleted.", + "- If the sender does not have an ATA for the deposited token, it is created.", + "- Emits a [`crate::utils::events::CancelLockupStream`] event.", + "", + "# Requirements", + "", + "- The signer must be the stream's sender.", + "- The `stream_nft_mint` must exist.", + "- The stream must be cancelable.", + "- The stream must be Pending or Streaming." + ], + "discriminator": [232, 219, 223, 41, 219, 236, 220, 190], + "accounts": [ + { + "name": "sender", + "docs": ["Write account: the sender of the stream who can cancel it."], + "writable": true, + "signer": true + }, + { + "name": "sender_ata", + "docs": ["Create if needed account: the deposited token ATA owned by the sender."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "sender" + }, + { + "kind": "account", + "path": "deposited_token_program" + }, + { + "kind": "account", + "path": "deposited_token_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "deposited_token_mint", + "docs": ["Read account: the mint account of the deposited token."] + }, + { + "name": "stream_data", + "docs": ["Write account: the stream data account storing stream details."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "stream_nft_mint" + } + ] + } + }, + { + "name": "stream_data_ata", + "docs": ["Write account: the deposited token ATA owned by the stream data account."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "stream_data" + }, + { + "kind": "account", + "path": "deposited_token_program" + }, + { + "kind": "account", + "path": "deposited_token_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "stream_nft_mint", + "docs": ["Read account: the mint account for the stream NFT."] + }, + { + "name": "associated_token_program", + "docs": ["Program account: the Associated Token program."], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "deposited_token_program", + "docs": ["Program account: the Token program of the deposited token."] + }, + { + "name": "system_program", + "docs": ["Program account: the System program."], + "address": "11111111111111111111111111111111" + } + ], + "args": [] + }, + { + "name": "collect_fees", + "docs": [ + "Collects the fees accumulated in the treasury by transferring them to the fee recipient.", + "", + "# Accounts Expected", + "", + "- `fee_collector` The transaction signer and the fee collector.", + "- `fee_recipient` The address receiving the collected fees.", + "", + "# Notes", + "", + "- Leaves a buffer of 0.001 SOL to ensure the account remains rent-exempt after the fee collection.", + "- Emits a [`crate::utils::events::FeesCollected`] event.", + "", + "# Requirements", + "", + "- `fee_collector` must be authorized for fee collection." + ], + "discriminator": [164, 152, 207, 99, 30, 186, 19, 182], + "accounts": [ + { + "name": "fee_collector", + "docs": ["Write account: the account authorized to collect fees from the treasury."], + "signer": true + }, + { + "name": "fee_recipient", + "docs": ["Write account: the address that will receive the collected fees."], + "writable": true + }, + { + "name": "treasury", + "docs": ["Write account: the treasury account that holds the fees."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [116, 114, 101, 97, 115, 117, 114, 121] + } + ] + } + } + ], + "args": [] + }, + { + "name": "create_with_durations_ll", + "docs": [ + "Creates a stream by setting the start time to the current timestamp, and the end time to the sum of the", + "current timestamp and the total duration The stream is funded by the signer and wrapped in a Metaplex NFT.", + "", + "# Accounts Expected", + "", + "Refer to the accounts in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", + "", + "# Parameters", + "", + "Refer to the parameters in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", + "", + "# Notes", + "", + "Refer to the notes in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", + "", + "# Requirements", + "", + "Refer to the requirements in [`fn@crate::sablier_lockup::create_with_timestamps_ll`]." + ], + "discriminator": [87, 17, 170, 167, 156, 152, 169, 61], + "accounts": [ + { + "name": "creator", + "docs": ["Write account: the creator and funder of the stream."], + "writable": true, + "signer": true + }, + { + "name": "creator_ata", + "docs": ["Write account: the creator's ATA for the deposit token."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "creator" + }, + { + "kind": "account", + "path": "deposit_token_program" + }, + { + "kind": "account", + "path": "deposit_token_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "recipient", + "docs": ["Read account: the recipient of the stream."] + }, + { + "name": "sender", + "docs": ["Read account: the sender of the stream."] + }, + { + "name": "nft_collection_data", + "docs": ["Write account: the NFT collection data storing the total supply."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 100, 97, 116, 97] + } + ] + } + }, + { + "name": "nft_collection_master_edition", + "docs": ["Write account: the master edition account for the NFT collection."], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [109, 101, 116, 97, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "token_metadata_program" + }, + { + "kind": "account", + "path": "nft_collection_mint" + }, + { + "kind": "const", + "value": [101, 100, 105, 116, 105, 111, 110] + } + ], + "program": { + "kind": "account", + "path": "token_metadata_program" + } + } + }, + { + "name": "nft_collection_metadata", + "docs": ["Write account: the metadata account for the NFT collection."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [109, 101, 116, 97, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "token_metadata_program" + }, + { + "kind": "account", + "path": "nft_collection_mint" + } + ], + "program": { + "kind": "account", + "path": "token_metadata_program" + } + } + }, + { + "name": "nft_collection_mint", + "docs": ["Read account: the mint account for the NFT collection."], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 109, 105, 110, 116] + } + ] + } + }, + { + "name": "deposit_token_mint", + "docs": ["Read account: the mint account for the deposit token."] + }, + { + "name": "stream_nft_mint", + "docs": ["Create account: the mint account for the stream NFT."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116] + }, + { + "kind": "account", + "path": "sender" + }, + { + "kind": "arg", + "path": "salt" + } + ] + } + }, + { + "name": "recipient_stream_nft_ata", + "docs": ["Create account: the ATA for the stream NFT owned by the recipient."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "recipient" + }, + { + "kind": "account", + "path": "nft_token_program" + }, + { + "kind": "account", + "path": "stream_nft_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "stream_data", + "docs": ["Create account: the account that will store the stream data."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "stream_nft_mint" + } + ] + } + }, + { + "name": "stream_data_ata", + "docs": ["Create account: the ATA for deposit tokens owned by stream data account."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "stream_data" + }, + { + "kind": "account", + "path": "deposit_token_program" + }, + { + "kind": "account", + "path": "deposit_token_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "stream_nft_master_edition", + "docs": ["Create account: the master edition account for the stream NFT."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [109, 101, 116, 97, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "token_metadata_program" + }, + { + "kind": "account", + "path": "stream_nft_mint" + }, + { + "kind": "const", + "value": [101, 100, 105, 116, 105, 111, 110] + } + ], + "program": { + "kind": "account", + "path": "token_metadata_program" + } + } + }, + { + "name": "stream_nft_metadata", + "docs": ["Create account: the metadata account for the stream NFT."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [109, 101, 116, 97, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "token_metadata_program" + }, + { + "kind": "account", + "path": "stream_nft_mint" + } + ], + "program": { + "kind": "account", + "path": "token_metadata_program" + } + } + }, + { + "name": "associated_token_program", + "docs": ["Program account: the Associated Token program."], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "deposit_token_program", + "docs": ["Program account: the Token program of the deposit token."] + }, + { + "name": "nft_token_program", + "docs": ["Program account: the Token program of the stream NFT."] + }, + { + "name": "token_metadata_program", + "docs": ["Program account: the Token Metadata program."], + "address": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" + }, + { + "name": "system_program", + "docs": ["Program account: the System program."], + "address": "11111111111111111111111111111111" + }, + { + "name": "rent", + "docs": ["Sysvar account: Rent."], + "address": "SysvarRent111111111111111111111111111111111" + } + ], + "args": [ + { + "name": "salt", + "type": "u128" + }, + { + "name": "deposit_amount", + "type": "u64" + }, + { + "name": "cliff_duration", + "type": "u64" + }, + { + "name": "total_duration", + "type": "u64" + }, + { + "name": "start_unlock_amount", + "type": "u64" + }, + { + "name": "cliff_unlock_amount", + "type": "u64" + }, + { + "name": "is_cancelable", + "type": "bool" + } + ] + }, + { + "name": "create_with_timestamps_ll", + "docs": [ + "Creates a stream with the provided start and end times. The stream is funded by the signer and wrapped in", + "a Metaplex NFT.", + "", + "# Accounts Expected", + "", + "- `creator` The transaction signer.", + "- `sender` The account that will have authority to cancel or renounce the stream.", + "- `deposit_token_mint` The mint of the tokens to be deposited.", + "- `recipient` The address receiving the tokens, as well as the NFT owner.", + "- `deposit_token_program` The Token Program of the deposit token.", + "- `nft_token_program` The Token Program of the NFT.", + "", + "# Parameters", + "", + "- `salt` A unique salt used to derive the address of the stream NFT mint.", + "- `deposit_amount` The deposit amount, denoted in units of the token's decimals.", + "- `start_time` The Unix timestamp indicating the stream's start.", + "- `cliff_time` The Unix timestamp indicating the stream's cliff.", + "- `end_time` The Unix timestamp indicating the stream's end.", + "- `start_unlock_amount` The amount to be unlocked at the start time.", + "- `cliff_unlock_amount` The amount to be unlocked at the cliff time.", + "- `is_cancelable` Indicates if the stream is cancelable.", + "", + "# Notes", + "", + "- The passed sender of the stream doesn't have to be the same as its creator.", + "- A cliff time of zero means there is no cliff.", + "- As long as the times are ordered, it is not an error for the start or the cliff time to be in the past.", + "- The stream recipient is given solely by the ownership of the stream NFT, which is minted to the passed", + "`recipient`.", + "- Emits a [`crate::utils::events::CreateLockupLinearStream`] event.", + "", + "# Requirements", + "", + "- `deposit_amount` must be greater than zero.", + "- `start_time` must be greater than zero and less than `end_time`.", + "- If set, `cliff_time` must be greater than `start_time` and less than `end_time`.", + "- The sum of `start_unlock_amount` and `cliff_unlock_amount` must be less than or equal to deposit amount.", + "- If `cliff_time` is not set, the `cliff_unlock_amount` amount must be zero." + ], + "discriminator": [150, 165, 147, 28, 68, 41, 48, 41], + "accounts": [ + { + "name": "creator", + "docs": ["Write account: the creator and funder of the stream."], + "writable": true, + "signer": true + }, + { + "name": "creator_ata", + "docs": ["Write account: the creator's ATA for the deposit token."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "creator" + }, + { + "kind": "account", + "path": "deposit_token_program" + }, + { + "kind": "account", + "path": "deposit_token_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "recipient", + "docs": ["Read account: the recipient of the stream."] + }, + { + "name": "sender", + "docs": ["Read account: the sender of the stream."] + }, + { + "name": "nft_collection_data", + "docs": ["Write account: the NFT collection data storing the total supply."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 100, 97, 116, 97] + } + ] + } + }, + { + "name": "nft_collection_master_edition", + "docs": ["Write account: the master edition account for the NFT collection."], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [109, 101, 116, 97, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "token_metadata_program" + }, + { + "kind": "account", + "path": "nft_collection_mint" + }, + { + "kind": "const", + "value": [101, 100, 105, 116, 105, 111, 110] + } + ], + "program": { + "kind": "account", + "path": "token_metadata_program" + } + } + }, + { + "name": "nft_collection_metadata", + "docs": ["Write account: the metadata account for the NFT collection."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [109, 101, 116, 97, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "token_metadata_program" + }, + { + "kind": "account", + "path": "nft_collection_mint" + } + ], + "program": { + "kind": "account", + "path": "token_metadata_program" + } + } + }, + { + "name": "nft_collection_mint", + "docs": ["Read account: the mint account for the NFT collection."], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 109, 105, 110, 116] + } + ] + } + }, + { + "name": "deposit_token_mint", + "docs": ["Read account: the mint account for the deposit token."] + }, + { + "name": "stream_nft_mint", + "docs": ["Create account: the mint account for the stream NFT."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116] + }, + { + "kind": "account", + "path": "sender" + }, + { + "kind": "arg", + "path": "salt" + } + ] + } + }, + { + "name": "recipient_stream_nft_ata", + "docs": ["Create account: the ATA for the stream NFT owned by the recipient."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "recipient" + }, + { + "kind": "account", + "path": "nft_token_program" + }, + { + "kind": "account", + "path": "stream_nft_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "stream_data", + "docs": ["Create account: the account that will store the stream data."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "stream_nft_mint" + } + ] + } + }, + { + "name": "stream_data_ata", + "docs": ["Create account: the ATA for deposit tokens owned by stream data account."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "stream_data" + }, + { + "kind": "account", + "path": "deposit_token_program" + }, + { + "kind": "account", + "path": "deposit_token_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "stream_nft_master_edition", + "docs": ["Create account: the master edition account for the stream NFT."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [109, 101, 116, 97, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "token_metadata_program" + }, + { + "kind": "account", + "path": "stream_nft_mint" + }, + { + "kind": "const", + "value": [101, 100, 105, 116, 105, 111, 110] + } + ], + "program": { + "kind": "account", + "path": "token_metadata_program" + } + } + }, + { + "name": "stream_nft_metadata", + "docs": ["Create account: the metadata account for the stream NFT."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [109, 101, 116, 97, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "token_metadata_program" + }, + { + "kind": "account", + "path": "stream_nft_mint" + } + ], + "program": { + "kind": "account", + "path": "token_metadata_program" + } + } + }, + { + "name": "associated_token_program", + "docs": ["Program account: the Associated Token program."], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "deposit_token_program", + "docs": ["Program account: the Token program of the deposit token."] + }, + { + "name": "nft_token_program", + "docs": ["Program account: the Token program of the stream NFT."] + }, + { + "name": "token_metadata_program", + "docs": ["Program account: the Token Metadata program."], + "address": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" + }, + { + "name": "system_program", + "docs": ["Program account: the System program."], + "address": "11111111111111111111111111111111" + }, + { + "name": "rent", + "docs": ["Sysvar account: Rent."], + "address": "SysvarRent111111111111111111111111111111111" + } + ], + "args": [ + { + "name": "salt", + "type": "u128" + }, + { + "name": "deposit_amount", + "type": "u64" + }, + { + "name": "start_time", + "type": "u64" + }, + { + "name": "cliff_time", + "type": "u64" + }, + { + "name": "end_time", + "type": "u64" + }, + { + "name": "start_unlock_amount", + "type": "u64" + }, + { + "name": "cliff_unlock_amount", + "type": "u64" + }, + { + "name": "is_cancelable", + "type": "bool" + } + ] + }, + { + "name": "initialize", + "docs": [ + "Initializes the program with the provided fee collector address by creating a Metaplex NFT collection.", + "", + "# Accounts Expected", + "", + "- `initializer` The transaction signer.", + "- `nft_token_program` The Token Program of the NFT collection.", + "", + "# Parameters:", + "", + "- `fee_collector`: The address that will have the authority to collect fees.", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data." + ], + "discriminator": [175, 175, 109, 31, 13, 152, 155, 237], + "accounts": [ + { + "name": "initializer", + "docs": ["Write account: the initializer of the program."], + "writable": true, + "signer": true + }, + { + "name": "treasury", + "docs": ["Create account: the treasury account that will hold the fees."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [116, 114, 101, 97, 115, 117, 114, 121] + } + ] + } + }, + { + "name": "nft_collection_data", + "docs": ["Create account: the NFT collection data account storing collection metadata."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 100, 97, 116, 97] + } + ] + } + }, + { + "name": "nft_collection_master_edition", + "docs": ["Create account: the master edition account for the NFT collection."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [109, 101, 116, 97, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "token_metadata_program" + }, + { + "kind": "account", + "path": "nft_collection_mint" + }, + { + "kind": "const", + "value": [101, 100, 105, 116, 105, 111, 110] + } + ], + "program": { + "kind": "account", + "path": "token_metadata_program" + } + } + }, + { + "name": "nft_collection_metadata", + "docs": ["Create account: the metadata account for the NFT collection."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [109, 101, 116, 97, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "token_metadata_program" + }, + { + "kind": "account", + "path": "nft_collection_mint" + } + ], + "program": { + "kind": "account", + "path": "token_metadata_program" + } + } + }, + { + "name": "nft_collection_mint", + "docs": ["Create account: the mint account for the NFT collection."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [110, 102, 116, 95, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 95, 109, 105, 110, 116] + } + ] + } + }, + { + "name": "nft_collection_ata", + "docs": ["Create account: the ATA for the NFT collection owned by treasury."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "treasury" + }, + { + "kind": "account", + "path": "nft_token_program" + }, + { + "kind": "account", + "path": "nft_collection_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "associated_token_program", + "docs": ["Program account: the Associated Token program."], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "nft_token_program", + "docs": ["Program account: the Token program of the collection NFT."] + }, + { + "name": "token_metadata_program", + "docs": ["Program account: the Token Metadata program."], + "address": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" + }, + { + "name": "rent", + "docs": ["Sysvar account: Rent."], + "address": "SysvarRent111111111111111111111111111111111" + }, + { + "name": "system_program", + "docs": ["Program account: the System program."], + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "fee_collector", + "type": "pubkey" + }, + { + "name": "chainlink_program", + "type": "pubkey" + }, + { + "name": "chainlink_sol_usd_feed", + "type": "pubkey" + } + ] + }, + { + "name": "refundable_amount_of", + "docs": [ + "Calculates the amount that the sender would be refunded if the stream were canceled, denoted in units of the", + "token's decimals.", + "", + "# Accounts Expected", + "", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "", + "# Requirements", + "", + "- The stream does not exist." + ], + "discriminator": [160, 136, 114, 120, 234, 178, 146, 58], + "accounts": [ + { + "name": "stream_data", + "docs": ["Read account: the account storing stream details."], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "stream_nft_mint" + } + ] + } + }, + { + "name": "stream_nft_mint", + "docs": ["Read account: the mint account for the stream NFT."] + } + ], + "args": [], + "returns": "u64" + }, + { + "name": "renounce", + "docs": [ + "Removes the right of the stream's sender to cancel the stream.", + "", + "# Accounts Expected", + "", + "- `sender` The transaction signer and the stream's sender.", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "", + "# Notes", + "", + "- Emits a [`crate::utils::events::RenounceLockupStream`] event." + ], + "discriminator": [241, 157, 138, 210, 8, 235, 187, 123], + "accounts": [ + { + "name": "sender", + "docs": ["Write account: the sender of the stream."], + "signer": true + }, + { + "name": "stream_data", + "docs": ["Write account: the stream data account storing stream details."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "stream_nft_mint" + } + ] + } + }, + { + "name": "stream_nft_mint", + "docs": ["Read account: the mint account for the stream NFT."] + } + ], + "args": [] + }, + { + "name": "status_of", + "docs": [ + "Retrieves the stream's status.", + "", + "# Accounts Expected", + "", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "", + "# Requirements", + "", + "- The stream does not exist." + ], + "discriminator": [90, 214, 253, 237, 126, 236, 132, 237], + "accounts": [ + { + "name": "stream_data", + "docs": ["Read account: the account storing stream details."], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "stream_nft_mint" + } + ] + } + }, + { + "name": "stream_nft_mint", + "docs": ["Read account: the mint account for the stream NFT."] + } + ], + "args": [], + "returns": { + "defined": { + "name": "StreamStatus" + } + } + }, + { + "name": "stream_exists", + "docs": [ + "Returns a flag indicating whether a stream based on the `_sender` and the `_salt` already exists.", + "", + "# Parameters", + "", + "- `_sender` The sender of the stream.", + "- `_salt` The unique salt used to derive the stream NFT mint address." + ], + "discriminator": [104, 209, 104, 97, 122, 35, 165, 195], + "accounts": [ + { + "name": "stream_nft_mint", + "docs": ["Read account: the mint account for the stream NFT."], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116] + }, + { + "kind": "arg", + "path": "_sender" + }, + { + "kind": "arg", + "path": "_salt" + } + ] + } + } + ], + "args": [ + { + "name": "_sender", + "type": "pubkey" + }, + { + "name": "_salt", + "type": "u128" + } + ], + "returns": "bool" + }, + { + "name": "streamed_amount_of", + "docs": [ + "Calculates the amount streamed to the recipient, denoted in units of the token's decimals.", + "", + "# Accounts Expected", + "", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "", + "# Notes", + "", + "- Upon cancellation of the stream, the amount streamed is calculated as the difference between the deposited", + "amount and the refunded amount. Ultimately, when the stream becomes depleted, the streamed amount is equivalent", + "to the total amount withdrawn.", + "", + "# Requirements", + "", + "- The stream does not exist." + ], + "discriminator": [91, 69, 219, 48, 189, 26, 13, 33], + "accounts": [ + { + "name": "stream_data", + "docs": ["Read account: the account storing stream details."], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "stream_nft_mint" + } + ] + } + }, + { + "name": "stream_nft_mint", + "docs": ["Read account: the mint account for the stream NFT."] + } + ], + "args": [], + "returns": "u64" + }, + { + "name": "treasury_view", + "docs": ["Returns the treasury details."], + "discriminator": [247, 160, 213, 237, 247, 121, 164, 82], + "accounts": [ + { + "name": "treasury", + "docs": ["Read account: the account storing the treasury details."], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [116, 114, 101, 97, 115, 117, 114, 121] + } + ] + } + } + ], + "args": [], + "returns": { + "defined": { + "name": "Treasury" + } + } + }, + { + "name": "withdraw", + "docs": [ + "Withdraws the provided amount of tokens from the stream data ATA to the provided account.", + "", + "# Accounts Expected", + "", + "- `signer` The transaction signer.", + "- `deposited_token_mint` The mint of the deposited token.", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "- `withdrawal_recipient` The address of the recipient receiving the withdrawn tokens.", + "- `deposited_token_program` The Token Program of the deposited token.", + "- `nft_token_program` The Token Program of the NFT.", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + "", + "# Parameters", + "", + "- `amount` The amount to withdraw, denoted in units of the token's decimals.", + "", + "# Notes", + "", + "- If the withdrawal recipient does not have an ATA for the deposited token, one is created.", + "- The instruction charges a fee in the native token (SOL), equivalent to $1 USD.", + "- Emits [`crate::utils::events::WithdrawFromLockupStream`] event.", + "", + "# Requirements", + "", + "- `stream_nft_mint` must exist.", + "- `withdrawal_recipient` must be the recipient if the signer is not the stream's recipient.", + "- `amount` must be greater than zero and must not exceed the withdrawable amount.", + "- The stream must not be Depleted.", + "- `chainlink_program` and `chainlink_sol_usd_feed` must match the ones stored in the treasury." + ], + "discriminator": [183, 18, 70, 156, 148, 109, 161, 34], + "accounts": [ + { + "name": "signer", + "docs": ["Write account: the signer of the withdrawal who pays the withdrawal fee."], + "writable": true, + "signer": true + }, + { + "name": "stream_recipient", + "docs": ["Read account: the recipient of the stream who owns the stream NFT."] + }, + { + "name": "withdrawal_recipient", + "docs": ["Read account: the account that will receive the withdrawn tokens.", "recipient."] + }, + { + "name": "withdrawal_recipient_ata", + "docs": ["Create if needed account: the ATA for deposited tokens owned by withdrawal recipient."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "withdrawal_recipient" + }, + { + "kind": "account", + "path": "deposited_token_program" + }, + { + "kind": "account", + "path": "deposited_token_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "treasury", + "docs": ["Write account: the treasury account that receives the withdrawal fee."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [116, 114, 101, 97, 115, 117, 114, 121] + } + ] + } + }, + { + "name": "deposited_token_mint", + "docs": ["Read account: the mint account for the deposited token."] + }, + { + "name": "recipient_stream_nft_ata", + "docs": ["Read account: the ATA for the stream NFT owned by recipient.", ""], + "pda": { + "seeds": [ + { + "kind": "account", + "path": "stream_recipient" + }, + { + "kind": "account", + "path": "nft_token_program" + }, + { + "kind": "account", + "path": "stream_nft_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "stream_data", + "docs": ["Write account: the account storing the stream data."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "stream_nft_mint" + } + ] + } + }, + { + "name": "stream_data_ata", + "docs": ["Write account: the ATA for deposited tokens owned by stream data."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "stream_data" + }, + { + "kind": "account", + "path": "deposited_token_program" + }, + { + "kind": "account", + "path": "deposited_token_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "stream_nft_mint", + "docs": ["Read account: the mint account for the stream NFT."] + }, + { + "name": "associated_token_program", + "docs": ["Program account: the Associated Token program."], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "chainlink_program", + "docs": ["Read account: The Chainlink program used to retrieve on-chain price feeds."] + }, + { + "name": "chainlink_sol_usd_feed", + "docs": ["Read account: The account providing the SOL/USD price feed data."] + }, + { + "name": "deposited_token_program", + "docs": ["Program account: the Token program of the deposited token."] + }, + { + "name": "nft_token_program", + "docs": ["Program account: the Token program of the stream NFT."] + }, + { + "name": "system_program", + "docs": ["Program account: the System program."], + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "withdraw_max", + "docs": [ + "Withdraws the maximum withdrawable amount from the stream data ATA to the provided account.", + "", + "# Accounts Expected", + "", + "Refer to the accounts in [`fn@crate::sablier_lockup::withdraw`].", + "", + "# Notes", + "", + "Refer to the notes in [`fn@crate::sablier_lockup::withdraw`].", + "", + "# Requirements", + "", + "Refer to the requirements in [`fn@crate::sablier_lockup::withdraw`]." + ], + "discriminator": [32, 71, 46, 98, 105, 76, 85, 96], + "accounts": [ + { + "name": "signer", + "docs": ["Write account: the signer of the withdrawal who pays the withdrawal fee."], + "writable": true, + "signer": true + }, + { + "name": "stream_recipient", + "docs": ["Read account: the recipient of the stream who owns the stream NFT."] + }, + { + "name": "withdrawal_recipient", + "docs": ["Read account: the account that will receive the withdrawn tokens.", "recipient."] + }, + { + "name": "withdrawal_recipient_ata", + "docs": ["Create if needed account: the ATA for deposited tokens owned by withdrawal recipient."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "withdrawal_recipient" + }, + { + "kind": "account", + "path": "deposited_token_program" + }, + { + "kind": "account", + "path": "deposited_token_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "treasury", + "docs": ["Write account: the treasury account that receives the withdrawal fee."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [116, 114, 101, 97, 115, 117, 114, 121] + } + ] + } + }, + { + "name": "deposited_token_mint", + "docs": ["Read account: the mint account for the deposited token."] + }, + { + "name": "recipient_stream_nft_ata", + "docs": ["Read account: the ATA for the stream NFT owned by recipient.", ""], + "pda": { + "seeds": [ + { + "kind": "account", + "path": "stream_recipient" + }, + { + "kind": "account", + "path": "nft_token_program" + }, + { + "kind": "account", + "path": "stream_nft_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "stream_data", + "docs": ["Write account: the account storing the stream data."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "stream_nft_mint" + } + ] + } + }, + { + "name": "stream_data_ata", + "docs": ["Write account: the ATA for deposited tokens owned by stream data."], + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "stream_data" + }, + { + "kind": "account", + "path": "deposited_token_program" + }, + { + "kind": "account", + "path": "deposited_token_mint" + } + ], + "program": { + "kind": "const", + "value": [ + 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, + 132, 4, 142, 123, 216, 219, 233, 248, 89 + ] + } + } + }, + { + "name": "stream_nft_mint", + "docs": ["Read account: the mint account for the stream NFT."] + }, + { + "name": "associated_token_program", + "docs": ["Program account: the Associated Token program."], + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "chainlink_program", + "docs": ["Read account: The Chainlink program used to retrieve on-chain price feeds."] + }, + { + "name": "chainlink_sol_usd_feed", + "docs": ["Read account: The account providing the SOL/USD price feed data."] + }, + { + "name": "deposited_token_program", + "docs": ["Program account: the Token program of the deposited token."] + }, + { + "name": "nft_token_program", + "docs": ["Program account: the Token program of the stream NFT."] + }, + { + "name": "system_program", + "docs": ["Program account: the System program."], + "address": "11111111111111111111111111111111" + } + ], + "args": [] + }, + { + "name": "withdrawable_amount_of", + "docs": [ + "Calculates the amount that the recipient can withdraw from the stream, denoted in units of the token's", + "decimals.", + "", + "# Accounts Expected", + "", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "", + "# Requirements", + "", + "- The stream does not exist." + ], + "discriminator": [30, 195, 140, 141, 173, 123, 253, 60], + "accounts": [ + { + "name": "stream_data", + "docs": ["Read account: the account storing stream details."], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] + }, + { + "kind": "account", + "path": "stream_nft_mint" + } + ] + } + }, + { + "name": "stream_nft_mint", + "docs": ["Read account: the mint account for the stream NFT."] + } + ], + "args": [], + "returns": "u64" + }, + { + "name": "withdrawal_fee_in_lamports", + "docs": [ + "Calculates the withdrawal fee in lamports, which is equivalent to $1 USD.", + "", + "# Accounts Expected:", + "", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data." + ], + "discriminator": [55, 255, 88, 224, 223, 23, 97, 140], + "accounts": [ + { + "name": "treasury", + "docs": ["Read account: the treasury account that receives the withdrawal fee."], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [116, 114, 101, 97, 115, 117, 114, 121] + } + ] + } + }, + { + "name": "chainlink_program", + "docs": ["Read account: The Chainlink program used to retrieve on-chain price feeds."] + }, + { + "name": "chainlink_sol_usd_feed", + "docs": ["Read account: The account providing the SOL/USD price feed data."] + } + ], + "args": [], + "returns": "u64" + } + ], + "accounts": [ + { + "name": "NftCollectionData", + "discriminator": [159, 26, 37, 150, 44, 84, 171, 172] + }, + { + "name": "StreamData", + "discriminator": [61, 89, 148, 141, 154, 81, 86, 113] + }, + { + "name": "Treasury", + "discriminator": [238, 239, 123, 238, 89, 1, 168, 253] + } + ], + "events": [ + { + "name": "CancelLockupStream", + "discriminator": [82, 106, 117, 112, 153, 245, 190, 66] + }, + { + "name": "CreateLockupLinearStream", + "discriminator": [234, 181, 19, 52, 67, 64, 151, 173] + }, + { + "name": "FeesCollected", + "discriminator": [233, 23, 117, 225, 107, 178, 254, 8] + }, + { + "name": "RenounceLockupStream", + "discriminator": [28, 66, 144, 150, 118, 56, 81, 93] + }, + { + "name": "WithdrawFromLockupStream", + "discriminator": [232, 101, 27, 150, 85, 222, 243, 9] + } + ], + "errors": [ + { + "code": 6000, + "name": "StreamDepleted", + "msg": "Can't perform the action on a depleted stream!" + }, + { + "code": 6001, + "name": "StreamCanceled", + "msg": "Can't renounce an already-renounced Stream!" + }, + { + "code": 6002, + "name": "StreamIsNotCancelable", + "msg": "Can't cancel a non-cancelable Stream!" + }, + { + "code": 6003, + "name": "StreamSettled", + "msg": "Can't cancel a settled Stream!" + }, + { + "code": 6004, + "name": "CantCollectZeroFees", + "msg": "Can't collect zero fees!" + }, + { + "code": 6005, + "name": "CliffTimeNotLessThanEndTime", + "msg": "Invalid cliff time of the Stream!" + }, + { + "code": 6006, + "name": "CliffTimeZeroUnlockAmountNotZero", + "msg": "Cliff time zero but unlock amount not zero!" + }, + { + "code": 6007, + "name": "DepositAmountZero", + "msg": "Invalid deposit amount!" + }, + { + "code": 6008, + "name": "StartTimeNotLessThanCliffTime", + "msg": "Start time must be less than cliff time!" + }, + { + "code": 6009, + "name": "StartTimeNotLessThanEndTime", + "msg": "Start time must be less than end time!" + }, + { + "code": 6010, + "name": "StartTimeZero", + "msg": "Start time can't be zero!" + }, + { + "code": 6011, + "name": "UnlockAmountsSumTooHigh", + "msg": "Unlock amounts sum is greater than deposit amount!" + }, + { + "code": 6012, + "name": "StreamAlreadyNonCancelable", + "msg": "Can't renounce a non-cancelable Stream!" + }, + { + "code": 6013, + "name": "Overdraw", + "msg": "Attempting to withdraw more than available in the stream!" + }, + { + "code": 6014, + "name": "WithdrawAmountZero", + "msg": "Can't withdraw a zero amount!" + } + ], + "types": [ + { + "name": "Amounts", + "type": { + "kind": "struct", + "fields": [ + { + "name": "start_unlock", + "type": "u64" + }, + { + "name": "cliff_unlock", + "type": "u64" + }, + { + "name": "deposited", + "type": "u64" + }, + { + "name": "refunded", + "type": "u64" + }, + { + "name": "withdrawn", + "type": "u64" + } + ] + } + }, + { + "name": "CancelLockupStream", + "type": { + "kind": "struct", + "fields": [ + { + "name": "deposited_token_mint", + "type": "pubkey" + }, + { + "name": "recipient_amount", + "type": "u64" + }, + { + "name": "sender_amount", + "type": "u64" + }, + { + "name": "stream_data", + "type": "pubkey" + }, + { + "name": "stream_nft_mint", + "type": "pubkey" + } + ] + } + }, + { + "name": "CreateLockupLinearStream", + "type": { + "kind": "struct", + "fields": [ + { + "name": "deposit_token_decimals", + "type": "u8" + }, + { + "name": "deposit_token_mint", + "type": "pubkey" + }, + { + "name": "recipient", + "type": "pubkey" + }, + { + "name": "salt", + "type": "u128" + }, + { + "name": "stream_data", + "type": "pubkey" + }, + { + "name": "stream_nft_mint", + "type": "pubkey" + } + ] + } + }, + { + "name": "FeesCollected", + "type": { + "kind": "struct", + "fields": [ + { + "name": "fee_amount", + "type": "u64" + }, + { + "name": "fee_collector", + "type": "pubkey" + }, + { + "name": "fee_recipient", + "type": "pubkey" + } + ] + } + }, + { + "name": "NftCollectionData", + "type": { + "kind": "struct", + "fields": [ + { + "name": "total_supply", + "type": "u64" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "RenounceLockupStream", + "type": { + "kind": "struct", + "fields": [ + { + "name": "deposited_token_mint", + "type": "pubkey" + }, + { + "name": "stream_data", + "type": "pubkey" + }, + { + "name": "stream_nft_mint", + "type": "pubkey" + } + ] + } + }, + { + "name": "StreamData", + "type": { + "kind": "struct", + "fields": [ + { + "name": "amounts", + "type": { + "defined": { + "name": "Amounts" + } + } + }, + { + "name": "deposited_token_mint", + "type": "pubkey" + }, + { + "name": "bump", + "type": "u8" + }, + { + "name": "salt", + "type": "u128" + }, + { + "name": "is_cancelable", + "type": "bool" + }, + { + "name": "is_depleted", + "type": "bool" + }, + { + "name": "timestamps", + "type": { + "defined": { + "name": "Timestamps" + } + } + }, + { + "name": "sender", + "type": "pubkey" + }, + { + "name": "was_canceled", + "type": "bool" + } + ] + } + }, + { + "name": "StreamStatus", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Pending" + }, + { + "name": "Streaming" + }, + { + "name": "Settled" + }, + { + "name": "Canceled" + }, + { + "name": "Depleted" + } + ] + } + }, + { + "name": "Timestamps", + "docs": ["Groups the timestamps for a Lockup stream."], + "type": { + "kind": "struct", + "fields": [ + { + "name": "cliff", + "type": "u64" + }, + { + "name": "end", + "type": "u64" + }, + { + "name": "start", + "type": "u64" + } + ] + } + }, + { + "name": "Treasury", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "type": "u8" + }, + { + "name": "fee_collector", + "type": "pubkey" + }, + { + "name": "chainlink_program", + "type": "pubkey" + }, + { + "name": "chainlink_sol_usd_feed", + "type": "pubkey" + } + ] + } + }, + { + "name": "WithdrawFromLockupStream", + "type": { + "kind": "struct", + "fields": [ + { + "name": "deposited_token_mint", + "type": "pubkey" + }, + { + "name": "fee_in_lamports", + "type": "u64" + }, + { + "name": "stream_data", + "type": "pubkey" + }, + { + "name": "stream_nft_mint", + "type": "pubkey" + }, + { + "name": "withdrawn_amount", + "type": "u64" + } + ] + } + } + ] +} diff --git a/src/solana/idl/lockup/v1.0/SablierLockupLinear.ts b/src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.ts similarity index 88% rename from src/solana/idl/lockup/v1.0/SablierLockupLinear.ts rename to src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.ts index 8f9ba57..6b93ace 100644 --- a/src/solana/idl/lockup/v1.0/SablierLockupLinear.ts +++ b/src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.ts @@ -1,48 +1,52 @@ -export const sablierLockupLinearIDL = { - accounts: [ - { discriminator: [159, 26, 37, 150, 44, 84, 171, 172], name: "NftCollectionData" }, - { discriminator: [61, 89, 148, 141, 154, 81, 86, 113], name: "StreamData" }, - { discriminator: [238, 239, 123, 238, 89, 1, 168, 253], name: "Treasury" }, - ], +export const idl = { address: "4EauRKrNErKfsR4XetEZJNmvACGHbHnHV4R5dvJuqupC", + metadata: { name: "sablier_lockup", version: "0.1.0", spec: "0.1.0", description: "Created with Anchor" }, docs: ["Sablier Lockup program for creating and managing token streams."], - errors: [ - { code: 6000, msg: "Can't perform the action on a depleted stream!", name: "StreamDepleted" }, - { code: 6001, msg: "Can't renounce an already-renounced Stream!", name: "StreamCanceled" }, - { code: 6002, msg: "Can't cancel a non-cancelable Stream!", name: "StreamIsNotCancelable" }, - { code: 6003, msg: "Can't cancel a settled Stream!", name: "StreamSettled" }, - { code: 6004, msg: "Can't collect zero fees!", name: "CantCollectZeroFees" }, - { code: 6005, msg: "Invalid cliff time of the Stream!", name: "CliffTimeNotLessThanEndTime" }, - { code: 6006, msg: "Cliff time zero but unlock amount not zero!", name: "CliffTimeZeroUnlockAmountNotZero" }, - { code: 6007, msg: "Invalid deposit amount!", name: "DepositAmountZero" }, - { code: 6008, msg: "Start time must be less than cliff time!", name: "StartTimeNotLessThanCliffTime" }, - { code: 6009, msg: "Start time must be less than end time!", name: "StartTimeNotLessThanEndTime" }, - { code: 6010, msg: "Start time can't be zero!", name: "StartTimeZero" }, - { code: 6011, msg: "Unlock amounts sum is greater than deposit amount!", name: "UnlockAmountsSumTooHigh" }, - { code: 6012, msg: "Can't renounce a non-cancelable Stream!", name: "StreamAlreadyNonCancelable" }, - { code: 6013, msg: "Attempting to withdraw more than available in the stream!", name: "Overdraw" }, - { code: 6014, msg: "Can't withdraw a zero amount!", name: "WithdrawAmountZero" }, - ], - events: [ - { discriminator: [82, 106, 117, 112, 153, 245, 190, 66], name: "CancelLockupStream" }, - { discriminator: [234, 181, 19, 52, 67, 64, 151, 173], name: "CreateLockupLinearStream" }, - { discriminator: [233, 23, 117, 225, 107, 178, 254, 8], name: "FeesCollected" }, - { discriminator: [28, 66, 144, 150, 118, 56, 81, 93], name: "RenounceLockupStream" }, - { discriminator: [232, 101, 27, 150, 85, 222, 243, 9], name: "WithdrawFromLockupStream" }, - ], instructions: [ { + name: "cancel", + docs: [ + "Cancels the stream and refunds any remaining tokens to the sender ATA.", + "", + "# Accounts Expected", + "", + "- `sender` The transaction signer and the stream's sender.", + "- `deposited_token_mint` The mint of the deposited token.", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "- `deposited_token_program` The Token Program of the deposited token.", + "", + "# Notes", + "", + "- If there are any tokens left for the recipient to withdraw, the stream is marked as canceled. Otherwise, the", + "stream is marked as depleted.", + "- If the sender does not have an ATA for the deposited token, it is created.", + "- Emits a [`crate::utils::events::CancelLockupStream`] event.", + "", + "# Requirements", + "", + "- The signer must be the stream's sender.", + "- The `stream_nft_mint` must exist.", + "- The stream must be cancelable.", + "- The stream must be Pending or Streaming.", + ], + discriminator: [232, 219, 223, 41, 219, 236, 220, 190], accounts: [ { - docs: ["Write account: the sender of the stream who can cancel it."], name: "sender", - signer: true, + docs: ["Write account: the sender of the stream who can cancel it."], writable: true, + signer: true, }, { - docs: ["Create if needed account: the deposited token ATA owned by the sender."], name: "sender_ata", + docs: ["Create if needed account: the deposited token ATA owned by the sender."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "sender" }, + { kind: "account", path: "deposited_token_program" }, + { kind: "account", path: "deposited_token_mint" }, + ], program: { kind: "const", value: [ @@ -50,30 +54,30 @@ export const sablierLockupLinearIDL = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "sender" }, - { kind: "account", path: "deposited_token_program" }, - { kind: "account", path: "deposited_token_mint" }, - ], }, - writable: true, }, - { docs: ["Read account: the mint account of the deposited token."], name: "deposited_token_mint" }, + { name: "deposited_token_mint", docs: ["Read account: the mint account of the deposited token."] }, { - docs: ["Write account: the stream data account storing stream details."], name: "stream_data", + docs: ["Write account: the stream data account storing stream details."], + writable: true, pda: { seeds: [ { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, { kind: "account", path: "stream_nft_mint" }, ], }, - writable: true, }, { - docs: ["Write account: the deposited token ATA owned by the stream data account."], name: "stream_data_ata", + docs: ["Write account: the deposited token ATA owned by the stream data account."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "stream_data" }, + { kind: "account", path: "deposited_token_program" }, + { kind: "account", path: "deposited_token_mint" }, + ], program: { kind: "const", value: [ @@ -81,107 +85,103 @@ export const sablierLockupLinearIDL = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "stream_data" }, - { kind: "account", path: "deposited_token_program" }, - { kind: "account", path: "deposited_token_mint" }, - ], }, - writable: true, }, - { docs: ["Read account: the mint account for the stream NFT."], name: "stream_nft_mint" }, + { name: "stream_nft_mint", docs: ["Read account: the mint account for the stream NFT."] }, { - address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", - docs: ["Program account: the Associated Token program."], name: "associated_token_program", + docs: ["Program account: the Associated Token program."], + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", }, - { docs: ["Program account: the Token program of the deposited token."], name: "deposited_token_program" }, + { name: "deposited_token_program", docs: ["Program account: the Token program of the deposited token."] }, { - address: "11111111111111111111111111111111", - docs: ["Program account: the System program."], name: "system_program", + docs: ["Program account: the System program."], + address: "11111111111111111111111111111111", }, ], args: [], - discriminator: [232, 219, 223, 41, 219, 236, 220, 190], + }, + { + name: "collect_fees", docs: [ - "Cancels the stream and refunds any remaining tokens to the sender ATA.", + "Collects the fees accumulated in the treasury by transferring them to the fee recipient.", "", "# Accounts Expected", "", - "- `sender` The transaction signer and the stream's sender.", - "- `deposited_token_mint` The mint of the deposited token.", - "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", - "- `deposited_token_program` The Token Program of the deposited token.", + "- `fee_collector` The transaction signer and the fee collector.", + "- `fee_recipient` The address receiving the collected fees.", "", "# Notes", "", - "- If there are any tokens left for the recipient to withdraw, the stream is marked as canceled. Otherwise, the", - "stream is marked as depleted.", - "- If the sender does not have an ATA for the deposited token, it is created.", - "- Emits a [`crate::utils::events::CancelLockupStream`] event.", + "- Leaves a buffer of 0.001 SOL to ensure the account remains rent-exempt after the fee collection.", + "- Emits a [`crate::utils::events::FeesCollected`] event.", "", "# Requirements", "", - "- The signer must be the stream's sender.", - "- The `stream_nft_mint` must exist.", - "- The stream must be cancelable.", - "- The stream must be Pending or Streaming.", + "- `fee_collector` must be authorized for fee collection.", ], - name: "cancel", - }, - { + discriminator: [164, 152, 207, 99, 30, 186, 19, 182], accounts: [ { - docs: ["Write account: the account authorized to collect fees from the treasury."], name: "fee_collector", + docs: ["Write account: the account authorized to collect fees from the treasury."], signer: true, }, { - docs: ["Write account: the address that will receive the collected fees."], name: "fee_recipient", + docs: ["Write account: the address that will receive the collected fees."], writable: true, }, { - docs: ["Write account: the treasury account that holds the fees."], name: "treasury", - pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, + docs: ["Write account: the treasury account that holds the fees."], writable: true, + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, }, ], args: [], - discriminator: [164, 152, 207, 99, 30, 186, 19, 182], + }, + { + name: "create_with_durations_ll", docs: [ - "Collects the fees accumulated in the treasury by transferring them to the fee recipient.", + "Creates a stream by setting the start time to the current timestamp, and the end time to the sum of the", + "current timestamp and the total duration The stream is funded by the signer and wrapped in a Metaplex NFT.", "", "# Accounts Expected", "", - "- `fee_collector` The transaction signer and the fee collector.", - "- `fee_recipient` The address receiving the collected fees.", + "Refer to the accounts in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", + "", + "# Parameters", + "", + "Refer to the parameters in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", "", "# Notes", "", - "- Leaves a buffer of 0.001 SOL to ensure the account remains rent-exempt after the fee collection.", - "- Emits a [`crate::utils::events::FeesCollected`] event.", + "Refer to the notes in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", "", "# Requirements", "", - "- `fee_collector` must be authorized for fee collection.", + "Refer to the requirements in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", ], - name: "collect_fees", - }, - { + discriminator: [87, 17, 170, 167, 156, 152, 169, 61], accounts: [ { - docs: ["Write account: the creator and funder of the stream."], name: "creator", - signer: true, + docs: ["Write account: the creator and funder of the stream."], writable: true, + signer: true, }, { - docs: ["Write account: the creator's ATA for the deposit token."], name: "creator_ata", + docs: ["Write account: the creator's ATA for the deposit token."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "creator" }, + { kind: "account", path: "deposit_token_program" }, + { kind: "account", path: "deposit_token_mint" }, + ], program: { kind: "const", value: [ @@ -189,19 +189,14 @@ export const sablierLockupLinearIDL = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "creator" }, - { kind: "account", path: "deposit_token_program" }, - { kind: "account", path: "deposit_token_mint" }, - ], }, - writable: true, }, - { docs: ["Read account: the recipient of the stream."], name: "recipient" }, - { docs: ["Read account: the sender of the stream."], name: "sender" }, + { name: "recipient", docs: ["Read account: the recipient of the stream."] }, + { name: "sender", docs: ["Read account: the sender of the stream."] }, { - docs: ["Write account: the NFT collection data storing the total supply."], name: "nft_collection_data", + docs: ["Write account: the NFT collection data storing the total supply."], + writable: true, pda: { seeds: [ { @@ -210,37 +205,36 @@ export const sablierLockupLinearIDL = { }, ], }, - writable: true, }, { - docs: ["Write account: the master edition account for the NFT collection."], name: "nft_collection_master_edition", + docs: ["Write account: the master edition account for the NFT collection."], pda: { - program: { kind: "account", path: "token_metadata_program" }, seeds: [ { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, { kind: "account", path: "token_metadata_program" }, { kind: "account", path: "nft_collection_mint" }, { kind: "const", value: [101, 100, 105, 116, 105, 111, 110] }, ], + program: { kind: "account", path: "token_metadata_program" }, }, }, { - docs: ["Write account: the metadata account for the NFT collection."], name: "nft_collection_metadata", + docs: ["Write account: the metadata account for the NFT collection."], + writable: true, pda: { - program: { kind: "account", path: "token_metadata_program" }, seeds: [ { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, { kind: "account", path: "token_metadata_program" }, { kind: "account", path: "nft_collection_mint" }, ], + program: { kind: "account", path: "token_metadata_program" }, }, - writable: true, }, { - docs: ["Read account: the mint account for the NFT collection."], name: "nft_collection_mint", + docs: ["Read account: the mint account for the NFT collection."], pda: { seeds: [ { @@ -250,10 +244,11 @@ export const sablierLockupLinearIDL = { ], }, }, - { docs: ["Read account: the mint account for the deposit token."], name: "deposit_token_mint" }, + { name: "deposit_token_mint", docs: ["Read account: the mint account for the deposit token."] }, { - docs: ["Create account: the mint account for the stream NFT."], name: "stream_nft_mint", + docs: ["Create account: the mint account for the stream NFT."], + writable: true, pda: { seeds: [ { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116] }, @@ -261,12 +256,17 @@ export const sablierLockupLinearIDL = { { kind: "arg", path: "salt" }, ], }, - writable: true, }, { - docs: ["Create account: the ATA for the stream NFT owned by the recipient."], name: "recipient_stream_nft_ata", + docs: ["Create account: the ATA for the stream NFT owned by the recipient."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "recipient" }, + { kind: "account", path: "nft_token_program" }, + { kind: "account", path: "stream_nft_mint" }, + ], program: { kind: "const", value: [ @@ -274,29 +274,29 @@ export const sablierLockupLinearIDL = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "recipient" }, - { kind: "account", path: "nft_token_program" }, - { kind: "account", path: "stream_nft_mint" }, - ], }, - writable: true, }, { - docs: ["Create account: the account that will store the stream data."], name: "stream_data", + docs: ["Create account: the account that will store the stream data."], + writable: true, pda: { seeds: [ { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, { kind: "account", path: "stream_nft_mint" }, ], }, - writable: true, }, { - docs: ["Create account: the ATA for deposit tokens owned by stream data account."], name: "stream_data_ata", + docs: ["Create account: the ATA for deposit tokens owned by stream data account."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "stream_data" }, + { kind: "account", path: "deposit_token_program" }, + { kind: "account", path: "deposit_token_mint" }, + ], program: { kind: "const", value: [ @@ -304,59 +304,53 @@ export const sablierLockupLinearIDL = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "stream_data" }, - { kind: "account", path: "deposit_token_program" }, - { kind: "account", path: "deposit_token_mint" }, - ], }, - writable: true, }, { - docs: ["Create account: the master edition account for the stream NFT."], name: "stream_nft_master_edition", + docs: ["Create account: the master edition account for the stream NFT."], + writable: true, pda: { - program: { kind: "account", path: "token_metadata_program" }, seeds: [ { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, { kind: "account", path: "token_metadata_program" }, { kind: "account", path: "stream_nft_mint" }, { kind: "const", value: [101, 100, 105, 116, 105, 111, 110] }, ], + program: { kind: "account", path: "token_metadata_program" }, }, - writable: true, }, { - docs: ["Create account: the metadata account for the stream NFT."], name: "stream_nft_metadata", + docs: ["Create account: the metadata account for the stream NFT."], + writable: true, pda: { - program: { kind: "account", path: "token_metadata_program" }, seeds: [ { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, { kind: "account", path: "token_metadata_program" }, { kind: "account", path: "stream_nft_mint" }, ], + program: { kind: "account", path: "token_metadata_program" }, }, - writable: true, }, { - address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", - docs: ["Program account: the Associated Token program."], name: "associated_token_program", + docs: ["Program account: the Associated Token program."], + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", }, - { docs: ["Program account: the Token program of the deposit token."], name: "deposit_token_program" }, - { docs: ["Program account: the Token program of the stream NFT."], name: "nft_token_program" }, + { name: "deposit_token_program", docs: ["Program account: the Token program of the deposit token."] }, + { name: "nft_token_program", docs: ["Program account: the Token program of the stream NFT."] }, { - address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", - docs: ["Program account: the Token Metadata program."], name: "token_metadata_program", + docs: ["Program account: the Token Metadata program."], + address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", }, { - address: "11111111111111111111111111111111", - docs: ["Program account: the System program."], name: "system_program", + docs: ["Program account: the System program."], + address: "11111111111111111111111111111111", }, - { address: "SysvarRent111111111111111111111111111111111", docs: ["Sysvar account: Rent."], name: "rent" }, + { name: "rent", docs: ["Sysvar account: Rent."], address: "SysvarRent111111111111111111111111111111111" }, ], args: [ { name: "salt", type: "u128" }, @@ -367,41 +361,68 @@ export const sablierLockupLinearIDL = { { name: "cliff_unlock_amount", type: "u64" }, { name: "is_cancelable", type: "bool" }, ], - discriminator: [87, 17, 170, 167, 156, 152, 169, 61], + }, + { + name: "create_with_timestamps_ll", docs: [ - "Creates a stream by setting the start time to the current timestamp, and the end time to the sum of the", - "current timestamp and the total duration The stream is funded by the signer and wrapped in a Metaplex NFT.", + "Creates a stream with the provided start and end times. The stream is funded by the signer and wrapped in", + "a Metaplex NFT.", "", "# Accounts Expected", "", - "Refer to the accounts in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", + "- `creator` The transaction signer.", + "- `sender` The account that will have authority to cancel or renounce the stream.", + "- `deposit_token_mint` The mint of the tokens to be deposited.", + "- `recipient` The address receiving the tokens, as well as the NFT owner.", + "- `deposit_token_program` The Token Program of the deposit token.", + "- `nft_token_program` The Token Program of the NFT.", "", "# Parameters", "", - "Refer to the parameters in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", + "- `salt` A unique salt used to derive the address of the stream NFT mint.", + "- `deposit_amount` The deposit amount, denoted in units of the token's decimals.", + "- `start_time` The Unix timestamp indicating the stream's start.", + "- `cliff_time` The Unix timestamp indicating the stream's cliff.", + "- `end_time` The Unix timestamp indicating the stream's end.", + "- `start_unlock_amount` The amount to be unlocked at the start time.", + "- `cliff_unlock_amount` The amount to be unlocked at the cliff time.", + "- `is_cancelable` Indicates if the stream is cancelable.", "", "# Notes", "", - "Refer to the notes in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", - "", - "# Requirements", - "", - "Refer to the requirements in [`fn@crate::sablier_lockup::create_with_timestamps_ll`].", + "- The passed sender of the stream doesn't have to be the same as its creator.", + "- A cliff time of zero means there is no cliff.", + "- As long as the times are ordered, it is not an error for the start or the cliff time to be in the past.", + "- The stream recipient is given solely by the ownership of the stream NFT, which is minted to the passed", + "`recipient`.", + "- Emits a [`crate::utils::events::CreateLockupLinearStream`] event.", + "", + "# Requirements", + "", + "- `deposit_amount` must be greater than zero.", + "- `start_time` must be greater than zero and less than `end_time`.", + "- If set, `cliff_time` must be greater than `start_time` and less than `end_time`.", + "- The sum of `start_unlock_amount` and `cliff_unlock_amount` must be less than or equal to deposit amount.", + "- If `cliff_time` is not set, the `cliff_unlock_amount` amount must be zero.", ], - name: "create_with_durations_ll", - }, - { + discriminator: [150, 165, 147, 28, 68, 41, 48, 41], accounts: [ { - docs: ["Write account: the creator and funder of the stream."], name: "creator", - signer: true, + docs: ["Write account: the creator and funder of the stream."], writable: true, + signer: true, }, { - docs: ["Write account: the creator's ATA for the deposit token."], name: "creator_ata", + docs: ["Write account: the creator's ATA for the deposit token."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "creator" }, + { kind: "account", path: "deposit_token_program" }, + { kind: "account", path: "deposit_token_mint" }, + ], program: { kind: "const", value: [ @@ -409,19 +430,14 @@ export const sablierLockupLinearIDL = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "creator" }, - { kind: "account", path: "deposit_token_program" }, - { kind: "account", path: "deposit_token_mint" }, - ], }, - writable: true, }, - { docs: ["Read account: the recipient of the stream."], name: "recipient" }, - { docs: ["Read account: the sender of the stream."], name: "sender" }, + { name: "recipient", docs: ["Read account: the recipient of the stream."] }, + { name: "sender", docs: ["Read account: the sender of the stream."] }, { - docs: ["Write account: the NFT collection data storing the total supply."], name: "nft_collection_data", + docs: ["Write account: the NFT collection data storing the total supply."], + writable: true, pda: { seeds: [ { @@ -430,37 +446,36 @@ export const sablierLockupLinearIDL = { }, ], }, - writable: true, }, { - docs: ["Write account: the master edition account for the NFT collection."], name: "nft_collection_master_edition", + docs: ["Write account: the master edition account for the NFT collection."], pda: { - program: { kind: "account", path: "token_metadata_program" }, seeds: [ { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, { kind: "account", path: "token_metadata_program" }, { kind: "account", path: "nft_collection_mint" }, { kind: "const", value: [101, 100, 105, 116, 105, 111, 110] }, ], + program: { kind: "account", path: "token_metadata_program" }, }, }, { - docs: ["Write account: the metadata account for the NFT collection."], name: "nft_collection_metadata", + docs: ["Write account: the metadata account for the NFT collection."], + writable: true, pda: { - program: { kind: "account", path: "token_metadata_program" }, seeds: [ { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, { kind: "account", path: "token_metadata_program" }, { kind: "account", path: "nft_collection_mint" }, ], + program: { kind: "account", path: "token_metadata_program" }, }, - writable: true, }, { - docs: ["Read account: the mint account for the NFT collection."], name: "nft_collection_mint", + docs: ["Read account: the mint account for the NFT collection."], pda: { seeds: [ { @@ -470,10 +485,11 @@ export const sablierLockupLinearIDL = { ], }, }, - { docs: ["Read account: the mint account for the deposit token."], name: "deposit_token_mint" }, + { name: "deposit_token_mint", docs: ["Read account: the mint account for the deposit token."] }, { - docs: ["Create account: the mint account for the stream NFT."], name: "stream_nft_mint", + docs: ["Create account: the mint account for the stream NFT."], + writable: true, pda: { seeds: [ { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116] }, @@ -481,12 +497,17 @@ export const sablierLockupLinearIDL = { { kind: "arg", path: "salt" }, ], }, - writable: true, }, { - docs: ["Create account: the ATA for the stream NFT owned by the recipient."], name: "recipient_stream_nft_ata", + docs: ["Create account: the ATA for the stream NFT owned by the recipient."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "recipient" }, + { kind: "account", path: "nft_token_program" }, + { kind: "account", path: "stream_nft_mint" }, + ], program: { kind: "const", value: [ @@ -494,29 +515,29 @@ export const sablierLockupLinearIDL = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "recipient" }, - { kind: "account", path: "nft_token_program" }, - { kind: "account", path: "stream_nft_mint" }, - ], }, - writable: true, }, { - docs: ["Create account: the account that will store the stream data."], name: "stream_data", + docs: ["Create account: the account that will store the stream data."], + writable: true, pda: { seeds: [ { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, { kind: "account", path: "stream_nft_mint" }, ], }, - writable: true, }, { - docs: ["Create account: the ATA for deposit tokens owned by stream data account."], name: "stream_data_ata", + docs: ["Create account: the ATA for deposit tokens owned by stream data account."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "stream_data" }, + { kind: "account", path: "deposit_token_program" }, + { kind: "account", path: "deposit_token_mint" }, + ], program: { kind: "const", value: [ @@ -524,59 +545,53 @@ export const sablierLockupLinearIDL = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "stream_data" }, - { kind: "account", path: "deposit_token_program" }, - { kind: "account", path: "deposit_token_mint" }, - ], }, - writable: true, }, { - docs: ["Create account: the master edition account for the stream NFT."], name: "stream_nft_master_edition", + docs: ["Create account: the master edition account for the stream NFT."], + writable: true, pda: { - program: { kind: "account", path: "token_metadata_program" }, seeds: [ { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, { kind: "account", path: "token_metadata_program" }, { kind: "account", path: "stream_nft_mint" }, { kind: "const", value: [101, 100, 105, 116, 105, 111, 110] }, ], + program: { kind: "account", path: "token_metadata_program" }, }, - writable: true, }, { - docs: ["Create account: the metadata account for the stream NFT."], name: "stream_nft_metadata", + docs: ["Create account: the metadata account for the stream NFT."], + writable: true, pda: { - program: { kind: "account", path: "token_metadata_program" }, seeds: [ { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, { kind: "account", path: "token_metadata_program" }, { kind: "account", path: "stream_nft_mint" }, ], + program: { kind: "account", path: "token_metadata_program" }, }, - writable: true, }, { - address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", - docs: ["Program account: the Associated Token program."], name: "associated_token_program", + docs: ["Program account: the Associated Token program."], + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", }, - { docs: ["Program account: the Token program of the deposit token."], name: "deposit_token_program" }, - { docs: ["Program account: the Token program of the stream NFT."], name: "nft_token_program" }, + { name: "deposit_token_program", docs: ["Program account: the Token program of the deposit token."] }, + { name: "nft_token_program", docs: ["Program account: the Token program of the stream NFT."] }, { - address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", - docs: ["Program account: the Token Metadata program."], name: "token_metadata_program", + docs: ["Program account: the Token Metadata program."], + address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", }, { - address: "11111111111111111111111111111111", - docs: ["Program account: the System program."], name: "system_program", + docs: ["Program account: the System program."], + address: "11111111111111111111111111111111", }, - { address: "SysvarRent111111111111111111111111111111111", docs: ["Sysvar account: Rent."], name: "rent" }, + { name: "rent", docs: ["Sysvar account: Rent."], address: "SysvarRent111111111111111111111111111111111" }, ], args: [ { name: "salt", type: "u128" }, @@ -588,62 +603,36 @@ export const sablierLockupLinearIDL = { { name: "cliff_unlock_amount", type: "u64" }, { name: "is_cancelable", type: "bool" }, ], - discriminator: [150, 165, 147, 28, 68, 41, 48, 41], + }, + { + name: "initialize", docs: [ - "Creates a stream with the provided start and end times. The stream is funded by the signer and wrapped in", - "a Metaplex NFT.", + "Initializes the program with the provided fee collector address by creating a Metaplex NFT collection.", "", "# Accounts Expected", "", - "- `creator` The transaction signer.", - "- `sender` The account that will have authority to cancel or renounce the stream.", - "- `deposit_token_mint` The mint of the tokens to be deposited.", - "- `recipient` The address receiving the tokens, as well as the NFT owner.", - "- `deposit_token_program` The Token Program of the deposit token.", - "- `nft_token_program` The Token Program of the NFT.", - "", - "# Parameters", - "", - "- `salt` A unique salt used to derive the address of the stream NFT mint.", - "- `deposit_amount` The deposit amount, denoted in units of the token's decimals.", - "- `start_time` The Unix timestamp indicating the stream's start.", - "- `cliff_time` The Unix timestamp indicating the stream's cliff.", - "- `end_time` The Unix timestamp indicating the stream's end.", - "- `start_unlock_amount` The amount to be unlocked at the start time.", - "- `cliff_unlock_amount` The amount to be unlocked at the cliff time.", - "- `is_cancelable` Indicates if the stream is cancelable.", - "", - "# Notes", - "", - "- The passed sender of the stream doesn't have to be the same as its creator.", - "- A cliff time of zero means there is no cliff.", - "- As long as the times are ordered, it is not an error for the start or the cliff time to be in the past.", - "- The stream recipient is given solely by the ownership of the stream NFT, which is minted to the passed", - "`recipient`.", - "- Emits a [`crate::utils::events::CreateLockupLinearStream`] event.", + "- `initializer` The transaction signer.", + "- `nft_token_program` The Token Program of the NFT collection.", "", - "# Requirements", + "# Parameters:", "", - "- `deposit_amount` must be greater than zero.", - "- `start_time` must be greater than zero and less than `end_time`.", - "- If set, `cliff_time` must be greater than `start_time` and less than `end_time`.", - "- The sum of `start_unlock_amount` and `cliff_unlock_amount` must be less than or equal to deposit amount.", - "- If `cliff_time` is not set, the `cliff_unlock_amount` amount must be zero.", + "- `fee_collector`: The address that will have the authority to collect fees.", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", ], - name: "create_with_timestamps_ll", - }, - { + discriminator: [175, 175, 109, 31, 13, 152, 155, 237], accounts: [ - { docs: ["Write account: the initializer of the program."], name: "initializer", signer: true, writable: true }, + { name: "initializer", docs: ["Write account: the initializer of the program."], writable: true, signer: true }, { - docs: ["Create account: the treasury account that will hold the fees."], name: "treasury", - pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, + docs: ["Create account: the treasury account that will hold the fees."], writable: true, + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, }, { - docs: ["Create account: the NFT collection data account storing collection metadata."], name: "nft_collection_data", + docs: ["Create account: the NFT collection data account storing collection metadata."], + writable: true, pda: { seeds: [ { @@ -652,38 +641,38 @@ export const sablierLockupLinearIDL = { }, ], }, - writable: true, }, { - docs: ["Create account: the master edition account for the NFT collection."], name: "nft_collection_master_edition", + docs: ["Create account: the master edition account for the NFT collection."], + writable: true, pda: { - program: { kind: "account", path: "token_metadata_program" }, seeds: [ { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, { kind: "account", path: "token_metadata_program" }, { kind: "account", path: "nft_collection_mint" }, { kind: "const", value: [101, 100, 105, 116, 105, 111, 110] }, ], + program: { kind: "account", path: "token_metadata_program" }, }, - writable: true, }, { - docs: ["Create account: the metadata account for the NFT collection."], name: "nft_collection_metadata", + docs: ["Create account: the metadata account for the NFT collection."], + writable: true, pda: { - program: { kind: "account", path: "token_metadata_program" }, seeds: [ { kind: "const", value: [109, 101, 116, 97, 100, 97, 116, 97] }, { kind: "account", path: "token_metadata_program" }, { kind: "account", path: "nft_collection_mint" }, ], + program: { kind: "account", path: "token_metadata_program" }, }, - writable: true, }, { - docs: ["Create account: the mint account for the NFT collection."], name: "nft_collection_mint", + docs: ["Create account: the mint account for the NFT collection."], + writable: true, pda: { seeds: [ { @@ -692,12 +681,17 @@ export const sablierLockupLinearIDL = { }, ], }, - writable: true, }, { - docs: ["Create account: the ATA for the NFT collection owned by treasury."], name: "nft_collection_ata", + docs: ["Create account: the ATA for the NFT collection owned by treasury."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "treasury" }, + { kind: "account", path: "nft_token_program" }, + { kind: "account", path: "nft_collection_mint" }, + ], program: { kind: "const", value: [ @@ -705,30 +699,24 @@ export const sablierLockupLinearIDL = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "treasury" }, - { kind: "account", path: "nft_token_program" }, - { kind: "account", path: "nft_collection_mint" }, - ], }, - writable: true, }, { - address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", - docs: ["Program account: the Associated Token program."], name: "associated_token_program", + docs: ["Program account: the Associated Token program."], + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", }, - { docs: ["Program account: the Token program of the collection NFT."], name: "nft_token_program" }, + { name: "nft_token_program", docs: ["Program account: the Token program of the collection NFT."] }, { - address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", - docs: ["Program account: the Token Metadata program."], name: "token_metadata_program", + docs: ["Program account: the Token Metadata program."], + address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", }, - { address: "SysvarRent111111111111111111111111111111111", docs: ["Sysvar account: Rent."], name: "rent" }, + { name: "rent", docs: ["Sysvar account: Rent."], address: "SysvarRent111111111111111111111111111111111" }, { - address: "11111111111111111111111111111111", - docs: ["Program account: the System program."], name: "system_program", + docs: ["Program account: the System program."], + address: "11111111111111111111111111111111", }, ], args: [ @@ -736,39 +724,9 @@ export const sablierLockupLinearIDL = { { name: "chainlink_program", type: "pubkey" }, { name: "chainlink_sol_usd_feed", type: "pubkey" }, ], - discriminator: [175, 175, 109, 31, 13, 152, 155, 237], - docs: [ - "Initializes the program with the provided fee collector address by creating a Metaplex NFT collection.", - "", - "# Accounts Expected", - "", - "- `initializer` The transaction signer.", - "- `nft_token_program` The Token Program of the NFT collection.", - "", - "# Parameters:", - "", - "- `fee_collector`: The address that will have the authority to collect fees.", - "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", - "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", - ], - name: "initialize", }, { - accounts: [ - { - docs: ["Read account: the account storing stream details."], - name: "stream_data", - pda: { - seeds: [ - { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, - { kind: "account", path: "stream_nft_mint" }, - ], - }, - }, - { docs: ["Read account: the mint account for the stream NFT."], name: "stream_nft_mint" }, - ], - args: [], - discriminator: [160, 136, 114, 120, 234, 178, 146, 58], + name: "refundable_amount_of", docs: [ "Calculates the amount that the sender would be refunded if the stream were canceled, denoted in units of the", "token's decimals.", @@ -781,27 +739,25 @@ export const sablierLockupLinearIDL = { "", "- The stream does not exist.", ], - name: "refundable_amount_of", - returns: "u64", - }, - { + discriminator: [160, 136, 114, 120, 234, 178, 146, 58], accounts: [ - { docs: ["Write account: the sender of the stream."], name: "sender", signer: true }, { - docs: ["Write account: the stream data account storing stream details."], name: "stream_data", + docs: ["Read account: the account storing stream details."], pda: { seeds: [ { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, { kind: "account", path: "stream_nft_mint" }, ], }, - writable: true, }, - { docs: ["Read account: the mint account for the stream NFT."], name: "stream_nft_mint" }, + { name: "stream_nft_mint", docs: ["Read account: the mint account for the stream NFT."] }, ], args: [], - discriminator: [241, 157, 138, 210, 8, 235, 187, 123], + returns: "u64", + }, + { + name: "renounce", docs: [ "Removes the right of the stream's sender to cancel the stream.", "", @@ -814,13 +770,13 @@ export const sablierLockupLinearIDL = { "", "- Emits a [`crate::utils::events::RenounceLockupStream`] event.", ], - name: "renounce", - }, - { + discriminator: [241, 157, 138, 210, 8, 235, 187, 123], accounts: [ + { name: "sender", docs: ["Write account: the sender of the stream."], signer: true }, { - docs: ["Read account: the account storing stream details."], name: "stream_data", + docs: ["Write account: the stream data account storing stream details."], + writable: true, pda: { seeds: [ { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, @@ -828,10 +784,12 @@ export const sablierLockupLinearIDL = { ], }, }, - { docs: ["Read account: the mint account for the stream NFT."], name: "stream_nft_mint" }, + { name: "stream_nft_mint", docs: ["Read account: the mint account for the stream NFT."] }, ], args: [], - discriminator: [90, 214, 253, 237, 126, 236, 132, 237], + }, + { + name: "status_of", docs: [ "Retrieves the stream's status.", "", @@ -843,28 +801,25 @@ export const sablierLockupLinearIDL = { "", "- The stream does not exist.", ], - name: "status_of", - returns: { defined: { name: "StreamStatus" } }, - }, - { + discriminator: [90, 214, 253, 237, 126, 236, 132, 237], accounts: [ { - docs: ["Read account: the mint account for the stream NFT."], - name: "stream_nft_mint", + name: "stream_data", + docs: ["Read account: the account storing stream details."], pda: { seeds: [ - { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116] }, - { kind: "arg", path: "_sender" }, - { kind: "arg", path: "_salt" }, + { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account", path: "stream_nft_mint" }, ], }, }, + { name: "stream_nft_mint", docs: ["Read account: the mint account for the stream NFT."] }, ], - args: [ - { name: "_sender", type: "pubkey" }, - { name: "_salt", type: "u128" }, - ], - discriminator: [104, 209, 104, 97, 122, 35, 165, 195], + args: [], + returns: { defined: { name: "StreamStatus" } }, + }, + { + name: "stream_exists", docs: [ "Returns a flag indicating whether a stream based on the `_sender` and the `_salt` already exists.", "", @@ -873,25 +828,28 @@ export const sablierLockupLinearIDL = { "- `_sender` The sender of the stream.", "- `_salt` The unique salt used to derive the stream NFT mint address.", ], - name: "stream_exists", - returns: "bool", - }, - { + discriminator: [104, 209, 104, 97, 122, 35, 165, 195], accounts: [ { - docs: ["Read account: the account storing stream details."], - name: "stream_data", + name: "stream_nft_mint", + docs: ["Read account: the mint account for the stream NFT."], pda: { seeds: [ - { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, - { kind: "account", path: "stream_nft_mint" }, + { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 110, 102, 116, 95, 109, 105, 110, 116] }, + { kind: "arg", path: "_sender" }, + { kind: "arg", path: "_salt" }, ], }, }, - { docs: ["Read account: the mint account for the stream NFT."], name: "stream_nft_mint" }, ], - args: [], - discriminator: [91, 69, 219, 48, 189, 26, 13, 33], + args: [ + { name: "_sender", type: "pubkey" }, + { name: "_salt", type: "u128" }, + ], + returns: "bool", + }, + { + name: "streamed_amount_of", docs: [ "Calculates the amount streamed to the recipient, denoted in units of the token's decimals.", "", @@ -909,40 +867,94 @@ export const sablierLockupLinearIDL = { "", "- The stream does not exist.", ], - name: "streamed_amount_of", + discriminator: [91, 69, 219, 48, 189, 26, 13, 33], + accounts: [ + { + name: "stream_data", + docs: ["Read account: the account storing stream details."], + pda: { + seeds: [ + { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, + { kind: "account", path: "stream_nft_mint" }, + ], + }, + }, + { name: "stream_nft_mint", docs: ["Read account: the mint account for the stream NFT."] }, + ], + args: [], returns: "u64", }, { + name: "treasury_view", + docs: ["Returns the treasury details."], + discriminator: [247, 160, 213, 237, 247, 121, 164, 82], accounts: [ { - docs: ["Read account: the account storing the treasury details."], name: "treasury", + docs: ["Read account: the account storing the treasury details."], pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, }, ], - args: [], - discriminator: [247, 160, 213, 237, 247, 121, 164, 82], - docs: ["Returns the treasury details."], - name: "treasury_view", - returns: { defined: { name: "Treasury" } }, - }, - { + args: [], + returns: { defined: { name: "Treasury" } }, + }, + { + name: "withdraw", + docs: [ + "Withdraws the provided amount of tokens from the stream data ATA to the provided account.", + "", + "# Accounts Expected", + "", + "- `signer` The transaction signer.", + "- `deposited_token_mint` The mint of the deposited token.", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "- `withdrawal_recipient` The address of the recipient receiving the withdrawn tokens.", + "- `deposited_token_program` The Token Program of the deposited token.", + "- `nft_token_program` The Token Program of the NFT.", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", + "", + "# Parameters", + "", + "- `amount` The amount to withdraw, denoted in units of the token's decimals.", + "", + "# Notes", + "", + "- If the withdrawal recipient does not have an ATA for the deposited token, one is created.", + "- The instruction charges a fee in the native token (SOL), equivalent to $1 USD.", + "- Emits [`crate::utils::events::WithdrawFromLockupStream`] event.", + "", + "# Requirements", + "", + "- `stream_nft_mint` must exist.", + "- `withdrawal_recipient` must be the recipient if the signer is not the stream's recipient.", + "- `amount` must be greater than zero and must not exceed the withdrawable amount.", + "- The stream must not be Depleted.", + "- `chainlink_program` and `chainlink_sol_usd_feed` must match the ones stored in the treasury.", + ], + discriminator: [183, 18, 70, 156, 148, 109, 161, 34], accounts: [ { - docs: ["Write account: the signer of the withdrawal who pays the withdrawal fee."], name: "signer", - signer: true, + docs: ["Write account: the signer of the withdrawal who pays the withdrawal fee."], writable: true, + signer: true, }, - { docs: ["Read account: the recipient of the stream who owns the stream NFT."], name: "stream_recipient" }, + { name: "stream_recipient", docs: ["Read account: the recipient of the stream who owns the stream NFT."] }, { - docs: ["Read account: the account that will receive the withdrawn tokens.", "recipient."], name: "withdrawal_recipient", + docs: ["Read account: the account that will receive the withdrawn tokens.", "recipient."], }, { - docs: ["Create if needed account: the ATA for deposited tokens owned by withdrawal recipient."], name: "withdrawal_recipient_ata", + docs: ["Create if needed account: the ATA for deposited tokens owned by withdrawal recipient."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "withdrawal_recipient" }, + { kind: "account", path: "deposited_token_program" }, + { kind: "account", path: "deposited_token_mint" }, + ], program: { kind: "const", value: [ @@ -950,25 +962,24 @@ export const sablierLockupLinearIDL = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "withdrawal_recipient" }, - { kind: "account", path: "deposited_token_program" }, - { kind: "account", path: "deposited_token_mint" }, - ], }, - writable: true, }, { - docs: ["Write account: the treasury account that receives the withdrawal fee."], name: "treasury", - pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, + docs: ["Write account: the treasury account that receives the withdrawal fee."], writable: true, + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, }, - { docs: ["Read account: the mint account for the deposited token."], name: "deposited_token_mint" }, + { name: "deposited_token_mint", docs: ["Read account: the mint account for the deposited token."] }, { - docs: ["Read account: the ATA for the stream NFT owned by recipient.", ""], name: "recipient_stream_nft_ata", + docs: ["Read account: the ATA for the stream NFT owned by recipient.", ""], pda: { + seeds: [ + { kind: "account", path: "stream_recipient" }, + { kind: "account", path: "nft_token_program" }, + { kind: "account", path: "stream_nft_mint" }, + ], program: { kind: "const", value: [ @@ -976,28 +987,29 @@ export const sablierLockupLinearIDL = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "stream_recipient" }, - { kind: "account", path: "nft_token_program" }, - { kind: "account", path: "stream_nft_mint" }, - ], }, }, { - docs: ["Write account: the account storing the stream data."], name: "stream_data", + docs: ["Write account: the account storing the stream data."], + writable: true, pda: { seeds: [ { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, { kind: "account", path: "stream_nft_mint" }, ], }, - writable: true, }, { - docs: ["Write account: the ATA for deposited tokens owned by stream data."], name: "stream_data_ata", + docs: ["Write account: the ATA for deposited tokens owned by stream data."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "stream_data" }, + { kind: "account", path: "deposited_token_program" }, + { kind: "account", path: "deposited_token_mint" }, + ], program: { kind: "const", value: [ @@ -1005,86 +1017,69 @@ export const sablierLockupLinearIDL = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "stream_data" }, - { kind: "account", path: "deposited_token_program" }, - { kind: "account", path: "deposited_token_mint" }, - ], }, - writable: true, }, - { docs: ["Read account: the mint account for the stream NFT."], name: "stream_nft_mint" }, + { name: "stream_nft_mint", docs: ["Read account: the mint account for the stream NFT."] }, { - address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", - docs: ["Program account: the Associated Token program."], name: "associated_token_program", + docs: ["Program account: the Associated Token program."], + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", }, { - docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], name: "chainlink_program", + docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], }, - { docs: ["Read account: The account providing the SOL/USD price feed data."], name: "chainlink_sol_usd_feed" }, - { docs: ["Program account: the Token program of the deposited token."], name: "deposited_token_program" }, - { docs: ["Program account: the Token program of the stream NFT."], name: "nft_token_program" }, + { name: "chainlink_sol_usd_feed", docs: ["Read account: The account providing the SOL/USD price feed data."] }, + { name: "deposited_token_program", docs: ["Program account: the Token program of the deposited token."] }, + { name: "nft_token_program", docs: ["Program account: the Token program of the stream NFT."] }, { - address: "11111111111111111111111111111111", - docs: ["Program account: the System program."], name: "system_program", + docs: ["Program account: the System program."], + address: "11111111111111111111111111111111", }, ], args: [{ name: "amount", type: "u64" }], - discriminator: [183, 18, 70, 156, 148, 109, 161, 34], + }, + { + name: "withdraw_max", docs: [ - "Withdraws the provided amount of tokens from the stream data ATA to the provided account.", + "Withdraws the maximum withdrawable amount from the stream data ATA to the provided account.", "", "# Accounts Expected", "", - "- `signer` The transaction signer.", - "- `deposited_token_mint` The mint of the deposited token.", - "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", - "- `withdrawal_recipient` The address of the recipient receiving the withdrawn tokens.", - "- `deposited_token_program` The Token Program of the deposited token.", - "- `nft_token_program` The Token Program of the NFT.", - "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", - "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", - "", - "# Parameters", - "", - "- `amount` The amount to withdraw, denoted in units of the token's decimals.", + "Refer to the accounts in [`fn@crate::sablier_lockup::withdraw`].", "", "# Notes", "", - "- If the withdrawal recipient does not have an ATA for the deposited token, one is created.", - "- The instruction charges a fee in the native token (SOL), equivalent to $1 USD.", - "- Emits [`crate::utils::events::WithdrawFromLockupStream`] event.", + "Refer to the notes in [`fn@crate::sablier_lockup::withdraw`].", "", "# Requirements", "", - "- `stream_nft_mint` must exist.", - "- `withdrawal_recipient` must be the recipient if the signer is not the stream's recipient.", - "- `amount` must be greater than zero and must not exceed the withdrawable amount.", - "- The stream must not be Depleted.", - "- `chainlink_program` and `chainlink_sol_usd_feed` must match the ones stored in the treasury.", + "Refer to the requirements in [`fn@crate::sablier_lockup::withdraw`].", ], - name: "withdraw", - }, - { + discriminator: [32, 71, 46, 98, 105, 76, 85, 96], accounts: [ { - docs: ["Write account: the signer of the withdrawal who pays the withdrawal fee."], name: "signer", - signer: true, + docs: ["Write account: the signer of the withdrawal who pays the withdrawal fee."], writable: true, + signer: true, }, - { docs: ["Read account: the recipient of the stream who owns the stream NFT."], name: "stream_recipient" }, + { name: "stream_recipient", docs: ["Read account: the recipient of the stream who owns the stream NFT."] }, { - docs: ["Read account: the account that will receive the withdrawn tokens.", "recipient."], name: "withdrawal_recipient", + docs: ["Read account: the account that will receive the withdrawn tokens.", "recipient."], }, { - docs: ["Create if needed account: the ATA for deposited tokens owned by withdrawal recipient."], name: "withdrawal_recipient_ata", + docs: ["Create if needed account: the ATA for deposited tokens owned by withdrawal recipient."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "withdrawal_recipient" }, + { kind: "account", path: "deposited_token_program" }, + { kind: "account", path: "deposited_token_mint" }, + ], program: { kind: "const", value: [ @@ -1092,25 +1087,24 @@ export const sablierLockupLinearIDL = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "withdrawal_recipient" }, - { kind: "account", path: "deposited_token_program" }, - { kind: "account", path: "deposited_token_mint" }, - ], }, - writable: true, }, { - docs: ["Write account: the treasury account that receives the withdrawal fee."], name: "treasury", - pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, + docs: ["Write account: the treasury account that receives the withdrawal fee."], writable: true, + pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, }, - { docs: ["Read account: the mint account for the deposited token."], name: "deposited_token_mint" }, + { name: "deposited_token_mint", docs: ["Read account: the mint account for the deposited token."] }, { - docs: ["Read account: the ATA for the stream NFT owned by recipient.", ""], name: "recipient_stream_nft_ata", + docs: ["Read account: the ATA for the stream NFT owned by recipient.", ""], pda: { + seeds: [ + { kind: "account", path: "stream_recipient" }, + { kind: "account", path: "nft_token_program" }, + { kind: "account", path: "stream_nft_mint" }, + ], program: { kind: "const", value: [ @@ -1118,28 +1112,29 @@ export const sablierLockupLinearIDL = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "stream_recipient" }, - { kind: "account", path: "nft_token_program" }, - { kind: "account", path: "stream_nft_mint" }, - ], }, }, { - docs: ["Write account: the account storing the stream data."], name: "stream_data", + docs: ["Write account: the account storing the stream data."], + writable: true, pda: { seeds: [ { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, { kind: "account", path: "stream_nft_mint" }, ], }, - writable: true, }, { - docs: ["Write account: the ATA for deposited tokens owned by stream data."], name: "stream_data_ata", + docs: ["Write account: the ATA for deposited tokens owned by stream data."], + writable: true, pda: { + seeds: [ + { kind: "account", path: "stream_data" }, + { kind: "account", path: "deposited_token_program" }, + { kind: "account", path: "deposited_token_mint" }, + ], program: { kind: "const", value: [ @@ -1147,57 +1142,48 @@ export const sablierLockupLinearIDL = { 132, 4, 142, 123, 216, 219, 233, 248, 89, ], }, - seeds: [ - { kind: "account", path: "stream_data" }, - { kind: "account", path: "deposited_token_program" }, - { kind: "account", path: "deposited_token_mint" }, - ], }, - writable: true, }, - { docs: ["Read account: the mint account for the stream NFT."], name: "stream_nft_mint" }, + { name: "stream_nft_mint", docs: ["Read account: the mint account for the stream NFT."] }, { - address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", - docs: ["Program account: the Associated Token program."], name: "associated_token_program", + docs: ["Program account: the Associated Token program."], + address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", }, { - docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], name: "chainlink_program", + docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], }, - { docs: ["Read account: The account providing the SOL/USD price feed data."], name: "chainlink_sol_usd_feed" }, - { docs: ["Program account: the Token program of the deposited token."], name: "deposited_token_program" }, - { docs: ["Program account: the Token program of the stream NFT."], name: "nft_token_program" }, + { name: "chainlink_sol_usd_feed", docs: ["Read account: The account providing the SOL/USD price feed data."] }, + { name: "deposited_token_program", docs: ["Program account: the Token program of the deposited token."] }, + { name: "nft_token_program", docs: ["Program account: the Token program of the stream NFT."] }, { - address: "11111111111111111111111111111111", - docs: ["Program account: the System program."], name: "system_program", + docs: ["Program account: the System program."], + address: "11111111111111111111111111111111", }, ], args: [], - discriminator: [32, 71, 46, 98, 105, 76, 85, 96], + }, + { + name: "withdrawable_amount_of", docs: [ - "Withdraws the maximum withdrawable amount from the stream data ATA to the provided account.", + "Calculates the amount that the recipient can withdraw from the stream, denoted in units of the token's", + "decimals.", "", "# Accounts Expected", "", - "Refer to the accounts in [`fn@crate::sablier_lockup::withdraw`].", - "", - "# Notes", - "", - "Refer to the notes in [`fn@crate::sablier_lockup::withdraw`].", + "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", "", "# Requirements", "", - "Refer to the requirements in [`fn@crate::sablier_lockup::withdraw`].", + "- The stream does not exist.", ], - name: "withdraw_max", - }, - { + discriminator: [30, 195, 140, 141, 173, 123, 253, 60], accounts: [ { - docs: ["Read account: the account storing stream details."], name: "stream_data", + docs: ["Read account: the account storing stream details."], pda: { seeds: [ { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, @@ -1205,57 +1191,72 @@ export const sablierLockupLinearIDL = { ], }, }, - { docs: ["Read account: the mint account for the stream NFT."], name: "stream_nft_mint" }, + { name: "stream_nft_mint", docs: ["Read account: the mint account for the stream NFT."] }, ], args: [], - discriminator: [30, 195, 140, 141, 173, 123, 253, 60], + returns: "u64", + }, + { + name: "withdrawal_fee_in_lamports", docs: [ - "Calculates the amount that the recipient can withdraw from the stream, denoted in units of the token's", - "decimals.", - "", - "# Accounts Expected", - "", - "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", + "Calculates the withdrawal fee in lamports, which is equivalent to $1 USD.", "", - "# Requirements", + "# Accounts Expected:", "", - "- The stream does not exist.", + "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", + "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", ], - name: "withdrawable_amount_of", - returns: "u64", - }, - { + discriminator: [55, 255, 88, 224, 223, 23, 97, 140], accounts: [ { - docs: ["Read account: the treasury account that receives the withdrawal fee."], name: "treasury", + docs: ["Read account: the treasury account that receives the withdrawal fee."], pda: { seeds: [{ kind: "const", value: [116, 114, 101, 97, 115, 117, 114, 121] }] }, }, { - docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], name: "chainlink_program", + docs: ["Read account: The Chainlink program used to retrieve on-chain price feeds."], }, - { docs: ["Read account: The account providing the SOL/USD price feed data."], name: "chainlink_sol_usd_feed" }, + { name: "chainlink_sol_usd_feed", docs: ["Read account: The account providing the SOL/USD price feed data."] }, ], args: [], - discriminator: [55, 255, 88, 224, 223, 23, 97, 140], - docs: [ - "Calculates the withdrawal fee in lamports, which is equivalent to $1 USD.", - "", - "# Accounts Expected:", - "", - "- `chainlink_program`: The Chainlink program used to retrieve on-chain price feeds.", - "- `chainlink_sol_usd_feed`: The account providing the SOL/USD price feed data.", - ], - name: "withdrawal_fee_in_lamports", returns: "u64", }, ], - metadata: { description: "Created with Anchor", name: "sablier_lockup", spec: "0.1.0", version: "0.1.0" }, + accounts: [ + { name: "NftCollectionData", discriminator: [159, 26, 37, 150, 44, 84, 171, 172] }, + { name: "StreamData", discriminator: [61, 89, 148, 141, 154, 81, 86, 113] }, + { name: "Treasury", discriminator: [238, 239, 123, 238, 89, 1, 168, 253] }, + ], + events: [ + { name: "CancelLockupStream", discriminator: [82, 106, 117, 112, 153, 245, 190, 66] }, + { name: "CreateLockupLinearStream", discriminator: [234, 181, 19, 52, 67, 64, 151, 173] }, + { name: "FeesCollected", discriminator: [233, 23, 117, 225, 107, 178, 254, 8] }, + { name: "RenounceLockupStream", discriminator: [28, 66, 144, 150, 118, 56, 81, 93] }, + { name: "WithdrawFromLockupStream", discriminator: [232, 101, 27, 150, 85, 222, 243, 9] }, + ], + errors: [ + { code: 6000, name: "StreamDepleted", msg: "Can't perform the action on a depleted stream!" }, + { code: 6001, name: "StreamCanceled", msg: "Can't renounce an already-renounced Stream!" }, + { code: 6002, name: "StreamIsNotCancelable", msg: "Can't cancel a non-cancelable Stream!" }, + { code: 6003, name: "StreamSettled", msg: "Can't cancel a settled Stream!" }, + { code: 6004, name: "CantCollectZeroFees", msg: "Can't collect zero fees!" }, + { code: 6005, name: "CliffTimeNotLessThanEndTime", msg: "Invalid cliff time of the Stream!" }, + { code: 6006, name: "CliffTimeZeroUnlockAmountNotZero", msg: "Cliff time zero but unlock amount not zero!" }, + { code: 6007, name: "DepositAmountZero", msg: "Invalid deposit amount!" }, + { code: 6008, name: "StartTimeNotLessThanCliffTime", msg: "Start time must be less than cliff time!" }, + { code: 6009, name: "StartTimeNotLessThanEndTime", msg: "Start time must be less than end time!" }, + { code: 6010, name: "StartTimeZero", msg: "Start time can't be zero!" }, + { code: 6011, name: "UnlockAmountsSumTooHigh", msg: "Unlock amounts sum is greater than deposit amount!" }, + { code: 6012, name: "StreamAlreadyNonCancelable", msg: "Can't renounce a non-cancelable Stream!" }, + { code: 6013, name: "Overdraw", msg: "Attempting to withdraw more than available in the stream!" }, + { code: 6014, name: "WithdrawAmountZero", msg: "Can't withdraw a zero amount!" }, + ], types: [ { name: "Amounts", type: { + kind: "struct", fields: [ { name: "start_unlock", type: "u64" }, { name: "cliff_unlock", type: "u64" }, @@ -1263,12 +1264,12 @@ export const sablierLockupLinearIDL = { { name: "refunded", type: "u64" }, { name: "withdrawn", type: "u64" }, ], - kind: "struct", }, }, { name: "CancelLockupStream", type: { + kind: "struct", fields: [ { name: "deposited_token_mint", type: "pubkey" }, { name: "recipient_amount", type: "u64" }, @@ -1276,12 +1277,12 @@ export const sablierLockupLinearIDL = { { name: "stream_data", type: "pubkey" }, { name: "stream_nft_mint", type: "pubkey" }, ], - kind: "struct", }, }, { name: "CreateLockupLinearStream", type: { + kind: "struct", fields: [ { name: "deposit_token_decimals", type: "u8" }, { name: "deposit_token_mint", type: "pubkey" }, @@ -1290,44 +1291,44 @@ export const sablierLockupLinearIDL = { { name: "stream_data", type: "pubkey" }, { name: "stream_nft_mint", type: "pubkey" }, ], - kind: "struct", }, }, { name: "FeesCollected", type: { + kind: "struct", fields: [ { name: "fee_amount", type: "u64" }, { name: "fee_collector", type: "pubkey" }, { name: "fee_recipient", type: "pubkey" }, ], - kind: "struct", }, }, { name: "NftCollectionData", type: { + kind: "struct", fields: [ { name: "total_supply", type: "u64" }, { name: "bump", type: "u8" }, ], - kind: "struct", }, }, { name: "RenounceLockupStream", type: { + kind: "struct", fields: [ { name: "deposited_token_mint", type: "pubkey" }, { name: "stream_data", type: "pubkey" }, { name: "stream_nft_mint", type: "pubkey" }, ], - kind: "struct", }, }, { name: "StreamData", type: { + kind: "struct", fields: [ { name: "amounts", type: { defined: { name: "Amounts" } } }, { name: "deposited_token_mint", type: "pubkey" }, @@ -1339,7 +1340,6 @@ export const sablierLockupLinearIDL = { { name: "sender", type: "pubkey" }, { name: "was_canceled", type: "bool" }, ], - kind: "struct", }, }, { @@ -1356,32 +1356,33 @@ export const sablierLockupLinearIDL = { }, }, { - docs: ["Groups the timestamps for a Lockup stream."], name: "Timestamps", + docs: ["Groups the timestamps for a Lockup stream."], type: { + kind: "struct", fields: [ { name: "cliff", type: "u64" }, { name: "end", type: "u64" }, { name: "start", type: "u64" }, ], - kind: "struct", }, }, { name: "Treasury", type: { + kind: "struct", fields: [ { name: "bump", type: "u8" }, { name: "fee_collector", type: "pubkey" }, { name: "chainlink_program", type: "pubkey" }, { name: "chainlink_sol_usd_feed", type: "pubkey" }, ], - kind: "struct", }, }, { name: "WithdrawFromLockupStream", type: { + kind: "struct", fields: [ { name: "deposited_token_mint", type: "pubkey" }, { name: "fee_in_lamports", type: "u64" }, @@ -1389,8 +1390,7 @@ export const sablierLockupLinearIDL = { { name: "stream_nft_mint", type: "pubkey" }, { name: "withdrawn_amount", type: "u64" }, ], - kind: "struct", }, }, ], -}; +} as const; diff --git a/src/solana/idl/lockup/v1.0/SablierLockupLinear/index.ts b/src/solana/idl/lockup/v1.0/SablierLockupLinear/index.ts new file mode 100644 index 0000000..8561e71 --- /dev/null +++ b/src/solana/idl/lockup/v1.0/SablierLockupLinear/index.ts @@ -0,0 +1,21 @@ +/* -------------------------------------------------------------------------- */ +/* OBJECTS */ +/* -------------------------------------------------------------------------- */ + +import { errorCodes } from "./errors"; +import { idl } from "./idl"; +import * as structs from "./structs"; + +export const sablierLockupLinear = { errorCodes, idl, structs }; + +/* -------------------------------------------------------------------------- */ +/* TYPES */ +/* -------------------------------------------------------------------------- */ + +import * as errors from "./errors"; +import * as idlType from "./idl-type"; + +export namespace SablierLockupLinear { + export import IDL = idlType.IDL; + export import ErrorNames = errors.ErrorNames; +} diff --git a/src/solana/idl/lockup/v1.0/SablierLockupLinear/structs.ts b/src/solana/idl/lockup/v1.0/SablierLockupLinear/structs.ts new file mode 100644 index 0000000..c482b69 --- /dev/null +++ b/src/solana/idl/lockup/v1.0/SablierLockupLinear/structs.ts @@ -0,0 +1,58 @@ +import type { BN } from "@coral-xyz/anchor"; +import type { PublicKey } from "@solana/web3.js"; + +export type Amounts = { startUnlock: BN; cliffUnlock: BN; deposited: BN; refunded: BN; withdrawn: BN }; + +export type CancelLockupStream = { + depositedTokenMint: PublicKey; + recipientAmount: BN; + senderAmount: BN; + streamData: PublicKey; + streamNftMint: PublicKey; +}; + +export type CreateLockupLinearStream = { + depositTokenDecimals: number; + depositTokenMint: PublicKey; + recipient: PublicKey; + salt: BN; + streamData: PublicKey; + streamNftMint: PublicKey; +}; + +export type FeesCollected = { feeAmount: BN; feeCollector: PublicKey; feeRecipient: PublicKey }; + +export type NftCollectionData = { totalSupply: BN; bump: number }; + +export type RenounceLockupStream = { depositedTokenMint: PublicKey; streamData: PublicKey; streamNftMint: PublicKey }; + +export type StreamData = { + amounts: Amounts; + depositedTokenMint: PublicKey; + bump: number; + salt: BN; + isCancelable: boolean; + isDepleted: boolean; + timestamps: Timestamps; + sender: PublicKey; + wasCanceled: boolean; +}; + +export type StreamStatus = "Pending" | "Streaming" | "Settled" | "Canceled" | "Depleted"; + +export type Timestamps = { cliff: BN; end: BN; start: BN }; + +export type Treasury = { + bump: number; + feeCollector: PublicKey; + chainlinkProgram: PublicKey; + chainlinkSolUsdFeed: PublicKey; +}; + +export type WithdrawFromLockupStream = { + depositedTokenMint: PublicKey; + feeInLamports: BN; + streamData: PublicKey; + streamNftMint: PublicKey; + withdrawnAmount: BN; +}; diff --git a/src/solana/idl/lockup/v1.0/index.ts b/src/solana/idl/lockup/v1.0/index.ts deleted file mode 100644 index 1b54219..0000000 --- a/src/solana/idl/lockup/v1.0/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { sablierLockupLinearIDL as SablierLockupLinearIDL } from "./SablierLockupLinear"; -export type { Idl as SablierLockupLinearType } from "./SablierLockupLinearType"; diff --git a/src/solana/index.ts b/src/solana/index.ts deleted file mode 100644 index 657df4d..0000000 --- a/src/solana/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./idl";