@bordrless/shared 0.3.0 → 0.4.0

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/dist/studio.d.ts CHANGED
@@ -3,9 +3,10 @@
3
3
  *
4
4
  * Studio is where anyone designs a launch config, and optionally a token hook of their own, with an
5
5
  * assistant that knows the Bordrless programs; has it reviewed; pays the rent for Bordrless to build
6
- * and deploy the hook (its upgrade authority then handed to them); makes the config; and may list it
7
- * on the marketplace, where every launch someone else makes from it pays them their share of the
8
- * creator fee (`create_listed_config`, docs/hooks-v2.md §5.7).
6
+ * and deploy the hook (Bordrless keeps its upgrade authority: the creator never holds it); makes the
7
+ * config; and may list it on the marketplace, where every launch someone else makes from it pays
8
+ * them half its creator fee, if it has one (`AUTHOR_SHARE_BPS`, `create_listed_config`,
9
+ * docs/hooks-v2.md §5.7). That half is all a creator gets from listing.
9
10
  *
10
11
  * A Studio hook is written against one template (`STUDIO_TEMPLATE`): an Anchor program with a fixed
11
12
  * `Cargo.toml` and the standard `prepare` (`STUDIO_PREPARE`), so the site can prepare any Studio hook
@@ -39,7 +40,10 @@ export interface StudioConfigDraft {
39
40
  hookFlags: number;
40
41
  /** List it on the marketplace (made with `create_listed_config`). */
41
42
  listed: boolean;
42
- /** The author's share of the creator fee on others' launches, bps of it: 1 to `MAX_AUTHOR_SHARE_BPS`. */
43
+ /**
44
+ * The author's share of the creator fee on others' launches, bps of it. Not the author's to choose:
45
+ * the backend holds it at `AUTHOR_SHARE_BPS` when listed and 0 when not, whatever is sent.
46
+ */
43
47
  authorShareBps: number;
44
48
  }
45
49
  /** Where a project stands, in the order the Studio walks it. */
@@ -207,12 +211,16 @@ export interface StudioDeployQuote {
207
211
  /** The quote holds until then (unix seconds). */
208
212
  expiresAt: number;
209
213
  }
214
+ /**
215
+ * The upgrade authority is not part of the request: Bordrless keeps it on every hook Studio deploys
216
+ * (`StudioDeploy.upgradeAuthority`). The creator never holds it, and Studio never makes a program
217
+ * final. The backend ignores an `authority` an older site still sends.
218
+ */
210
219
  export interface StudioDeployRequest {
211
220
  /** The confirmed payment transaction. */
212
221
  paymentSignature: string;
213
- /** Hand the upgrade authority to the owner (default), or make the program final. */
214
- authority: 'owner' | 'final';
215
222
  }
223
+ /** `handing_over`: the program is deployed and its upgrade authority goes from Studio's deployer to Bordrless's upgrade key. */
216
224
  export type StudioDeployState = 'awaiting_payment' | 'paid' | 'writing' | 'deploying' | 'handing_over' | 'deployed' | 'failed' | 'refunded';
217
225
  export interface StudioDeploy {
218
226
  state: StudioDeployState;
@@ -224,7 +232,11 @@ export interface StudioDeploy {
224
232
  written: number;
225
233
  bytes: number;
226
234
  deploySignature: string | null;
227
- /** Who can upgrade it now: the owner, or null once final. */
235
+ /**
236
+ * Who holds its upgrade authority once deployed: Bordrless's upgrade key (the backend's
237
+ * STUDIO_UPGRADE_AUTHORITY, `STUDIO_UPGRADE_AUTHORITY` above by default), never the creator; null until
238
+ * the deploy finishes.
239
+ */
228
240
  upgradeAuthority: Address | null;
229
241
  error: string | null;
230
242
  refundSignature: string | null;
@@ -305,10 +317,24 @@ export interface AuthorEarnings {
305
317
  claimable: string;
306
318
  paid: string;
307
319
  }
308
- /** `bordrless_launch::constants::MAX_AUTHOR_SHARE_BPS`: half the creator fee. */
320
+ /** Bordrless Studio's upgrade key: the upgrade authority of every hook Studio deploys (STUDIO_UPGRADE_AUTHORITY defaults to it). */
321
+ export declare const STUDIO_UPGRADE_AUTHORITY = "CS1NRyXNCPxEUP4CRoa26cHQSeSJCxXh5SPijwFhDW6W";
322
+ /** The protocol's own upgrade authority (Half-Life, tax_hook). */
323
+ export declare const PROTOCOL_UPGRADE_AUTHORITY = "5xsibKwtiN6ruxsYrEyWVpV3KcwuzSPbQd1n28a7spEd";
324
+ /**
325
+ * `bordrless_launch::constants::HOOK_UPGRADE_AUTHORITIES`: besides no one at all, the only keys that
326
+ * may hold a custom hook's upgrade authority for `create_config` to accept it (docs/hooks-v2.md §5.8).
327
+ */
328
+ export declare const HOOK_UPGRADE_AUTHORITIES: readonly string[];
329
+ /** `bordrless_launch::constants::MAX_AUTHOR_SHARE_BPS`: half the creator fee, the most the program lets a listed config pay its author. */
309
330
  export declare const MAX_AUTHOR_SHARE_BPS = 5000;
310
- /** The share the Studio suggests. */
311
- export declare const DEFAULT_AUTHOR_SHARE_BPS = 2000;
331
+ /**
332
+ * The only share Studio lists with: a listed config's author gets half the creator fee of every
333
+ * launch someone else makes from it (nothing when the config has no creator fee). It is not the
334
+ * author's to choose. A config listed straight through the SDK may carry less, so the marketplace
335
+ * always shows the share that is on chain.
336
+ */
337
+ export declare const AUTHOR_SHARE_BPS = 5000;
312
338
  /**
313
339
  * The standard `prepare` of a Studio hook: `prepare()` (no arguments) with the accounts
314
340
  * `[payer (signer, writable), mint, state = PDA(["state", mint], hook) (writable), registry =
package/dist/studio.js CHANGED
@@ -5,10 +5,24 @@ export function studioSignInMessage(wallet, nonce, issuedAt) {
5
5
  /** The header the session token travels in, browser → site proxy → backend. */
6
6
  export const STUDIO_SESSION_HEADER = 'x-studio-session';
7
7
  // ---- constants ----------------------------------------------------------------------------------------
8
- /** `bordrless_launch::constants::MAX_AUTHOR_SHARE_BPS`: half the creator fee. */
8
+ /** Bordrless Studio's upgrade key: the upgrade authority of every hook Studio deploys (STUDIO_UPGRADE_AUTHORITY defaults to it). */
9
+ export const STUDIO_UPGRADE_AUTHORITY = 'CS1NRyXNCPxEUP4CRoa26cHQSeSJCxXh5SPijwFhDW6W';
10
+ /** The protocol's own upgrade authority (Half-Life, tax_hook). */
11
+ export const PROTOCOL_UPGRADE_AUTHORITY = '5xsibKwtiN6ruxsYrEyWVpV3KcwuzSPbQd1n28a7spEd';
12
+ /**
13
+ * `bordrless_launch::constants::HOOK_UPGRADE_AUTHORITIES`: besides no one at all, the only keys that
14
+ * may hold a custom hook's upgrade authority for `create_config` to accept it (docs/hooks-v2.md §5.8).
15
+ */
16
+ export const HOOK_UPGRADE_AUTHORITIES = [STUDIO_UPGRADE_AUTHORITY, PROTOCOL_UPGRADE_AUTHORITY];
17
+ /** `bordrless_launch::constants::MAX_AUTHOR_SHARE_BPS`: half the creator fee, the most the program lets a listed config pay its author. */
9
18
  export const MAX_AUTHOR_SHARE_BPS = 5_000;
10
- /** The share the Studio suggests. */
11
- export const DEFAULT_AUTHOR_SHARE_BPS = 2_000;
19
+ /**
20
+ * The only share Studio lists with: a listed config's author gets half the creator fee of every
21
+ * launch someone else makes from it (nothing when the config has no creator fee). It is not the
22
+ * author's to choose. A config listed straight through the SDK may carry less, so the marketplace
23
+ * always shows the share that is on chain.
24
+ */
25
+ export const AUTHOR_SHARE_BPS = 5_000;
12
26
  /**
13
27
  * The standard `prepare` of a Studio hook: `prepare()` (no arguments) with the accounts
14
28
  * `[payer (signer, writable), mint, state = PDA(["state", mint], hook) (writable), registry =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bordrless/shared",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "Bordrless policy (the same math as crates/bordrless-core), program addresses and the API types shared by the server and the site. No Solana dependencies.",
6
6
  "license": "Apache-2.0",