@star-factory/sdk-launchpad 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -1
- package/dist/idl/index.d.ts +2 -0
- package/dist/idl/index.d.ts.map +1 -0
- package/dist/idl/index.js +6 -0
- package/dist/idl/index.js.map +1 -0
- package/dist/idl/launchpad.json +2892 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/program.d.ts +15 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +31 -0
- package/dist/program.js.map +1 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
|
2
|
+
type LaunchpadIdlJson = {
|
|
3
|
+
address: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const LAUNCHPAD_IDL: LaunchpadIdlJson;
|
|
1
6
|
/**
|
|
2
7
|
* Star Launchpad SDK
|
|
3
8
|
*
|
|
@@ -18,10 +23,12 @@
|
|
|
18
23
|
* @see https://docs.combinator.trade/llms.txt
|
|
19
24
|
* @see programs/launchpad/spec/09-zc-dao-creation.md
|
|
20
25
|
*/
|
|
26
|
+
export { dummyWallet, getLaunchpadProgram, type LaunchpadIdl } from './program';
|
|
21
27
|
export { LaunchpadSDK } from './sdk';
|
|
22
28
|
export * from './types';
|
|
23
29
|
export { derivePoolAddress, sortMints } from './pdas';
|
|
24
30
|
export * from './instructions';
|
|
25
31
|
export * from './claims';
|
|
26
32
|
export * from './zc';
|
|
33
|
+
export declare const LAUNCHPAD_PROGRAM_ID: PublicKey;
|
|
27
34
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGrC,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGtD,cAAc,gBAAgB,CAAC;AAG/B,cAAc,UAAU,CAAC;AAGzB,cAAc,MAAM,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,KAAK,gBAAgB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAC5C,eAAO,MAAM,aAAa,EAAmB,gBAAgB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGrC,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGtD,cAAc,gBAAgB,CAAC;AAG/B,cAAc,UAAU,CAAC;AAGzB,cAAc,MAAM,CAAC;AAErB,eAAO,MAAM,oBAAoB,WAAuC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LAUNCHPAD_PROGRAM_ID = exports.sortMints = exports.derivePoolAddress = exports.LaunchpadSDK = exports.getLaunchpadProgram = exports.dummyWallet = exports.LAUNCHPAD_IDL = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
6
|
+
const launchpad_json_1 = tslib_1.__importDefault(require("./idl/launchpad.json"));
|
|
7
|
+
exports.LAUNCHPAD_IDL = launchpad_json_1.default;
|
|
2
8
|
/**
|
|
3
9
|
* Star Launchpad SDK
|
|
4
10
|
*
|
|
@@ -19,10 +25,10 @@
|
|
|
19
25
|
* @see https://docs.combinator.trade/llms.txt
|
|
20
26
|
* @see programs/launchpad/spec/09-zc-dao-creation.md
|
|
21
27
|
*/
|
|
22
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.sortMints = exports.derivePoolAddress = exports.LaunchpadSDK = void 0;
|
|
24
|
-
const tslib_1 = require("tslib");
|
|
25
28
|
// Main SDK
|
|
29
|
+
var program_1 = require("./program");
|
|
30
|
+
Object.defineProperty(exports, "dummyWallet", { enumerable: true, get: function () { return program_1.dummyWallet; } });
|
|
31
|
+
Object.defineProperty(exports, "getLaunchpadProgram", { enumerable: true, get: function () { return program_1.getLaunchpadProgram; } });
|
|
26
32
|
var sdk_1 = require("./sdk");
|
|
27
33
|
Object.defineProperty(exports, "LaunchpadSDK", { enumerable: true, get: function () { return sdk_1.LaunchpadSDK; } });
|
|
28
34
|
// Types
|
|
@@ -37,4 +43,5 @@ tslib_1.__exportStar(require("./instructions"), exports);
|
|
|
37
43
|
tslib_1.__exportStar(require("./claims"), exports);
|
|
38
44
|
// ZC (re-export everything)
|
|
39
45
|
tslib_1.__exportStar(require("./zc"), exports);
|
|
46
|
+
exports.LAUNCHPAD_PROGRAM_ID = new web3_js_1.PublicKey(exports.LAUNCHPAD_IDL.address);
|
|
40
47
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,6CAA4C;AAC5C,kFAAgD;AAGnC,QAAA,aAAa,GAAG,wBAAgC,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,WAAW;AACX,qCAAgF;AAAvE,sGAAA,WAAW,OAAA;AAAE,8GAAA,mBAAmB,OAAA;AACzC,6BAAqC;AAA5B,mGAAA,YAAY,OAAA;AAErB,QAAQ;AACR,kDAAwB;AAExB,yBAAyB;AACzB,+BAAsD;AAA7C,yGAAA,iBAAiB,OAAA;AAAE,iGAAA,SAAS,OAAA;AAErC,mDAAmD;AACnD,yDAA+B;AAE/B,sCAAsC;AACtC,mDAAyB;AAEzB,4BAA4B;AAC5B,+CAAqB;AAER,QAAA,oBAAoB,GAAG,IAAI,mBAAS,CAAC,qBAAa,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Idl, Wallet } from '@coral-xyz/anchor';
|
|
2
|
+
import { Program } from '@coral-xyz/anchor';
|
|
3
|
+
import { Connection, Keypair, PublicKey } from '@solana/web3.js';
|
|
4
|
+
export type LaunchpadIdl = Idl & {
|
|
5
|
+
address: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const dummyWallet: Wallet & {
|
|
8
|
+
payer: Keypair;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Create an Anchor Program client for launchpad without requiring callers to
|
|
12
|
+
* pass providers/wallets in API routes and backend contexts.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getLaunchpadProgram(connection: Connection, programId?: PublicKey): Program<LaunchpadIdl>;
|
|
15
|
+
//# sourceMappingURL=program.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAkB,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjE,MAAM,MAAM,YAAY,GAAG,GAAG,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAGrD,eAAO,MAAM,WAAW,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,OAAO,CAAA;CAKlD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,UAAU,EACtB,SAAS,CAAC,EAAE,SAAS,GACpB,OAAO,CAAC,YAAY,CAAC,CAavB"}
|
package/dist/program.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dummyWallet = void 0;
|
|
4
|
+
exports.getLaunchpadProgram = getLaunchpadProgram;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const anchor_1 = require("@coral-xyz/anchor");
|
|
7
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
8
|
+
const launchpad_json_1 = tslib_1.__importDefault(require("./idl/launchpad.json"));
|
|
9
|
+
const DUMMY_KEYPAIR = web3_js_1.Keypair.generate();
|
|
10
|
+
exports.dummyWallet = {
|
|
11
|
+
publicKey: DUMMY_KEYPAIR.publicKey,
|
|
12
|
+
signAllTransactions: async (txs) => txs,
|
|
13
|
+
signTransaction: async (tx) => tx,
|
|
14
|
+
payer: DUMMY_KEYPAIR,
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Create an Anchor Program client for launchpad without requiring callers to
|
|
18
|
+
* pass providers/wallets in API routes and backend contexts.
|
|
19
|
+
*/
|
|
20
|
+
function getLaunchpadProgram(connection, programId) {
|
|
21
|
+
const idl = launchpad_json_1.default;
|
|
22
|
+
const provider = new anchor_1.AnchorProvider(connection, exports.dummyWallet, {
|
|
23
|
+
commitment: 'confirmed',
|
|
24
|
+
});
|
|
25
|
+
const envPidStr = process.env.NEXT_PUBLIC_LAUNCHPAD_PROGRAM_ID || process.env.LAUNCHPAD_PROGRAM_ID;
|
|
26
|
+
const pidOverride = programId ?? (envPidStr ? new web3_js_1.PublicKey(envPidStr) : undefined);
|
|
27
|
+
// Keep IDL address as default, but allow deterministic program-id override per env.
|
|
28
|
+
const effectiveIdl = pidOverride ? { ...idl, address: pidOverride.toBase58() } : idl;
|
|
29
|
+
return new anchor_1.Program(effectiveIdl, provider);
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=program.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":";;;AAoBA,kDAgBC;;AAnCD,8CAA4D;AAC5D,6CAAiE;AAEjE,kFAAqD;AAIrD,MAAM,aAAa,GAAG,iBAAO,CAAC,QAAQ,EAAE,CAAC;AAC5B,QAAA,WAAW,GAAgC;IACtD,SAAS,EAAE,aAAa,CAAC,SAAS;IAClC,mBAAmB,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG;IACvC,eAAe,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE;IACjC,KAAK,EAAE,aAAa;CACrB,CAAC;AAEF;;;GAGG;AACH,SAAgB,mBAAmB,CACjC,UAAsB,EACtB,SAAqB;IAErB,MAAM,GAAG,GAAG,wBAAiC,CAAC;IAC9C,MAAM,QAAQ,GAAG,IAAI,uBAAc,CAAC,UAAU,EAAE,mBAAW,EAAE;QAC3D,UAAU,EAAE,WAAW;KACxB,CAAC,CAAC;IAEH,MAAM,SAAS,GACb,OAAO,CAAC,GAAG,CAAC,gCAAgC,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC;IACnF,MAAM,WAAW,GAAG,SAAS,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,mBAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAEpF,oFAAoF;IACpF,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,OAAO,EAAE,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IACrF,OAAO,IAAI,gBAAO,CAAe,YAAY,EAAE,QAAQ,CAAC,CAAC;AAC3D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@star-factory/sdk-launchpad",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "TypeScript SDK for Star Launchpad - Token launches with DAO integration",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Star Protocol",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"main": "dist/index.js",
|
|
17
17
|
"types": "dist/index.d.ts",
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "rm -rf dist && tsc -p ./tsconfig.json",
|
|
19
|
+
"build": "rm -rf dist && tsc -p ./tsconfig.json && mkdir -p dist/idl && cp -f src/idl/launchpad.json dist/idl/launchpad.json",
|
|
20
20
|
"prepublishOnly": "yarn build",
|
|
21
21
|
"clean": "rm -rf dist",
|
|
22
22
|
"test": "echo 'No tests yet'"
|