@medialane/sdk 0.94.0 → 0.95.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/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/{services-DTkc0lLx.d.ts → services-BllZwNlB.d.ts} +7 -1
- package/dist/{services-D3M9dJZg.d.cts → services-DbJoYGF0.d.cts} +7 -1
- package/dist/starknet/index.cjs +5 -52
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +3 -16
- package/dist/starknet/index.d.ts +3 -16
- package/dist/starknet/index.js +6 -52
- package/dist/starknet/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -363,11 +363,16 @@ interface ApiCoin {
|
|
|
363
363
|
description: string | null;
|
|
364
364
|
image: string | null;
|
|
365
365
|
creator: string | null;
|
|
366
|
+
isLaunched?: boolean | null;
|
|
366
367
|
startBlock: string;
|
|
367
368
|
isHidden: boolean;
|
|
368
369
|
createdAt: string;
|
|
369
370
|
updatedAt: string;
|
|
370
371
|
}
|
|
372
|
+
interface ApiCoinPrice {
|
|
373
|
+
usdc: number;
|
|
374
|
+
}
|
|
375
|
+
type ApiCoinPrices = Record<string, ApiCoinPrice | null>;
|
|
371
376
|
interface ApiCoinsQuery {
|
|
372
377
|
chain?: ChainFilter;
|
|
373
378
|
page?: number;
|
|
@@ -1157,6 +1162,7 @@ declare class ApiClient {
|
|
|
1157
1162
|
getCoin(contract: string): Promise<{
|
|
1158
1163
|
data: ApiCoin;
|
|
1159
1164
|
}>;
|
|
1165
|
+
getCoinPrices(): Promise<ApiResponse<ApiCoinPrices>>;
|
|
1160
1166
|
updateCoinProfile(contract: string, data: {
|
|
1161
1167
|
image?: string;
|
|
1162
1168
|
description?: string;
|
|
@@ -1285,4 +1291,4 @@ interface ProposeSponsorshipParams {
|
|
|
1285
1291
|
royaltyBps: bigint | string;
|
|
1286
1292
|
}
|
|
1287
1293
|
|
|
1288
|
-
export { type
|
|
1294
|
+
export { type ApiRewardsLeaderboardEntry as $, type AcceptSponsorshipBidIntentParams as A, type ApiIntentCreated as B, type ApiKeyStatus as C, type ApiMeta as D, type ApiMetadataSignedUrl as E, type ApiMetadataUpload as F, type ApiOrder as G, type ApiOrderConsideration as H, type ApiOrderOffer as I, type ApiOrderPrice as J, type ApiOrderTokenMeta as K, type ApiOrderTxHash as L, type ApiOrdersQuery as M, type ApiPointEvent as N, type ApiPortalKey as O, type ApiPortalKeyCreated as P, type ApiPortalMe as Q, type ResolvedFeeConfig as R, type ServiceDefinition as S, type ApiPublicRemix as T, type ApiRemixOffer as U, type ApiRemixOfferPrice as V, type ApiRemixOffersQuery as W, type ApiResponse as X, type ApiRewardsBadge as Y, type ApiRewardsBatchEntry as Z, type ApiRewardsConfig as _, type ServiceCapability as a, type Order as a$, type ApiRewardsLevel as a0, type ApiSearchCollectionResult as a1, type ApiSearchCreatorResult as a2, type ApiSearchResult as a3, type ApiSearchTokenResult as a4, type ApiToken as a5, type ApiTokenBalance as a6, type ApiTokenMetadata as a7, type ApiUsageDay as a8, type ApiUserRewards as a9, type CreateSponsorshipOfferParams as aA, type CreateSponsorshipProposalIntentParams as aB, type CreateTicketParams as aC, type CreateTierIntentParams as aD, type CreateWebhookParams as aE, type DropMintStatus as aF, type EnforcementDeclaration as aG, type FactoryFamilyServiceId as aH, type FeeConfig as aI, FeeConfigSchema as aJ, type FulfillOrderIntentParams as aK, type IPType as aL, type IntentCall as aM, type IntentStatus as aN, type IntentType as aO, type IpAttribute as aP, type IpNftMetadata as aQ, type LaunchCoinIntentParams as aR, type MakeOfferIntentParams as aS, MedialaneApiError as aT, type MedialaneConfig as aU, type MedialaneErrorCode as aV, type MintMembershipsParams as aW, type MintTicketsParams as aX, OPEN_LICENSES as aY, type OfferItem as aZ, type OpenLicense as a_, type ApiUserWallet as aa, type ApiWalletActivity as ab, type ApiWebhookCreated as ac, type ApiWebhookEndpoint as ad, type AutoRemixOfferParams as ae, type CancelOrderIntentParams as af, type ChainFilter as ag, type CheckoutIntentItem as ah, type ClaimConditions as ai, type CollectionServiceId as aj, type CollectionSort as ak, type CollectionTokensSort as al, type ConfirmRemixOfferParams as am, type ConfirmSelfRemixParams as an, type ConsiderationItem as ao, type CreateCheckoutIntentParams as ap, type CreateCoinIntentParams as aq, type CreateCollectionIntentParams as ar, type CreateCounterOfferIntentParams as as, type CreateDropParams as at, type CreateListingIntentParams as au, type CreateMembershipParams as av, type CreateMintIntentParams as aw, type CreatePopCollectionParams as ax, type CreateRemixOfferParams as ay, type CreateSponsorshipOfferIntentParams as az, type AcceptSponsorshipProposalIntentParams as b, type OrderDetails as b0, type OrderParameters as b1, type OrderStatus as b2, type PlaceSponsorshipBidIntentParams as b3, type PopBatchEligibilityItem as b4, type PopClaimStatus as b5, type PopEventType as b6, type ProposeSponsorshipParams as b7, type RejectSponsorshipProposalIntentParams as b8, type RemixOfferStatus as b9, type ResolvedConfig as ba, type RetractSponsorshipBidIntentParams as bb, type RetryOptions as bc, type ServiceEventDeclaration as bd, type SetSponsorshipOfferOpenIntentParams as be, type SortOrder as bf, type TenantPlan as bg, type TierServiceId as bh, type TxResult as bi, type WebhookEventType as bj, type WebhookStatus as bk, type WithdrawSponsorshipProposalIntentParams as bl, resolveConfig as bm, resolveFeeConfig as bn, type ActivityType as c, type ApiActivitiesQuery as d, type ApiActivity as e, type ApiActivityPrice as f, type ApiAdminCollectionClaim as g, type ApiAppSource as h, type ApiBusinessProvisioning as i, type ApiChain as j, type ApiCheckoutIntentResult as k, ApiClient as l, type ApiCoin as m, type ApiCoinPrice as n, type ApiCoinPrices as o, type ApiCoinsQuery as p, type ApiCollection as q, type ApiCollectionClaim as r, type ApiCollectionProfile as s, type ApiCollectionSlugClaim as t, type ApiCollectionsQuery as u, type ApiComment as v, type ApiCounterOffersQuery as w, type ApiCreatorListResult as x, type ApiCreatorProfile as y, type ApiIntent as z };
|
|
@@ -363,11 +363,16 @@ interface ApiCoin {
|
|
|
363
363
|
description: string | null;
|
|
364
364
|
image: string | null;
|
|
365
365
|
creator: string | null;
|
|
366
|
+
isLaunched?: boolean | null;
|
|
366
367
|
startBlock: string;
|
|
367
368
|
isHidden: boolean;
|
|
368
369
|
createdAt: string;
|
|
369
370
|
updatedAt: string;
|
|
370
371
|
}
|
|
372
|
+
interface ApiCoinPrice {
|
|
373
|
+
usdc: number;
|
|
374
|
+
}
|
|
375
|
+
type ApiCoinPrices = Record<string, ApiCoinPrice | null>;
|
|
371
376
|
interface ApiCoinsQuery {
|
|
372
377
|
chain?: ChainFilter;
|
|
373
378
|
page?: number;
|
|
@@ -1157,6 +1162,7 @@ declare class ApiClient {
|
|
|
1157
1162
|
getCoin(contract: string): Promise<{
|
|
1158
1163
|
data: ApiCoin;
|
|
1159
1164
|
}>;
|
|
1165
|
+
getCoinPrices(): Promise<ApiResponse<ApiCoinPrices>>;
|
|
1160
1166
|
updateCoinProfile(contract: string, data: {
|
|
1161
1167
|
image?: string;
|
|
1162
1168
|
description?: string;
|
|
@@ -1285,4 +1291,4 @@ interface ProposeSponsorshipParams {
|
|
|
1285
1291
|
royaltyBps: bigint | string;
|
|
1286
1292
|
}
|
|
1287
1293
|
|
|
1288
|
-
export { type
|
|
1294
|
+
export { type ApiRewardsLeaderboardEntry as $, type AcceptSponsorshipBidIntentParams as A, type ApiIntentCreated as B, type ApiKeyStatus as C, type ApiMeta as D, type ApiMetadataSignedUrl as E, type ApiMetadataUpload as F, type ApiOrder as G, type ApiOrderConsideration as H, type ApiOrderOffer as I, type ApiOrderPrice as J, type ApiOrderTokenMeta as K, type ApiOrderTxHash as L, type ApiOrdersQuery as M, type ApiPointEvent as N, type ApiPortalKey as O, type ApiPortalKeyCreated as P, type ApiPortalMe as Q, type ResolvedFeeConfig as R, type ServiceDefinition as S, type ApiPublicRemix as T, type ApiRemixOffer as U, type ApiRemixOfferPrice as V, type ApiRemixOffersQuery as W, type ApiResponse as X, type ApiRewardsBadge as Y, type ApiRewardsBatchEntry as Z, type ApiRewardsConfig as _, type ServiceCapability as a, type Order as a$, type ApiRewardsLevel as a0, type ApiSearchCollectionResult as a1, type ApiSearchCreatorResult as a2, type ApiSearchResult as a3, type ApiSearchTokenResult as a4, type ApiToken as a5, type ApiTokenBalance as a6, type ApiTokenMetadata as a7, type ApiUsageDay as a8, type ApiUserRewards as a9, type CreateSponsorshipOfferParams as aA, type CreateSponsorshipProposalIntentParams as aB, type CreateTicketParams as aC, type CreateTierIntentParams as aD, type CreateWebhookParams as aE, type DropMintStatus as aF, type EnforcementDeclaration as aG, type FactoryFamilyServiceId as aH, type FeeConfig as aI, FeeConfigSchema as aJ, type FulfillOrderIntentParams as aK, type IPType as aL, type IntentCall as aM, type IntentStatus as aN, type IntentType as aO, type IpAttribute as aP, type IpNftMetadata as aQ, type LaunchCoinIntentParams as aR, type MakeOfferIntentParams as aS, MedialaneApiError as aT, type MedialaneConfig as aU, type MedialaneErrorCode as aV, type MintMembershipsParams as aW, type MintTicketsParams as aX, OPEN_LICENSES as aY, type OfferItem as aZ, type OpenLicense as a_, type ApiUserWallet as aa, type ApiWalletActivity as ab, type ApiWebhookCreated as ac, type ApiWebhookEndpoint as ad, type AutoRemixOfferParams as ae, type CancelOrderIntentParams as af, type ChainFilter as ag, type CheckoutIntentItem as ah, type ClaimConditions as ai, type CollectionServiceId as aj, type CollectionSort as ak, type CollectionTokensSort as al, type ConfirmRemixOfferParams as am, type ConfirmSelfRemixParams as an, type ConsiderationItem as ao, type CreateCheckoutIntentParams as ap, type CreateCoinIntentParams as aq, type CreateCollectionIntentParams as ar, type CreateCounterOfferIntentParams as as, type CreateDropParams as at, type CreateListingIntentParams as au, type CreateMembershipParams as av, type CreateMintIntentParams as aw, type CreatePopCollectionParams as ax, type CreateRemixOfferParams as ay, type CreateSponsorshipOfferIntentParams as az, type AcceptSponsorshipProposalIntentParams as b, type OrderDetails as b0, type OrderParameters as b1, type OrderStatus as b2, type PlaceSponsorshipBidIntentParams as b3, type PopBatchEligibilityItem as b4, type PopClaimStatus as b5, type PopEventType as b6, type ProposeSponsorshipParams as b7, type RejectSponsorshipProposalIntentParams as b8, type RemixOfferStatus as b9, type ResolvedConfig as ba, type RetractSponsorshipBidIntentParams as bb, type RetryOptions as bc, type ServiceEventDeclaration as bd, type SetSponsorshipOfferOpenIntentParams as be, type SortOrder as bf, type TenantPlan as bg, type TierServiceId as bh, type TxResult as bi, type WebhookEventType as bj, type WebhookStatus as bk, type WithdrawSponsorshipProposalIntentParams as bl, resolveConfig as bm, resolveFeeConfig as bn, type ActivityType as c, type ApiActivitiesQuery as d, type ApiActivity as e, type ApiActivityPrice as f, type ApiAdminCollectionClaim as g, type ApiAppSource as h, type ApiBusinessProvisioning as i, type ApiChain as j, type ApiCheckoutIntentResult as k, ApiClient as l, type ApiCoin as m, type ApiCoinPrice as n, type ApiCoinPrices as o, type ApiCoinsQuery as p, type ApiCollection as q, type ApiCollectionClaim as r, type ApiCollectionProfile as s, type ApiCollectionSlugClaim as t, type ApiCollectionsQuery as u, type ApiComment as v, type ApiCounterOffersQuery as w, type ApiCreatorListResult as x, type ApiCreatorProfile as y, type ApiIntent as z };
|
package/dist/starknet/index.cjs
CHANGED
|
@@ -760,6 +760,9 @@ var ApiClient = class {
|
|
|
760
760
|
getCoin(contract) {
|
|
761
761
|
return this.get(`/v1/coins/${this.addr(contract)}`);
|
|
762
762
|
}
|
|
763
|
+
getCoinPrices() {
|
|
764
|
+
return this.get("/v1/coins/prices");
|
|
765
|
+
}
|
|
763
766
|
updateCoinProfile(contract, data, siwsToken) {
|
|
764
767
|
return this.request(`/v1/coins/${this.addr(contract)}`, {
|
|
765
768
|
method: "PATCH",
|
|
@@ -10252,25 +10255,6 @@ var ERC1155CollectionService = class {
|
|
|
10252
10255
|
}
|
|
10253
10256
|
};
|
|
10254
10257
|
|
|
10255
|
-
// src/utils/token.ts
|
|
10256
|
-
function getTokenByAddress(address) {
|
|
10257
|
-
let target = null;
|
|
10258
|
-
try {
|
|
10259
|
-
target = BigInt(address);
|
|
10260
|
-
} catch {
|
|
10261
|
-
target = null;
|
|
10262
|
-
}
|
|
10263
|
-
return SUPPORTED_TOKENS.find((t) => {
|
|
10264
|
-
if (target !== null) {
|
|
10265
|
-
try {
|
|
10266
|
-
return BigInt(t.address) === target;
|
|
10267
|
-
} catch {
|
|
10268
|
-
}
|
|
10269
|
-
}
|
|
10270
|
-
return t.address.toLowerCase() === address.toLowerCase();
|
|
10271
|
-
});
|
|
10272
|
-
}
|
|
10273
|
-
|
|
10274
10258
|
// src/starknet/services/coinLaunchMath.ts
|
|
10275
10259
|
var COIN_DECIMALS = 18;
|
|
10276
10260
|
var LAUNCH_PRICE_QUOTE_PER_COIN = 0.01;
|
|
@@ -10365,36 +10349,6 @@ async function getCreatorCoinGuarantees(coinAddress, provider) {
|
|
|
10365
10349
|
};
|
|
10366
10350
|
}
|
|
10367
10351
|
var COIN_DECIMALS2 = 18;
|
|
10368
|
-
async function getCreatorCoinMarket(coinAddress, provider) {
|
|
10369
|
-
const r = await provider.callContract({
|
|
10370
|
-
contractAddress: coinAddress,
|
|
10371
|
-
entrypoint: "launched_with_liquidity_parameters",
|
|
10372
|
-
calldata: []
|
|
10373
|
-
});
|
|
10374
|
-
if (BigInt(r[0]) !== 0n || BigInt(r[1]) !== 0n) return { status: "pre-launch" };
|
|
10375
|
-
const fee = r[2];
|
|
10376
|
-
const tickSpacing = r[3];
|
|
10377
|
-
const quoteToken = normalizeAddress("STARKNET", "0x" + BigInt(r[7]).toString(16));
|
|
10378
|
-
const token = getTokenByAddress(quoteToken);
|
|
10379
|
-
const quoteDecimals = token?.decimals ?? 18;
|
|
10380
|
-
const ci = BigInt(coinAddress);
|
|
10381
|
-
const qi = BigInt(quoteToken);
|
|
10382
|
-
const [t0, t1] = ci < qi ? [coinAddress, quoteToken] : [quoteToken, coinAddress];
|
|
10383
|
-
const quoteIsToken0 = qi === BigInt(t0);
|
|
10384
|
-
const pp = await provider.callContract({
|
|
10385
|
-
contractAddress: getStarknetCoordinates("STARKNET").ekuboCore,
|
|
10386
|
-
entrypoint: "get_pool_price",
|
|
10387
|
-
calldata: [t0, t1, fee, tickSpacing, "0x0"]
|
|
10388
|
-
});
|
|
10389
|
-
const sqrt = BigInt(pp[0]) + (BigInt(pp[1] ?? "0x0") << 128n);
|
|
10390
|
-
const priceT1perT0 = (Number(sqrt) / 2 ** 128) ** 2;
|
|
10391
|
-
const decAdj = 10 ** (COIN_DECIMALS2 - quoteDecimals);
|
|
10392
|
-
const quotePerCoin = (quoteIsToken0 ? 1 / priceT1perT0 : priceT1perT0) * decAdj;
|
|
10393
|
-
return {
|
|
10394
|
-
status: "live",
|
|
10395
|
-
price: { quotePerCoin, quoteToken, quoteSymbol: token?.symbol ?? null, quoteDecimals }
|
|
10396
|
-
};
|
|
10397
|
-
}
|
|
10398
10352
|
var _factoryContract = null;
|
|
10399
10353
|
function factoryContract() {
|
|
10400
10354
|
if (!_factoryContract) {
|
|
@@ -10482,8 +10436,8 @@ var CreatorCoinService = class {
|
|
|
10482
10436
|
const r = await this._factory(account).is_creator_coin(address);
|
|
10483
10437
|
return BigInt(r) === 1n;
|
|
10484
10438
|
}
|
|
10485
|
-
async
|
|
10486
|
-
return
|
|
10439
|
+
async getGuarantees(coinAddress) {
|
|
10440
|
+
return getCreatorCoinGuarantees(coinAddress, new starknet.RpcProvider({ nodeUrl: this.config.rpcUrl }));
|
|
10487
10441
|
}
|
|
10488
10442
|
};
|
|
10489
10443
|
var TicketService = class {
|
|
@@ -11805,7 +11759,6 @@ exports.generateStarkKeyPair = generateStarkKeyPair;
|
|
|
11805
11759
|
exports.getCounter = getCounter;
|
|
11806
11760
|
exports.getCounter1155 = getCounter1155;
|
|
11807
11761
|
exports.getCreatorCoinGuarantees = getCreatorCoinGuarantees;
|
|
11808
|
-
exports.getCreatorCoinMarket = getCreatorCoinMarket;
|
|
11809
11762
|
exports.getEscape = getEscape;
|
|
11810
11763
|
exports.getEscapeSecurityPeriod = getEscapeSecurityPeriod;
|
|
11811
11764
|
exports.getGuardians = getGuardians;
|