@zoralabs/protocol-sdk 0.5.1 → 0.5.2
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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +11 -1
- package/dist/index.cjs +34 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/premint/contract-types.d.ts +1 -1
- package/dist/premint/contract-types.d.ts.map +1 -1
- package/dist/premint/premint-client.d.ts +1 -1
- package/dist/premint/premint-client.d.ts.map +1 -1
- package/dist/premint/preminter.d.ts +1 -1
- package/dist/premint/preminter.d.ts.map +1 -1
- package/dist/preminter.d.ts +1 -1
- package/dist/preminter.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/apis/chain-constants.ts +1 -1
- package/src/create/1155-create-helper.ts +1 -1
- package/src/mint/mint-client.test.ts +1 -1
- package/src/mint/mint-client.ts +1 -1
- package/src/premint/contract-types.ts +1 -1
- package/src/premint/premint-client.ts +1 -1
- package/src/premint/preminter.test.ts +1 -1
- package/src/premint/preminter.ts +1 -1
- package/src/preminter.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -8,9 +8,9 @@ $ tsup
|
|
|
8
8
|
[34mCLI[39m Cleaning output folder
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[32mCJS[39m ⚡️ Build success in 54ms
|
|
14
|
-
[32mESM[39m [1mdist/index.js [22m[32m46.17 KB[39m
|
|
15
|
-
[32mESM[39m [1mdist/index.js.map [22m[32m97.00 KB[39m
|
|
11
|
+
[32mESM[39m [1mdist/index.js [22m[32m46.16 KB[39m
|
|
12
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m96.98 KB[39m
|
|
16
13
|
[32mESM[39m ⚡️ Build success in 54ms
|
|
14
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m49.78 KB[39m
|
|
15
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m96.89 KB[39m
|
|
16
|
+
[32mCJS[39m ⚡️ Build success in 55ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
# @zoralabs/protocol-sdk
|
|
2
2
|
|
|
3
|
+
## 0.5.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5c536dc: Update optimism eth constant
|
|
8
|
+
- Updated dependencies [f3332ee]
|
|
9
|
+
- Updated dependencies [d2085fd]
|
|
10
|
+
- Updated dependencies [a51a0cb]
|
|
11
|
+
- @zoralabs/1155-deployments@0.0.13
|
|
12
|
+
|
|
3
13
|
## 0.5.1
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
6
16
|
|
|
7
|
-
- 73070c0:
|
|
17
|
+
- 73070c0:
|
|
8
18
|
- Fix types export - make sure that types are exported to the correct directory. Broken by commit 627f8c37716f0b5c201f75ab1d025ae878be0ae29e7a269d21185fa04e4bcf93
|
|
9
19
|
- Exclude tests from built bundle
|
|
10
20
|
- Fixes #396
|
package/dist/index.cjs
CHANGED
|
@@ -67,10 +67,10 @@ module.exports = __toCommonJS(src_exports);
|
|
|
67
67
|
|
|
68
68
|
// src/premint/premint-client.ts
|
|
69
69
|
var import_viem4 = require("viem");
|
|
70
|
-
var
|
|
70
|
+
var import_deployments2 = require("@zoralabs/1155-deployments");
|
|
71
71
|
|
|
72
72
|
// src/premint/preminter.ts
|
|
73
|
-
var
|
|
73
|
+
var import_deployments = require("@zoralabs/1155-deployments");
|
|
74
74
|
var import_viem = require("viem");
|
|
75
75
|
|
|
76
76
|
// src/premint/contract-types.ts
|
|
@@ -130,7 +130,7 @@ var PremintConfigVersion = /* @__PURE__ */ ((PremintConfigVersion2) => {
|
|
|
130
130
|
})(PremintConfigVersion || {});
|
|
131
131
|
|
|
132
132
|
// src/premint/preminter.ts
|
|
133
|
-
var getPremintExecutorAddress = () =>
|
|
133
|
+
var getPremintExecutorAddress = () => import_deployments.zoraCreator1155PremintExecutorImplAddress[999];
|
|
134
134
|
var premintTypedDataDefinition = ({
|
|
135
135
|
verifyingContract,
|
|
136
136
|
chainId,
|
|
@@ -167,7 +167,7 @@ async function isAuthorizedToCreatePremint({
|
|
|
167
167
|
signer
|
|
168
168
|
}) {
|
|
169
169
|
return await publicClient.readContract({
|
|
170
|
-
abi:
|
|
170
|
+
abi: import_deployments.zoraCreator1155PremintExecutorImplABI,
|
|
171
171
|
address: getPremintExecutorAddress(),
|
|
172
172
|
functionName: "isAuthorizedToCreatePremint",
|
|
173
173
|
args: [signer, collection.contractAdmin, collectionAddress]
|
|
@@ -283,7 +283,7 @@ var supportedPremintVersions = async ({
|
|
|
283
283
|
publicClient
|
|
284
284
|
}) => {
|
|
285
285
|
return await publicClient.readContract({
|
|
286
|
-
abi:
|
|
286
|
+
abi: import_deployments.zoraCreator1155PremintExecutorImplABI,
|
|
287
287
|
address: getPremintExecutorAddress(),
|
|
288
288
|
functionName: "supportedPremintSignatureVersions",
|
|
289
289
|
args: [tokenContract]
|
|
@@ -302,7 +302,7 @@ async function getPremintCollectionAddress({
|
|
|
302
302
|
}) {
|
|
303
303
|
return publicClient.readContract({
|
|
304
304
|
address: getPremintExecutorAddress(),
|
|
305
|
-
abi:
|
|
305
|
+
abi: import_deployments.zoraCreator1155PremintExecutorImplABI,
|
|
306
306
|
functionName: "getContractAddress",
|
|
307
307
|
args: [collection]
|
|
308
308
|
});
|
|
@@ -350,7 +350,7 @@ async function getPremintMintFee({
|
|
|
350
350
|
try {
|
|
351
351
|
return await publicClient.readContract({
|
|
352
352
|
address: getPremintExecutorAddress(),
|
|
353
|
-
abi:
|
|
353
|
+
abi: import_deployments.zoraCreator1155PremintExecutorImplABI,
|
|
354
354
|
functionName: "mintFee",
|
|
355
355
|
args: [tokenContract]
|
|
356
356
|
});
|
|
@@ -379,7 +379,7 @@ function makeMintRewardsRecipient({
|
|
|
379
379
|
return [mintReferral, platformReferral];
|
|
380
380
|
}
|
|
381
381
|
function getDefaultFixedPriceMinterAddress(chainId) {
|
|
382
|
-
return
|
|
382
|
+
return import_deployments.zoraCreatorFixedPriceSaleStrategyAddress[chainId];
|
|
383
383
|
}
|
|
384
384
|
|
|
385
385
|
// src/apis/http-api-base.ts
|
|
@@ -512,7 +512,7 @@ var networkConfigByChain = {
|
|
|
512
512
|
[import_chains.optimism.id]: {
|
|
513
513
|
chainId: import_chains.optimism.id,
|
|
514
514
|
isTestnet: false,
|
|
515
|
-
zoraCollectPathChainName: "
|
|
515
|
+
zoraCollectPathChainName: "oeth",
|
|
516
516
|
zoraBackendChainName: "OPTIMISM-MAINNET",
|
|
517
517
|
subgraphUrl: getSubgraph("zora-create-optimism", "stable")
|
|
518
518
|
},
|
|
@@ -851,7 +851,7 @@ function getPremintedLogFromReceipt(receipt) {
|
|
|
851
851
|
for (const data of receipt.logs) {
|
|
852
852
|
try {
|
|
853
853
|
const decodedLog = (0, import_viem4.decodeEventLog)({
|
|
854
|
-
abi:
|
|
854
|
+
abi: import_deployments2.zoraCreator1155PremintExecutorImplABI,
|
|
855
855
|
eventName: "PremintedV2",
|
|
856
856
|
...data
|
|
857
857
|
});
|
|
@@ -1163,7 +1163,7 @@ var PremintClient = class {
|
|
|
1163
1163
|
if (premintConfigVersion === "1" /* V1 */) {
|
|
1164
1164
|
return {
|
|
1165
1165
|
account: minterAccount,
|
|
1166
|
-
abi:
|
|
1166
|
+
abi: import_deployments2.zoraCreator1155PremintExecutorImplABI,
|
|
1167
1167
|
functionName: "premintV1",
|
|
1168
1168
|
value,
|
|
1169
1169
|
address: getPremintExecutorAddress(),
|
|
@@ -1178,7 +1178,7 @@ var PremintClient = class {
|
|
|
1178
1178
|
} else if (premintConfigVersion === "2" /* V2 */) {
|
|
1179
1179
|
return {
|
|
1180
1180
|
account: minterAccount,
|
|
1181
|
-
abi:
|
|
1181
|
+
abi: import_deployments2.zoraCreator1155PremintExecutorImplABI,
|
|
1182
1182
|
functionName: "premintV2",
|
|
1183
1183
|
value,
|
|
1184
1184
|
address: getPremintExecutorAddress(),
|
|
@@ -1267,7 +1267,7 @@ async function signAndSubmitPremint({
|
|
|
1267
1267
|
|
|
1268
1268
|
// src/mint/mint-client.ts
|
|
1269
1269
|
var import_viem5 = require("viem");
|
|
1270
|
-
var
|
|
1270
|
+
var import_deployments3 = require("@zoralabs/1155-deployments");
|
|
1271
1271
|
var MintError = class extends Error {
|
|
1272
1272
|
};
|
|
1273
1273
|
var MintInactiveError = class extends Error {
|
|
@@ -1380,14 +1380,14 @@ async function makePrepareMint1155TokenParams({
|
|
|
1380
1380
|
quantityToMint: mintQuantity
|
|
1381
1381
|
}).totalCost;
|
|
1382
1382
|
const result = {
|
|
1383
|
-
abi:
|
|
1383
|
+
abi: import_deployments3.zoraCreator1155ImplABI,
|
|
1384
1384
|
functionName: "mintWithRewards",
|
|
1385
1385
|
account: minterAccount,
|
|
1386
1386
|
value: mintValue,
|
|
1387
1387
|
address: tokenAddress,
|
|
1388
1388
|
/* args: minter, tokenId, quantity, minterArguments, mintReferral */
|
|
1389
1389
|
args: [
|
|
1390
|
-
salesConfigAndTokenInfo?.fixedPrice.address ||
|
|
1390
|
+
salesConfigAndTokenInfo?.fixedPrice.address || import_deployments3.zoraCreatorFixedPriceSaleStrategyAddress[999],
|
|
1391
1391
|
BigInt(tokenId),
|
|
1392
1392
|
mintQuantity,
|
|
1393
1393
|
(0, import_viem5.encodeAbiParameters)((0, import_viem5.parseAbiParameters)("address, string"), [
|
|
@@ -1401,7 +1401,7 @@ async function makePrepareMint1155TokenParams({
|
|
|
1401
1401
|
}
|
|
1402
1402
|
|
|
1403
1403
|
// src/create/1155-create-helper.ts
|
|
1404
|
-
var
|
|
1404
|
+
var import_deployments4 = require("@zoralabs/1155-deployments");
|
|
1405
1405
|
var import_viem6 = require("viem");
|
|
1406
1406
|
var SALE_END_FOREVER = 18446744073709551615n;
|
|
1407
1407
|
var ROYALTY_BPS_DEFAULT = 1e3;
|
|
@@ -1446,32 +1446,32 @@ function create1155TokenSetupArgs({
|
|
|
1446
1446
|
};
|
|
1447
1447
|
const setupActions = [
|
|
1448
1448
|
(0, import_viem6.encodeFunctionData)({
|
|
1449
|
-
abi:
|
|
1449
|
+
abi: import_deployments4.zoraCreator1155ImplABI,
|
|
1450
1450
|
functionName: "assumeLastTokenIdMatches",
|
|
1451
1451
|
args: [nextTokenId - 1n]
|
|
1452
1452
|
}),
|
|
1453
1453
|
createReferral ? (0, import_viem6.encodeFunctionData)({
|
|
1454
|
-
abi:
|
|
1454
|
+
abi: import_deployments4.zoraCreator1155ImplABI,
|
|
1455
1455
|
functionName: "setupNewTokenWithCreateReferral",
|
|
1456
1456
|
args: [tokenMetadataURI, maxSupply, createReferral]
|
|
1457
1457
|
}) : (0, import_viem6.encodeFunctionData)({
|
|
1458
|
-
abi:
|
|
1458
|
+
abi: import_deployments4.zoraCreator1155ImplABI,
|
|
1459
1459
|
functionName: "setupNewToken",
|
|
1460
1460
|
args: [tokenMetadataURI, maxSupply]
|
|
1461
1461
|
}),
|
|
1462
1462
|
(0, import_viem6.encodeFunctionData)({
|
|
1463
|
-
abi:
|
|
1463
|
+
abi: import_deployments4.zoraCreator1155ImplABI,
|
|
1464
1464
|
functionName: "addPermission",
|
|
1465
1465
|
args: [0n, fixedPriceMinterAddress, PERMISSION_BIT_MINTER]
|
|
1466
1466
|
}),
|
|
1467
1467
|
(0, import_viem6.encodeFunctionData)({
|
|
1468
|
-
abi:
|
|
1468
|
+
abi: import_deployments4.zoraCreator1155ImplABI,
|
|
1469
1469
|
functionName: "callSale",
|
|
1470
1470
|
args: [
|
|
1471
1471
|
nextTokenId,
|
|
1472
1472
|
fixedPriceMinterAddress,
|
|
1473
1473
|
(0, import_viem6.encodeFunctionData)({
|
|
1474
|
-
abi:
|
|
1474
|
+
abi: import_deployments4.zoraCreatorFixedPriceSaleStrategyABI,
|
|
1475
1475
|
functionName: "setSale",
|
|
1476
1476
|
args: [nextTokenId, salesConfigWithDefaults]
|
|
1477
1477
|
})
|
|
@@ -1481,7 +1481,7 @@ function create1155TokenSetupArgs({
|
|
|
1481
1481
|
if (mintToCreatorCount) {
|
|
1482
1482
|
setupActions.push(
|
|
1483
1483
|
(0, import_viem6.encodeFunctionData)({
|
|
1484
|
-
abi:
|
|
1484
|
+
abi: import_deployments4.zoraCreator1155ImplABI,
|
|
1485
1485
|
functionName: "adminMint",
|
|
1486
1486
|
args: [account, nextTokenId, mintToCreatorCount, "0x"]
|
|
1487
1487
|
})
|
|
@@ -1490,7 +1490,7 @@ function create1155TokenSetupArgs({
|
|
|
1490
1490
|
if (royaltySettings) {
|
|
1491
1491
|
setupActions.push(
|
|
1492
1492
|
(0, import_viem6.encodeFunctionData)({
|
|
1493
|
-
abi:
|
|
1493
|
+
abi: import_deployments4.zoraCreator1155ImplABI,
|
|
1494
1494
|
functionName: "updateRoyaltiesForToken",
|
|
1495
1495
|
args: [
|
|
1496
1496
|
nextTokenId,
|
|
@@ -1509,7 +1509,7 @@ var getTokenIdFromCreateReceipt = (receipt) => {
|
|
|
1509
1509
|
for (const data of receipt.logs) {
|
|
1510
1510
|
try {
|
|
1511
1511
|
const decodedLog = (0, import_viem6.decodeEventLog)({
|
|
1512
|
-
abi:
|
|
1512
|
+
abi: import_deployments4.zoraCreator1155ImplABI,
|
|
1513
1513
|
eventName: "SetupNewToken",
|
|
1514
1514
|
...data
|
|
1515
1515
|
});
|
|
@@ -1525,9 +1525,9 @@ async function getContractExists(publicClient, contract, account) {
|
|
|
1525
1525
|
let contractExists = false;
|
|
1526
1526
|
if (typeof contract !== "string") {
|
|
1527
1527
|
contractAddress = await publicClient.readContract({
|
|
1528
|
-
abi:
|
|
1528
|
+
abi: import_deployments4.zoraCreator1155FactoryImplABI,
|
|
1529
1529
|
// Since this address is deterministic we can hardcode a chain id safely here.
|
|
1530
|
-
address:
|
|
1530
|
+
address: import_deployments4.zoraCreator1155FactoryImplAddress[999],
|
|
1531
1531
|
functionName: "deterministicContractAddress",
|
|
1532
1532
|
args: [
|
|
1533
1533
|
account,
|
|
@@ -1538,7 +1538,7 @@ async function getContractExists(publicClient, contract, account) {
|
|
|
1538
1538
|
});
|
|
1539
1539
|
try {
|
|
1540
1540
|
await publicClient.readContract({
|
|
1541
|
-
abi:
|
|
1541
|
+
abi: import_deployments4.zoraCreator1155ImplABI,
|
|
1542
1542
|
address: contractAddress,
|
|
1543
1543
|
functionName: "contractVersion"
|
|
1544
1544
|
});
|
|
@@ -1573,14 +1573,14 @@ function create1155CreatorClient({
|
|
|
1573
1573
|
let nextTokenId = 1n;
|
|
1574
1574
|
if (contractExists) {
|
|
1575
1575
|
nextTokenId = await publicClient.readContract({
|
|
1576
|
-
abi:
|
|
1576
|
+
abi: import_deployments4.zoraCreator1155ImplABI,
|
|
1577
1577
|
functionName: "nextTokenId",
|
|
1578
1578
|
address: contractAddress
|
|
1579
1579
|
});
|
|
1580
1580
|
}
|
|
1581
1581
|
const fixedPriceMinterAddress = await publicClient.readContract({
|
|
1582
|
-
abi:
|
|
1583
|
-
address:
|
|
1582
|
+
abi: import_deployments4.zoraCreator1155FactoryImplABI,
|
|
1583
|
+
address: import_deployments4.zoraCreator1155FactoryImplAddress[999],
|
|
1584
1584
|
functionName: "fixedPriceMinter"
|
|
1585
1585
|
});
|
|
1586
1586
|
let tokenSetupActions = create1155TokenSetupArgs({
|
|
@@ -1604,10 +1604,10 @@ function create1155CreatorClient({
|
|
|
1604
1604
|
}
|
|
1605
1605
|
if (!contractExists && typeof contract !== "string") {
|
|
1606
1606
|
const request = {
|
|
1607
|
-
abi:
|
|
1607
|
+
abi: import_deployments4.zoraCreator1155FactoryImplABI,
|
|
1608
1608
|
functionName: "createContractDeterministic",
|
|
1609
1609
|
account,
|
|
1610
|
-
address:
|
|
1610
|
+
address: import_deployments4.zoraCreator1155FactoryImplAddress[999],
|
|
1611
1611
|
args: [
|
|
1612
1612
|
contract.uri,
|
|
1613
1613
|
contract.name,
|
|
@@ -1629,7 +1629,7 @@ function create1155CreatorClient({
|
|
|
1629
1629
|
};
|
|
1630
1630
|
} else if (contractExists) {
|
|
1631
1631
|
const request = {
|
|
1632
|
-
abi:
|
|
1632
|
+
abi: import_deployments4.zoraCreator1155ImplABI,
|
|
1633
1633
|
functionName: "multicall",
|
|
1634
1634
|
account,
|
|
1635
1635
|
address: contractAddress,
|