goodrdotfun-sdk
Version:
SDK for interacting with goodr.fun and Sonic on Solana
1,458 lines (1,457 loc) • 79.6 kB
TypeScript
/**
* 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/pump_fun.json`.
*/
export type GoodrFun = {
address: '5QfLviZ6gqbXMuN2sjQzTFpQKZtJoYneAcfwDnLLDY2C';
metadata: {
name: 'pumpFun';
version: '0.1.0';
spec: '0.1.0';
description: 'Created with Anchor';
};
instructions: [
{
name: 'addDonationDestinations';
discriminator: [181, 167, 104, 71, 53, 42, 112, 52];
accounts: [
{
name: 'authority';
writable: true;
signer: true;
},
{
name: 'global';
writable: true;
},
{
name: 'systemProgram';
address: '11111111111111111111111111111111';
}
];
args: [
{
name: 'donationDestinations';
type: {
vec: 'pubkey';
};
}
];
},
{
name: 'buy';
discriminator: [102, 6, 61, 18, 1, 218, 235, 234];
accounts: [
{
name: 'global';
pda: {
seeds: [
{
kind: 'const';
value: [103, 108, 111, 98, 97, 108];
}
];
};
},
{
name: 'mint';
writable: true;
},
{
name: 'creatorWallet';
docs: ['CHECK'];
writable: true;
},
{
name: 'operatingWallet';
docs: ['CHECK'];
writable: true;
},
{
name: 'associatedBondingCurve';
writable: true;
},
{
name: 'bondingCurve';
writable: true;
pda: {
seeds: [
{
kind: 'const';
value: [
98,
111,
110,
100,
105,
110,
103,
95,
99,
117,
114,
118,
101
];
},
{
kind: 'account';
path: 'mint';
}
];
};
},
{
name: 'associatedUser';
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: 'user';
writable: true;
signer: true;
},
{
name: 'associatedTokenProgram';
address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
},
{
name: 'tokenProgram';
address: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb';
},
{
name: 'systemProgram';
address: '11111111111111111111111111111111';
},
{
name: 'rent';
address: 'SysvarRent111111111111111111111111111111111';
}
];
args: [
{
name: 'amount';
type: 'u64';
},
{
name: 'maxCostSol';
type: 'u64';
}
];
},
{
name: 'buyWithSpl';
discriminator: [86, 194, 224, 114, 187, 0, 129, 53];
accounts: [
{
name: 'global';
pda: {
seeds: [
{
kind: 'const';
value: [103, 108, 111, 98, 97, 108];
}
];
};
},
{
name: 'mint';
writable: true;
},
{
name: 'sonicMint';
},
{
name: 'creatorWallet';
writable: true;
},
{
name: 'operatingWallet';
writable: true;
},
{
name: 'userSonicAccount';
writable: true;
},
{
name: 'creatorSonicAccount';
writable: true;
pda: {
seeds: [
{
kind: 'account';
path: 'creatorWallet';
},
{
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: 'sonicMint';
}
];
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: 'operatingSonicAccount';
writable: true;
pda: {
seeds: [
{
kind: 'account';
path: 'operatingWallet';
},
{
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: 'sonicMint';
}
];
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: 'bondingCurveTokenAccount';
writable: true;
},
{
name: 'bondingCurveSonicAccount';
writable: true;
},
{
name: 'bondingCurve';
writable: true;
pda: {
seeds: [
{
kind: 'const';
value: [
98,
111,
110,
100,
105,
110,
103,
95,
99,
117,
114,
118,
101,
95,
118,
50
];
},
{
kind: 'account';
path: 'mint';
}
];
};
},
{
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: 'user';
writable: true;
signer: true;
},
{
name: 'associatedTokenProgram';
address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
},
{
name: 'tokenProgram';
address: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb';
},
{
name: 'systemProgram';
address: '11111111111111111111111111111111';
},
{
name: 'rent';
address: 'SysvarRent111111111111111111111111111111111';
}
];
args: [
{
name: 'amount';
type: 'u64';
},
{
name: 'maxCostSonic';
type: 'u64';
}
];
},
{
name: 'create';
discriminator: [24, 30, 200, 40, 5, 28, 7, 119];
accounts: [
{
name: 'user';
writable: true;
signer: true;
},
{
name: 'global';
pda: {
seeds: [
{
kind: 'const';
value: [103, 108, 111, 98, 97, 108];
}
];
};
},
{
name: 'mint';
writable: true;
signer: true;
},
{
name: 'donationDestination';
docs: ['CHECK'];
writable: true;
},
{
name: 'associatedBondingCurve';
docs: ['CHECK'];
writable: true;
},
{
name: 'associatedDonationDestination';
docs: ['CHECK'];
writable: true;
},
{
name: 'bondingCurve';
writable: true;
pda: {
seeds: [
{
kind: 'const';
value: [
98,
111,
110,
100,
105,
110,
103,
95,
99,
117,
114,
118,
101
];
},
{
kind: 'account';
path: 'mint';
}
];
};
},
{
name: 'associatedTokenProgram';
address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
},
{
name: 'tokenProgram';
address: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb';
},
{
name: 'systemProgram';
address: '11111111111111111111111111111111';
},
{
name: 'rent';
address: 'SysvarRent111111111111111111111111111111111';
}
];
args: [
{
name: 'name';
type: 'string';
},
{
name: 'symbol';
type: 'string';
},
{
name: 'uri';
type: 'string';
},
{
name: 'donationAmount';
type: 'u64';
}
];
},
{
name: 'createWithSpl';
discriminator: [196, 31, 67, 197, 71, 205, 128, 242];
accounts: [
{
name: 'user';
writable: true;
signer: true;
},
{
name: 'global';
pda: {
seeds: [
{
kind: 'const';
value: [103, 108, 111, 98, 97, 108];
}
];
};
},
{
name: 'sonicMint';
},
{
name: 'mint';
writable: true;
signer: true;
},
{
name: 'donationDestination';
writable: true;
},
{
name: 'associatedBondingCurve';
writable: true;
},
{
name: 'associatedDonationDestination';
writable: true;
},
{
name: 'bondingCurveSonicAccount';
writable: true;
},
{
name: 'bondingCurve';
writable: true;
pda: {
seeds: [
{
kind: 'const';
value: [
98,
111,
110,
100,
105,
110,
103,
95,
99,
117,
114,
118,
101,
95,
118,
50
];
},
{
kind: 'account';
path: 'mint';
}
];
};
},
{
name: 'associatedTokenProgram';
address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
},
{
name: 'tokenProgram';
address: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb';
},
{
name: 'splTokenProgram';
},
{
name: 'systemProgram';
address: '11111111111111111111111111111111';
},
{
name: 'rent';
address: 'SysvarRent111111111111111111111111111111111';
}
];
args: [
{
name: 'name';
type: 'string';
},
{
name: 'symbol';
type: 'string';
},
{
name: 'uri';
type: 'string';
},
{
name: 'donationAmount';
type: 'u64';
}
];
},
{
name: 'initialize';
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: 'removeDonationDestinations';
discriminator: [45, 169, 120, 148, 4, 97, 96, 53];
accounts: [
{
name: 'authority';
writable: true;
signer: true;
},
{
name: 'global';
writable: true;
},
{
name: 'systemProgram';
address: '11111111111111111111111111111111';
}
];
args: [
{
name: 'donationDestinations';
type: {
vec: 'pubkey';
};
}
];
},
{
name: 'sell';
discriminator: [51, 230, 133, 164, 1, 127, 131, 173];
accounts: [
{
name: 'global';
pda: {
seeds: [
{
kind: 'const';
value: [103, 108, 111, 98, 97, 108];
}
];
};
},
{
name: 'mint';
writable: true;
},
{
name: 'operatingWallet';
docs: ['CHECK'];
writable: true;
},
{
name: 'creatorWallet';
docs: ['CHECK'];
writable: true;
},
{
name: 'associatedBondingCurve';
writable: true;
},
{
name: 'bondingCurve';
writable: true;
pda: {
seeds: [
{
kind: 'const';
value: [
98,
111,
110,
100,
105,
110,
103,
95,
99,
117,
114,
118,
101
];
},
{
kind: 'account';
path: 'mint';
}
];
};
},
{
name: 'associatedUser';
writable: true;
},
{
name: 'user';
writable: true;
signer: true;
},
{
name: 'tokenProgram';
address: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb';
},
{
name: 'systemProgram';
address: '11111111111111111111111111111111';
},
{
name: 'rent';
address: 'SysvarRent111111111111111111111111111111111';
}
];
args: [
{
name: 'amount';
type: 'u64';
},
{
name: 'minOut';
type: 'u64';
}
];
},
{
name: 'sellWithSpl';
discriminator: [138, 14, 220, 187, 19, 0, 46, 94];
accounts: [
{
name: 'global';
pda: {
seeds: [
{
kind: 'const';
value: [103, 108, 111, 98, 97, 108];
}
];
};
},
{
name: 'mint';
writable: true;
},
{
name: 'sonicMint';
},
{
name: 'operatingWallet';
writable: true;
},
{
name: 'creatorWallet';
writable: true;
},
{
name: 'userSonicAccount';
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: 'sonicMint';
}
];
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: 'creatorSonicAccount';
writable: true;
pda: {
seeds: [
{
kind: 'account';
path: 'creatorWallet';
},
{
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: 'sonicMint';
}
];
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: 'operatingSonicAccount';
writable: true;
pda: {
seeds: [
{
kind: 'account';
path: 'operatingWallet';
},
{
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: 'sonicMint';
}
];
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: 'bondingCurveTokenAccount';
writable: true;
},
{
name: 'bondingCurveSonicAccount';
writable: true;
},
{
name: 'bondingCurve';
writable: true;
pda: {
seeds: [
{
kind: 'const';
value: [
98,
111,
110,
100,
105,
110,
103,
95,
99,
117,
114,
118,
101,
95,
118,
50
];
},
{
kind: 'account';
path: 'mint';
}
];
};
},
{
name: 'userTokenAccount';
writable: true;
},
{
name: 'user';
writable: true;
signer: true;
},
{
name: 'associatedTokenProgram';
address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
},
{
name: 'tokenProgram';
address: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb';
},
{
name: 'systemProgram';
address: '11111111111111111111111111111111';
},
{
name: 'rent';
address: 'SysvarRent111111111111111111111111111111111';
}
];
args: [
{
name: 'amount';
type: 'u64';
},
{
name: 'minSonicOutput';
type: 'u64';
}
];
},
{
name: 'setParams';
discriminator: [27, 234, 178, 52, 147, 2, 187, 141];
accounts: [
{
name: 'authority';
writable: true;
signer: true;
},
{
name: 'global';
writable: true;
},
{
name: 'systemProgram';
address: '11111111111111111111111111111111';
}
];
args: [
{
name: 'feeRecipient';
type: 'pubkey';
},
{
name: 'initialVirtualTokenReserves';
type: 'u64';
},
{
name: 'initialVirtualSolReserves';
type: 'u64';
},
{
name: 'initialRealTokenReserves';
type: 'u64';
},
{
name: 'tokenTotalSupply';
type: 'u64';
},
{
name: 'operatingFeeBasisPoints';
type: 'u64';
},
{
name: 'creatorFeeBasisPoints';
type: 'u64';
},
{
name: 'sonicMint';
type: {
option: 'pubkey';
};
},
{
name: 'sonicDecimals';
type: {
option: 'u8';
};
},
{
name: 'sonicInitialVirtualTokenReserves';
type: {
option: 'u64';
};
},
{
name: 'sonicInitialVirtualBaseReserves';
type: {
option: 'u64';
};
},
{
name: 'sonicInitialRealTokenReserves';
type: {
option: 'u64';
};
}
];
},
{
name: 'updateAuthority';
discriminator: [32, 46, 64, 28, 149, 75, 243, 88];
accounts: [
{
name: 'authority';
writable: true;
signer: true;
},
{
name: 'global';
writable: true;
},
{
name: 'systemProgram';
address: '11111111111111111111111111111111';
}
];
args: [
{
name: 'newAuthority';