UNPKG

@solsdk/tokenflow_sdk

Version:

A simple SDK for interacting with tokenflow

1,384 lines (1,383 loc) 129 kB
/** * 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/happy_pump_program.json`. */ export type HappyPumpProgram = { "address": "2wcKsovYJcjjRo21DNrY3ZNjvxEWssR2qQQVhE4EXZeA"; "metadata": { "name": "happyPumpProgram"; "version": "0.1.0"; "spec": "0.1.0"; "description": "happyPump"; }; "instructions": [ { "name": "buy"; "docs": [ "Buys tokens from a bonding curve." ]; "discriminator": [ 102, 6, 61, 18, 1, 218, 235, 234 ]; "accounts": [ { "name": "user"; "writable": true; "signer": true; }, { "name": "tradeAuthority"; "writable": true; "signer": true; "optional": true; }, { "name": "global"; "pda": { "seeds": [ { "kind": "const"; "value": [ 103, 108, 111, 98, 97, 108 ]; } ]; }; }, { "name": "feeRecipient"; "writable": true; }, { "name": "creatorFeeRecipient"; "writable": true; }, { "name": "mint"; "writable": true; }, { "name": "bondingCurve"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ]; }, { "kind": "account"; "path": "mint"; } ]; }; }, { "name": "bondingCurveTokenAccount"; "writable": true; "pda": { "seeds": [ { "kind": "account"; "path": "bondingCurve"; }, { "kind": "const"; "value": [ 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133, 126, 255, 0, 169 ]; }, { "kind": "account"; "path": "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": "userTokenAccount"; "writable": true; "pda": { "seeds": [ { "kind": "account"; "path": "user"; }, { "kind": "const"; "value": [ 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133, 126, 255, 0, 169 ]; }, { "kind": "account"; "path": "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": "systemProgram"; "address": "11111111111111111111111111111111"; }, { "name": "tokenProgram"; "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"; }, { "name": "eventAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; } ]; }; }, { "name": "program"; } ]; "args": [ { "name": "params"; "type": { "defined": { "name": "buyParams"; }; }; } ]; }, { "name": "create"; "docs": [ "Creates a new coin and bonding curve." ]; "discriminator": [ 24, 30, 200, 40, 5, 28, 7, 119 ]; "accounts": [ { "name": "mint"; "writable": true; "signer": true; }, { "name": "creator"; "writable": true; "signer": true; }, { "name": "mintAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 109, 105, 110, 116, 45, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; } ]; }; }, { "name": "bondingCurve"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ]; }, { "kind": "account"; "path": "mint"; } ]; }; }, { "name": "bondingCurveTokenAccount"; "writable": true; "pda": { "seeds": [ { "kind": "account"; "path": "bondingCurve"; }, { "kind": "const"; "value": [ 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133, 126, 255, 0, 169 ]; }, { "kind": "account"; "path": "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": "global"; "pda": { "seeds": [ { "kind": "const"; "value": [ 103, 108, 111, 98, 97, 108 ]; } ]; }; }, { "name": "metadata"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 109, 101, 116, 97, 100, 97, 116, 97 ]; }, { "kind": "account"; "path": "tokenMetadataProgram"; }, { "kind": "account"; "path": "mint"; } ]; "program": { "kind": "account"; "path": "tokenMetadataProgram"; }; }; }, { "name": "systemProgram"; "address": "11111111111111111111111111111111"; }, { "name": "tokenProgram"; "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"; }, { "name": "tokenMetadataProgram"; "address": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"; }, { "name": "associatedTokenProgram"; "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"; }, { "name": "rent"; "address": "SysvarRent111111111111111111111111111111111"; }, { "name": "feeRecipient"; "writable": true; }, { "name": "eventAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; } ]; }; }, { "name": "program"; } ]; "args": [ { "name": "params"; "type": { "defined": { "name": "createParams"; }; }; } ]; }, { "name": "initialize"; "docs": [ "Creates the global state." ]; "discriminator": [ 175, 175, 109, 31, 13, 152, 155, 237 ]; "accounts": [ { "name": "authority"; "writable": true; "signer": true; }, { "name": "global"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 103, 108, 111, 98, 97, 108 ]; } ]; }; }, { "name": "systemProgram"; "address": "11111111111111111111111111111111"; } ]; "args": []; }, { "name": "migrateToRaydium"; "docs": [ "Migrate bonding curve to raydium cpmm" ]; "discriminator": [ 116, 139, 75, 192, 86, 63, 121, 169 ]; "accounts": [ { "name": "cpSwapProgram"; "address": "CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"; }, { "name": "payer"; "writable": true; "signer": true; }, { "name": "creatorLpToken"; "writable": true; }, { "name": "global"; "pda": { "seeds": [ { "kind": "const"; "value": [ 103, 108, 111, 98, 97, 108 ]; } ]; }; }, { "name": "mint"; }, { "name": "wsolMint"; "writable": true; }, { "name": "observationState"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 111, 98, 115, 101, 114, 118, 97, 116, 105, 111, 110 ]; }, { "kind": "account"; "path": "poolState"; } ]; "program": { "kind": "account"; "path": "cpSwapProgram"; }; }; }, { "name": "bondingCurve"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ]; }, { "kind": "account"; "path": "mint"; } ]; }; }, { "name": "bondingCurveTokenAccount"; "writable": true; "pda": { "seeds": [ { "kind": "account"; "path": "bondingCurve"; }, { "kind": "const"; "value": [ 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133, 126, 255, 0, 169 ]; }, { "kind": "account"; "path": "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": "bondingCurveWsolAccount"; "writable": true; "pda": { "seeds": [ { "kind": "account"; "path": "bondingCurve"; }, { "kind": "const"; "value": [ 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133, 126, 255, 0, 169 ]; }, { "kind": "account"; "path": "wsolMint"; } ]; "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": "creatorWsolAccount"; "writable": true; "pda": { "seeds": [ { "kind": "account"; "path": "payer"; }, { "kind": "const"; "value": [ 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133, 126, 255, 0, 169 ]; }, { "kind": "account"; "path": "wsolMint"; } ]; "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": "creatorTokenAccount"; "writable": true; "pda": { "seeds": [ { "kind": "account"; "path": "payer"; }, { "kind": "const"; "value": [ 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133, 126, 255, 0, 169 ]; }, { "kind": "account"; "path": "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": "poolWsolVault"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 112, 111, 111, 108, 95, 118, 97, 117, 108, 116 ]; }, { "kind": "account"; "path": "poolState"; }, { "kind": "account"; "path": "wsolMint"; } ]; "program": { "kind": "account"; "path": "cpSwapProgram"; }; }; }, { "name": "poolTokenVault"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 112, 111, 111, 108, 95, 118, 97, 117, 108, 116 ]; }, { "kind": "account"; "path": "poolState"; }, { "kind": "account"; "path": "mint"; } ]; "program": { "kind": "account"; "path": "cpSwapProgram"; }; }; }, { "name": "createPoolFee"; "docs": [ "create pool fee account" ]; "writable": true; "address": "DNXgeM9EiiaAbaWvwjHj9fQQLAX5ZsfHyvmYUNRAdNC8"; }, { "name": "ammConfig"; "docs": [ "Which config the pool belongs to." ]; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 97, 109, 109, 95, 99, 111, 110, 102, 105, 103 ]; }, { "kind": "const"; "value": [ 0, 0 ]; } ]; "program": { "kind": "account"; "path": "cpSwapProgram"; }; }; }, { "name": "poolState"; "writable": true; }, { "name": "lpMint"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 112, 111, 111, 108, 95, 108, 112, 95, 109, 105, 110, 116 ]; }, { "kind": "account"; "path": "poolState"; } ]; "program": { "kind": "account"; "path": "cpSwapProgram"; }; }; }, { "name": "cpAuthority"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 118, 97, 117, 108, 116, 95, 97, 110, 100, 95, 108, 112, 95, 109, 105, 110, 116, 95, 97, 117, 116, 104, 95, 115, 101, 101, 100 ]; } ]; "program": { "kind": "account"; "path": "cpSwapProgram"; }; }; }, { "name": "associatedTokenProgram"; "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"; }, { "name": "systemProgram"; "address": "11111111111111111111111111111111"; }, { "name": "tokenProgram"; "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"; }, { "name": "rent"; "address": "SysvarRent111111111111111111111111111111111"; }, { "name": "eventAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116,