export type StreamflowIDL = { "version": "0.1.0"; "name": "streamflow"; "instructions": [ { "name": "initializePool"; "docs": [ "Initialize a streamflow pool account.", "This instruction is only available to the admin of the pool.", "The admin can change the admin and pending admin of the pool.", "The admin can also pause and start the pool.", "", "### Parameter", "- `freed_interval` - The interval of freed tokens.", "", "#### Special Errors", "- `InvalidFreedInterval` - The freed interval of token is invalid." ]; "accounts": [ { "name": "base"; "isMut": false; "isSigner": true; "docs": [ "`base` is used to initialize admin account." ]; }, { "name": "admin"; "isMut": true; "isSigner": true; "docs": [ "`admin` is used to initialize admin account.", "It will be modified when pending admin is accepted." ]; }, { "name": "pool"; "isMut": true; "isSigner": false; "docs": [ "`pool` is an PDA that stores the locked pool state.", "It will be initialized by 'Pool' string and base key." ]; }, { "name": "mint"; "isMut": false; "isSigner": false; "docs": [ "`mint` is the token mint that pool vault holds." ]; }, { "name": "poolVault"; "isMut": true; "isSigner": false; "docs": [ "`pool_vault` is the vault(token account) that pool holds." ]; }, { "name": "tokenProgram"; "isMut": false; "isSigner": false; "docs": [ "`token_program` is the program that pool vault runs." ]; }, { "name": "associatedTokenProgram"; "isMut": false; "isSigner": false; "docs": [ "`associated_token_program` is the ATA of pool vault." ]; }, { "name": "systemProgram"; "isMut": false; "isSigner": false; "docs": [ "`system_program` is solana system program." ]; }, { "name": "rent"; "isMut": false; "isSigner": false; "docs": [ "`rent` use to initialize account." ]; } ]; "args": [ { "name": "freedInterval"; "type": "u64"; } ]; }, { "name": "initializePosition"; "docs": [ "Initialize a streamflow position account.", "This instruction is only available to the admin of the pool.", "", "### Parameters", "- `start_time` - The start time of the position unlock.", "- `end_time` - The end time of the position unlock.", "- `locked_amount` - The amount of locked tokens.", "", "#### Special Errors", "- `StartTimeMustBeGreaterThanCurrentTime` - The start time of the position unlock must be greater than current time.", "- `EndTimeMustBeGreaterThanStartTime` - The end time of the position unlock must be greater than start time.", "- `UnlockedPeriodMustBeMultipleOfFreedInterval` - The unlocked period of the position unlock must be multiple of freed interval." ]; "accounts": [ { "name": "admin"; "isMut": true; "isSigner": true; "docs": [ "`admin` will be set the same as the admin of the pool." ]; }, { "name": "payer"; "isMut": true; "isSigner": true; "docs": [ "`payer` will should can be set." ]; }, { "name": "pool"; "isMut": true; "isSigner": false; "docs": [ "`pool` allowance and locked_amount will update." ]; }, { "name": "authorityNftMint"; "isMut": false; "isSigner": false; "docs": [ "`authority_nft_mint` can only be bound to a unique pool." ]; }, { "name": "position"; "isMut": true; "isSigner": false; "docs": [ "`position` will be initialized by the `Position` string、pool address and authority nft mint." ]; }, { "name": "systemProgram"; "isMut": false; "isSigner": false; "docs": [ "`system_program` is solana system program." ]; }, { "name": "rent"; "isMut": false; "isSigner": false; "docs": [ "`rent` use to create account." ]; } ]; "args": [ { "name": "startTime"; "type": "u64"; }, { "name": "endTime"; "type": "u64"; }, { "name": "lockedAmount"; "type": "u64"; } ]; }, { "name": "withdrawUnlockedToken"; "docs": [ "Withdraw unlocked tokens from a streamflow position account.", "This instruction is only available to the owner of the authority nft mint.", "", "### Parameters", "- None.", "", "#### Special Errors", "- `WithdrawPaused` - The pool is paused.", "- `InvalidWithdrawTime` - The withdraw time is invalid.", "- `WithdrawNotStart` - The position is not started.", "- `NoAvailableWithdrawToken` - There is no available withdraw token." ]; "accounts": [ { "name": "receiver"; "isMut": false; "isSigner": true; "docs": [ "`user` is the owner of authority nft mint." ]; }, { "name": "pool"; "isMut": false; "isSigner": false; "docs": [ "`pool` is the owner of position." ]; }, { "name": "position"; "isMut": true; "isSigner": false; "docs": [ "`position` is control the withdrawal.", "The allowance of position will be decreased by the amount of the once withdraw." ]; }, { "name": "authorityNftMint"; "isMut": false; "isSigner": false; "docs": [ "`authority_nft_mint` is only one withdraw permit of position." ]; }, { "name": "authorityNftAta"; "isMut": false; "isSigner": false; "docs": [ "`authority_nft_token` is the token of authority nft mint.", "not check nft_mint_authority is none, because some nft's mint authority is already transfered." ]; }, { "name": "poolVault"; "isMut": true; "isSigner": false; "docs": [ "`pool_vault` will used to transfer tokens to user." ]; }, { "name": "receiverTokenAta"; "isMut": true; "isSigner": false; "docs": [ "`user_token_account` will get the unlocked tokens from pool vault.", "It must be already exist.", "receiver" ]; }, { "name": "tokenProgram"; "isMut": false; "isSigner": false; "docs": [ "`token_program` is solana system program" ]; } ]; "args": []; }, { "name": "transferAdmin"; "docs": [ "Trasfer admin of the pool.", "This instruction is only available to the admin of the pool.", "", "### Parameters", "- None.", "", "#### Special Errors", "- `VerifiedAdminFailed` - The admin is not verified." ]; "accounts": [ { "name": "pool"; "isMut": true; "isSigner": false; "docs": [ "`pool` is the transferrable pool." ]; }, { "name": "admin"; "isMut": false; "isSigner": true; "docs": [ "`admin` is the admin of pool. It must be the signer of this instruction." ]; }, { "name": "nextAdmin"; "isMut": false; "isSigner": false; "docs": [ "`new_admin` will be the new admin of pool." ]; } ]; "args": []; }, { "name": "acceptAdmin"; "docs": [ "Accept admin of the pool.", "This instruction is only available to the admin of the authority nft mint in position.", "", "### Parameters", "- None.", "", "#### Special Errors", "- `VerifiedAdminFailed` - The admin is not verified." ]; "accounts": [ { "name": "pool"; "isMut": true; "isSigner": false; "docs": [ "`pool` is the transferrable pool." ]; }, { "name": "pendingAdmin"; "isMut": false; "isSigner": true; "docs": [ "`pending_admin` will be the admin of pool after accept." ]; } ]; "args": []; }, { "name": "pauseWithdraw"; "docs": [ "Pause the pool withdraw.", "This instruction is only available to the admin of the pool.", "", "### Parameters", "- None.", "", "#### Special Errors", "- `PoolWithdrawAlreadyPaused` - The withdraw of pool is already paused." ]; "accounts": [ { "name": "admin"; "isMut": false; "isSigner": true; "docs": [ "`admin` is the admin of pool. It must be the signer of this instruction." ]; }, { "name": "pool"; "isMut": true; "isSigner": false; "docs": [ "`pool` is the controlled pool." ]; } ]; "args": []; }, { "name": "startWithdraw"; "docs": [ "Start the pool withdraw.", "This instruction is only available to the admin of the pool.", "", "### Parameters", "- None.", "", "#### Special Errors", "- `PoolWithdrawAlreadyStarted` - The withdraw of pool is already started." ]; "accounts": [ { "name": "admin"; "isMut": false; "isSigner": true; "docs": [ "`admin` is the admin of pool. It must be the signer of this instruction." ]; }, { "name": "pool"; "isMut": true; "isSigner": false; "docs": [ "`pool` is the controlled pool." ]; } ]; "args": []; } ]; "accounts": [ { "name": "Pool"; "docs": [ "Pool is an program derived address controlled by streamflow program.", "Pool means the pool of tokens that are locked by the contract.", "Pool is a collection of positions." ]; "type": { "kind": "struct"; "fields": [ { "name": "base"; "docs": [ "`base` is the seed of the pool admin." ]; "type": "publicKey"; }, { "name": "admin"; "docs": [ "`admin` can change the admin and pending admin of the pool.", "It also can pause and start the pool." ]; "type": "publicKey"; }, { "name": "pendingAdmin"; "docs": [ "`pending_admin` will be the admin of pool when pending admin accept it.", "The pending admin can be set by the `transfer_admin` instruction." ]; "type": "publicKey"; }, { "name": "bump"; "docs": [ "`bump` could kick the address off of the elliptic curve.", "The bump will be set 'pool'." ]; "type": { "array": [ "u8", 1 ]; }; }, { "name": "freedInterval"; "docs": [ "`freed_interval` is the interval of freed tokens." ]; "type": "u64"; }, { "name": "mint"; "docs": [ "`mint` is the mint of the token that pool holds." ]; "type": "publicKey"; }, { "name": "poolVault"; "docs": [ "`pool_vault` is used to store the locked tokens.", "It will be set when the pool is initialized." ]; "type": "publicKey"; }, { "name": "positionCount"; "docs": [ "`position_count` will add 1 when the `initialize_position` instruction is called." ]; "type": "u64"; }, { "name": "isPaused"; "docs": [ "`is_paused` controls the activity of the pool.", "If true, withdraw_unlocked_token on the [LockPool] should be pause." ]; "type": "bool"; }, { "name": "lockedAmount"; "docs": [ "`locked_amout` is the amount of locked tokens of the pool.", "It will be added when the `initialize_position` instruction is called." ]; "type": "u64"; }, { "name": "allowance"; "docs": [ "`allowance` is the amount of unlocked(withdrawed) tokens of the pool.", "It will be added when the `withdraw_unlocked_token` instruction is called." ]; "type": "u64"; } ]; }; }, { "name": "Position"; "docs": [ "`Position` is an program derived address controlled by streamflow program.", "It means the position of the token that is locked by the contract.", "It only can be initialized by the pool admin and only bind with one nft." ]; "type": { "kind": "struct"; "fields": [ { "name": "bump"; "docs": [ "`bump` is used to kick the address off of the elliptic curve." ]; "type": "u8"; }, { "name": "authorityNftMint"; "docs": [ "`authority_nft_mint` is the mint of the nft that position authiritied." ]; "type": "publicKey"; }, { "name": "pool"; "docs": [ "`pool` is the owner of the position." ]; "type": "publicKey"; }, { "name": "startTime"; "docs": [ "`start_time` is the time of position start to unlock." ]; "type": "u64"; }, { "name": "endTime"; "docs": [ "`end_time` is the time of position end to unlock." ]; "type": "u64"; }, { "name": "lastWithdrawTime"; "docs": [ "`last_withdraw_time` is the timestamp of last withdraw." ]; "type": "u64"; }, { "name": "lockedAmount"; "docs": [ "`locked_amount` is the amount of locked tokens of the position.", "It will be set when the `initialize_position` instruction is called." ]; "type": "u64"; }, { "name": "allowance"; "docs": [ "`allowance` is the amount of still locked tokens of the position.", "It will be reduced when the `withdraw_unlocked_token` instruction is called." ]; "type": "u64"; } ]; }; } ]; "events": [ { "name": "InitializePoolEvent"; "fields": [ { "name": "admin"; "type": "publicKey"; "index": false; }, { "name": "pool"; "type": "publicKey"; "index": false; }, { "name": "mint"; "type": "publicKey"; "index": false; }, { "name": "freedInterval"; "type": "u64"; "index": false; } ]; }, { "name": "InitializePositionEvent"; "fields": [ { "name": "pool"; "type": "publicKey"; "index": false; }, { "name": "authorityNftMint"; "type": "publicKey"; "index": false; }, { "name": "position"; "type": "publicKey"; "index": false; }, { "name": "startTime"; "type": "u64"; "index": false; }, { "name": "endTime"; "type": "u64"; "index": false; }, { "name": "lockedAmount"; "type": "u64"; "index": false; } ]; }, { "name": "WithdrawUnlockEvent"; "fields": [ { "name": "pool"; "type": "publicKey"; "index": false; }, { "name": "position"; "type": "publicKey"; "index": false; }, { "name": "authorityNftMint"; "type": "publicKey"; "index": false; }, { "name": "authorityNftAta"; "type": "publicKey"; "index": false; } ]; }, { "name": "AcceptAdminEvent"; "fields": [ { "name": "pool"; "type": "publicKey"; "index": false; }, { "name": "previousAdmin"; "type": "publicKey"; "index": false; }, { "name": "admin"; "type": "publicKey"; "index": false; } ]; }, { "name": "TransferAdminEvent"; "fields": [ { "name": "pool"; "type": "publicKey"; "index": false; }, { "name": "currentAdmin"; "type": "publicKey"; "index": false; }, { "name": "pendingAdmin"; "type": "publicKey"; "index": false; } ]; }, { "name": "PauseWithdrawEvent"; "fields": [ { "name": "admin"; "type": "publicKey"; "index": false; }, { "name": "pool"; "type": "publicKey"; "index": false; } ]; }, { "name": "StartWithdrawEvent"; "fields": [ { "name": "admin"; "type": "publicKey"; "index": false; }, { "name": "pool"; "type": "publicKey"; "index": false; } ]; } ]; "errors": [ { "code": 6000; "name": "Unauthorized"; "msg": "Unauthorized"; }, { "code": 6001; "name": "InvalidFreedInterval"; "msg": "Invalid interver when initializing pool"; }, { "code": 6002; "name": "EndTimeMustBeGreaterThanStartTime"; "msg": "End time must be greater than start_time"; }, { "code": 6003; "name": "StartTimeMustBeGreaterThanCurrentTime"; "msg": "Start time must be greater than current_time"; }, { "code": 6004; "name": "NftMintAlreadyInitialized"; "msg": "Nft mint already initialized"; }, { "code": 6005; "name": "InvalidNftBalance"; "msg": "Invalid nft balance"; }, { "code": 6006; "name": "WithdrawAlreadyDone"; "msg": "Withdraw already done"; }, { "code": 6007; "name": "InvalidWithdrawTime"; "msg": "Invalid withdraw time"; }, { "code": 6008; "name": "WithdrawPaused"; "msg": "Withdraw is paused"; }, { "code": 6009; "name": "VerifiedAdminFailed"; "msg": "Verified admin failed"; }, { "code": 6010; "name": "UnlockPeriodMustBeMultipleOfFreedInterval"; "msg": "Unlock period must be multiple of freed interval"; }, { "code": 6011; "name": "WithdrawNotStart"; "msg": "Withdraw not start"; }, { "code": 6012; "name": "PoolWithdrawAlreadyPause"; "msg": "Pool withdraw already pause"; }, { "code": 6013; "name": "PoolWithdrawAlreadyStart"; "msg": "Pool withdraw already start"; }, { "code": 6014; "name": "NoAvailableWithdrawToken"; "msg": "No available withdraw token"; }, { "code": 6015; "name": "InvaildAuthorityNftATA"; "msg": "Invaild authority nft ata"; }, { "code": 6016; "name": "InvalidLockedAmount"; "msg": "Invalid locked amount"; } ]; }; export declare const StreamflowJSON: StreamflowIDL; export declare const StreamflowErrors: import("@saberhq/anchor-contrib").ErrorMap; //# sourceMappingURL=streamflow.d.ts.map