@medialane/sdk 0.57.0 → 0.58.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.
@@ -1,192 +0,0 @@
1
- /** Mirrors the backend Prisma `Chain` enum. */
2
- declare const CHAINS: readonly ["STARKNET", "ETHEREUM", "SOLANA", "BASE", "STELLAR", "BITCOIN"];
3
- type Chain = (typeof CHAINS)[number];
4
- /** Starknet coordinates of Medialane services + venues. All fields optional
5
- * because not every service exists on every chain. */
6
- interface StarknetCoordinates {
7
- rpcUrl: string;
8
- marketplace721?: `0x${string}`;
9
- marketplace721ClassHash?: `0x${string}`;
10
- marketplace721StartBlock?: number;
11
- marketplace1155?: `0x${string}`;
12
- marketplace1155ClassHash?: `0x${string}`;
13
- marketplace1155StartBlock?: number;
14
- collection721?: `0x${string}`;
15
- collection721StartBlock?: number;
16
- ipNftClassHash?: `0x${string}`;
17
- ipCollectionClassHash?: `0x${string}`;
18
- collection1155?: `0x${string}`;
19
- collection1155FactoryClassHash?: `0x${string}`;
20
- collection1155ClassHash?: `0x${string}`;
21
- collection1155StartBlock?: number;
22
- popFactory?: `0x${string}`;
23
- popCollectionClassHash?: `0x${string}`;
24
- dropFactory?: `0x${string}`;
25
- dropCollectionClassHash?: `0x${string}`;
26
- nftComments?: `0x${string}`;
27
- creatorCoinFactory?: `0x${string}`;
28
- creatorCoinEkuboLauncher?: `0x${string}`;
29
- creatorCoinClassHash?: `0x${string}`;
30
- creatorCoinFactoryClassHash?: `0x${string}`;
31
- creatorCoinStartBlock?: number;
32
- ekuboCore?: `0x${string}`;
33
- ipTicketsFactory?: `0x${string}`;
34
- ipTicketCollectionClassHash?: `0x${string}`;
35
- ipTicketsStartBlock?: number;
36
- ipClubRegistry?: `0x${string}`;
37
- ipClubNftClassHash?: `0x${string}`;
38
- ipClubStartBlock?: number;
39
- ipSponsorship?: `0x${string}`;
40
- ipSponsorshipStartBlock?: number;
41
- ipSponsorshipLicense?: `0x${string}`;
42
- }
43
- /** Coordinates per chain. Only STARKNET is populated today; adding a chain
44
- * means adding an entry here (litmus test, spec §7). */
45
- /** EVM coordinates — one shape for Ethereum and Base (same bytecode, two
46
- * chains). Populated at deploy time (federation Phase 4). */
47
- interface EvmCoordinates {
48
- rpcUrl: string;
49
- marketplace721?: `0x${string}`;
50
- marketplace721StartBlock?: number;
51
- marketplace1155?: `0x${string}`;
52
- marketplace1155StartBlock?: number;
53
- mipRegistry?: `0x${string}`;
54
- mipRegistryStartBlock?: number;
55
- mipEditionsRegistry?: `0x${string}`;
56
- mipEditionsRegistryStartBlock?: number;
57
- }
58
- /** Solana coordinates — base58 program ids. Populated at deploy time. */
59
- interface SolanaCoordinates {
60
- rpcUrl: string;
61
- mipCollectionsProgram?: string;
62
- marketplaceProgram?: string;
63
- startSlot?: number;
64
- }
65
- /** Stellar (Soroban) coordinates — strkey contract ids. Populated at deploy
66
- * time; the registry takes the collection WASM hash as a constructor arg. */
67
- interface StellarCoordinates {
68
- rpcUrl: string;
69
- mipRegistry?: string;
70
- marketplace?: string;
71
- collectionWasmHash?: string;
72
- startLedger?: number;
73
- }
74
- /** Per-chain coordinate shapes. Every chain is an equal entry — no chain is
75
- * privileged in core (chain-sovereignty I2/I4). */
76
- interface CoordinatesByChain {
77
- STARKNET?: StarknetCoordinates;
78
- ETHEREUM?: EvmCoordinates;
79
- BASE?: EvmCoordinates;
80
- SOLANA?: SolanaCoordinates;
81
- STELLAR?: StellarCoordinates;
82
- BITCOIN?: never;
83
- }
84
- /** @deprecated Renamed — use `StarknetCoordinates` (coordinates are per-chain-shaped). */
85
- type ChainCoordinates = StarknetCoordinates;
86
- declare function getCoordinates(chain: "STARKNET"): StarknetCoordinates;
87
- declare function getCoordinates(chain: "ETHEREUM" | "BASE"): EvmCoordinates;
88
- declare function getCoordinates(chain: "SOLANA"): SolanaCoordinates;
89
- declare function getCoordinates(chain: "STELLAR"): StellarCoordinates;
90
- declare function getCoordinates(chain: Chain): StarknetCoordinates | EvmCoordinates | SolanaCoordinates | StellarCoordinates;
91
- declare const DEFAULT_CHAIN: Chain;
92
- /** Typed Starknet coordinates for Starknet-only modules; throws when the
93
- * client is scoped to another chain. */
94
- declare function getStarknetCoordinates(chain: Chain): StarknetCoordinates;
95
-
96
- /**
97
- * Chain-neutral adapter interfaces — the target surface every chain adapter
98
- * (`@medialane/sdk/starknet`, `/evm`, `/solana`, `/stellar`) implements, so
99
- * apps can transact against a chain-tagged asset without knowing the chain
100
- * (chain-sovereignty I2/I4; platform-federation spec §2.2). `Signer` is the
101
- * chain's `VenueSigner` capability port (see {@link VenueSigner}), not a raw
102
- * account — the app implements it over its own wallet layer.
103
- */
104
- /**
105
- * A chain-neutral capability port the app implements over its own wallet layer.
106
- * The adapter orchestrates with only these three capabilities — it never holds a
107
- * chain account or an execution provider. Confirmation lives behind `execute`
108
- * (the app awaits + revert-detects the receipt before resolving), so there is no
109
- * separate receipt method: a resolved `execute` means "on-chain, not reverted".
110
- * `TypedData`/`Call` are the chain's native shapes (Starknet: SNIP-12 typed data
111
- * and `{ contractAddress, entrypoint, calldata }`); the signature is `string[]`
112
- * (Starknet felt array).
113
- */
114
- interface VenueSigner<TypedData = unknown, Call = unknown> {
115
- readonly address: string;
116
- signTypedData(data: TypedData): Promise<string[]>;
117
- execute(calls: Call[]): Promise<{
118
- txHash: string;
119
- }>;
120
- }
121
- /** A chain-tagged asset reference — the working asset identity `(chain, contract, tokenId)`. */
122
- interface AssetRef {
123
- chain: Chain;
124
- contract: string;
125
- tokenId: string;
126
- }
127
- /** Canonical order identity per chain (platform-federation spec §3.2b):
128
- * Starknet/EVM = the typed-data digest; Solana = the order PDA address;
129
- * Stellar = a stable digest of (contract, offerer, salt). */
130
- type OrderRef = string;
131
- interface RegisterOrderParams {
132
- asset: AssetRef;
133
- /** "listing" offers the asset; "bid" offers payment. */
134
- side: "listing" | "bid";
135
- /** Payment token in the chain's canonical address form; adapters define the
136
- * native-currency sentinel where the chain has one. */
137
- paymentToken: string;
138
- /** Per-unit price in base units, as a decimal string. For single-item (721)
139
- * orders this is the whole price; for multi-unit (1155) orders it is the price
140
- * per unit and the total is `amount × quantity`. */
141
- amount: string;
142
- /** Units offered — 1155 only; defaults to "1" (and is inert for 721). */
143
- quantity?: string;
144
- royaltyMaxBps: number;
145
- startTime: number;
146
- /** 0 = no expiry. */
147
- endTime: number;
148
- salt: string;
149
- }
150
- interface AdapterTxResult {
151
- txHash: string;
152
- }
153
- interface VenueAdapter<Signer> {
154
- readonly chain: Chain;
155
- registerOrder(signer: Signer, params: RegisterOrderParams): Promise<AdapterTxResult & {
156
- orderRef: OrderRef;
157
- }>;
158
- fulfillOrder(signer: Signer, orderRef: OrderRef, opts?: {
159
- quantity?: string;
160
- } & Record<string, string | undefined>): Promise<AdapterTxResult>;
161
- cancelOrder(signer: Signer, orderRef: OrderRef, opts?: Record<string, string | undefined>): Promise<AdapterTxResult>;
162
- incrementCounter(signer: Signer): Promise<AdapterTxResult>;
163
- getOrderDetails(orderRef: OrderRef): Promise<unknown>;
164
- getCounter(address: string): Promise<bigint>;
165
- }
166
- interface CreateCollectionInput {
167
- name: string;
168
- symbol: string;
169
- baseUri: string;
170
- royaltyBps: number;
171
- }
172
- interface MintInput {
173
- collection: string;
174
- recipient: string;
175
- tokenUri: string;
176
- }
177
- interface IssuanceAdapter<Signer> {
178
- readonly chain: Chain;
179
- createCollection(signer: Signer, params: CreateCollectionInput): Promise<AdapterTxResult & {
180
- collection: string;
181
- }>;
182
- mint(signer: Signer, params: MintInput): Promise<AdapterTxResult & {
183
- tokenId: string;
184
- }>;
185
- batchMint(signer: Signer, params: {
186
- collection: string;
187
- recipients: string[];
188
- tokenUris: string[];
189
- }): Promise<AdapterTxResult>;
190
- }
191
-
192
- export { type AdapterTxResult as A, type Chain as C, DEFAULT_CHAIN as D, type EvmCoordinates as E, type IssuanceAdapter as I, type MintInput as M, type OrderRef as O, type RegisterOrderParams as R, type SolanaCoordinates as S, type VenueAdapter as V, type AssetRef as a, CHAINS as b, type ChainCoordinates as c, type CoordinatesByChain as d, type CreateCollectionInput as e, type StarknetCoordinates as f, type StellarCoordinates as g, type VenueSigner as h, getCoordinates as i, getStarknetCoordinates as j };
@@ -1,192 +0,0 @@
1
- /** Mirrors the backend Prisma `Chain` enum. */
2
- declare const CHAINS: readonly ["STARKNET", "ETHEREUM", "SOLANA", "BASE", "STELLAR", "BITCOIN"];
3
- type Chain = (typeof CHAINS)[number];
4
- /** Starknet coordinates of Medialane services + venues. All fields optional
5
- * because not every service exists on every chain. */
6
- interface StarknetCoordinates {
7
- rpcUrl: string;
8
- marketplace721?: `0x${string}`;
9
- marketplace721ClassHash?: `0x${string}`;
10
- marketplace721StartBlock?: number;
11
- marketplace1155?: `0x${string}`;
12
- marketplace1155ClassHash?: `0x${string}`;
13
- marketplace1155StartBlock?: number;
14
- collection721?: `0x${string}`;
15
- collection721StartBlock?: number;
16
- ipNftClassHash?: `0x${string}`;
17
- ipCollectionClassHash?: `0x${string}`;
18
- collection1155?: `0x${string}`;
19
- collection1155FactoryClassHash?: `0x${string}`;
20
- collection1155ClassHash?: `0x${string}`;
21
- collection1155StartBlock?: number;
22
- popFactory?: `0x${string}`;
23
- popCollectionClassHash?: `0x${string}`;
24
- dropFactory?: `0x${string}`;
25
- dropCollectionClassHash?: `0x${string}`;
26
- nftComments?: `0x${string}`;
27
- creatorCoinFactory?: `0x${string}`;
28
- creatorCoinEkuboLauncher?: `0x${string}`;
29
- creatorCoinClassHash?: `0x${string}`;
30
- creatorCoinFactoryClassHash?: `0x${string}`;
31
- creatorCoinStartBlock?: number;
32
- ekuboCore?: `0x${string}`;
33
- ipTicketsFactory?: `0x${string}`;
34
- ipTicketCollectionClassHash?: `0x${string}`;
35
- ipTicketsStartBlock?: number;
36
- ipClubRegistry?: `0x${string}`;
37
- ipClubNftClassHash?: `0x${string}`;
38
- ipClubStartBlock?: number;
39
- ipSponsorship?: `0x${string}`;
40
- ipSponsorshipStartBlock?: number;
41
- ipSponsorshipLicense?: `0x${string}`;
42
- }
43
- /** Coordinates per chain. Only STARKNET is populated today; adding a chain
44
- * means adding an entry here (litmus test, spec §7). */
45
- /** EVM coordinates — one shape for Ethereum and Base (same bytecode, two
46
- * chains). Populated at deploy time (federation Phase 4). */
47
- interface EvmCoordinates {
48
- rpcUrl: string;
49
- marketplace721?: `0x${string}`;
50
- marketplace721StartBlock?: number;
51
- marketplace1155?: `0x${string}`;
52
- marketplace1155StartBlock?: number;
53
- mipRegistry?: `0x${string}`;
54
- mipRegistryStartBlock?: number;
55
- mipEditionsRegistry?: `0x${string}`;
56
- mipEditionsRegistryStartBlock?: number;
57
- }
58
- /** Solana coordinates — base58 program ids. Populated at deploy time. */
59
- interface SolanaCoordinates {
60
- rpcUrl: string;
61
- mipCollectionsProgram?: string;
62
- marketplaceProgram?: string;
63
- startSlot?: number;
64
- }
65
- /** Stellar (Soroban) coordinates — strkey contract ids. Populated at deploy
66
- * time; the registry takes the collection WASM hash as a constructor arg. */
67
- interface StellarCoordinates {
68
- rpcUrl: string;
69
- mipRegistry?: string;
70
- marketplace?: string;
71
- collectionWasmHash?: string;
72
- startLedger?: number;
73
- }
74
- /** Per-chain coordinate shapes. Every chain is an equal entry — no chain is
75
- * privileged in core (chain-sovereignty I2/I4). */
76
- interface CoordinatesByChain {
77
- STARKNET?: StarknetCoordinates;
78
- ETHEREUM?: EvmCoordinates;
79
- BASE?: EvmCoordinates;
80
- SOLANA?: SolanaCoordinates;
81
- STELLAR?: StellarCoordinates;
82
- BITCOIN?: never;
83
- }
84
- /** @deprecated Renamed — use `StarknetCoordinates` (coordinates are per-chain-shaped). */
85
- type ChainCoordinates = StarknetCoordinates;
86
- declare function getCoordinates(chain: "STARKNET"): StarknetCoordinates;
87
- declare function getCoordinates(chain: "ETHEREUM" | "BASE"): EvmCoordinates;
88
- declare function getCoordinates(chain: "SOLANA"): SolanaCoordinates;
89
- declare function getCoordinates(chain: "STELLAR"): StellarCoordinates;
90
- declare function getCoordinates(chain: Chain): StarknetCoordinates | EvmCoordinates | SolanaCoordinates | StellarCoordinates;
91
- declare const DEFAULT_CHAIN: Chain;
92
- /** Typed Starknet coordinates for Starknet-only modules; throws when the
93
- * client is scoped to another chain. */
94
- declare function getStarknetCoordinates(chain: Chain): StarknetCoordinates;
95
-
96
- /**
97
- * Chain-neutral adapter interfaces — the target surface every chain adapter
98
- * (`@medialane/sdk/starknet`, `/evm`, `/solana`, `/stellar`) implements, so
99
- * apps can transact against a chain-tagged asset without knowing the chain
100
- * (chain-sovereignty I2/I4; platform-federation spec §2.2). `Signer` is the
101
- * chain's `VenueSigner` capability port (see {@link VenueSigner}), not a raw
102
- * account — the app implements it over its own wallet layer.
103
- */
104
- /**
105
- * A chain-neutral capability port the app implements over its own wallet layer.
106
- * The adapter orchestrates with only these three capabilities — it never holds a
107
- * chain account or an execution provider. Confirmation lives behind `execute`
108
- * (the app awaits + revert-detects the receipt before resolving), so there is no
109
- * separate receipt method: a resolved `execute` means "on-chain, not reverted".
110
- * `TypedData`/`Call` are the chain's native shapes (Starknet: SNIP-12 typed data
111
- * and `{ contractAddress, entrypoint, calldata }`); the signature is `string[]`
112
- * (Starknet felt array).
113
- */
114
- interface VenueSigner<TypedData = unknown, Call = unknown> {
115
- readonly address: string;
116
- signTypedData(data: TypedData): Promise<string[]>;
117
- execute(calls: Call[]): Promise<{
118
- txHash: string;
119
- }>;
120
- }
121
- /** A chain-tagged asset reference — the working asset identity `(chain, contract, tokenId)`. */
122
- interface AssetRef {
123
- chain: Chain;
124
- contract: string;
125
- tokenId: string;
126
- }
127
- /** Canonical order identity per chain (platform-federation spec §3.2b):
128
- * Starknet/EVM = the typed-data digest; Solana = the order PDA address;
129
- * Stellar = a stable digest of (contract, offerer, salt). */
130
- type OrderRef = string;
131
- interface RegisterOrderParams {
132
- asset: AssetRef;
133
- /** "listing" offers the asset; "bid" offers payment. */
134
- side: "listing" | "bid";
135
- /** Payment token in the chain's canonical address form; adapters define the
136
- * native-currency sentinel where the chain has one. */
137
- paymentToken: string;
138
- /** Per-unit price in base units, as a decimal string. For single-item (721)
139
- * orders this is the whole price; for multi-unit (1155) orders it is the price
140
- * per unit and the total is `amount × quantity`. */
141
- amount: string;
142
- /** Units offered — 1155 only; defaults to "1" (and is inert for 721). */
143
- quantity?: string;
144
- royaltyMaxBps: number;
145
- startTime: number;
146
- /** 0 = no expiry. */
147
- endTime: number;
148
- salt: string;
149
- }
150
- interface AdapterTxResult {
151
- txHash: string;
152
- }
153
- interface VenueAdapter<Signer> {
154
- readonly chain: Chain;
155
- registerOrder(signer: Signer, params: RegisterOrderParams): Promise<AdapterTxResult & {
156
- orderRef: OrderRef;
157
- }>;
158
- fulfillOrder(signer: Signer, orderRef: OrderRef, opts?: {
159
- quantity?: string;
160
- } & Record<string, string | undefined>): Promise<AdapterTxResult>;
161
- cancelOrder(signer: Signer, orderRef: OrderRef, opts?: Record<string, string | undefined>): Promise<AdapterTxResult>;
162
- incrementCounter(signer: Signer): Promise<AdapterTxResult>;
163
- getOrderDetails(orderRef: OrderRef): Promise<unknown>;
164
- getCounter(address: string): Promise<bigint>;
165
- }
166
- interface CreateCollectionInput {
167
- name: string;
168
- symbol: string;
169
- baseUri: string;
170
- royaltyBps: number;
171
- }
172
- interface MintInput {
173
- collection: string;
174
- recipient: string;
175
- tokenUri: string;
176
- }
177
- interface IssuanceAdapter<Signer> {
178
- readonly chain: Chain;
179
- createCollection(signer: Signer, params: CreateCollectionInput): Promise<AdapterTxResult & {
180
- collection: string;
181
- }>;
182
- mint(signer: Signer, params: MintInput): Promise<AdapterTxResult & {
183
- tokenId: string;
184
- }>;
185
- batchMint(signer: Signer, params: {
186
- collection: string;
187
- recipients: string[];
188
- tokenUris: string[];
189
- }): Promise<AdapterTxResult>;
190
- }
191
-
192
- export { type AdapterTxResult as A, type Chain as C, DEFAULT_CHAIN as D, type EvmCoordinates as E, type IssuanceAdapter as I, type MintInput as M, type OrderRef as O, type RegisterOrderParams as R, type SolanaCoordinates as S, type VenueAdapter as V, type AssetRef as a, CHAINS as b, type ChainCoordinates as c, type CoordinatesByChain as d, type CreateCollectionInput as e, type StarknetCoordinates as f, type StellarCoordinates as g, type VenueSigner as h, getCoordinates as i, getStarknetCoordinates as j };