@telaro/sacp 1.0.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.
Files changed (75) hide show
  1. package/INTEGRATION.md +238 -0
  2. package/README.md +253 -0
  3. package/dist/codec.d.ts +35 -0
  4. package/dist/codec.d.ts.map +1 -0
  5. package/dist/codec.js +63 -0
  6. package/dist/codec.js.map +1 -0
  7. package/dist/constants.d.ts +50 -0
  8. package/dist/constants.d.ts.map +1 -0
  9. package/dist/constants.js +50 -0
  10. package/dist/constants.js.map +1 -0
  11. package/dist/dispatcher.d.ts +87 -0
  12. package/dist/dispatcher.d.ts.map +1 -0
  13. package/dist/dispatcher.js +175 -0
  14. package/dist/dispatcher.js.map +1 -0
  15. package/dist/events.d.ts +93 -0
  16. package/dist/events.d.ts.map +1 -0
  17. package/dist/events.js +142 -0
  18. package/dist/events.js.map +1 -0
  19. package/dist/index.d.ts +38 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +39 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/job.d.ts +99 -0
  24. package/dist/job.d.ts.map +1 -0
  25. package/dist/job.js +297 -0
  26. package/dist/job.js.map +1 -0
  27. package/dist/lst.d.ts +52 -0
  28. package/dist/lst.d.ts.map +1 -0
  29. package/dist/lst.js +58 -0
  30. package/dist/lst.js.map +1 -0
  31. package/dist/negotiation.d.ts +66 -0
  32. package/dist/negotiation.d.ts.map +1 -0
  33. package/dist/negotiation.js +184 -0
  34. package/dist/negotiation.js.map +1 -0
  35. package/dist/offering.d.ts +65 -0
  36. package/dist/offering.d.ts.map +1 -0
  37. package/dist/offering.js +190 -0
  38. package/dist/offering.js.map +1 -0
  39. package/dist/pdas.d.ts +44 -0
  40. package/dist/pdas.d.ts.map +1 -0
  41. package/dist/pdas.js +95 -0
  42. package/dist/pdas.js.map +1 -0
  43. package/dist/runtime.d.ts +244 -0
  44. package/dist/runtime.d.ts.map +1 -0
  45. package/dist/runtime.js +481 -0
  46. package/dist/runtime.js.map +1 -0
  47. package/dist/signer.d.ts +107 -0
  48. package/dist/signer.d.ts.map +1 -0
  49. package/dist/signer.js +94 -0
  50. package/dist/signer.js.map +1 -0
  51. package/dist/take_rate.d.ts +44 -0
  52. package/dist/take_rate.d.ts.map +1 -0
  53. package/dist/take_rate.js +141 -0
  54. package/dist/take_rate.js.map +1 -0
  55. package/dist/timeout.d.ts +35 -0
  56. package/dist/timeout.d.ts.map +1 -0
  57. package/dist/timeout.js +113 -0
  58. package/dist/timeout.js.map +1 -0
  59. package/dist/types.d.ts +39 -0
  60. package/dist/types.d.ts.map +1 -0
  61. package/dist/types.js +13 -0
  62. package/dist/types.js.map +1 -0
  63. package/dist/validation.d.ts +133 -0
  64. package/dist/validation.d.ts.map +1 -0
  65. package/dist/validation.js +315 -0
  66. package/dist/validation.js.map +1 -0
  67. package/dist/watcher.d.ts +67 -0
  68. package/dist/watcher.d.ts.map +1 -0
  69. package/dist/watcher.js +176 -0
  70. package/dist/watcher.js.map +1 -0
  71. package/dist/wormhole.d.ts +88 -0
  72. package/dist/wormhole.d.ts.map +1 -0
  73. package/dist/wormhole.js +152 -0
  74. package/dist/wormhole.js.map +1 -0
  75. package/package.json +138 -0
@@ -0,0 +1,244 @@
1
+ import { Connection, PublicKey } from "@solana/web3.js";
2
+ import { type FetchedJob, type FetchedVerdict } from "./job.js";
3
+ import { listOfferings, type FetchedOffering, type RegisterOfferingParams, type UpdateOfferingParams } from "./offering.js";
4
+ import { type FetchedNegotiation } from "./negotiation.js";
5
+ import { type FetchedSacpConfig } from "./take_rate.js";
6
+ import type { VerdictWinner } from "./types.js";
7
+ import type { SacpSigner } from "./signer.js";
8
+ /**
9
+ * v0.8 — high-level runtime layer.
10
+ *
11
+ * Wraps the low-level instruction builders in an `SacpClient` +
12
+ * `JobSession` pair so the typical consumer writes intent ("this
13
+ * client is accepting the work") rather than account derivations,
14
+ * Treasury ATA bootstraps, and explicit `sendAndConfirmTransaction`
15
+ * boilerplate.
16
+ *
17
+ * Low-level builders stay exported. The runtime is purely additive.
18
+ */
19
+ /** Per-role keys for a Job that the client needs to drive end-to-end. */
20
+ export interface JobActors {
21
+ client: SacpSigner;
22
+ provider?: SacpSigner;
23
+ /** Evaluator signer is optional — only needed when this runtime
24
+ * instance plays the evaluator role. */
25
+ evaluator?: SacpSigner;
26
+ }
27
+ /** Cached on-chain state for a Job + derived ATAs the runtime needs. */
28
+ export interface JobSnapshot {
29
+ job: FetchedJob;
30
+ config: FetchedSacpConfig;
31
+ clientAta: PublicKey;
32
+ providerAta: PublicKey;
33
+ evaluatorAta: PublicKey;
34
+ treasuryAta: PublicKey;
35
+ }
36
+ /** What a given role can do right now, given the Job's state. */
37
+ export type JobAction = "fund" | "submit_work" | "accept" | "dispute" | "submit_verdict" | "reclaim" | "record_verdict" | "publish_settlement";
38
+ export interface SacpClientConfig {
39
+ connection: Connection;
40
+ /**
41
+ * Optional fee payer for any helper that pre-creates an ATA on
42
+ * behalf of a role (e.g. ensuring the Treasury ATA before settle).
43
+ * Falls back to whichever signer drives the relevant action.
44
+ */
45
+ payer?: SacpSigner;
46
+ }
47
+ /**
48
+ * Top-level entry point. One instance per RPC connection; spin up new
49
+ * `JobSession`s for each Job you create or attach to.
50
+ */
51
+ export declare class SacpClient {
52
+ readonly connection: Connection;
53
+ readonly payer: SacpSigner | undefined;
54
+ constructor(config: SacpClientConfig);
55
+ /**
56
+ * Create a new Job and return a session you can drive through its
57
+ * lifecycle. Combines `create_job` + the first `fund_job` into the
58
+ * caller's hands — the session begins in the `Open` state, and the
59
+ * client funds it via `session.fund()`.
60
+ */
61
+ createJob(params: {
62
+ jobId: bigint;
63
+ actors: JobActors;
64
+ bondMint: PublicKey;
65
+ amount: bigint;
66
+ workUri: string;
67
+ submitWindowSecs?: bigint;
68
+ }): Promise<JobSession>;
69
+ /**
70
+ * Attach to an existing Job. Use this on the provider/evaluator side
71
+ * after they receive a Job ID off-band (webhook, queue, watcher).
72
+ */
73
+ openJob(args: {
74
+ jobId: bigint;
75
+ actors: JobActors;
76
+ bondMint?: PublicKey;
77
+ }): Promise<JobSession>;
78
+ /** v0.9 — Offering registry namespace. Provider operations
79
+ * (register / update / close) plus buyer-side discovery (browse /
80
+ * createJobFromOffering). */
81
+ get offering(): OfferingNamespace;
82
+ /** v1.0 Phase 8 — Negotiation namespace. propose / counter /
83
+ * accept / materialize / cancel + session helper. */
84
+ get negotiation(): NegotiationNamespace;
85
+ /**
86
+ * Ensure the protocol Treasury ATA exists for `bondMint`. Idempotent.
87
+ * Pre-v0.6 there was nothing to do; v0.6+ every settlement reads
88
+ * this account, so call once per mint before the first settle.
89
+ *
90
+ * Works with any `SacpSigner` (`LocalSigner`, `RemoteSigner`,
91
+ * `WalletAdapterSigner`) — builds the create-ATA instruction and
92
+ * delegates the send to the signer. Skips the network call entirely
93
+ * when the ATA already exists.
94
+ */
95
+ ensureTreasuryAta(bondMint: PublicKey, payer?: SacpSigner): Promise<PublicKey>;
96
+ }
97
+ /**
98
+ * Stateful handle to one Job. Tracks role keys, derived ATAs, and
99
+ * fetches the current on-chain state on demand. Each lifecycle action
100
+ * (fund, submitWork, accept, dispute, submitVerdict, reclaim) is a
101
+ * single SDK call.
102
+ */
103
+ export declare class JobSession {
104
+ readonly client: SacpClient;
105
+ readonly jobId: bigint;
106
+ readonly bondMint: PublicKey;
107
+ readonly actors: JobActors;
108
+ readonly clientAta: PublicKey;
109
+ readonly providerAta: PublicKey;
110
+ readonly evaluatorAta: PublicKey;
111
+ readonly treasuryAta: PublicKey;
112
+ private cached;
113
+ private constructor();
114
+ static attach(client: SacpClient, args: {
115
+ jobId: bigint;
116
+ actors: JobActors;
117
+ bondMint: PublicKey;
118
+ }): JobSession;
119
+ /** Force-refresh the on-chain Job state + Config (take rate may
120
+ * have shifted between settlement calls). */
121
+ refresh(): Promise<JobSnapshot>;
122
+ /** Most recently fetched Job snapshot, or `null` if `refresh()`
123
+ * hasn't been called yet. */
124
+ get snapshot(): JobSnapshot | null;
125
+ /**
126
+ * What this session's actors can do right now. Returns one entry
127
+ * per (role, action) pair so a UI can drive the right button per
128
+ * connected wallet.
129
+ */
130
+ availableActions(): Promise<Array<{
131
+ role: "client" | "provider" | "evaluator" | "anyone";
132
+ action: JobAction;
133
+ }>>;
134
+ fund(amount?: bigint): Promise<string>;
135
+ submitWork(submissionUri: string): Promise<string>;
136
+ accept(): Promise<string>;
137
+ dispute(reasonHash: Uint8Array): Promise<string>;
138
+ submitVerdict(winner: VerdictWinner, options?: {
139
+ evidenceUri?: string;
140
+ }): Promise<string>;
141
+ reclaim(): Promise<string>;
142
+ fetchVerdict(): Promise<FetchedVerdict | null>;
143
+ }
144
+ /**
145
+ * v0.9 — Offering helpers grouped behind `sacp.offering.*`. Each
146
+ * method is a one-shot thin wrapper around the low-level builders so
147
+ * providers register a catalog entry, browse / discover other
148
+ * providers, and buyers turn an Offering into a `JobSession` in a
149
+ * single call.
150
+ */
151
+ export declare class OfferingNamespace {
152
+ private readonly client;
153
+ constructor(client: SacpClient);
154
+ /** Register a new Offering as the provider. Returns the offering
155
+ * PDA + the signed tx signature. */
156
+ register(provider: SacpSigner, params: Omit<RegisterOfferingParams, "provider">): Promise<{
157
+ pda: PublicKey;
158
+ signature: string;
159
+ }>;
160
+ update(provider: SacpSigner, params: Omit<UpdateOfferingParams, "provider">): Promise<string>;
161
+ close(provider: SacpSigner, slotId: number): Promise<string>;
162
+ fetch(provider: PublicKey, slotId: number): Promise<FetchedOffering | null>;
163
+ browse(filter?: Parameters<typeof listOfferings>[1]): Promise<FetchedOffering[]>;
164
+ /**
165
+ * Turn an Offering into a Job in one call. Pulls bond_mint and
166
+ * default_evaluator from the Offering, lets the buyer override the
167
+ * evaluator and supply work_uri + amount. Validates amount falls
168
+ * within the Offering's min/max band.
169
+ *
170
+ * The returned `JobSession` is already in the `Open` state — call
171
+ * `.fund()` immediately to lock the escrow.
172
+ */
173
+ createJobFrom(offering: FetchedOffering, args: {
174
+ jobId: bigint;
175
+ client: SacpSigner;
176
+ provider: SacpSigner;
177
+ /** Override the Offering's default evaluator. The override
178
+ * needs to be a real signer (the runtime stubs the rest). */
179
+ evaluator: SacpSigner;
180
+ amount: bigint;
181
+ workUri: string;
182
+ submitWindowSecs?: bigint;
183
+ }): Promise<JobSession>;
184
+ }
185
+ /**
186
+ * v1.0 Phase 8 — Negotiation namespace + NegotiationSession.
187
+ *
188
+ * `sacp.negotiation.propose(...)` opens a Negotiation. The returned
189
+ * session exposes counter / accept / cancel / materialize, plus
190
+ * `availableActions()` so a UI knows whose turn it is.
191
+ */
192
+ export declare class NegotiationNamespace {
193
+ private readonly client;
194
+ constructor(client: SacpClient);
195
+ propose(buyer: SacpSigner, args: {
196
+ provider: PublicKey;
197
+ evaluator: PublicKey;
198
+ bondMint: PublicKey;
199
+ negotiationId: bigint;
200
+ amount: bigint;
201
+ workUri: string;
202
+ submitWindowSecs: bigint;
203
+ }): Promise<NegotiationSession>;
204
+ attach(args: {
205
+ buyer: PublicKey;
206
+ negotiationId: bigint;
207
+ }): NegotiationSession;
208
+ fetch(buyer: PublicKey, negotiationId: bigint): Promise<FetchedNegotiation | null>;
209
+ }
210
+ export interface NegotiationSessionAction {
211
+ role: "buyer" | "provider";
212
+ action: "counter" | "accept" | "cancel" | "materialize";
213
+ }
214
+ export declare class NegotiationSession {
215
+ readonly client: SacpClient;
216
+ readonly buyer: PublicKey;
217
+ readonly negotiationId: bigint;
218
+ constructor(args: {
219
+ client: SacpClient;
220
+ buyer: PublicKey;
221
+ negotiationId: bigint;
222
+ });
223
+ refresh(): Promise<FetchedNegotiation>;
224
+ counter(signer: SacpSigner, terms: {
225
+ amount: bigint;
226
+ workUri: string;
227
+ submitWindowSecs: bigint;
228
+ }): Promise<string>;
229
+ accept(signer: SacpSigner): Promise<string>;
230
+ cancel(signer: SacpSigner): Promise<string>;
231
+ /**
232
+ * Buyer-only. After the negotiation is Accepted, mint the Job +
233
+ * escrow vault. Returns the created jobId so callers can attach a
234
+ * `JobSession` immediately.
235
+ */
236
+ materialize(buyer: SacpSigner, args: {
237
+ jobId: bigint;
238
+ bondMint: PublicKey;
239
+ }): Promise<bigint>;
240
+ /** Returns which side(s) can act, given the current state + last
241
+ * proposer. UIs use this to enable / disable buttons. */
242
+ availableActions(): Promise<NegotiationSessionAction[]>;
243
+ }
244
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACV,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EAWL,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EAKL,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAOL,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAY,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;;;;GAUG;AAEH,yEAAyE;AACzE,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB;4CACwC;IACxC,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB;AAED,wEAAwE;AACxE,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,UAAU,CAAC;IAChB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,SAAS,CAAC;IACvB,YAAY,EAAE,SAAS,CAAC;IACxB,WAAW,EAAE,SAAS,CAAC;CACxB;AAED,iEAAiE;AACjE,MAAM,MAAM,SAAS,GACjB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