@medialane/sdk 0.143.0 → 0.145.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.
@@ -12074,6 +12074,25 @@ var SERVICES = {
12074
12074
  ],
12075
12075
  metadataSchema: { licenseDefault: "CC BY-SA" }
12076
12076
  },
12077
+ "certificate-emission": {
12078
+ id: "certificate-emission",
12079
+ displayName: "Certificate Emission",
12080
+ description: "Issue a soulbound credential to a list of recipients in one run \u2014 everyone gets a wallet and their certificate.",
12081
+ standard: "ERC721",
12082
+ provenance: "MEDIALANE",
12083
+ onchain: {
12084
+ STARKNET: {
12085
+ factoryAddress: SN2.popFactory,
12086
+ classHash: SN2.popCollectionClassHash
12087
+ }
12088
+ },
12089
+ uiVariant: "pop",
12090
+ capabilities: ["mint", "airdrop"],
12091
+ events: [
12092
+ { name: "CollectionCreated", emittedBy: "factory" }
12093
+ ],
12094
+ metadataSchema: { licenseDefault: "CC BY-SA" }
12095
+ },
12077
12096
  "drop-collection": {
12078
12097
  id: "drop-collection",
12079
12098
  displayName: "Collection Drop",
@@ -12937,13 +12956,33 @@ function createPasskeyOwner(config) {
12937
12956
  }
12938
12957
  };
12939
12958
  }
12959
+
12960
+ // src/utils/token.ts
12961
+ function getTokenBySymbol(symbol) {
12962
+ if (typeof symbol !== "string") return void 0;
12963
+ const upper = symbol.toUpperCase();
12964
+ return SUPPORTED_TOKENS.find((t) => t.symbol === upper);
12965
+ }
12966
+
12967
+ // src/wallet/executors.ts
12940
12968
  function accountFor(provider, address, privateKeyHex) {
12941
12969
  return new starknet.Account({ provider, address, signer: privateKeyHex, cairoVersion: "1" });
12942
12970
  }
12943
12971
  async function estimateSelfFundedFee(provider, address, calls) {
12944
12972
  const account = new starknet.Account({ provider, address, signer: "0x1", cairoVersion: "1" });
12945
12973
  const estimate = await account.estimateInvokeFee(calls);
12946
- return { feeRaw: estimate.overall_fee, unit: estimate.unit };
12974
+ const balanceRaw = await feeTokenBalance(provider, address, estimate.unit).catch(() => null);
12975
+ return { feeRaw: estimate.overall_fee, unit: estimate.unit, balanceRaw };
12976
+ }
12977
+ async function feeTokenBalance(provider, address, unit) {
12978
+ const token = getTokenBySymbol(unit === "FRI" ? "STRK" : "ETH");
12979
+ if (!token) throw new Error(`No fee token for unit ${unit}`);
12980
+ const [low = "0x0", high = "0x0"] = await provider.callContract({
12981
+ contractAddress: token.address,
12982
+ entrypoint: "balance_of",
12983
+ calldata: [address]
12984
+ });
12985
+ return BigInt(low) + (BigInt(high) << 128n);
12947
12986
  }
12948
12987
  function selfFundedExecutor(deps) {
12949
12988
  return {