@medialane/sdk 0.99.0 → 0.100.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 +2 -2
- 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 +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{services-6lZz3hUV.d.ts → services-BcckoQHb.d.ts} +1 -0
- package/dist/{services-CRckcKEc.d.cts → services-DkdQoHIr.d.cts} +1 -0
- package/dist/starknet/index.cjs +62 -10
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +26 -6
- package/dist/starknet/index.d.ts +26 -6
- package/dist/starknet/index.js +59 -10
- package/dist/starknet/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bb as ResolvedConfig, bj as TxResult, ay as CreatePopCollectionParams, aj as ClaimConditions, au as CreateDropParams, aD as CreateTicketParams, aY as MintTicketsParams, aw as CreateMembershipParams, aX as MintMembershipsParams, aB as CreateSponsorshipOfferParams, b8 as ProposeSponsorshipParams, l as ApiClient, aV as MedialaneConfig, aW as MedialaneErrorCode, b1 as OrderDetails, R as ResolvedFeeConfig } from '../services-
|
|
1
|
+
import { bb as ResolvedConfig, bj as TxResult, ay as CreatePopCollectionParams, aj as ClaimConditions, au as CreateDropParams, aD as CreateTicketParams, aY as MintTicketsParams, aw as CreateMembershipParams, aX as MintMembershipsParams, aB as CreateSponsorshipOfferParams, b8 as ProposeSponsorshipParams, l as ApiClient, aV as MedialaneConfig, aW as MedialaneErrorCode, b1 as OrderDetails, R as ResolvedFeeConfig } from '../services-DkdQoHIr.cjs';
|
|
2
2
|
import { AccountInterface, Call, ProviderInterface, TypedData, constants, BigNumberish, DeployAccountContractPayload } from 'starknet';
|
|
3
3
|
import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-nPIXtCF5.cjs';
|
|
4
4
|
import 'zod';
|
|
@@ -157,11 +157,12 @@ interface EkuboLaunchParams {
|
|
|
157
157
|
initialHoldersAmounts: (bigint | string)[];
|
|
158
158
|
transferRestrictionDelay?: number;
|
|
159
159
|
maxPercentageBuyLaunch?: number;
|
|
160
|
-
ekubo
|
|
160
|
+
ekubo: EkuboPoolParams;
|
|
161
161
|
quoteFundAmount?: bigint | string;
|
|
162
162
|
}
|
|
163
163
|
declare const VALIDATED_EKUBO_PARAMS: EkuboPoolParams;
|
|
164
164
|
declare function priceToEkuboParams(quoteDecimals: number, price?: number): EkuboPoolParams;
|
|
165
|
+
declare function validatePrice(quoteDecimals: number, price: number): string | null;
|
|
165
166
|
declare const MAX_TEAM_ALLOCATION_PERCENT = 10;
|
|
166
167
|
declare const MAX_HOLDERS_AT_LAUNCH = 10;
|
|
167
168
|
interface CreatorCoinGuarantees {
|
|
@@ -7829,7 +7830,7 @@ declare const IPGenesisABI: readonly [{
|
|
|
7829
7830
|
}];
|
|
7830
7831
|
}];
|
|
7831
7832
|
|
|
7832
|
-
declare const
|
|
7833
|
+
declare const SUGGESTED_DEFAULT_PRICE = 0.01;
|
|
7833
7834
|
declare const MIN_SUPPLY = 1000n;
|
|
7834
7835
|
declare const MAX_SUPPLY = 1000000000000n;
|
|
7835
7836
|
declare function validateName(s: string): string | null;
|
|
@@ -7837,8 +7838,27 @@ declare function validateSymbol(s: string): string | null;
|
|
|
7837
7838
|
declare function validateSupply(human: string): string | null;
|
|
7838
7839
|
declare function toRaw(human: bigint, decimals?: number): bigint;
|
|
7839
7840
|
declare function teamCoinsRaw(supplyRaw: bigint, pct: number): bigint;
|
|
7840
|
-
declare function buybackQuoteRaw(teamCoinsRawValue: bigint, quoteDecimals: number): bigint;
|
|
7841
|
-
declare function fdvHuman(supplyHuman: number): number;
|
|
7841
|
+
declare function buybackQuoteRaw(teamCoinsRawValue: bigint, price: number, quoteDecimals: number): bigint;
|
|
7842
|
+
declare function fdvHuman(supplyHuman: number, price: number): number;
|
|
7843
|
+
|
|
7844
|
+
interface TypedDataSigner {
|
|
7845
|
+
address: string;
|
|
7846
|
+
signTypedData(typedData: TypedData): Promise<string[]>;
|
|
7847
|
+
}
|
|
7848
|
+
interface SponsoredExecuteConfig {
|
|
7849
|
+
proxyUrl: string;
|
|
7850
|
+
fetchImpl?: typeof fetch;
|
|
7851
|
+
}
|
|
7852
|
+
type SponsoredExecuteResult = {
|
|
7853
|
+
status: "sponsored";
|
|
7854
|
+
transactionHash: string;
|
|
7855
|
+
} | {
|
|
7856
|
+
status: "unavailable";
|
|
7857
|
+
reason: string;
|
|
7858
|
+
};
|
|
7859
|
+
declare class SponsoredCallRejectedError extends Error {
|
|
7860
|
+
}
|
|
7861
|
+
declare function executeSponsored(config: SponsoredExecuteConfig, signer: TypedDataSigner, calls: Call[]): Promise<SponsoredExecuteResult>;
|
|
7842
7862
|
|
|
7843
7863
|
declare function encodeByteArray(str: string): string[];
|
|
7844
7864
|
|
|
@@ -7905,4 +7925,4 @@ declare function signWithPrivateKey(privateKeyHex: string, msgHash: string): [st
|
|
|
7905
7925
|
|
|
7906
7926
|
type StarknetVenueSigner = VenueSigner<TypedData, Call>;
|
|
7907
7927
|
|
|
7908
|
-
export { ADMIN_HEADERS, ADMIN_SCOPE, type AddSupplyParams, type AdminGrant, type AdminRequest, type AdminRequestSig, type AdminSession, type AdminSessionTypedDataInput, type BatchMintEditionParams, type BuildFeeCallParams, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClaimConditions, ClubService, type CreateCreatorCoinParams, CreateDropParams, type CreateGrantOpts, CreatePopCollectionParams, CreatorCoinFactoryABI, type CreatorCoinGuarantees, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EscapeInfo, type EscapeStatusName, type EscapeTypeName, type FeeSurface, type GuardianInfo, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI,
|
|
7928
|
+
export { ADMIN_HEADERS, ADMIN_SCOPE, type AddSupplyParams, type AdminGrant, type AdminRequest, type AdminRequestSig, type AdminSession, type AdminSessionTypedDataInput, type BatchMintEditionParams, type BuildFeeCallParams, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClaimConditions, ClubService, type CreateCreatorCoinParams, CreateDropParams, type CreateGrantOpts, CreatePopCollectionParams, CreatorCoinFactoryABI, type CreatorCoinGuarantees, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EscapeInfo, type EscapeStatusName, type EscapeTypeName, type FeeSurface, type GuardianInfo, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, MAX_HOLDERS_AT_LAUNCH, MAX_TEAM_ALLOCATION_PERCENT, Medialane1155ABI, MedialaneClient, MedialaneError, type MintEditionParams, POPCollectionABI, POPFactoryABI, type ParsedAdminHeaders, PopService, type RequestSiwsTokenArgs, type ResolvedOrder, SUGGESTED_DEFAULT_PRICE, type SiwsSigner, SponsoredCallRejectedError, type SponsoredExecuteConfig, type SponsoredExecuteResult, SponsorshipService, StarknetVenue, type StarknetVenueDeps, type StarknetVenueSigner, TicketService, type TypedDataSigner, VALIDATED_EKUBO_PARAMS, VenueSigner, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancelEscapeCall, buildCancellationTypedData, buildChangeOwnersCall, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, toRaw as coinToRaw, computeAccountAddress, computeOwnerGuid, createAdminSessionGrant, decodeEscapeAndStatus, decodeGuardiansInfo, deriveAesKey, deriveOwnerKeyPair, encodeAdminHeaders, encodeByteArray, executeSponsored, fdvHuman, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getSiwsStorageKey, getStoredSiwsToken, isSiwsTokenValid, normalizeSiwsSignature, ownerConstructorCalldata, parseAdminHeaders, parseCreatorCoinCreated, priceToEkuboParams, randomNonce, requestSiwsToken, sealPrivateKey, sessionKeyHashOf, signAdminRequest, signWithPrivateKey, storeSiwsToken, teamCoinsRaw, toContractConditions as toDropContractConditions, unsealPrivateKey, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyAdminRequestSig };
|
package/dist/starknet/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bb as ResolvedConfig, bj as TxResult, ay as CreatePopCollectionParams, aj as ClaimConditions, au as CreateDropParams, aD as CreateTicketParams, aY as MintTicketsParams, aw as CreateMembershipParams, aX as MintMembershipsParams, aB as CreateSponsorshipOfferParams, b8 as ProposeSponsorshipParams, l as ApiClient, aV as MedialaneConfig, aW as MedialaneErrorCode, b1 as OrderDetails, R as ResolvedFeeConfig } from '../services-
|
|
1
|
+
import { bb as ResolvedConfig, bj as TxResult, ay as CreatePopCollectionParams, aj as ClaimConditions, au as CreateDropParams, aD as CreateTicketParams, aY as MintTicketsParams, aw as CreateMembershipParams, aX as MintMembershipsParams, aB as CreateSponsorshipOfferParams, b8 as ProposeSponsorshipParams, l as ApiClient, aV as MedialaneConfig, aW as MedialaneErrorCode, b1 as OrderDetails, R as ResolvedFeeConfig } from '../services-BcckoQHb.js';
|
|
2
2
|
import { AccountInterface, Call, ProviderInterface, TypedData, constants, BigNumberish, DeployAccountContractPayload } from 'starknet';
|
|
3
3
|
import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-nPIXtCF5.js';
|
|
4
4
|
import 'zod';
|
|
@@ -157,11 +157,12 @@ interface EkuboLaunchParams {
|
|
|
157
157
|
initialHoldersAmounts: (bigint | string)[];
|
|
158
158
|
transferRestrictionDelay?: number;
|
|
159
159
|
maxPercentageBuyLaunch?: number;
|
|
160
|
-
ekubo
|
|
160
|
+
ekubo: EkuboPoolParams;
|
|
161
161
|
quoteFundAmount?: bigint | string;
|
|
162
162
|
}
|
|
163
163
|
declare const VALIDATED_EKUBO_PARAMS: EkuboPoolParams;
|
|
164
164
|
declare function priceToEkuboParams(quoteDecimals: number, price?: number): EkuboPoolParams;
|
|
165
|
+
declare function validatePrice(quoteDecimals: number, price: number): string | null;
|
|
165
166
|
declare const MAX_TEAM_ALLOCATION_PERCENT = 10;
|
|
166
167
|
declare const MAX_HOLDERS_AT_LAUNCH = 10;
|
|
167
168
|
interface CreatorCoinGuarantees {
|
|
@@ -7829,7 +7830,7 @@ declare const IPGenesisABI: readonly [{
|
|
|
7829
7830
|
}];
|
|
7830
7831
|
}];
|
|
7831
7832
|
|
|
7832
|
-
declare const
|
|
7833
|
+
declare const SUGGESTED_DEFAULT_PRICE = 0.01;
|
|
7833
7834
|
declare const MIN_SUPPLY = 1000n;
|
|
7834
7835
|
declare const MAX_SUPPLY = 1000000000000n;
|
|
7835
7836
|
declare function validateName(s: string): string | null;
|
|
@@ -7837,8 +7838,27 @@ declare function validateSymbol(s: string): string | null;
|
|
|
7837
7838
|
declare function validateSupply(human: string): string | null;
|
|
7838
7839
|
declare function toRaw(human: bigint, decimals?: number): bigint;
|
|
7839
7840
|
declare function teamCoinsRaw(supplyRaw: bigint, pct: number): bigint;
|
|
7840
|
-
declare function buybackQuoteRaw(teamCoinsRawValue: bigint, quoteDecimals: number): bigint;
|
|
7841
|
-
declare function fdvHuman(supplyHuman: number): number;
|
|
7841
|
+
declare function buybackQuoteRaw(teamCoinsRawValue: bigint, price: number, quoteDecimals: number): bigint;
|
|
7842
|
+
declare function fdvHuman(supplyHuman: number, price: number): number;
|
|
7843
|
+
|
|
7844
|
+
interface TypedDataSigner {
|
|
7845
|
+
address: string;
|
|
7846
|
+
signTypedData(typedData: TypedData): Promise<string[]>;
|
|
7847
|
+
}
|
|
7848
|
+
interface SponsoredExecuteConfig {
|
|
7849
|
+
proxyUrl: string;
|
|
7850
|
+
fetchImpl?: typeof fetch;
|
|
7851
|
+
}
|
|
7852
|
+
type SponsoredExecuteResult = {
|
|
7853
|
+
status: "sponsored";
|
|
7854
|
+
transactionHash: string;
|
|
7855
|
+
} | {
|
|
7856
|
+
status: "unavailable";
|
|
7857
|
+
reason: string;
|
|
7858
|
+
};
|
|
7859
|
+
declare class SponsoredCallRejectedError extends Error {
|
|
7860
|
+
}
|
|
7861
|
+
declare function executeSponsored(config: SponsoredExecuteConfig, signer: TypedDataSigner, calls: Call[]): Promise<SponsoredExecuteResult>;
|
|
7842
7862
|
|
|
7843
7863
|
declare function encodeByteArray(str: string): string[];
|
|
7844
7864
|
|
|
@@ -7905,4 +7925,4 @@ declare function signWithPrivateKey(privateKeyHex: string, msgHash: string): [st
|
|
|
7905
7925
|
|
|
7906
7926
|
type StarknetVenueSigner = VenueSigner<TypedData, Call>;
|
|
7907
7927
|
|
|
7908
|
-
export { ADMIN_HEADERS, ADMIN_SCOPE, type AddSupplyParams, type AdminGrant, type AdminRequest, type AdminRequestSig, type AdminSession, type AdminSessionTypedDataInput, type BatchMintEditionParams, type BuildFeeCallParams, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClaimConditions, ClubService, type CreateCreatorCoinParams, CreateDropParams, type CreateGrantOpts, CreatePopCollectionParams, CreatorCoinFactoryABI, type CreatorCoinGuarantees, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EscapeInfo, type EscapeStatusName, type EscapeTypeName, type FeeSurface, type GuardianInfo, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI,
|
|
7928
|
+
export { ADMIN_HEADERS, ADMIN_SCOPE, type AddSupplyParams, type AdminGrant, type AdminRequest, type AdminRequestSig, type AdminSession, type AdminSessionTypedDataInput, type BatchMintEditionParams, type BuildFeeCallParams, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClaimConditions, ClubService, type CreateCreatorCoinParams, CreateDropParams, type CreateGrantOpts, CreatePopCollectionParams, CreatorCoinFactoryABI, type CreatorCoinGuarantees, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EscapeInfo, type EscapeStatusName, type EscapeTypeName, type FeeSurface, type GuardianInfo, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, MAX_HOLDERS_AT_LAUNCH, MAX_TEAM_ALLOCATION_PERCENT, Medialane1155ABI, MedialaneClient, MedialaneError, type MintEditionParams, POPCollectionABI, POPFactoryABI, type ParsedAdminHeaders, PopService, type RequestSiwsTokenArgs, type ResolvedOrder, SUGGESTED_DEFAULT_PRICE, type SiwsSigner, SponsoredCallRejectedError, type SponsoredExecuteConfig, type SponsoredExecuteResult, SponsorshipService, StarknetVenue, type StarknetVenueDeps, type StarknetVenueSigner, TicketService, type TypedDataSigner, VALIDATED_EKUBO_PARAMS, VenueSigner, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancelEscapeCall, buildCancellationTypedData, buildChangeOwnersCall, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, toRaw as coinToRaw, computeAccountAddress, computeOwnerGuid, createAdminSessionGrant, decodeEscapeAndStatus, decodeGuardiansInfo, deriveAesKey, deriveOwnerKeyPair, encodeAdminHeaders, encodeByteArray, executeSponsored, fdvHuman, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getSiwsStorageKey, getStoredSiwsToken, isSiwsTokenValid, normalizeSiwsSignature, ownerConstructorCalldata, parseAdminHeaders, parseCreatorCoinCreated, priceToEkuboParams, randomNonce, requestSiwsToken, sealPrivateKey, sessionKeyHashOf, signAdminRequest, signWithPrivateKey, storeSiwsToken, teamCoinsRaw, toContractConditions as toDropContractConditions, unsealPrivateKey, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyAdminRequestSig };
|
package/dist/starknet/index.js
CHANGED
|
@@ -10267,7 +10267,7 @@ var ERC1155CollectionService = class {
|
|
|
10267
10267
|
|
|
10268
10268
|
// src/starknet/services/coinLaunchMath.ts
|
|
10269
10269
|
var COIN_DECIMALS = 18;
|
|
10270
|
-
var
|
|
10270
|
+
var SUGGESTED_DEFAULT_PRICE = 0.01;
|
|
10271
10271
|
var MIN_SUPPLY = 1000n;
|
|
10272
10272
|
var MAX_SUPPLY = 1000000000000n;
|
|
10273
10273
|
var MAX_FELT_BYTES = 31;
|
|
@@ -10298,11 +10298,13 @@ function teamCoinsRaw(supplyRaw, pct) {
|
|
|
10298
10298
|
const bps = BigInt(Math.round(pct * 100));
|
|
10299
10299
|
return supplyRaw * bps / 10000n;
|
|
10300
10300
|
}
|
|
10301
|
-
|
|
10302
|
-
|
|
10301
|
+
var PRICE_SCALE = 1000000000000n;
|
|
10302
|
+
function buybackQuoteRaw(teamCoinsRawValue, price, quoteDecimals) {
|
|
10303
|
+
const priceScaled = BigInt(Math.round(price * Number(PRICE_SCALE)));
|
|
10304
|
+
return teamCoinsRawValue * priceScaled * 10n ** BigInt(quoteDecimals) / (PRICE_SCALE * 10n ** BigInt(COIN_DECIMALS));
|
|
10303
10305
|
}
|
|
10304
|
-
function fdvHuman(supplyHuman) {
|
|
10305
|
-
return supplyHuman *
|
|
10306
|
+
function fdvHuman(supplyHuman, price) {
|
|
10307
|
+
return supplyHuman * price;
|
|
10306
10308
|
}
|
|
10307
10309
|
|
|
10308
10310
|
// src/starknet/services/creatorCoin.ts
|
|
@@ -10313,8 +10315,8 @@ var VALIDATED_EKUBO_PARAMS = {
|
|
|
10313
10315
|
bound: 88719042n
|
|
10314
10316
|
};
|
|
10315
10317
|
var TICK_BASE = 1.000001;
|
|
10316
|
-
function priceToEkuboParams(quoteDecimals, price =
|
|
10317
|
-
const decAdj = 10 ** (
|
|
10318
|
+
function priceToEkuboParams(quoteDecimals, price = SUGGESTED_DEFAULT_PRICE) {
|
|
10319
|
+
const decAdj = 10 ** (COIN_DECIMALS - quoteDecimals);
|
|
10318
10320
|
const rawRatio = price / decAdj;
|
|
10319
10321
|
const tickSpacing = Number(VALIDATED_EKUBO_PARAMS.tickSpacing);
|
|
10320
10322
|
const rawTick = Math.log(rawRatio) / Math.log(TICK_BASE);
|
|
@@ -10326,6 +10328,17 @@ function priceToEkuboParams(quoteDecimals, price = LAUNCH_PRICE_QUOTE_PER_COIN)
|
|
|
10326
10328
|
bound: VALIDATED_EKUBO_PARAMS.bound
|
|
10327
10329
|
};
|
|
10328
10330
|
}
|
|
10331
|
+
function validatePrice(quoteDecimals, price) {
|
|
10332
|
+
if (!isFinite(price) || price <= 0) return "Price must be a positive number";
|
|
10333
|
+
const decAdj = 10 ** (COIN_DECIMALS - quoteDecimals);
|
|
10334
|
+
const rawRatio = price / decAdj;
|
|
10335
|
+
if (!isFinite(rawRatio) || rawRatio <= 0) return "Price must be a positive number";
|
|
10336
|
+
const rawTick = Math.log(rawRatio) / Math.log(TICK_BASE);
|
|
10337
|
+
if (!isFinite(rawTick)) return "Price is outside the supported range";
|
|
10338
|
+
const bound = Number(VALIDATED_EKUBO_PARAMS.bound);
|
|
10339
|
+
if (Math.abs(rawTick) >= bound) return "Price is outside the supported range";
|
|
10340
|
+
return null;
|
|
10341
|
+
}
|
|
10329
10342
|
var MAX_TEAM_ALLOCATION_PERCENT = 10;
|
|
10330
10343
|
var MAX_HOLDERS_AT_LAUNCH = 10;
|
|
10331
10344
|
function u256(parts, offset = 0) {
|
|
@@ -10358,7 +10371,6 @@ async function getCreatorCoinGuarantees(coinAddress, provider) {
|
|
|
10358
10371
|
liquidityPositionId
|
|
10359
10372
|
};
|
|
10360
10373
|
}
|
|
10361
|
-
var COIN_DECIMALS2 = 18;
|
|
10362
10374
|
var _factoryContract = null;
|
|
10363
10375
|
function factoryContract() {
|
|
10364
10376
|
if (!_factoryContract) {
|
|
@@ -10380,7 +10392,7 @@ function buildCreateCreatorCoinCall(params) {
|
|
|
10380
10392
|
]);
|
|
10381
10393
|
}
|
|
10382
10394
|
function buildLaunchOnEkuboCalls(params) {
|
|
10383
|
-
const ek = params.ekubo
|
|
10395
|
+
const ek = params.ekubo;
|
|
10384
10396
|
const launchParameters = {
|
|
10385
10397
|
creator_coin_address: params.creatorCoin,
|
|
10386
10398
|
transfer_restriction_delay: params.transferRestrictionDelay ?? 0,
|
|
@@ -11530,6 +11542,43 @@ async function requestSiwsToken({
|
|
|
11530
11542
|
storeSiwsToken(walletAddress, token);
|
|
11531
11543
|
return token;
|
|
11532
11544
|
}
|
|
11545
|
+
|
|
11546
|
+
// src/starknet/services/sponsoredExecutor.ts
|
|
11547
|
+
var SponsoredCallRejectedError = class extends Error {
|
|
11548
|
+
};
|
|
11549
|
+
var PRE_BROADCAST_EXECUTE_STATUSES = /* @__PURE__ */ new Set([400, 429, 503]);
|
|
11550
|
+
async function errorReason(res, fallback) {
|
|
11551
|
+
const body = await res.json().catch(() => null);
|
|
11552
|
+
return body?.error || fallback;
|
|
11553
|
+
}
|
|
11554
|
+
async function executeSponsored(config, signer, calls) {
|
|
11555
|
+
const doFetch = config.fetchImpl ?? fetch;
|
|
11556
|
+
const base = config.proxyUrl.replace(/\/$/, "");
|
|
11557
|
+
const buildRes = await doFetch(`${base}/build`, {
|
|
11558
|
+
method: "POST",
|
|
11559
|
+
headers: { "Content-Type": "application/json" },
|
|
11560
|
+
body: JSON.stringify({ userAddress: signer.address, calls })
|
|
11561
|
+
});
|
|
11562
|
+
if (!buildRes.ok) {
|
|
11563
|
+
return { status: "unavailable", reason: await errorReason(buildRes, "We couldn't prepare this transaction.") };
|
|
11564
|
+
}
|
|
11565
|
+
const { typedData } = await buildRes.json();
|
|
11566
|
+
const signature = await signer.signTypedData(typedData);
|
|
11567
|
+
const executeRes = await doFetch(`${base}/execute`, {
|
|
11568
|
+
method: "POST",
|
|
11569
|
+
headers: { "Content-Type": "application/json" },
|
|
11570
|
+
body: JSON.stringify({ userAddress: signer.address, typedData, signature, calls })
|
|
11571
|
+
});
|
|
11572
|
+
if (!executeRes.ok) {
|
|
11573
|
+
const reason = await errorReason(executeRes, "We couldn't submit this transaction.");
|
|
11574
|
+
if (PRE_BROADCAST_EXECUTE_STATUSES.has(executeRes.status)) {
|
|
11575
|
+
return { status: "unavailable", reason };
|
|
11576
|
+
}
|
|
11577
|
+
throw new SponsoredCallRejectedError(reason);
|
|
11578
|
+
}
|
|
11579
|
+
const { transactionHash } = await executeRes.json();
|
|
11580
|
+
return { status: "sponsored", transactionHash };
|
|
11581
|
+
}
|
|
11533
11582
|
function encodeByteArray(str) {
|
|
11534
11583
|
const bytes = new TextEncoder().encode(str);
|
|
11535
11584
|
const fullChunks = [];
|
|
@@ -11703,6 +11752,6 @@ function signWithPrivateKey(privateKeyHex, msgHash) {
|
|
|
11703
11752
|
return [num.toHex(sig.r), num.toHex(sig.s)];
|
|
11704
11753
|
}
|
|
11705
11754
|
|
|
11706
|
-
export { ADMIN_HEADERS, ADMIN_SCOPE, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClubService, CreatorCoinFactoryABI, CreatorCoinService, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI,
|
|
11755
|
+
export { ADMIN_HEADERS, ADMIN_SCOPE, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClubService, CreatorCoinFactoryABI, CreatorCoinService, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, MAX_HOLDERS_AT_LAUNCH, MAX_TEAM_ALLOCATION_PERCENT, Medialane1155ABI, MedialaneClient, MedialaneError, POPCollectionABI, POPFactoryABI, PopService, SUGGESTED_DEFAULT_PRICE, SponsoredCallRejectedError, SponsorshipService, StarknetVenue, TicketService, VALIDATED_EKUBO_PARAMS, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancelEscapeCall, buildCancellationTypedData, buildChangeOwnersCall, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, toRaw as coinToRaw, computeAccountAddress, computeOwnerGuid, createAdminSessionGrant, decodeEscapeAndStatus, decodeGuardiansInfo, deriveAesKey, deriveOwnerKeyPair, encodeAdminHeaders, encodeByteArray, executeSponsored, fdvHuman, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getSiwsStorageKey, getStoredSiwsToken, isSiwsTokenValid, normalizeSiwsSignature, ownerConstructorCalldata, parseAdminHeaders, parseCreatorCoinCreated, priceToEkuboParams, randomNonce, requestSiwsToken, sealPrivateKey, sessionKeyHashOf, signAdminRequest, signWithPrivateKey, storeSiwsToken, teamCoinsRaw, toContractConditions as toDropContractConditions, unsealPrivateKey, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyAdminRequestSig };
|
|
11707
11756
|
//# sourceMappingURL=index.js.map
|
|
11708
11757
|
//# sourceMappingURL=index.js.map
|