@medialane/sdk 0.75.0 → 0.77.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/evm/index.cjs +2 -1
- package/dist/evm/index.cjs.map +1 -1
- package/dist/evm/index.d.cts +1 -1
- package/dist/evm/index.d.ts +1 -1
- package/dist/evm/index.js +2 -1
- package/dist/evm/index.js.map +1 -1
- package/dist/index.cjs +28 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +28 -1
- package/dist/index.js.map +1 -1
- package/dist/{services-B7h1qh97.d.ts → services-C5lxQjem.d.ts} +52 -2
- package/dist/{services-CDpAVNqQ.d.cts → services-DgIaaJbX.d.cts} +52 -2
- package/dist/solana/index.cjs +2 -1
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +1 -1
- package/dist/solana/index.d.ts +1 -1
- package/dist/solana/index.js +2 -1
- package/dist/solana/index.js.map +1 -1
- package/dist/starknet/index.cjs +79 -3
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +59 -4
- package/dist/starknet/index.d.ts +59 -4
- package/dist/starknet/index.js +74 -4
- package/dist/starknet/index.js.map +1 -1
- package/dist/stellar/index.cjs +2 -1
- package/dist/stellar/index.cjs.map +1 -1
- package/dist/stellar/index.d.cts +1 -1
- package/dist/stellar/index.d.ts +1 -1
- package/dist/stellar/index.js +2 -1
- package/dist/stellar/index.js.map +1 -1
- package/dist/{types-Cdwb6lXp.d.cts → types-sIc3OCpo.d.cts} +1 -0
- package/dist/{types-Cdwb6lXp.d.ts → types-sIc3OCpo.d.ts} +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AccountInterface, Call, ProviderInterface, TypedData, constants } from 'starknet';
|
|
3
|
-
import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-
|
|
1
|
+
import { aV as ResolvedConfig, a$ as TxResult, an as CreatePopCollectionParams, ab as ClaimConditions, aj as CreateDropParams, aq as CreateTicketParams, aI as MintTicketsParams, al as CreateMembershipParams, aH as MintMembershipsParams, ap as CreateSponsorshipOfferParams, aT as ProposeSponsorshipParams, i as ApiClient, aF as MedialaneConfig, aG as MedialaneErrorCode, aN as OrderDetails, aW as ResolvedFeeConfig } from '../services-DgIaaJbX.cjs';
|
|
2
|
+
import { AccountInterface, Call, ProviderInterface, TypedData, constants, BigNumberish, DeployAccountContractPayload } from 'starknet';
|
|
3
|
+
import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-sIc3OCpo.cjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
6
|
declare class PopService {
|
|
@@ -8124,6 +8124,61 @@ declare function build1155OrderTypedData(message: Record<string, unknown>, chain
|
|
|
8124
8124
|
declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
8125
8125
|
declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
8126
8126
|
|
|
8127
|
+
/**
|
|
8128
|
+
* Derive a MediaWallet owner key pair from a business-held secret and a
|
|
8129
|
+
* per-recipient identifier (typically their email) — deterministic, so the
|
|
8130
|
+
* business never has to store a per-recipient key: recompute it from the one
|
|
8131
|
+
* secret it already holds whenever it's needed (deploy time, handoff time),
|
|
8132
|
+
* then discard it. HKDF-SHA256(secret, recipientId), reduced mod the Stark
|
|
8133
|
+
* curve order to get a valid scalar (never zero).
|
|
8134
|
+
*/
|
|
8135
|
+
declare function deriveOwnerKeyPair(secret: Uint8Array, recipientId: string): {
|
|
8136
|
+
privateKey: string;
|
|
8137
|
+
publicKey: string;
|
|
8138
|
+
};
|
|
8139
|
+
|
|
8140
|
+
/**
|
|
8141
|
+
* Account constructor calldata for a Stark-curve owner and no guardian:
|
|
8142
|
+
* `serialize((Signer::Starknet(owner_pubkey), Option::None))` = `[0, owner_pubkey, 1]`.
|
|
8143
|
+
* Verified against `medialane-contracts/contracts/MediaWallet`'s factory
|
|
8144
|
+
* `build_constructor_calldata`.
|
|
8145
|
+
*/
|
|
8146
|
+
declare function ownerConstructorCalldata(ownerPubkey: BigNumberish): string[];
|
|
8147
|
+
/**
|
|
8148
|
+
* Counterfactual MediaWallet account address for `(ownerPubkey, salt)` —
|
|
8149
|
+
* standard Starknet derivation with `deploy_from_zero` (deployer address = 0).
|
|
8150
|
+
* With `salt = 0` the address is a pure function of the owner key, so it can
|
|
8151
|
+
* be computed before anything is deployed on-chain.
|
|
8152
|
+
*/
|
|
8153
|
+
declare function computeAccountAddress(ownerPubkey: BigNumberish, salt?: BigNumberish): string;
|
|
8154
|
+
|
|
8155
|
+
/**
|
|
8156
|
+
* GUID of a Stark-curve owner, matching MediaWallet's
|
|
8157
|
+
* `SignerTrait::into_guid` for `Signer::Starknet` — `poseidon_2("Starknet
|
|
8158
|
+
* Signer", pubkey)`. `change_owners` removes owners by GUID, not by raw
|
|
8159
|
+
* pubkey.
|
|
8160
|
+
*/
|
|
8161
|
+
declare function computeOwnerGuid(ownerPubkey: BigNumberish): string;
|
|
8162
|
+
/**
|
|
8163
|
+
* The `change_owners` call that hands a provisioned account off to its real
|
|
8164
|
+
* owner: removes the business-derived interim owner (by GUID) and adds the
|
|
8165
|
+
* recipient's own new owner key (by pubkey) — one call, immediate, no
|
|
8166
|
+
* timelock. Must be signed by a *current* owner (the interim key) to
|
|
8167
|
+
* succeed on-chain.
|
|
8168
|
+
*/
|
|
8169
|
+
declare function buildChangeOwnersCall(accountAddress: string, removeOwnerPubkey: BigNumberish, addOwnerPubkey: BigNumberish): Call;
|
|
8170
|
+
|
|
8171
|
+
/**
|
|
8172
|
+
* The exact payload starknet.js's `Account.deployAccount()` expects — the
|
|
8173
|
+
* caller constructs a signing `Account` from the derived private key
|
|
8174
|
+
* (`deriveOwnerKeyPair`) against a **pre-funded** counterfactual address
|
|
8175
|
+
* (`computeAccountAddress`) and calls
|
|
8176
|
+
* `account.deployAccount(buildDeployAccountParams(ownerPubkey))` directly.
|
|
8177
|
+
* This function only builds the payload — it never signs or submits
|
|
8178
|
+
* anything itself.
|
|
8179
|
+
*/
|
|
8180
|
+
declare function buildDeployAccountParams(ownerPubkey: BigNumberish, salt?: BigNumberish): DeployAccountContractPayload;
|
|
8181
|
+
|
|
8127
8182
|
type StarknetVenueSigner = VenueSigner<TypedData, Call>;
|
|
8128
8183
|
|
|
8129
|
-
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, ClubService, type CreateCreatorCoinParams, type CreateGrantOpts, CreatorCoinFactoryABI, type CreatorCoinPrice, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type FeeSurface, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, LAUNCH_PRICE_QUOTE_PER_COIN, Medialane1155ABI, MedialaneClient, MedialaneError, type MintEditionParams, POPCollectionABI, POPFactoryABI, type ParsedAdminHeaders, PopService, type RequestSiwsTokenArgs, type ResolvedOrder, type SiwsSigner, SponsorshipService, StarknetVenue, type StarknetVenueDeps, type StarknetVenueSigner, TicketService, VALIDATED_EKUBO_PARAMS, VenueSigner, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancellationTypedData, buildCreateCreatorCoinCall, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buybackQuoteRaw, toRaw as coinToRaw, createAdminSessionGrant, encodeAdminHeaders, encodeByteArray, fdvHuman, getCounter, getCounter1155, getCreatorCoinPrice, getOrderDetails, getOrderDetails1155, getSiwsStorageKey, getStoredSiwsToken, isSiwsTokenValid, normalizeSiwsSignature, parseAdminHeaders, parseCreatorCoinCreated, priceToEkuboParams, randomNonce, requestSiwsToken, sessionKeyHashOf, signAdminRequest, storeSiwsToken, teamCoinsRaw, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, verifyAdminRequestSig };
|
|
8184
|
+
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, ClubService, type CreateCreatorCoinParams, type CreateGrantOpts, CreatorCoinFactoryABI, type CreatorCoinPrice, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type FeeSurface, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, LAUNCH_PRICE_QUOTE_PER_COIN, Medialane1155ABI, MedialaneClient, MedialaneError, type MintEditionParams, POPCollectionABI, POPFactoryABI, type ParsedAdminHeaders, PopService, type RequestSiwsTokenArgs, type ResolvedOrder, type SiwsSigner, SponsorshipService, StarknetVenue, type StarknetVenueDeps, type StarknetVenueSigner, TicketService, VALIDATED_EKUBO_PARAMS, VenueSigner, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancellationTypedData, buildChangeOwnersCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buybackQuoteRaw, toRaw as coinToRaw, computeAccountAddress, computeOwnerGuid, createAdminSessionGrant, deriveOwnerKeyPair, encodeAdminHeaders, encodeByteArray, fdvHuman, getCounter, getCounter1155, getCreatorCoinPrice, getOrderDetails, getOrderDetails1155, getSiwsStorageKey, getStoredSiwsToken, isSiwsTokenValid, normalizeSiwsSignature, ownerConstructorCalldata, parseAdminHeaders, parseCreatorCoinCreated, priceToEkuboParams, randomNonce, requestSiwsToken, sessionKeyHashOf, signAdminRequest, storeSiwsToken, teamCoinsRaw, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, verifyAdminRequestSig };
|
package/dist/starknet/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AccountInterface, Call, ProviderInterface, TypedData, constants } from 'starknet';
|
|
3
|
-
import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-
|
|
1
|
+
import { aV as ResolvedConfig, a$ as TxResult, an as CreatePopCollectionParams, ab as ClaimConditions, aj as CreateDropParams, aq as CreateTicketParams, aI as MintTicketsParams, al as CreateMembershipParams, aH as MintMembershipsParams, ap as CreateSponsorshipOfferParams, aT as ProposeSponsorshipParams, i as ApiClient, aF as MedialaneConfig, aG as MedialaneErrorCode, aN as OrderDetails, aW as ResolvedFeeConfig } from '../services-C5lxQjem.js';
|
|
2
|
+
import { AccountInterface, Call, ProviderInterface, TypedData, constants, BigNumberish, DeployAccountContractPayload } from 'starknet';
|
|
3
|
+
import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-sIc3OCpo.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
6
|
declare class PopService {
|
|
@@ -8124,6 +8124,61 @@ declare function build1155OrderTypedData(message: Record<string, unknown>, chain
|
|
|
8124
8124
|
declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
8125
8125
|
declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
|
|
8126
8126
|
|
|
8127
|
+
/**
|
|
8128
|
+
* Derive a MediaWallet owner key pair from a business-held secret and a
|
|
8129
|
+
* per-recipient identifier (typically their email) — deterministic, so the
|
|
8130
|
+
* business never has to store a per-recipient key: recompute it from the one
|
|
8131
|
+
* secret it already holds whenever it's needed (deploy time, handoff time),
|
|
8132
|
+
* then discard it. HKDF-SHA256(secret, recipientId), reduced mod the Stark
|
|
8133
|
+
* curve order to get a valid scalar (never zero).
|
|
8134
|
+
*/
|
|
8135
|
+
declare function deriveOwnerKeyPair(secret: Uint8Array, recipientId: string): {
|
|
8136
|
+
privateKey: string;
|
|
8137
|
+
publicKey: string;
|
|
8138
|
+
};
|
|
8139
|
+
|
|
8140
|
+
/**
|
|
8141
|
+
* Account constructor calldata for a Stark-curve owner and no guardian:
|
|
8142
|
+
* `serialize((Signer::Starknet(owner_pubkey), Option::None))` = `[0, owner_pubkey, 1]`.
|
|
8143
|
+
* Verified against `medialane-contracts/contracts/MediaWallet`'s factory
|
|
8144
|
+
* `build_constructor_calldata`.
|
|
8145
|
+
*/
|
|
8146
|
+
declare function ownerConstructorCalldata(ownerPubkey: BigNumberish): string[];
|
|
8147
|
+
/**
|
|
8148
|
+
* Counterfactual MediaWallet account address for `(ownerPubkey, salt)` —
|
|
8149
|
+
* standard Starknet derivation with `deploy_from_zero` (deployer address = 0).
|
|
8150
|
+
* With `salt = 0` the address is a pure function of the owner key, so it can
|
|
8151
|
+
* be computed before anything is deployed on-chain.
|
|
8152
|
+
*/
|
|
8153
|
+
declare function computeAccountAddress(ownerPubkey: BigNumberish, salt?: BigNumberish): string;
|
|
8154
|
+
|
|
8155
|
+
/**
|
|
8156
|
+
* GUID of a Stark-curve owner, matching MediaWallet's
|
|
8157
|
+
* `SignerTrait::into_guid` for `Signer::Starknet` — `poseidon_2("Starknet
|
|
8158
|
+
* Signer", pubkey)`. `change_owners` removes owners by GUID, not by raw
|
|
8159
|
+
* pubkey.
|
|
8160
|
+
*/
|
|
8161
|
+
declare function computeOwnerGuid(ownerPubkey: BigNumberish): string;
|
|
8162
|
+
/**
|
|
8163
|
+
* The `change_owners` call that hands a provisioned account off to its real
|
|
8164
|
+
* owner: removes the business-derived interim owner (by GUID) and adds the
|
|
8165
|
+
* recipient's own new owner key (by pubkey) — one call, immediate, no
|
|
8166
|
+
* timelock. Must be signed by a *current* owner (the interim key) to
|
|
8167
|
+
* succeed on-chain.
|
|
8168
|
+
*/
|
|
8169
|
+
declare function buildChangeOwnersCall(accountAddress: string, removeOwnerPubkey: BigNumberish, addOwnerPubkey: BigNumberish): Call;
|
|
8170
|
+
|
|
8171
|
+
/**
|
|
8172
|
+
* The exact payload starknet.js's `Account.deployAccount()` expects — the
|
|
8173
|
+
* caller constructs a signing `Account` from the derived private key
|
|
8174
|
+
* (`deriveOwnerKeyPair`) against a **pre-funded** counterfactual address
|
|
8175
|
+
* (`computeAccountAddress`) and calls
|
|
8176
|
+
* `account.deployAccount(buildDeployAccountParams(ownerPubkey))` directly.
|
|
8177
|
+
* This function only builds the payload — it never signs or submits
|
|
8178
|
+
* anything itself.
|
|
8179
|
+
*/
|
|
8180
|
+
declare function buildDeployAccountParams(ownerPubkey: BigNumberish, salt?: BigNumberish): DeployAccountContractPayload;
|
|
8181
|
+
|
|
8127
8182
|
type StarknetVenueSigner = VenueSigner<TypedData, Call>;
|
|
8128
8183
|
|
|
8129
|
-
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, ClubService, type CreateCreatorCoinParams, type CreateGrantOpts, CreatorCoinFactoryABI, type CreatorCoinPrice, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type FeeSurface, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, LAUNCH_PRICE_QUOTE_PER_COIN, Medialane1155ABI, MedialaneClient, MedialaneError, type MintEditionParams, POPCollectionABI, POPFactoryABI, type ParsedAdminHeaders, PopService, type RequestSiwsTokenArgs, type ResolvedOrder, type SiwsSigner, SponsorshipService, StarknetVenue, type StarknetVenueDeps, type StarknetVenueSigner, TicketService, VALIDATED_EKUBO_PARAMS, VenueSigner, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancellationTypedData, buildCreateCreatorCoinCall, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buybackQuoteRaw, toRaw as coinToRaw, createAdminSessionGrant, encodeAdminHeaders, encodeByteArray, fdvHuman, getCounter, getCounter1155, getCreatorCoinPrice, getOrderDetails, getOrderDetails1155, getSiwsStorageKey, getStoredSiwsToken, isSiwsTokenValid, normalizeSiwsSignature, parseAdminHeaders, parseCreatorCoinCreated, priceToEkuboParams, randomNonce, requestSiwsToken, sessionKeyHashOf, signAdminRequest, storeSiwsToken, teamCoinsRaw, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, verifyAdminRequestSig };
|
|
8184
|
+
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, ClubService, type CreateCreatorCoinParams, type CreateGrantOpts, CreatorCoinFactoryABI, type CreatorCoinPrice, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type FeeSurface, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, LAUNCH_PRICE_QUOTE_PER_COIN, Medialane1155ABI, MedialaneClient, MedialaneError, type MintEditionParams, POPCollectionABI, POPFactoryABI, type ParsedAdminHeaders, PopService, type RequestSiwsTokenArgs, type ResolvedOrder, type SiwsSigner, SponsorshipService, StarknetVenue, type StarknetVenueDeps, type StarknetVenueSigner, TicketService, VALIDATED_EKUBO_PARAMS, VenueSigner, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancellationTypedData, buildChangeOwnersCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buybackQuoteRaw, toRaw as coinToRaw, computeAccountAddress, computeOwnerGuid, createAdminSessionGrant, deriveOwnerKeyPair, encodeAdminHeaders, encodeByteArray, fdvHuman, getCounter, getCounter1155, getCreatorCoinPrice, getOrderDetails, getOrderDetails1155, getSiwsStorageKey, getStoredSiwsToken, isSiwsTokenValid, normalizeSiwsSignature, ownerConstructorCalldata, parseAdminHeaders, parseCreatorCoinCreated, priceToEkuboParams, randomNonce, requestSiwsToken, sessionKeyHashOf, signAdminRequest, storeSiwsToken, teamCoinsRaw, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, verifyAdminRequestSig };
|
package/dist/starknet/index.js
CHANGED
|
@@ -2,6 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
import { keccak_256 } from '@noble/hashes/sha3.js';
|
|
3
3
|
import { base32, base58 } from '@scure/base';
|
|
4
4
|
import { hash, cairo, uint256, RpcProvider, CairoOption, CairoOptionVariant, num, ec, encode, Contract, TypedDataRevision, constants, shortString } from 'starknet';
|
|
5
|
+
import { extract, expand } from '@noble/hashes/hkdf.js';
|
|
6
|
+
import { sha256 } from '@noble/hashes/sha2.js';
|
|
5
7
|
|
|
6
8
|
// src/config.ts
|
|
7
9
|
|
|
@@ -50,7 +52,8 @@ var COORDINATES = {
|
|
|
50
52
|
// zero offers/licenses ever issued (clean cutover, no reclassification).
|
|
51
53
|
ipSponsorship: "0x03729ebe0fedf29ec97fca34db09174772af7f870af26a26e024a61040143e5c",
|
|
52
54
|
ipSponsorshipClassHash: "0x0626daac2ed7e2bf630ef5b10104b3202db1559216c0c1a504c0e99be2fbfec3",
|
|
53
|
-
ipSponsorshipStartBlock: 11896456
|
|
55
|
+
ipSponsorshipStartBlock: 11896456,
|
|
56
|
+
mediaWalletClassHash: "0x014b210c7d47392691144bafecdca3c6c7791cc295ea305988da0a724c05ac31"
|
|
54
57
|
}
|
|
55
58
|
};
|
|
56
59
|
function getCoordinates(chain) {
|
|
@@ -151,10 +154,10 @@ function normalizeEvm(address) {
|
|
|
151
154
|
const m = /^0x([0-9a-fA-F]{40})$/.exec(address);
|
|
152
155
|
if (!m) throw new Error(`Invalid ETHEREUM/BASE address: "${address}"`);
|
|
153
156
|
const lower = m[1].toLowerCase();
|
|
154
|
-
const
|
|
157
|
+
const hash7 = keccak_256(new TextEncoder().encode(lower));
|
|
155
158
|
let out = "0x";
|
|
156
159
|
for (let i = 0; i < 40; i++) {
|
|
157
|
-
const nibble =
|
|
160
|
+
const nibble = hash7[i >> 1] >> (i % 2 === 0 ? 4 : 0) & 15;
|
|
158
161
|
out += nibble >= 8 ? lower[i].toUpperCase() : lower[i];
|
|
159
162
|
}
|
|
160
163
|
return out;
|
|
@@ -538,6 +541,13 @@ var ApiClient = class {
|
|
|
538
541
|
body: JSON.stringify(params)
|
|
539
542
|
});
|
|
540
543
|
}
|
|
544
|
+
// ─── Business Provisioning ──────────────────────────────────────────────────
|
|
545
|
+
registerBusinessProvisioning(params) {
|
|
546
|
+
return this.post("/v1/business/provisioning", params);
|
|
547
|
+
}
|
|
548
|
+
completeBusinessProvisioning(id) {
|
|
549
|
+
return this.post(`/v1/business/provisioning/${id}/complete`, {});
|
|
550
|
+
}
|
|
541
551
|
// ─── Collection Profiles ────────────────────────────────────────────────────
|
|
542
552
|
getCollectionProfile(contractAddress) {
|
|
543
553
|
return this.request(
|
|
@@ -555,6 +565,12 @@ var ApiClient = class {
|
|
|
555
565
|
{ method: "PATCH", body: JSON.stringify(data), headers: this.bearer(clerkToken) }
|
|
556
566
|
);
|
|
557
567
|
}
|
|
568
|
+
getWalletActivity(address, siwsToken, chain = "STARKNET") {
|
|
569
|
+
return this.request(
|
|
570
|
+
`/v1/wallet-activity?address=${this.addr(address)}&chain=${chain}`,
|
|
571
|
+
{ method: "GET", headers: this.bearer(siwsToken) }
|
|
572
|
+
);
|
|
573
|
+
}
|
|
558
574
|
getGatedContent(contractAddress, clerkToken) {
|
|
559
575
|
return this.request(
|
|
560
576
|
`/v1/collections/${this.addr(contractAddress)}/gated-content`,
|
|
@@ -793,6 +809,18 @@ var ApiClient = class {
|
|
|
793
809
|
getCoin(contract) {
|
|
794
810
|
return this.get(`/v1/coins/${this.addr(contract)}`);
|
|
795
811
|
}
|
|
812
|
+
/**
|
|
813
|
+
* Creator-authed coin profile edit (image/description). Backend authorizes
|
|
814
|
+
* via `coin.creator` (trustless — from the factory event), not a body param;
|
|
815
|
+
* `siwsToken` is the caller's SIWS/Clerk bearer token for `identityAuth`.
|
|
816
|
+
*/
|
|
817
|
+
updateCoinProfile(contract, data, siwsToken) {
|
|
818
|
+
return this.request(`/v1/coins/${this.addr(contract)}`, {
|
|
819
|
+
method: "PATCH",
|
|
820
|
+
body: JSON.stringify(data),
|
|
821
|
+
headers: this.bearer(siwsToken)
|
|
822
|
+
});
|
|
823
|
+
}
|
|
796
824
|
// ─── Collection Drop ────────────────────────────────────────────────────────
|
|
797
825
|
getDropCollections(opts = {}) {
|
|
798
826
|
return this.getCollections(opts.page ?? 1, opts.limit ?? 20, void 0, opts.sort, "COLLECTION_DROP");
|
|
@@ -861,6 +889,7 @@ SN.ipClubFactory;
|
|
|
861
889
|
SN.ipClubCollectionClassHash;
|
|
862
890
|
SN.ipSponsorship;
|
|
863
891
|
SN.ipSponsorshipClassHash;
|
|
892
|
+
var STARKNET_MEDIAWALLET_CLASS_HASH = SN.mediaWalletClassHash;
|
|
864
893
|
SN.creatorCoinFactory;
|
|
865
894
|
SN.creatorCoinEkuboLauncher;
|
|
866
895
|
SN.creatorCoinClassHash;
|
|
@@ -11687,7 +11716,48 @@ function encodeByteArray(str) {
|
|
|
11687
11716
|
remaining.length.toString()
|
|
11688
11717
|
];
|
|
11689
11718
|
}
|
|
11719
|
+
var STARK_ORDER = 3618502788666131213697322783095070105526743751716087489154079457884512865583n;
|
|
11720
|
+
function deriveOwnerKeyPair(secret, recipientId) {
|
|
11721
|
+
const prk = extract(sha256, secret);
|
|
11722
|
+
const okm = expand(sha256, prk, new TextEncoder().encode(recipientId), 32);
|
|
11723
|
+
let scalar = BigInt("0x" + Buffer.from(okm).toString("hex")) % STARK_ORDER;
|
|
11724
|
+
if (scalar === 0n) scalar = 1n;
|
|
11725
|
+
const privateKey = num.toHex(scalar);
|
|
11726
|
+
const publicKey = ec.starkCurve.getStarkKey(privateKey);
|
|
11727
|
+
return { privateKey, publicKey };
|
|
11728
|
+
}
|
|
11729
|
+
function ownerConstructorCalldata(ownerPubkey) {
|
|
11730
|
+
return ["0x0", num.toHex(ownerPubkey), "0x1"];
|
|
11731
|
+
}
|
|
11732
|
+
function computeAccountAddress(ownerPubkey, salt = 0) {
|
|
11733
|
+
return hash.calculateContractAddressFromHash(
|
|
11734
|
+
num.toHex(salt),
|
|
11735
|
+
STARKNET_MEDIAWALLET_CLASS_HASH,
|
|
11736
|
+
ownerConstructorCalldata(ownerPubkey),
|
|
11737
|
+
0
|
|
11738
|
+
);
|
|
11739
|
+
}
|
|
11740
|
+
var STARKNET_SIGNER_TYPE = "0x537461726b6e6574205369676e6572";
|
|
11741
|
+
function computeOwnerGuid(ownerPubkey) {
|
|
11742
|
+
return hash.computePoseidonHash(STARKNET_SIGNER_TYPE, num.toHex(ownerPubkey));
|
|
11743
|
+
}
|
|
11744
|
+
function buildChangeOwnersCall(accountAddress, removeOwnerPubkey, addOwnerPubkey) {
|
|
11745
|
+
const guidToRemove = computeOwnerGuid(removeOwnerPubkey);
|
|
11746
|
+
return {
|
|
11747
|
+
contractAddress: accountAddress,
|
|
11748
|
+
entrypoint: "change_owners",
|
|
11749
|
+
calldata: ["0x1", guidToRemove, "0x1", "0x0", num.toHex(addOwnerPubkey)]
|
|
11750
|
+
};
|
|
11751
|
+
}
|
|
11752
|
+
function buildDeployAccountParams(ownerPubkey, salt = 0) {
|
|
11753
|
+
return {
|
|
11754
|
+
classHash: STARKNET_MEDIAWALLET_CLASS_HASH,
|
|
11755
|
+
constructorCalldata: ownerConstructorCalldata(ownerPubkey),
|
|
11756
|
+
addressSalt: num.toHex(salt),
|
|
11757
|
+
contractAddress: computeAccountAddress(ownerPubkey, salt)
|
|
11758
|
+
};
|
|
11759
|
+
}
|
|
11690
11760
|
|
|
11691
|
-
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, LAUNCH_PRICE_QUOTE_PER_COIN, Medialane1155ABI, MedialaneClient, MedialaneError, POPCollectionABI, POPFactoryABI, PopService, SponsorshipService, StarknetVenue, TicketService, VALIDATED_EKUBO_PARAMS, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancellationTypedData, buildCreateCreatorCoinCall, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buybackQuoteRaw, toRaw as coinToRaw, createAdminSessionGrant, encodeAdminHeaders, encodeByteArray, fdvHuman, getCounter, getCounter1155, getCreatorCoinPrice, getOrderDetails, getOrderDetails1155, getSiwsStorageKey, getStoredSiwsToken, isSiwsTokenValid, normalizeSiwsSignature, parseAdminHeaders, parseCreatorCoinCreated, priceToEkuboParams, randomNonce, requestSiwsToken, sessionKeyHashOf, signAdminRequest, storeSiwsToken, teamCoinsRaw, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, verifyAdminRequestSig };
|
|
11761
|
+
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, LAUNCH_PRICE_QUOTE_PER_COIN, Medialane1155ABI, MedialaneClient, MedialaneError, POPCollectionABI, POPFactoryABI, PopService, SponsorshipService, StarknetVenue, TicketService, VALIDATED_EKUBO_PARAMS, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancellationTypedData, buildChangeOwnersCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buybackQuoteRaw, toRaw as coinToRaw, computeAccountAddress, computeOwnerGuid, createAdminSessionGrant, deriveOwnerKeyPair, encodeAdminHeaders, encodeByteArray, fdvHuman, getCounter, getCounter1155, getCreatorCoinPrice, getOrderDetails, getOrderDetails1155, getSiwsStorageKey, getStoredSiwsToken, isSiwsTokenValid, normalizeSiwsSignature, ownerConstructorCalldata, parseAdminHeaders, parseCreatorCoinCreated, priceToEkuboParams, randomNonce, requestSiwsToken, sessionKeyHashOf, signAdminRequest, storeSiwsToken, teamCoinsRaw, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, verifyAdminRequestSig };
|
|
11692
11762
|
//# sourceMappingURL=index.js.map
|
|
11693
11763
|
//# sourceMappingURL=index.js.map
|