@misofm/sdk 0.1.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/LICENSE +201 -0
- package/README.md +248 -0
- package/dist/catalog.d.ts +31 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +45 -0
- package/dist/catalog.js.map +1 -0
- package/dist/client.d.ts +134 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +113 -0
- package/dist/client.js.map +1 -0
- package/dist/contracts/miso_pressing/certificate.d.ts +78 -0
- package/dist/contracts/miso_pressing/certificate.d.ts.map +1 -0
- package/dist/contracts/miso_pressing/certificate.js +91 -0
- package/dist/contracts/miso_pressing/certificate.js.map +1 -0
- package/dist/contracts/miso_pressing/deps/std/type_name.d.ts +18 -0
- package/dist/contracts/miso_pressing/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/miso_pressing/deps/std/type_name.js +20 -0
- package/dist/contracts/miso_pressing/deps/std/type_name.js.map +1 -0
- package/dist/contracts/miso_pressing/listing.d.ts +449 -0
- package/dist/contracts/miso_pressing/listing.d.ts.map +1 -0
- package/dist/contracts/miso_pressing/listing.js +416 -0
- package/dist/contracts/miso_pressing/listing.js.map +1 -0
- package/dist/contracts/miso_pressing/pressing.d.ts +365 -0
- package/dist/contracts/miso_pressing/pressing.d.ts.map +1 -0
- package/dist/contracts/miso_pressing/pressing.js +335 -0
- package/dist/contracts/miso_pressing/pressing.js.map +1 -0
- package/dist/contracts/utils/index.d.ts +31 -0
- package/dist/contracts/utils/index.d.ts.map +1 -0
- package/dist/contracts/utils/index.js +162 -0
- package/dist/contracts/utils/index.js.map +1 -0
- package/dist/execute.d.ts +17 -0
- package/dist/execute.d.ts.map +1 -0
- package/dist/execute.js +21 -0
- package/dist/execute.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/pressing.d.ts +223 -0
- package/dist/pressing.d.ts.map +1 -0
- package/dist/pressing.js +280 -0
- package/dist/pressing.js.map +1 -0
- package/dist/queries.d.ts +2 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +8 -0
- package/dist/queries.js.map +1 -0
- package/dist/release-graph.d.ts +93 -0
- package/dist/release-graph.d.ts.map +1 -0
- package/dist/release-graph.js +143 -0
- package/dist/release-graph.js.map +1 -0
- package/dist/share-template.d.ts +3 -0
- package/dist/share-template.d.ts.map +1 -0
- package/dist/share-template.js +46 -0
- package/dist/share-template.js.map +1 -0
- package/dist/share.d.ts +66 -0
- package/dist/share.d.ts.map +1 -0
- package/dist/share.js +156 -0
- package/dist/share.js.map +1 -0
- package/dist/transactions.d.ts +177 -0
- package/dist/transactions.d.ts.map +1 -0
- package/dist/transactions.js +237 -0
- package/dist/transactions.js.map +1 -0
- package/package.json +99 -0
- package/src/catalog.ts +77 -0
- package/src/client.ts +249 -0
- package/src/contracts/miso_pressing/certificate.ts +129 -0
- package/src/contracts/miso_pressing/deps/std/type_name.ts +22 -0
- package/src/contracts/miso_pressing/listing.ts +621 -0
- package/src/contracts/miso_pressing/pressing.ts +454 -0
- package/src/contracts/utils/index.ts +229 -0
- package/src/execute.ts +34 -0
- package/src/index.ts +29 -0
- package/src/pressing.ts +497 -0
- package/src/queries.ts +9 -0
- package/src/release-graph.ts +279 -0
- package/src/share-template.ts +55 -0
- package/src/share.ts +258 -0
- package/src/transactions.ts +440 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* A release's record production — its _Pressing_.
|
|
6
|
+
*
|
|
7
|
+
* A release has exactly one pressing, and the pressing is one uncapped run of
|
|
8
|
+
* records: every copy ever made draws its number from this single counter,
|
|
9
|
+
* forever. There are no editions, no supply caps, and no sold-out state — scarcity
|
|
10
|
+
* on Miso is what a record _accrues_ (playtime above all), not how few of it were
|
|
11
|
+
* printed. The pressing owns two things and only two things: the **run** the
|
|
12
|
+
* records number against, and the **switch** that stops it.
|
|
13
|
+
*
|
|
14
|
+
* ```text
|
|
15
|
+
* Release
|
|
16
|
+
* └─ Pressing the run, and when it sells at all PressingKey()
|
|
17
|
+
* ├─ PressingAdminCap authority over price and state PressingAdminCapKey()
|
|
18
|
+
* ├─ Listing<SUI> what it costs in one currency ListingKey<SUI>()
|
|
19
|
+
* └─ Listing<USDC>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* # Everything is address math
|
|
23
|
+
*
|
|
24
|
+
* A pressing's UID is derived off its release's UID at a singleton key, its admin
|
|
25
|
+
* cap's and each listing's off the pressing's, and records off the pressing's at
|
|
26
|
+
* their number. So every object in the tree is reachable from the release id
|
|
27
|
+
* alone, by pure computation — no registry, no pointer that has to be maintained,
|
|
28
|
+
* and no stored set of listings: a listing either exists at its derived address or
|
|
29
|
+
* it does not (`listing::has_listing`), and `ListingOpenedEvent<Currency>`
|
|
30
|
+
* enumerates them for an indexer. It also makes the number sequence gap-free for
|
|
31
|
+
* free, and every record verifiable against its pressing from chain state alone
|
|
32
|
+
* (`verify_record`).
|
|
33
|
+
*
|
|
34
|
+
* # Starting and stopping is state, never teardown
|
|
35
|
+
*
|
|
36
|
+
* Nothing here is ever destroyed, sealed, or wound down — deleting a pressing
|
|
37
|
+
* would strand its whole derived subtree, so there is no destructor at all. The
|
|
38
|
+
* run's lifecycle is `Scheduled → Active → Paused → Active`: it opens itself at
|
|
39
|
+
* its drop moment (no artist transaction, and nobody can buy early), and after
|
|
40
|
+
* that the artist stops and starts it at will. The first transition is real, not
|
|
41
|
+
* computed — the first sale past the start rewrites `Scheduled` to `Active` inside
|
|
42
|
+
* `mint_next`, which is why `Scheduled` only ever describes a run still waiting.
|
|
43
|
+
* Below it, each listing's `Enabled | Disabled` governs one currency. A run that
|
|
44
|
+
* is paused or not yet open sells in no currency, whatever the listings say.
|
|
45
|
+
*
|
|
46
|
+
* There is no end state and no expiry: an uncapped, permanent run has nothing to
|
|
47
|
+
* count down to, and a time-limited sale is scarcity theater this design rejects.
|
|
48
|
+
* An artist ending a campaign pauses it.
|
|
49
|
+
*
|
|
50
|
+
* # Authority
|
|
51
|
+
*
|
|
52
|
+
* Opening a pressing needs the release's `ReleaseAdminCap`, enforced by the
|
|
53
|
+
* protocol's `release::uid_mut`, and hands back a `PressingAdminCap`. Everything
|
|
54
|
+
* after that — pricing, pausing, opening listings — authorizes against the
|
|
55
|
+
* pressing cap alone.
|
|
56
|
+
*
|
|
57
|
+
* The split is deliberate and it is about money, not tidiness. `ReleaseAdminCap`
|
|
58
|
+
* yields `release::uid_mut`, and `balance::withdraw_funds_from_object` is gated on
|
|
59
|
+
* `&mut UID` alone — so the release cap can withdraw the sales revenue that `buy`
|
|
60
|
+
* forwards to the release's address. Under one cap, "may reprice a listing" and
|
|
61
|
+
* "may take the money" would be the same grant. The pressing cap is the routine
|
|
62
|
+
* one, safe to delegate to whoever runs the shop; the release cap stays with the
|
|
63
|
+
* rightsholder.
|
|
64
|
+
*/
|
|
65
|
+
import { MoveTuple, MoveStruct, MoveEnum, normalizeMoveArguments } from '../utils/index.js';
|
|
66
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
67
|
+
import {} from '@mysten/sui/transactions';
|
|
68
|
+
const $moduleName = '@local-pkg/miso_pressing::pressing';
|
|
69
|
+
export const PressingKey = new MoveTuple({ name: `${$moduleName}::PressingKey`, fields: [bcs.bool()] });
|
|
70
|
+
export const PressingAdminCapKey = new MoveTuple({ name: `${$moduleName}::PressingAdminCapKey`, fields: [bcs.bool()] });
|
|
71
|
+
export const MintWitness = new MoveStruct({ name: `${$moduleName}::MintWitness`, fields: {
|
|
72
|
+
dummy_field: bcs.bool()
|
|
73
|
+
} });
|
|
74
|
+
/**
|
|
75
|
+
* Whether the run sells, over every currency at once. The lifecycle runs
|
|
76
|
+
* `Scheduled → Active → Paused → Active`: a pressing opens itself at its drop
|
|
77
|
+
* moment, then the artist stops and starts it at will.
|
|
78
|
+
*/
|
|
79
|
+
export const PressingState = new MoveEnum({ name: `${$moduleName}::PressingState`, fields: {
|
|
80
|
+
/**
|
|
81
|
+
* Opens the moment the clock passes `start_timestamp_ms` (Unix ms), with no
|
|
82
|
+
* further action from anyone. A start already in the past sells now.
|
|
83
|
+
*
|
|
84
|
+
* This is a _transitional_ state: the first sale past the start rewrites it to
|
|
85
|
+
* `Active` (in `mint_next`, before any sales logic), so a run reads `Scheduled`
|
|
86
|
+
* only while it is still waiting. Between the start and that first sale the run
|
|
87
|
+
* already sells — `is_selling` answers against the clock — so nobody has to go
|
|
88
|
+
* first for the drop to be open.
|
|
89
|
+
*
|
|
90
|
+
* Consequence worth knowing: once the transition fires the start time is gone from
|
|
91
|
+
* the object. `PressingOpenedEvent` and `PressingStateChangedEvent` carry it, so
|
|
92
|
+
* "when was this run scheduled for" is an event-log question, not an object read.
|
|
93
|
+
*/
|
|
94
|
+
Scheduled: new MoveStruct({ name: `PressingState.Scheduled`, fields: {
|
|
95
|
+
start_timestamp_ms: bcs.u64()
|
|
96
|
+
} }),
|
|
97
|
+
/** Selling, subject to each listing's own state. */
|
|
98
|
+
Active: null,
|
|
99
|
+
/** Selling in no currency, whatever the listings say. */
|
|
100
|
+
Paused: null
|
|
101
|
+
} });
|
|
102
|
+
export const Pressing = new MoveStruct({ name: `${$moduleName}::Pressing`, fields: {
|
|
103
|
+
id: bcs.Address,
|
|
104
|
+
/** The release these records are copies of. */
|
|
105
|
+
release_id: bcs.Address,
|
|
106
|
+
/** Whether the run sells at all, in any currency. */
|
|
107
|
+
state: PressingState,
|
|
108
|
+
/**
|
|
109
|
+
* Records pressed so far; also the most recent number. Read on every mint — this
|
|
110
|
+
* is the sequence itself, not a statistic.
|
|
111
|
+
*/
|
|
112
|
+
supply: bcs.u64()
|
|
113
|
+
} });
|
|
114
|
+
export const PressingAdminCap = new MoveStruct({ name: `${$moduleName}::PressingAdminCap`, fields: {
|
|
115
|
+
id: bcs.Address,
|
|
116
|
+
/** The pressing this cap controls. Every mutator asserts against it. */
|
|
117
|
+
pressing_id: bcs.Address
|
|
118
|
+
} });
|
|
119
|
+
export const PressingOpenedEvent = new MoveStruct({ name: `${$moduleName}::PressingOpenedEvent`, fields: {
|
|
120
|
+
pressing_id: bcs.Address,
|
|
121
|
+
release_id: bcs.Address,
|
|
122
|
+
state: PressingState
|
|
123
|
+
} });
|
|
124
|
+
export const PressingStateChangedEvent = new MoveStruct({ name: `${$moduleName}::PressingStateChangedEvent`, fields: {
|
|
125
|
+
pressing_id: bcs.Address,
|
|
126
|
+
state: PressingState
|
|
127
|
+
} });
|
|
128
|
+
/** The scheduled state: the run opens itself at `start_timestamp_ms` (Unix ms). */
|
|
129
|
+
export function newScheduledState(options) {
|
|
130
|
+
const packageAddress = options.package ?? '@local-pkg/miso_pressing';
|
|
131
|
+
const argumentsTypes = [
|
|
132
|
+
'u64'
|
|
133
|
+
];
|
|
134
|
+
const parameterNames = ["startTimestampMs"];
|
|
135
|
+
return (tx) => tx.moveCall({
|
|
136
|
+
package: packageAddress,
|
|
137
|
+
module: 'pressing',
|
|
138
|
+
function: 'new_scheduled_state',
|
|
139
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/** The active state: the run sells, subject to each listing's own state. */
|
|
143
|
+
export function newActiveState(options = {}) {
|
|
144
|
+
const packageAddress = options.package ?? '@local-pkg/miso_pressing';
|
|
145
|
+
return (tx) => tx.moveCall({
|
|
146
|
+
package: packageAddress,
|
|
147
|
+
module: 'pressing',
|
|
148
|
+
function: 'new_active_state',
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/** The paused state: the run sells in no currency. */
|
|
152
|
+
export function newPausedState(options = {}) {
|
|
153
|
+
const packageAddress = options.package ?? '@local-pkg/miso_pressing';
|
|
154
|
+
return (tx) => tx.moveCall({
|
|
155
|
+
package: packageAddress,
|
|
156
|
+
module: 'pressing',
|
|
157
|
+
function: 'new_paused_state',
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Open a release's pressing in `state` — `Scheduled` for a drop moment, `Active`
|
|
162
|
+
* to sell immediately, `Paused` to set it up quietly. Returns it unshared, so the
|
|
163
|
+
* same transaction can list it (`listing::new`) before `share` puts it on chain,
|
|
164
|
+
* plus the cap that governs it from here on. Neither value has `drop`, so neither
|
|
165
|
+
* can be lost by forgetting.
|
|
166
|
+
*
|
|
167
|
+
* Claim-once on `PressingKey()` means a release's pressing can only ever be opened
|
|
168
|
+
* here, exactly once; calling this twice for the same release aborts.
|
|
169
|
+
*/
|
|
170
|
+
export function _new(options) {
|
|
171
|
+
const packageAddress = options.package ?? '@local-pkg/miso_pressing';
|
|
172
|
+
const argumentsTypes = [
|
|
173
|
+
null,
|
|
174
|
+
null,
|
|
175
|
+
null
|
|
176
|
+
];
|
|
177
|
+
const parameterNames = ["release", "cap", "state"];
|
|
178
|
+
return (tx) => tx.moveCall({
|
|
179
|
+
package: packageAddress,
|
|
180
|
+
module: 'pressing',
|
|
181
|
+
function: 'new',
|
|
182
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Put the pressing on chain. `new` hands back an unshared `Pressing` so the same
|
|
187
|
+
* transaction can list it first; this is the last call in that sequence.
|
|
188
|
+
*/
|
|
189
|
+
export function share(options) {
|
|
190
|
+
const packageAddress = options.package ?? '@local-pkg/miso_pressing';
|
|
191
|
+
const argumentsTypes = [
|
|
192
|
+
null
|
|
193
|
+
];
|
|
194
|
+
const parameterNames = ["self"];
|
|
195
|
+
return (tx) => tx.moveCall({
|
|
196
|
+
package: packageAddress,
|
|
197
|
+
module: 'pressing',
|
|
198
|
+
function: 'share',
|
|
199
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Move the run between its three modes — schedule it, open it, stop it. Takes
|
|
204
|
+
* effect across every currency at once, regardless of any listing's own state.
|
|
205
|
+
*/
|
|
206
|
+
export function setState(options) {
|
|
207
|
+
const packageAddress = options.package ?? '@local-pkg/miso_pressing';
|
|
208
|
+
const argumentsTypes = [
|
|
209
|
+
null,
|
|
210
|
+
null,
|
|
211
|
+
null
|
|
212
|
+
];
|
|
213
|
+
const parameterNames = ["self", "cap", "state"];
|
|
214
|
+
return (tx) => tx.moveCall({
|
|
215
|
+
package: packageAddress,
|
|
216
|
+
module: 'pressing',
|
|
217
|
+
function: 'set_state',
|
|
218
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* The address `release_id`'s pressing occupies — pure address math, computable
|
|
223
|
+
* before the pressing has been opened.
|
|
224
|
+
*/
|
|
225
|
+
export function deriveId(options) {
|
|
226
|
+
const packageAddress = options.package ?? '@local-pkg/miso_pressing';
|
|
227
|
+
const argumentsTypes = [
|
|
228
|
+
'0x2::object::ID'
|
|
229
|
+
];
|
|
230
|
+
const parameterNames = ["releaseId"];
|
|
231
|
+
return (tx) => tx.moveCall({
|
|
232
|
+
package: packageAddress,
|
|
233
|
+
module: 'pressing',
|
|
234
|
+
function: 'derive_id',
|
|
235
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
export function id(options) {
|
|
239
|
+
const packageAddress = options.package ?? '@local-pkg/miso_pressing';
|
|
240
|
+
const argumentsTypes = [
|
|
241
|
+
null
|
|
242
|
+
];
|
|
243
|
+
const parameterNames = ["self"];
|
|
244
|
+
return (tx) => tx.moveCall({
|
|
245
|
+
package: packageAddress,
|
|
246
|
+
module: 'pressing',
|
|
247
|
+
function: 'id',
|
|
248
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
export function releaseId(options) {
|
|
252
|
+
const packageAddress = options.package ?? '@local-pkg/miso_pressing';
|
|
253
|
+
const argumentsTypes = [
|
|
254
|
+
null
|
|
255
|
+
];
|
|
256
|
+
const parameterNames = ["self"];
|
|
257
|
+
return (tx) => tx.moveCall({
|
|
258
|
+
package: packageAddress,
|
|
259
|
+
module: 'pressing',
|
|
260
|
+
function: 'release_id',
|
|
261
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
/** Records pressed so far; also the most recent number. */
|
|
265
|
+
export function supply(options) {
|
|
266
|
+
const packageAddress = options.package ?? '@local-pkg/miso_pressing';
|
|
267
|
+
const argumentsTypes = [
|
|
268
|
+
null
|
|
269
|
+
];
|
|
270
|
+
const parameterNames = ["self"];
|
|
271
|
+
return (tx) => tx.moveCall({
|
|
272
|
+
package: packageAddress,
|
|
273
|
+
module: 'pressing',
|
|
274
|
+
function: 'supply',
|
|
275
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Whether the run sells _right now_ — the question `buy` actually asks.
|
|
280
|
+
* `Scheduled` answers it against the clock, so a run past its start that has not
|
|
281
|
+
* yet had a sale to settle it reads as selling, which it is.
|
|
282
|
+
*/
|
|
283
|
+
export function isSelling(options) {
|
|
284
|
+
const packageAddress = options.package ?? '@local-pkg/miso_pressing';
|
|
285
|
+
const argumentsTypes = [
|
|
286
|
+
null,
|
|
287
|
+
'0x2::clock::Clock'
|
|
288
|
+
];
|
|
289
|
+
const parameterNames = ["self"];
|
|
290
|
+
return (tx) => tx.moveCall({
|
|
291
|
+
package: packageAddress,
|
|
292
|
+
module: 'pressing',
|
|
293
|
+
function: 'is_selling',
|
|
294
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* The pressing this cap controls. Public so a custody layer holding the cap can
|
|
299
|
+
* tell what it governs without the `Pressing` object.
|
|
300
|
+
*/
|
|
301
|
+
export function pressingAdminCapPressingId(options) {
|
|
302
|
+
const packageAddress = options.package ?? '@local-pkg/miso_pressing';
|
|
303
|
+
const argumentsTypes = [
|
|
304
|
+
null
|
|
305
|
+
];
|
|
306
|
+
const parameterNames = ["cap"];
|
|
307
|
+
return (tx) => tx.moveCall({
|
|
308
|
+
package: packageAddress,
|
|
309
|
+
module: 'pressing',
|
|
310
|
+
function: 'pressing_admin_cap_pressing_id',
|
|
311
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Whether `record` is genuinely the copy its certificate claims it is, checked
|
|
316
|
+
* from chain state alone and without needing the `Pressing` object.
|
|
317
|
+
*
|
|
318
|
+
* The record must sit at exactly the address its certificate number derives to off
|
|
319
|
+
* its release's pressing. The certificate is the readable form of what the address
|
|
320
|
+
* already proves.
|
|
321
|
+
*/
|
|
322
|
+
export function verifyRecord(options) {
|
|
323
|
+
const packageAddress = options.package ?? '@local-pkg/miso_pressing';
|
|
324
|
+
const argumentsTypes = [
|
|
325
|
+
null
|
|
326
|
+
];
|
|
327
|
+
const parameterNames = ["record"];
|
|
328
|
+
return (tx) => tx.moveCall({
|
|
329
|
+
package: packageAddress,
|
|
330
|
+
module: 'pressing',
|
|
331
|
+
function: 'verify_record',
|
|
332
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
//# sourceMappingURL=pressing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pressing.js","sourceRoot":"","sources":["../../../src/contracts/mi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E,UAAU;QAClB,QAAQ,EAAE,gCAAgC;QAC1C,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC;AAUD;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,OAA4B;IACrD,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,0BAA0B,CAAC;IACrE,MAAM,cAAc,GAAG;QACnB,IAAI;KACqB,CAAC;IAC9B,MAAM,cAAc,GAAG,CAAC,QAAQ,CAAC,CAAC;IAClC,OAAO,CAAC,EAAe,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,UAAU;QAClB,QAAQ,EAAE,eAAe;QACzB,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type BcsType, type TypeTag, BcsStruct, BcsEnum, BcsTuple } from '@mysten/sui/bcs';
|
|
2
|
+
import { type TransactionArgument } from '@mysten/sui/transactions';
|
|
3
|
+
import { type ClientWithCoreApi, type SuiClientTypes } from '@mysten/sui/client';
|
|
4
|
+
export type RawTransactionArgument<T> = T | TransactionArgument;
|
|
5
|
+
export type GetOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> = SuiClientTypes.GetObjectOptions<Include> & {
|
|
6
|
+
client: ClientWithCoreApi;
|
|
7
|
+
};
|
|
8
|
+
export type GetManyOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> = SuiClientTypes.GetObjectsOptions<Include> & {
|
|
9
|
+
client: ClientWithCoreApi;
|
|
10
|
+
};
|
|
11
|
+
export declare function getPureBcsSchema(typeTag: string | TypeTag): BcsType<any> | null;
|
|
12
|
+
export declare function normalizeMoveArguments(args: unknown[] | object, argTypes: readonly (string | null)[], parameterNames?: string[]): TransactionArgument[];
|
|
13
|
+
export declare class MoveStruct<T extends Record<string, BcsType<any>>, const Name extends string = string> extends BcsStruct<T, Name> {
|
|
14
|
+
get<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({ objectId, ...options }: GetOptions<Include>): Promise<SuiClientTypes.Object<Include & {
|
|
15
|
+
content: true;
|
|
16
|
+
json: true;
|
|
17
|
+
}> & {
|
|
18
|
+
json: BcsStruct<T>['$inferType'];
|
|
19
|
+
}>;
|
|
20
|
+
getMany<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({ client, ...options }: GetManyOptions<Include>): Promise<Array<SuiClientTypes.Object<Include & {
|
|
21
|
+
content: true;
|
|
22
|
+
json: true;
|
|
23
|
+
}> & {
|
|
24
|
+
json: BcsStruct<T>['$inferType'];
|
|
25
|
+
}>>;
|
|
26
|
+
}
|
|
27
|
+
export declare class MoveEnum<T extends Record<string, BcsType<any> | null>, const Name extends string> extends BcsEnum<T, Name> {
|
|
28
|
+
}
|
|
29
|
+
export declare class MoveTuple<const T extends readonly BcsType<any>[], const Name extends string> extends BcsTuple<T, Name> {
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contracts/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,KAAK,OAAO,EACZ,KAAK,OAAO,EAEZ,SAAS,EACT,OAAO,EACP,QAAQ,EACR,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,mBAAmB,EAAc,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKjF,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC;AAEhE,MAAM,MA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ACrG;IAaK,OAAO,CAAC,OAAO,SAAS,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,SAAS,GAAG,MAAM,CAAC,GAAG,EAAE,EAAE,EAC1F,MAAM,EACN,GAAG,OAAO,EACV,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,OAAO,CACnC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,GAAG;QAAE,OAAO,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC,GAAG;QAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAA;KAAE,CAAC,CAC5G;CAoBD;AAED,qBAAa,QAAQ,CACpB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,EAC7C,KAAK,CAAC,IAAI,SAAS,MAAM,CACxB,SAAQ,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC;CAAG;AAE7B,qBAAa,SAAS,CACrB,KAAK,CAAC,CAAC,SAAS,SAAS,OAAO,CAAC,GAAG,CAAC,EAAE,EACvC,KAAK,CAAC,IAAI,SAAS,MAAM,CACxB,SAAQ,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC;CAAG"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { bcs, TypeTagSerializer, BcsStruct, BcsEnum, BcsTuple, } from '@mysten/sui/bcs';
|
|
2
|
+
import { normalizeSuiAddress } from '@mysten/sui/utils';
|
|
3
|
+
import { isArgument } from '@mysten/sui/transactions';
|
|
4
|
+
import {} from '@mysten/sui/client';
|
|
5
|
+
const MOVE_STDLIB_ADDRESS = normalizeSuiAddress('0x1');
|
|
6
|
+
const SUI_FRAMEWORK_ADDRESS = normalizeSuiAddress('0x2');
|
|
7
|
+
export function getPureBcsSchema(typeTag) {
|
|
8
|
+
const parsedTag = typeof typeTag === 'string' ? TypeTagSerializer.parseFromStr(typeTag) : typeTag;
|
|
9
|
+
if ('u8' in parsedTag) {
|
|
10
|
+
return bcs.U8;
|
|
11
|
+
}
|
|
12
|
+
else if ('u16' in parsedTag) {
|
|
13
|
+
return bcs.U16;
|
|
14
|
+
}
|
|
15
|
+
else if ('u32' in parsedTag) {
|
|
16
|
+
return bcs.U32;
|
|
17
|
+
}
|
|
18
|
+
else if ('u64' in parsedTag) {
|
|
19
|
+
return bcs.U64;
|
|
20
|
+
}
|
|
21
|
+
else if ('u128' in parsedTag) {
|
|
22
|
+
return bcs.U128;
|
|
23
|
+
}
|
|
24
|
+
else if ('u256' in parsedTag) {
|
|
25
|
+
return bcs.U256;
|
|
26
|
+
}
|
|
27
|
+
else if ('address' in parsedTag) {
|
|
28
|
+
return bcs.Address;
|
|
29
|
+
}
|
|
30
|
+
else if ('bool' in parsedTag) {
|
|
31
|
+
return bcs.Bool;
|
|
32
|
+
}
|
|
33
|
+
else if ('vector' in parsedTag) {
|
|
34
|
+
const type = getPureBcsSchema(parsedTag.vector);
|
|
35
|
+
return type ? bcs.vector(type) : null;
|
|
36
|
+
}
|
|
37
|
+
else if ('struct' in parsedTag) {
|
|
38
|
+
const structTag = parsedTag.struct;
|
|
39
|
+
const pkg = normalizeSuiAddress(structTag.address);
|
|
40
|
+
if (pkg === MOVE_STDLIB_ADDRESS) {
|
|
41
|
+
if ((structTag.module === 'ascii' || structTag.module === 'string') &&
|
|
42
|
+
structTag.name === 'String') {
|
|
43
|
+
return bcs.String;
|
|
44
|
+
}
|
|
45
|
+
if (structTag.module === 'option' && structTag.name === 'Option') {
|
|
46
|
+
const inner = structTag.typeParams[0];
|
|
47
|
+
const type = inner ? getPureBcsSchema(inner) : null;
|
|
48
|
+
return type ? bcs.option(type) : null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (pkg === SUI_FRAMEWORK_ADDRESS &&
|
|
52
|
+
structTag.module === 'object' &&
|
|
53
|
+
(structTag.name === 'ID' || structTag.name === 'UID')) {
|
|
54
|
+
return bcs.Address;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
export function normalizeMoveArguments(args, argTypes, parameterNames) {
|
|
60
|
+
const argLen = Array.isArray(args) ? args.length : Object.keys(args).length;
|
|
61
|
+
if (parameterNames && argLen !== parameterNames.length) {
|
|
62
|
+
throw new Error(`Invalid number of arguments, expected ${parameterNames.length}, got ${argLen}`);
|
|
63
|
+
}
|
|
64
|
+
const normalizedArgs = [];
|
|
65
|
+
let index = 0;
|
|
66
|
+
for (const argType of argTypes) {
|
|
67
|
+
if (argType === '0x2::clock::Clock') {
|
|
68
|
+
normalizedArgs.push((tx) => tx.object.clock());
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (argType === '0x2::random::Random') {
|
|
72
|
+
normalizedArgs.push((tx) => tx.object.random());
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (argType === '0x2::deny_list::DenyList') {
|
|
76
|
+
normalizedArgs.push((tx) => tx.object.denyList());
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (argType === '0x3::sui_system::SuiSystemState') {
|
|
80
|
+
normalizedArgs.push((tx) => tx.object.system());
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
let arg;
|
|
84
|
+
if (Array.isArray(args)) {
|
|
85
|
+
if (index >= args.length) {
|
|
86
|
+
throw new Error(`Invalid number of arguments, expected at least ${index + 1}, got ${args.length}`);
|
|
87
|
+
}
|
|
88
|
+
arg = args[index];
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
if (!parameterNames) {
|
|
92
|
+
throw new Error(`Expected arguments to be passed as an array`);
|
|
93
|
+
}
|
|
94
|
+
const name = parameterNames[index];
|
|
95
|
+
arg = args[name];
|
|
96
|
+
if (arg === undefined) {
|
|
97
|
+
throw new Error(`Parameter ${name} is required`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
index += 1;
|
|
101
|
+
if (typeof arg === 'function' || isArgument(arg)) {
|
|
102
|
+
normalizedArgs.push(arg);
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
const bcsType = argType === null ? null : getPureBcsSchema(argType);
|
|
106
|
+
if (bcsType) {
|
|
107
|
+
const bytes = bcsType.serialize(arg);
|
|
108
|
+
normalizedArgs.push((tx) => tx.pure(bytes));
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (typeof arg === 'string') {
|
|
112
|
+
normalizedArgs.push((tx) => tx.object(arg));
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
throw new Error(`Invalid argument ${stringify(arg)} for type ${argType}`);
|
|
116
|
+
}
|
|
117
|
+
return normalizedArgs;
|
|
118
|
+
}
|
|
119
|
+
export class MoveStruct extends BcsStruct {
|
|
120
|
+
async get({ objectId, ...options }) {
|
|
121
|
+
const [res] = await this.getMany({
|
|
122
|
+
...options,
|
|
123
|
+
objectIds: [objectId],
|
|
124
|
+
});
|
|
125
|
+
if (!res) {
|
|
126
|
+
throw new Error(`No object found for id ${objectId}`);
|
|
127
|
+
}
|
|
128
|
+
return res;
|
|
129
|
+
}
|
|
130
|
+
async getMany({ client, ...options }) {
|
|
131
|
+
const response = (await client.core.getObjects({
|
|
132
|
+
...options,
|
|
133
|
+
include: {
|
|
134
|
+
...options.include,
|
|
135
|
+
content: true,
|
|
136
|
+
},
|
|
137
|
+
}));
|
|
138
|
+
return response.objects.map((obj) => {
|
|
139
|
+
if (obj instanceof Error) {
|
|
140
|
+
throw obj;
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
...obj,
|
|
144
|
+
json: this.parse(obj.content),
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
export class MoveEnum extends BcsEnum {
|
|
150
|
+
}
|
|
151
|
+
export class MoveTuple extends BcsTuple {
|
|
152
|
+
}
|
|
153
|
+
function stringify(val) {
|
|
154
|
+
if (typeof val === 'object') {
|
|
155
|
+
return JSON.stringify(val, (val) => val);
|
|
156
|
+
}
|
|
157
|
+
if (typeof val === 'bigint') {
|
|
158
|
+
return val.toString();
|
|
159
|
+
}
|
|
160
|
+
return val;
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contracts/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EACN,GAAG,EAGH,iBAAiB,EACjB,SAAS,EACT,OAAO,EACP,QAAQ,GACR,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAA4B,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAA+C,MAAM,oBAAoB,CAAC;AAEjF,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;AACvD,MAAM,qBAAqB,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;AAUzD,MAAM,UAAU,gBAAgB,CAAC,OAAyB;IACzD,MAAM,SAAS,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAElG,IAAI,IAAI,IAAI,SAAS,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC,EAAE,CAAC;IACf,CAAC;SAAM,IAAI,KAAK,IAAI,SAAS,EAAE,CAAC;QAC/B,OAAO,GAAG,CAAC,GAAG,CAAC;IAChB,CAAC;SAAM,IAAI,KAAK,IAAI,SAAS,EAAE,CAAC;QAC/B,OAAO,GAAG,CAAC,GAAG,CAAC;IAChB,CAAC;SAAM,IAAI,KAAK,IAAI,SAAS,EAAE,CAAC;QAC/B,OAAO,GAAG,CAAC,GAAG,CAAC;IAChB,CAAC;SAAM,IAAI,MAAM,IAAI,SAAS,EAAE,CAAC;QAChC,OAAO,GAA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AAmE,CAAC;QAEtE,OAAO,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YACnC,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;gBAC1B,MAAM,GAAG,CAAC;YACX,CAAC;YAED,OAAO;gBACN,GAAG,GAAG;gBACN,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;aAC7B,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AAED,MAAM,OAAO,QAGX,SAAQ,OAAgB;CAAG;AAE7B,MAAM,OAAO,SAGX,SAAQ,QAAiB;CAAG;AAE9B,SAAS,SAAS,CAAC,GAAY;IAC9B,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,GAAY,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;IACnD,CAAC;IACD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;IACvB,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ParallelTransactionExecutor } from "@mysten/sui/transactions";
|
|
2
|
+
import { type ExecResult } from "@misonetwork/sdk";
|
|
3
|
+
import type { TxThunk } from "./transactions.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Builds a transaction from thunks and executes it through the parallel executor,
|
|
6
|
+
* exactly ONCE.
|
|
7
|
+
*
|
|
8
|
+
* These PTBs are typically non-idempotent (publish a package, initialize a
|
|
9
|
+
* currency, consume a TreasuryCap). A thrown transport error is ambiguous — the tx
|
|
10
|
+
* may already have committed — so blindly rebuilding and re-submitting would risk
|
|
11
|
+
* double-execution or a guaranteed abort against already-consumed inputs. We
|
|
12
|
+
* therefore do NOT auto-retry: any error propagates and recovery is the caller's
|
|
13
|
+
* job (e.g. a resumable checkpoint that reconciles against on-chain state). A Move
|
|
14
|
+
* abort RESOLVES as a `FailedTransaction`, so `toExecResult` surfaces it too.
|
|
15
|
+
*/
|
|
16
|
+
export declare function executeViaExecutor(executor: ParallelTransactionExecutor, ...thunks: TxThunk[]): Promise<ExecResult>;
|
|
17
|
+
//# sourceMappingURL=execute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAE5E,OAAO,EAAuC,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAIjD;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,2BAA2B,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAIzH"}
|
package/dist/execute.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright (c) Miso Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { buildTx, toExecResult, FULL_INCLUDE } from "@misonetwork/sdk";
|
|
4
|
+
/**
|
|
5
|
+
* Builds a transaction from thunks and executes it through the parallel executor,
|
|
6
|
+
* exactly ONCE.
|
|
7
|
+
*
|
|
8
|
+
* These PTBs are typically non-idempotent (publish a package, initialize a
|
|
9
|
+
* currency, consume a TreasuryCap). A thrown transport error is ambiguous — the tx
|
|
10
|
+
* may already have committed — so blindly rebuilding and re-submitting would risk
|
|
11
|
+
* double-execution or a guaranteed abort against already-consumed inputs. We
|
|
12
|
+
* therefore do NOT auto-retry: any error propagates and recovery is the caller's
|
|
13
|
+
* job (e.g. a resumable checkpoint that reconciles against on-chain state). A Move
|
|
14
|
+
* abort RESOLVES as a `FailedTransaction`, so `toExecResult` surfaces it too.
|
|
15
|
+
*/
|
|
16
|
+
export async function executeViaExecutor(executor, ...thunks) {
|
|
17
|
+
const tx = await buildTx(...thunks);
|
|
18
|
+
const res = await executor.executeTransaction(tx, FULL_INCLUDE);
|
|
19
|
+
return toExecResult(res);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAWtC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAmB,MAAM,kBAAkB,CAAC;AAKxF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,QAAqC,EAAE,GAAG,MAAiB;IAClG,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC;IACpC,MAAM,GAAG,GAAkD,MAAM,QAAQ,CAAC,kBAAkB,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;IAC/G,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { misoPlatform, MisoPlatformClient } from "./client.ts";
|
|
2
|
+
export type { MisoPlatformConfig } from "./client.ts";
|
|
3
|
+
export * from "./pressing.ts";
|
|
4
|
+
export * from "./transactions.ts";
|
|
5
|
+
export * from "./execute.ts";
|
|
6
|
+
export * from "./share.ts";
|
|
7
|
+
export * from "./share-template.ts";
|
|
8
|
+
export * from "./release-graph.ts";
|
|
9
|
+
export * from "./catalog.ts";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC/D,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Copyright (c) Miso Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// `@misofm/sdk` — the PLATFORM layer.
|
|
4
|
+
//
|
|
5
|
+
// Miso's own product sits on top of the permissionless protocol, and the two
|
|
6
|
+
// have different names on npm because they have different promises:
|
|
7
|
+
//
|
|
8
|
+
// @misonetwork/* PROTOCOL — Composition, Recording, Release. The open layer
|
|
9
|
+
// anyone can build on, and nobody needs Miso's permission to use.
|
|
10
|
+
// @misofm/* PLATFORM — Pressing, Listing, Record. How MISO sells copies of
|
|
11
|
+
// a release: the production line, its currencies, and the record
|
|
12
|
+
// a buyer walks away with.
|
|
13
|
+
//
|
|
14
|
+
// A release is protocol. Pressing a record off it and selling that record is
|
|
15
|
+
// platform. Keeping the split at the package boundary is what stops the protocol
|
|
16
|
+
// from quietly growing a storefront.
|
|
17
|
+
// The recommended entry point is the client extension (see ./client.ts); the bare
|
|
18
|
+
// builders and readers stay exported for callers that hold ids themselves.
|
|
19
|
+
export { misoPlatform, MisoPlatformClient } from "./client.js";
|
|
20
|
+
export * from "./pressing.js";
|
|
21
|
+
export * from "./transactions.js";
|
|
22
|
+
export * from "./execute.js";
|
|
23
|
+
export * from "./share.js";
|
|
24
|
+
export * from "./share-template.js";
|
|
25
|
+
export * from "./release-graph.js";
|
|
26
|
+
export * from "./catalog.js";
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAEtC,sCAAsC;AACtC,EAAE;AACF,6EAA6E;AAC7E,oEAAoE;AACpE,EAAE;AACF,+EAA+E;AAC/E,oFAAoF;AACpF,mFAAmF;AACnF,mFAAmF;AACnF,6CAA6C;AAC7C,EAAE;AACF,6EAA6E;AAC7E,iFAAiF;AACjF,qCAAqC;AAErC,kFAAkF;AAClF,2EAA2E;AAC3E,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/D,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC"}
|