@medialane/sdk 0.51.0 → 0.52.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.
@@ -0,0 +1,78 @@
1
+ import { C as Chain } from './chains-DE8AJMIY.js';
2
+
3
+ /**
4
+ * Chain-neutral adapter interfaces — the target surface every chain adapter
5
+ * (`@medialane/sdk/starknet`, `/evm`, `/solana`, `/stellar`) implements, so
6
+ * apps can transact against a chain-tagged asset without knowing the chain
7
+ * (chain-sovereignty I2/I4; platform-federation spec §2.2). `Signer` is the
8
+ * chain's wallet/account handle (starknet.js AccountInterface, a viem wallet
9
+ * client, a Solana signer, a Stellar signer) — adapters fix the type.
10
+ */
11
+ /** A chain-tagged asset reference — the working asset identity `(chain, contract, tokenId)`. */
12
+ interface AssetRef {
13
+ chain: Chain;
14
+ contract: string;
15
+ tokenId: string;
16
+ }
17
+ /** Canonical order identity per chain (platform-federation spec §3.2b):
18
+ * Starknet/EVM = the typed-data digest; Solana = the order PDA address;
19
+ * Stellar = a stable digest of (contract, offerer, salt). */
20
+ type OrderRef = string;
21
+ interface RegisterOrderParams {
22
+ asset: AssetRef;
23
+ /** "listing" offers the asset; "bid" offers payment. */
24
+ side: "listing" | "bid";
25
+ /** Payment token in the chain's canonical address form; adapters define the
26
+ * native-currency sentinel where the chain has one. */
27
+ paymentToken: string;
28
+ /** Base-unit amount as a decimal string. */
29
+ amount: string;
30
+ royaltyMaxBps: number;
31
+ startTime: number;
32
+ /** 0 = no expiry. */
33
+ endTime: number;
34
+ salt: string;
35
+ }
36
+ interface AdapterTxResult {
37
+ txHash: string;
38
+ }
39
+ interface VenueAdapter<Signer> {
40
+ readonly chain: Chain;
41
+ registerOrder(signer: Signer, params: RegisterOrderParams): Promise<AdapterTxResult & {
42
+ orderRef: OrderRef;
43
+ }>;
44
+ fulfillOrder(signer: Signer, orderRef: OrderRef, opts?: {
45
+ quantity?: string;
46
+ } & Record<string, string | undefined>): Promise<AdapterTxResult>;
47
+ cancelOrder(signer: Signer, orderRef: OrderRef, opts?: Record<string, string | undefined>): Promise<AdapterTxResult>;
48
+ incrementCounter(signer: Signer): Promise<AdapterTxResult>;
49
+ getOrderDetails(orderRef: OrderRef): Promise<unknown>;
50
+ getCounter(address: string): Promise<bigint>;
51
+ }
52
+ interface CreateCollectionInput {
53
+ name: string;
54
+ symbol: string;
55
+ baseUri: string;
56
+ royaltyBps: number;
57
+ }
58
+ interface MintInput {
59
+ collection: string;
60
+ recipient: string;
61
+ tokenUri: string;
62
+ }
63
+ interface IssuanceAdapter<Signer> {
64
+ readonly chain: Chain;
65
+ createCollection(signer: Signer, params: CreateCollectionInput): Promise<AdapterTxResult & {
66
+ collection: string;
67
+ }>;
68
+ mint(signer: Signer, params: MintInput): Promise<AdapterTxResult & {
69
+ tokenId: string;
70
+ }>;
71
+ batchMint(signer: Signer, params: {
72
+ collection: string;
73
+ recipients: string[];
74
+ tokenUris: string[];
75
+ }): Promise<AdapterTxResult>;
76
+ }
77
+
78
+ export type { AdapterTxResult as A, CreateCollectionInput as C, IssuanceAdapter as I, MintInput as M, OrderRef as O, RegisterOrderParams as R, VenueAdapter as V, AssetRef as a };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medialane/sdk",
3
- "version": "0.51.0",
3
+ "version": "0.52.0",
4
4
  "description": "Framework-agnostic TypeScript SDK for Medialane.io — the IP marketplace on Starknet",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -11,6 +11,26 @@
11
11
  "types": "./dist/index.d.ts",
12
12
  "import": "./dist/index.js",
13
13
  "require": "./dist/index.cjs"
14
+ },
15
+ "./starknet": {
16
+ "types": "./dist/starknet/index.d.ts",
17
+ "import": "./dist/starknet/index.js",
18
+ "require": "./dist/starknet/index.cjs"
19
+ },
20
+ "./evm": {
21
+ "types": "./dist/evm/index.d.ts",
22
+ "import": "./dist/evm/index.js",
23
+ "require": "./dist/evm/index.cjs"
24
+ },
25
+ "./solana": {
26
+ "types": "./dist/solana/index.d.ts",
27
+ "import": "./dist/solana/index.js",
28
+ "require": "./dist/solana/index.cjs"
29
+ },
30
+ "./stellar": {
31
+ "types": "./dist/stellar/index.d.ts",
32
+ "import": "./dist/stellar/index.js",
33
+ "require": "./dist/stellar/index.cjs"
14
34
  }
15
35
  },
16
36
  "license": "MIT",
@@ -27,16 +47,36 @@
27
47
  "test": "bun test"
28
48
  },
29
49
  "peerDependencies": {
30
- "starknet": ">=6.0.0"
50
+ "starknet": ">=6.0.0",
51
+ "viem": ">=2.0.0",
52
+ "@solana/web3.js": ">=1.90.0",
53
+ "@stellar/stellar-sdk": ">=13.0.0"
31
54
  },
32
55
  "devDependencies": {
56
+ "@solana/web3.js": "^1.98.4",
57
+ "@stellar/stellar-sdk": "^16.0.1",
33
58
  "starknet": "^6.11.0",
34
59
  "tsup": "^8.0.0",
35
- "typescript": "^5.6.0"
60
+ "typescript": "^5.6.0",
61
+ "viem": "^2.54.6"
36
62
  },
37
63
  "dependencies": {
38
64
  "@noble/hashes": "^2.2.0",
39
65
  "@scure/base": "^2.2.0",
40
66
  "zod": "^3.23.8"
67
+ },
68
+ "peerDependenciesMeta": {
69
+ "starknet": {
70
+ "optional": true
71
+ },
72
+ "viem": {
73
+ "optional": true
74
+ },
75
+ "@solana/web3.js": {
76
+ "optional": true
77
+ },
78
+ "@stellar/stellar-sdk": {
79
+ "optional": true
80
+ }
41
81
  }
42
- }
82
+ }