@zoralabs/protocol-sdk 0.4.3 → 0.5.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/.turbo/turbo-build.log +15 -14
- package/CHANGELOG.md +19 -1
- package/README.md +1 -1
- package/dist/index.cjs +55 -66
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +58 -71
- package/dist/index.js.map +1 -1
- package/dist/{anvil.d.ts → src/anvil.d.ts} +6 -2
- package/dist/src/anvil.d.ts.map +1 -0
- package/dist/src/apis/chain-constants.d.ts +13 -0
- package/dist/src/apis/chain-constants.d.ts.map +1 -0
- package/dist/src/apis/client-base.d.ts.map +1 -0
- package/dist/src/apis/generated/premint-api-types.d.ts.map +1 -0
- package/dist/src/apis/http-api-base.d.ts.map +1 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/create/1155-create-helper.d.ts.map +1 -0
- package/dist/src/create/1155-create-helper.test.d.ts.map +1 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/mint/mint-api-client.d.ts.map +1 -0
- package/dist/src/mint/mint-client.d.ts.map +1 -0
- package/dist/src/mint/mint-client.test.d.ts.map +1 -0
- package/dist/src/premint/contract-types.d.ts.map +1 -0
- package/dist/{premint → src/premint}/conversions.d.ts +1 -1
- package/dist/src/premint/conversions.d.ts.map +1 -0
- package/dist/src/premint/premint-api-client.d.ts.map +1 -0
- package/dist/{premint → src/premint}/premint-client.d.ts +4 -4
- package/dist/src/premint/premint-client.d.ts.map +1 -0
- package/dist/src/premint/premint-client.test.d.ts.map +1 -0
- package/dist/{premint → src/premint}/preminter.d.ts +3 -3
- package/dist/src/premint/preminter.d.ts.map +1 -0
- package/dist/src/premint/preminter.test.d.ts.map +1 -0
- package/dist/src/preminter.d.ts.map +1 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/test-integration/premint-client.test.d.ts +2 -0
- package/dist/test-integration/premint-client.test.d.ts.map +1 -0
- package/package.json +10 -8
- package/src/anvil.ts +10 -3
- package/src/apis/chain-constants.ts +31 -32
- package/src/mint/mint-client.test.ts +1 -1
- package/src/premint/conversions.ts +12 -6
- package/src/premint/premint-client.test.ts +14 -64
- package/src/premint/premint-client.ts +25 -27
- package/src/premint/preminter.test.ts +1 -1
- package/src/premint/preminter.ts +9 -23
- package/test-integration/premint-client.test.ts +146 -0
- package/tsconfig.json +1 -1
- package/.turbo/turbo-lint.log +0 -5
- package/dist/anvil.d.ts.map +0 -1
- package/dist/apis/chain-constants.d.ts +0 -21
- package/dist/apis/chain-constants.d.ts.map +0 -1
- package/dist/apis/client-base.d.ts.map +0 -1
- package/dist/apis/generated/premint-api-types.d.ts.map +0 -1
- package/dist/apis/http-api-base.d.ts.map +0 -1
- package/dist/constants.d.ts.map +0 -1
- package/dist/create/1155-create-helper.d.ts.map +0 -1
- package/dist/create/1155-create-helper.test.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/mint/mint-api-client.d.ts.map +0 -1
- package/dist/mint/mint-client.d.ts.map +0 -1
- package/dist/mint/mint-client.test.d.ts.map +0 -1
- package/dist/premint/contract-types.d.ts.map +0 -1
- package/dist/premint/conversions.d.ts.map +0 -1
- package/dist/premint/premint-api-client.d.ts.map +0 -1
- package/dist/premint/premint-client.d.ts.map +0 -1
- package/dist/premint/premint-client.test.d.ts.map +0 -1
- package/dist/premint/preminter.d.ts.map +0 -1
- package/dist/premint/preminter.test.d.ts.map +0 -1
- package/dist/preminter.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- /package/dist/{apis → src/apis}/client-base.d.ts +0 -0
- /package/dist/{apis → src/apis}/generated/premint-api-types.d.ts +0 -0
- /package/dist/{apis → src/apis}/http-api-base.d.ts +0 -0
- /package/dist/{constants.d.ts → src/constants.d.ts} +0 -0
- /package/dist/{create → src/create}/1155-create-helper.d.ts +0 -0
- /package/dist/{create → src/create}/1155-create-helper.test.d.ts +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{mint → src/mint}/mint-api-client.d.ts +0 -0
- /package/dist/{mint → src/mint}/mint-client.d.ts +0 -0
- /package/dist/{mint → src/mint}/mint-client.test.d.ts +0 -0
- /package/dist/{premint → src/premint}/contract-types.d.ts +0 -0
- /package/dist/{premint → src/premint}/premint-api-client.d.ts +0 -0
- /package/dist/{premint → src/premint}/premint-client.test.d.ts +0 -0
- /package/dist/{premint → src/premint}/preminter.test.d.ts +0 -0
- /package/dist/{preminter.d.ts → src/preminter.d.ts} +0 -0
- /package/dist/{types.d.ts → src/types.d.ts} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
warning package.json: "dependencies" has dependency "vite" with range "4.5.0" that collides with a dependency in "devDependencies" of the same name with version "^4.5.0"
|
|
1
2
|
$ tsup
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
4
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
5
|
+
[34mCLI[39m tsup v7.3.0
|
|
6
|
+
[34mCLI[39m Using tsup config: /home/runner/work/zora-protocol-private/zora-protocol-private/packages/protocol-sdk/tsup.config.js
|
|
7
|
+
[34mCLI[39m Target: es2021
|
|
8
|
+
[34mCLI[39m Cleaning output folder
|
|
9
|
+
[34mCJS[39m Build start
|
|
10
|
+
[34mESM[39m Build start
|
|
11
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m50.09 KB[39m
|
|
12
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m96.94 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 85ms
|
|
14
|
+
[32mESM[39m [1mdist/index.js [22m[32m46.17 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m97.00 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 85ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
# @zoralabs/protocol-sdk
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a52d245: Fix premint v2 support in premint client and add support for sepolia to SDK:
|
|
8
|
+
|
|
9
|
+
- Fix chain constants config for Zora Goerli.
|
|
10
|
+
- Support Zora-Sepolia for premint client.
|
|
11
|
+
- Fix passing of `config_version` to and from the backend API.
|
|
12
|
+
- Change parameter on `makeMintParameters` from `account` to `minterAccount`.
|
|
13
|
+
- Fix price minter address for premint client by chain, since it is not the same on all chains (yet).
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [3af77cf]
|
|
18
|
+
- Updated dependencies [23dba1c]
|
|
19
|
+
- @zoralabs/protocol-deployments@0.0.12
|
|
20
|
+
|
|
3
21
|
## 0.4.3
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
6
24
|
|
|
7
|
-
-
|
|
25
|
+
- 92b1b0e: Export premint conversions
|
|
8
26
|
|
|
9
27
|
## 0.4.2
|
|
10
28
|
|
package/README.md
CHANGED
|
@@ -300,7 +300,7 @@ async function mintCreatedForFreeToken(walletClient: WalletClient, publicClient:
|
|
|
300
300
|
const premintClient = createPremintClient({chain: walletClient.chain!});
|
|
301
301
|
|
|
302
302
|
const simulateContractParameters = await premintClient.makeMintParameters({
|
|
303
|
-
|
|
303
|
+
minterAccount,
|
|
304
304
|
tokenContract: "0xf8dA7f53c283d898818af7FB9d98103F559bDac2",
|
|
305
305
|
uid: 3,
|
|
306
306
|
mintArguments: {
|
package/dist/index.cjs
CHANGED
|
@@ -40,6 +40,7 @@ __export(src_exports, {
|
|
|
40
40
|
encodePostSignatureInput: () => encodePostSignatureInput,
|
|
41
41
|
encodePremintForAPI: () => encodePremintForAPI,
|
|
42
42
|
getApiNetworkConfigForChain: () => getApiNetworkConfigForChain,
|
|
43
|
+
getDefaultFixedPriceMinterAddress: () => getDefaultFixedPriceMinterAddress,
|
|
43
44
|
getMintCosts: () => getMintCosts,
|
|
44
45
|
getPremintCollectionAddress: () => getPremintCollectionAddress,
|
|
45
46
|
getPremintExecutorAddress: () => getPremintExecutorAddress,
|
|
@@ -163,20 +164,8 @@ async function isAuthorizedToCreatePremint({
|
|
|
163
164
|
collection,
|
|
164
165
|
collectionAddress,
|
|
165
166
|
publicClient,
|
|
166
|
-
premintConfig,
|
|
167
|
-
premintConfigVersion,
|
|
168
|
-
signature,
|
|
169
167
|
signer
|
|
170
168
|
}) {
|
|
171
|
-
if (premintConfigVersion === "1" /* V1 */) {
|
|
172
|
-
const [isValidSignature2] = await publicClient.readContract({
|
|
173
|
-
abi: import_protocol_deployments.zoraCreator1155PremintExecutorImplABI,
|
|
174
|
-
address: getPremintExecutorAddress(),
|
|
175
|
-
functionName: "isValidSignature",
|
|
176
|
-
args: [collection, premintConfig, signature]
|
|
177
|
-
});
|
|
178
|
-
return isValidSignature2;
|
|
179
|
-
}
|
|
180
169
|
return await publicClient.readContract({
|
|
181
170
|
abi: import_protocol_deployments.zoraCreator1155PremintExecutorImplABI,
|
|
182
171
|
address: getPremintExecutorAddress(),
|
|
@@ -228,9 +217,7 @@ async function isValidSignature({
|
|
|
228
217
|
signer: recoveredAddress,
|
|
229
218
|
collection,
|
|
230
219
|
collectionAddress: tokenContract,
|
|
231
|
-
publicClient
|
|
232
|
-
signature,
|
|
233
|
-
...premintConfigAndVersion
|
|
220
|
+
publicClient
|
|
234
221
|
});
|
|
235
222
|
return {
|
|
236
223
|
isAuthorized,
|
|
@@ -391,6 +378,9 @@ function makeMintRewardsRecipient({
|
|
|
391
378
|
}) {
|
|
392
379
|
return [mintReferral, platformReferral];
|
|
393
380
|
}
|
|
381
|
+
function getDefaultFixedPriceMinterAddress(chainId) {
|
|
382
|
+
return import_protocol_deployments.zoraCreatorFixedPriceSaleStrategyAddress[chainId];
|
|
383
|
+
}
|
|
394
384
|
|
|
395
385
|
// src/apis/http-api-base.ts
|
|
396
386
|
var BadResponseError = class extends Error {
|
|
@@ -483,78 +473,75 @@ var zora721Abi = (0, import_viem2.parseAbi)([
|
|
|
483
473
|
var import_chains = require("viem/chains");
|
|
484
474
|
var import_viem3 = require("viem");
|
|
485
475
|
var REWARD_PER_TOKEN = (0, import_viem3.parseEther)("0.000777");
|
|
486
|
-
var BackendChainNamesLookup = {
|
|
487
|
-
ZORA_MAINNET: "ZORA-MAINNET",
|
|
488
|
-
ZORA_GOERLI: "ZORA-GOERLI",
|
|
489
|
-
OPTIMISM_MAINNET: "OPTIMISM-MAINNET",
|
|
490
|
-
OPTIMISM_GOERLI: "OPTIMISM-GOERLI",
|
|
491
|
-
ETHEREUM_MAINNET: "ETHEREUM-MAINNET",
|
|
492
|
-
ETHEREUM_GOERLI: "ETHEREUM-GOERLI",
|
|
493
|
-
BASE_MAINNET: "BASE-MAINNET",
|
|
494
|
-
BASE_GOERLI: "BASE-GOERLI"
|
|
495
|
-
};
|
|
496
476
|
var networkConfigByChain = {
|
|
497
477
|
[import_chains.mainnet.id]: {
|
|
498
478
|
chainId: import_chains.mainnet.id,
|
|
499
479
|
isTestnet: false,
|
|
500
|
-
|
|
501
|
-
zoraBackendChainName:
|
|
480
|
+
zoraCollectPathChainName: "eth",
|
|
481
|
+
zoraBackendChainName: "ETHEREUM-MAINNET",
|
|
502
482
|
subgraphUrl: getSubgraph("zora-create-mainnet", "stable")
|
|
503
483
|
},
|
|
504
484
|
[import_chains.goerli.id]: {
|
|
505
485
|
chainId: import_chains.goerli.id,
|
|
506
486
|
isTestnet: true,
|
|
507
|
-
|
|
508
|
-
zoraBackendChainName:
|
|
487
|
+
zoraCollectPathChainName: "gor",
|
|
488
|
+
zoraBackendChainName: "ETHEREUM-GOERLI",
|
|
509
489
|
subgraphUrl: getSubgraph("zora-create-goerli", "stable")
|
|
510
490
|
},
|
|
511
491
|
[import_chains.zora.id]: {
|
|
512
492
|
chainId: import_chains.zora.id,
|
|
513
493
|
isTestnet: false,
|
|
514
|
-
|
|
515
|
-
zoraBackendChainName:
|
|
494
|
+
zoraCollectPathChainName: "zora",
|
|
495
|
+
zoraBackendChainName: "ZORA-MAINNET",
|
|
516
496
|
subgraphUrl: getSubgraph("zora-create-zora-mainnet", "stable")
|
|
517
497
|
},
|
|
518
498
|
[import_chains.zoraTestnet.id]: {
|
|
519
|
-
chainId: import_chains.
|
|
499
|
+
chainId: import_chains.zoraTestnet.id,
|
|
520
500
|
isTestnet: true,
|
|
521
|
-
|
|
522
|
-
zoraBackendChainName:
|
|
501
|
+
zoraCollectPathChainName: "zgor",
|
|
502
|
+
zoraBackendChainName: "ZORA-GOERLI",
|
|
523
503
|
subgraphUrl: getSubgraph("zora-create-zora-testnet", "stable")
|
|
524
504
|
},
|
|
505
|
+
[import_chains.zoraSepolia.id]: {
|
|
506
|
+
chainId: import_chains.zoraSepolia.id,
|
|
507
|
+
isTestnet: true,
|
|
508
|
+
zoraCollectPathChainName: "zsep",
|
|
509
|
+
zoraBackendChainName: "ZORA-SEPOLIA",
|
|
510
|
+
subgraphUrl: getSubgraph("zora-create-zora-sepolia", "stable")
|
|
511
|
+
},
|
|
525
512
|
[import_chains.optimism.id]: {
|
|
526
513
|
chainId: import_chains.optimism.id,
|
|
527
514
|
isTestnet: false,
|
|
528
|
-
|
|
529
|
-
zoraBackendChainName:
|
|
515
|
+
zoraCollectPathChainName: "opt",
|
|
516
|
+
zoraBackendChainName: "OPTIMISM-MAINNET",
|
|
530
517
|
subgraphUrl: getSubgraph("zora-create-optimism", "stable")
|
|
531
518
|
},
|
|
532
519
|
[import_chains.optimismGoerli.id]: {
|
|
533
520
|
chainId: import_chains.optimismGoerli.id,
|
|
534
521
|
isTestnet: true,
|
|
535
|
-
|
|
536
|
-
zoraBackendChainName:
|
|
522
|
+
zoraCollectPathChainName: "ogor",
|
|
523
|
+
zoraBackendChainName: "OPTIMISM-GOERLI",
|
|
537
524
|
subgraphUrl: getSubgraph("zora-create-optimism-goerli", "stable")
|
|
538
525
|
},
|
|
539
526
|
[import_chains.base.id]: {
|
|
540
527
|
chainId: import_chains.base.id,
|
|
541
528
|
isTestnet: false,
|
|
542
|
-
|
|
543
|
-
zoraBackendChainName:
|
|
529
|
+
zoraCollectPathChainName: "base",
|
|
530
|
+
zoraBackendChainName: "BASE-MAINNET",
|
|
544
531
|
subgraphUrl: getSubgraph("zora-create-base-mainnet", "stable")
|
|
545
532
|
},
|
|
546
533
|
[import_chains.baseGoerli.id]: {
|
|
547
534
|
chainId: import_chains.baseGoerli.id,
|
|
548
535
|
isTestnet: true,
|
|
549
|
-
|
|
550
|
-
zoraBackendChainName:
|
|
536
|
+
zoraCollectPathChainName: "bgor",
|
|
537
|
+
zoraBackendChainName: "BASE-GOERLI",
|
|
551
538
|
subgraphUrl: getSubgraph("zora-create-base-goerli", "stable")
|
|
552
539
|
},
|
|
553
540
|
[import_chains.foundry.id]: {
|
|
554
541
|
chainId: import_chains.foundry.id,
|
|
555
542
|
isTestnet: true,
|
|
556
|
-
|
|
557
|
-
zoraBackendChainName:
|
|
543
|
+
zoraCollectPathChainName: "zgor",
|
|
544
|
+
zoraBackendChainName: "ZORA-GOERLI",
|
|
558
545
|
subgraphUrl: getSubgraph("zora-create-zora-testnet", "stable")
|
|
559
546
|
}
|
|
560
547
|
};
|
|
@@ -642,7 +629,9 @@ var convertPremintFromApi = (premint) => {
|
|
|
642
629
|
return {
|
|
643
630
|
premintConfigVersion: "1" /* V1 */,
|
|
644
631
|
premintConfig: {
|
|
645
|
-
|
|
632
|
+
deleted: premint.deleted,
|
|
633
|
+
uid: premint.uid,
|
|
634
|
+
version: premint.version,
|
|
646
635
|
tokenConfig: {
|
|
647
636
|
...tokenConfig,
|
|
648
637
|
fixedPriceMinter: tokenConfig.fixedPriceMinter,
|
|
@@ -660,7 +649,9 @@ var convertPremintFromApi = (premint) => {
|
|
|
660
649
|
return {
|
|
661
650
|
premintConfigVersion: "2" /* V2 */,
|
|
662
651
|
premintConfig: {
|
|
663
|
-
|
|
652
|
+
deleted: premint.deleted,
|
|
653
|
+
uid: premint.uid,
|
|
654
|
+
version: premint.version,
|
|
664
655
|
tokenConfig: {
|
|
665
656
|
...tokenConfig,
|
|
666
657
|
fixedPriceMinter: tokenConfig.fixedPriceMinter,
|
|
@@ -686,6 +677,7 @@ var encodePremintV1ForAPI = ({
|
|
|
686
677
|
...premint
|
|
687
678
|
}) => ({
|
|
688
679
|
...premint,
|
|
680
|
+
config_version: "1",
|
|
689
681
|
tokenConfig: {
|
|
690
682
|
...tokenConfig,
|
|
691
683
|
maxSupply: tokenConfig.maxSupply.toString(),
|
|
@@ -700,6 +692,7 @@ var encodePremintV2ForAPI = ({
|
|
|
700
692
|
...premint
|
|
701
693
|
}) => ({
|
|
702
694
|
...premint,
|
|
695
|
+
config_version: "2",
|
|
703
696
|
tokenConfig: {
|
|
704
697
|
...tokenConfig,
|
|
705
698
|
maxSupply: tokenConfig.maxSupply.toString(),
|
|
@@ -829,11 +822,12 @@ var defaultTokenConfigV2MintArguments = () => ({
|
|
|
829
822
|
// 10%,
|
|
830
823
|
});
|
|
831
824
|
var makeTokenConfigWithDefaults = ({
|
|
825
|
+
chainId,
|
|
832
826
|
premintConfigVersion,
|
|
833
827
|
tokenCreationConfig,
|
|
834
828
|
creatorAccount
|
|
835
829
|
}) => {
|
|
836
|
-
const fixedPriceMinter = tokenCreationConfig.fixedPriceMinter || getDefaultFixedPriceMinterAddress();
|
|
830
|
+
const fixedPriceMinter = tokenCreationConfig.fixedPriceMinter || getDefaultFixedPriceMinterAddress(chainId);
|
|
837
831
|
if (premintConfigVersion === "1" /* V1 */) {
|
|
838
832
|
return {
|
|
839
833
|
fixedPriceMinter,
|
|
@@ -1035,7 +1029,8 @@ var PremintClient = class {
|
|
|
1035
1029
|
tokenConfig: makeTokenConfigWithDefaults({
|
|
1036
1030
|
premintConfigVersion: actualVersion,
|
|
1037
1031
|
tokenCreationConfig,
|
|
1038
|
-
creatorAccount
|
|
1032
|
+
creatorAccount,
|
|
1033
|
+
chainId: this.chain.id
|
|
1039
1034
|
}),
|
|
1040
1035
|
uid: uidToUse
|
|
1041
1036
|
});
|
|
@@ -1113,13 +1108,13 @@ var PremintClient = class {
|
|
|
1113
1108
|
async getMintCosts({
|
|
1114
1109
|
tokenContract,
|
|
1115
1110
|
quantityToMint,
|
|
1116
|
-
|
|
1111
|
+
pricePerToken
|
|
1117
1112
|
}) {
|
|
1118
1113
|
return await getPremintMintCosts({
|
|
1119
1114
|
publicClient: this.publicClient,
|
|
1120
1115
|
quantityToMint,
|
|
1121
1116
|
tokenContract,
|
|
1122
|
-
tokenPrice:
|
|
1117
|
+
tokenPrice: pricePerToken
|
|
1123
1118
|
});
|
|
1124
1119
|
}
|
|
1125
1120
|
/**
|
|
@@ -1137,13 +1132,13 @@ var PremintClient = class {
|
|
|
1137
1132
|
async makeMintParameters({
|
|
1138
1133
|
uid,
|
|
1139
1134
|
tokenContract,
|
|
1140
|
-
|
|
1135
|
+
minterAccount,
|
|
1141
1136
|
mintArguments
|
|
1142
1137
|
}) {
|
|
1143
1138
|
if (mintArguments && mintArguments?.quantityToMint < 1) {
|
|
1144
1139
|
throw new Error("Quantity to mint cannot be below 1");
|
|
1145
1140
|
}
|
|
1146
|
-
if (!
|
|
1141
|
+
if (!minterAccount) {
|
|
1147
1142
|
throw new Error("Wallet not passed in");
|
|
1148
1143
|
}
|
|
1149
1144
|
const { premintConfig, premintConfigVersion, collection, signature } = await this.getPremintSignature({
|
|
@@ -1159,7 +1154,7 @@ var PremintClient = class {
|
|
|
1159
1154
|
})).totalCost;
|
|
1160
1155
|
const mintArgumentsContract = {
|
|
1161
1156
|
mintComment: mintArguments?.mintComment || "",
|
|
1162
|
-
mintRecipient: mintArguments?.mintRecipient || (typeof
|
|
1157
|
+
mintRecipient: mintArguments?.mintRecipient || (typeof minterAccount === "string" ? minterAccount : minterAccount.address),
|
|
1163
1158
|
mintRewardsRecipients: makeMintRewardsRecipient({
|
|
1164
1159
|
mintReferral: mintArguments?.mintReferral,
|
|
1165
1160
|
platformReferral: mintArguments?.platformReferral
|
|
@@ -1167,7 +1162,7 @@ var PremintClient = class {
|
|
|
1167
1162
|
};
|
|
1168
1163
|
if (premintConfigVersion === "1" /* V1 */) {
|
|
1169
1164
|
return {
|
|
1170
|
-
account,
|
|
1165
|
+
account: minterAccount,
|
|
1171
1166
|
abi: import_protocol_deployments2.zoraCreator1155PremintExecutorImplABI,
|
|
1172
1167
|
functionName: "premintV1",
|
|
1173
1168
|
value,
|
|
@@ -1181,17 +1176,15 @@ var PremintClient = class {
|
|
|
1181
1176
|
]
|
|
1182
1177
|
};
|
|
1183
1178
|
} else if (premintConfigVersion === "2" /* V2 */) {
|
|
1184
|
-
const toPost = premintConfig;
|
|
1185
1179
|
return {
|
|
1186
|
-
account,
|
|
1180
|
+
account: minterAccount,
|
|
1187
1181
|
abi: import_protocol_deployments2.zoraCreator1155PremintExecutorImplABI,
|
|
1188
1182
|
functionName: "premintV2",
|
|
1189
1183
|
value,
|
|
1190
1184
|
address: getPremintExecutorAddress(),
|
|
1191
|
-
// args are: ContractCreationConfig calldata contractConfig, PremintConfigV2 calldata premintConfig, bytes calldata signature, uint256 quantityToMint, MintArguments calldata mintArguments
|
|
1192
1185
|
args: [
|
|
1193
1186
|
collection,
|
|
1194
|
-
|
|
1187
|
+
premintConfig,
|
|
1195
1188
|
signature,
|
|
1196
1189
|
numberToMint,
|
|
1197
1190
|
mintArgumentsContract
|
|
@@ -1221,8 +1214,8 @@ function makeUrls({
|
|
|
1221
1214
|
const network = getApiNetworkConfigForChain(chain.id);
|
|
1222
1215
|
return {
|
|
1223
1216
|
explorer: tokenId ? `https://${chain.blockExplorers?.default.url}/token/${address}/instance/${tokenId}` : null,
|
|
1224
|
-
zoraCollect: `https://${network.isTestnet ? "testnet." : ""}zora.co/collect/${network.
|
|
1225
|
-
zoraManage: `https://${network.isTestnet ? "testnet." : ""}zora.co/collect/${network.
|
|
1217
|
+
zoraCollect: `https://${network.isTestnet ? "testnet." : ""}zora.co/collect/${network.zoraCollectPathChainName}:${address}/${zoraTokenPath}`,
|
|
1218
|
+
zoraManage: `https://${network.isTestnet ? "testnet." : ""}zora.co/collect/${network.zoraCollectPathChainName}:${address}/${zoraTokenPath}`
|
|
1226
1219
|
};
|
|
1227
1220
|
}
|
|
1228
1221
|
async function signAndSubmitPremint({
|
|
@@ -1253,14 +1246,12 @@ async function signAndSubmitPremint({
|
|
|
1253
1246
|
if (checkSignature) {
|
|
1254
1247
|
const isAuthorized = await isAuthorizedToCreatePremint({
|
|
1255
1248
|
collection,
|
|
1256
|
-
signature,
|
|
1257
1249
|
publicClient,
|
|
1258
1250
|
signer: typeof account === "string" ? account : account.address,
|
|
1259
1251
|
collectionAddress: await getPremintCollectionAddress({
|
|
1260
1252
|
collection,
|
|
1261
1253
|
publicClient
|
|
1262
|
-
})
|
|
1263
|
-
...premintConfigAndVersion
|
|
1254
|
+
})
|
|
1264
1255
|
});
|
|
1265
1256
|
if (!isAuthorized) {
|
|
1266
1257
|
throw new Error("Not authorized to create premint");
|
|
@@ -1273,9 +1264,6 @@ async function signAndSubmitPremint({
|
|
|
1273
1264
|
});
|
|
1274
1265
|
return { premint, verifyingContract };
|
|
1275
1266
|
}
|
|
1276
|
-
function getDefaultFixedPriceMinterAddress() {
|
|
1277
|
-
return import_protocol_deployments2.zoraCreatorFixedPriceSaleStrategyAddress[999];
|
|
1278
|
-
}
|
|
1279
1267
|
|
|
1280
1268
|
// src/mint/mint-client.ts
|
|
1281
1269
|
var import_viem5 = require("viem");
|
|
@@ -1680,6 +1668,7 @@ function create1155CreatorClient({
|
|
|
1680
1668
|
encodePostSignatureInput,
|
|
1681
1669
|
encodePremintForAPI,
|
|
1682
1670
|
getApiNetworkConfigForChain,
|
|
1671
|
+
getDefaultFixedPriceMinterAddress,
|
|
1683
1672
|
getMintCosts,
|
|
1684
1673
|
getPremintCollectionAddress,
|
|
1685
1674
|
getPremintExecutorAddress,
|