@zoralabs/protocol-sdk 0.11.3-COMMENTS.1 → 0.11.3-COMMENTS.3
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 +7 -7
- package/CHANGELOG.md +15 -0
- package/dist/anvil.d.ts.map +1 -1
- package/dist/create/minter-defaults.d.ts +1 -1
- package/dist/create/minter-defaults.d.ts.map +1 -1
- package/dist/create/types.d.ts +1 -1
- package/dist/create/types.d.ts.map +1 -1
- package/dist/fixtures/contract-setup.d.ts +2 -0
- package/dist/fixtures/contract-setup.d.ts.map +1 -1
- package/dist/fixtures/secondary.d.ts +13 -0
- package/dist/fixtures/secondary.d.ts.map +1 -0
- package/dist/index.cjs +60 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/preminter.d.ts +2 -2
- package/dist/preminter.d.ts.map +1 -1
- package/dist/test-utils.d.ts +1 -1
- package/dist/test-utils.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/comments/comments.test.ts +139 -19
- package/src/create/1155-create-helper.test.ts +6 -13
- package/src/create/1155-create-helper.ts +2 -2
- package/src/create/minter-defaults.ts +3 -4
- package/src/create/types.ts +1 -1
- package/src/fixtures/contract-setup.ts +4 -4
- package/src/fixtures/secondary.ts +69 -0
- package/src/mint/subgraph-mint-getter.ts +1 -1
- package/src/rewards/rewards-client.test.ts +2 -2
- package/src/secondary/secondary-client.test.ts +39 -70
- package/src/test-utils.ts +2 -0
- package/dist/create/1155-create-helper.test.d.ts +0 -3
- package/dist/create/1155-create-helper.test.d.ts.map +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @zoralabs/protocol-sdk@0.11.3-COMMENTS.
|
|
2
|
+
> @zoralabs/protocol-sdk@0.11.3-COMMENTS.3 build /home/runner/work/zora-protocol-private/zora-protocol-private/packages/protocol-sdk
|
|
3
3
|
> pnpm tsup
|
|
4
4
|
|
|
5
5
|
CLI Building entry: src/index.ts
|
|
@@ -10,9 +10,9 @@ CLI Target: es2021
|
|
|
10
10
|
CLI Cleaning output folder
|
|
11
11
|
CJS Build start
|
|
12
12
|
ESM Build start
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
CJS dist/index.cjs 224.30 KB
|
|
14
|
+
CJS dist/index.cjs.map 454.54 KB
|
|
15
|
+
CJS ⚡️ Build success in 387ms
|
|
16
|
+
ESM dist/index.js 218.03 KB
|
|
17
|
+
ESM dist/index.js.map 452.53 KB
|
|
18
|
+
ESM ⚡️ Build success in 388ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @zoralabs/protocol-sdk
|
|
2
2
|
|
|
3
|
+
## 0.11.3-COMMENTS.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 364d7906: Change DEFAULT_MINIMUM_MARKET_ETH to 0.0123321 eth (1,111 mints) to match default that is set on zora.co
|
|
8
|
+
- e68ce881: Fix filtering for active markets
|
|
9
|
+
|
|
10
|
+
## 0.11.3-COMMENTS.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 4a29c2b9: Bump viem to 2.21.21
|
|
15
|
+
- Updated dependencies [4a29c2b9]
|
|
16
|
+
- @zoralabs/protocol-deployments@0.3.5-COMMENTS.3
|
|
17
|
+
|
|
3
18
|
## 0.11.3-COMMENTS.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/anvil.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anvil.d.ts","sourceRoot":"","sources":["../src/anvil.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,OAAO,EACP,KAAK,EACL,YAAY,EACZ,0BAA0B,EAC1B,UAAU,EACV,SA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CAAC,EACxD,UAAU,EACV,YAAY,EACZ,YAAY,GACb,EAAE;IACD,UAAU,EAAE,qCAAqC,CAAC;IAClD,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;CAC5B,8CAOA;AAED,wBAAsB,wBAAwB,CAAC,EAC7C,OAAO,EACP,YAAY,EACZ,YAAY,GACb,EAAE;IACD,OAAO,EAAE,0BAA0B,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC;IAC9E,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;CAC5B,8CAuBA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SalesConfigParamsType, ConcreteSalesConfig } from "./types";
|
|
2
|
-
export declare const DEFAULT_MINIMUM_MARKET_ETH
|
|
2
|
+
export declare const DEFAULT_MINIMUM_MARKET_ETH: bigint;
|
|
3
3
|
export declare const DEFAULT_MARKET_COUNTDOWN: bigint;
|
|
4
4
|
export declare const SALE_END_FOREVER = 18446744073709551615n;
|
|
5
5
|
export declare const parseNameIntoSymbol: (name: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minter-defaults.d.ts","sourceRoot":"","sources":["../../src/create/minter-defaults.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EAMrB,mBAAmB,EAEpB,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"minter-defaults.d.ts","sourceRoot":"","sources":["../../src/create/minter-defaults.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EAMrB,mBAAmB,EAEpB,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,0BAA0B,QAA0B,CAAC;AAElE,eAAO,MAAM,wBAAwB,QAAuB,CAAC;AAG7D,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAuCtD,eAAO,MAAM,mBAAmB,SAAU,MAAM,WAsB/C,CAAC;AAsCF,eAAO,MAAM,0BAA0B,gBACxB,qBAAqB,GAAG,SAAS,gBAChC,MAAM,KACnB,mBAaF,CAAC"}
|
package/dist/create/types.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export type AllowListParamType = SaleStartAndEnd & {
|
|
|
36
36
|
};
|
|
37
37
|
export type SalesConfigParamsType = AllowListParamType | Erc20ParamsType | FixedPriceParamsType | TimedSaleParamsType;
|
|
38
38
|
export type CreateNew1155ParamsBase = {
|
|
39
|
-
account: Address;
|
|
39
|
+
account: Address | Account;
|
|
40
40
|
getAdditionalSetupActions?: (args: {
|
|
41
41
|
tokenId: bigint;
|
|
42
42
|
}) => Hex[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/create/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,0BAA0B,EAAE,MAAM,MAAM,CAAC;AAEzE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAE5B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAEhC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,eAAe,GAChD,mBAAmB,GAAG;IACpB,IAAI,CAAC,EAAE,YAAY,CAAC;IAEpB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEJ,MA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B,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,gBAAgB,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,eAAe,EAAE,OAAO,CAAC;CAC1B,GAAG,wBAAwB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Address, Chain, PublicClient, WalletClient } from "viem";
|
|
2
2
|
import { SubgraphMintGetter } from "src/mint/subgraph-mint-getter";
|
|
3
3
|
import { SubgraphRewardsGetter } from "../rewards/subgraph-rewards-getter";
|
|
4
|
+
export declare const demoTokenMetadataURI = "ipfs://bafkreice23maski3x52tsfqgxstx3kbiifnt5jotg3a5ynvve53c4soi2u";
|
|
5
|
+
export declare const demoContractMetadataURI = "ipfs://DUMMY/contract.json";
|
|
4
6
|
export declare function setupContractAndToken({ chain, publicClient, creatorAccount, walletClient, }: {
|
|
5
7
|
chain: Chain;
|
|
6
8
|
publicClient: PublicClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-setup.d.ts","sourceRoot":"","sources":["../../src/fixtures/contract-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"contract-setup.d.ts","sourceRoot":"","sources":["../../src/fixtures/contract-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAGlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,eAAO,MAAM,oBAAoB,uEACqC,CAAC;AACvE,eAAO,MAAM,uBAAuB,+BAA+B,CAAC;AAEpE,wBAAsB,qBAAqB,CAAC,EAC1C,KAAK,EACL,YAAY,EACZ,cAAc,EACd,YAAY,GACb,EAAE;IACD,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,YAAY,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,YAAY,CAAC;CAC5B;;;;;;GAoCA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Address, Account, PublicClient, TestClient, WalletClient } from "viem";
|
|
2
|
+
import { CollectorClient } from "../sdk";
|
|
3
|
+
export declare function advanceToSaleAndAndLaunchMarket({ contractAddress, tokenId, testClient, publicClient, walletClient, collectorClient, chainId, account, }: {
|
|
4
|
+
contractAddress: Address;
|
|
5
|
+
tokenId: bigint;
|
|
6
|
+
testClient: TestClient;
|
|
7
|
+
publicClient: PublicClient;
|
|
8
|
+
walletClient: WalletClient;
|
|
9
|
+
collectorClient: CollectorClient;
|
|
10
|
+
chainId: number;
|
|
11
|
+
account: Address | Account;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=secondary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secondary.d.ts","sourceRoot":"","sources":["../../src/fixtures/secondary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAQzC,wBAAsB,+BAA+B,CAAC,EACpD,eAAe,EACf,OAAO,EACP,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,OAAO,EACP,OAAO,GACR,EAAE;IACD,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;IACvB,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,eAAe,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;CAC5B,iBAyCA"}
|
package/dist/index.cjs
CHANGED
|
@@ -2936,7 +2936,7 @@ function getTargetStrategy({
|
|
|
2936
2936
|
(strategy) => parseSalesConfig(strategy, contractMintFee, blockTime)
|
|
2937
2937
|
);
|
|
2938
2938
|
const stillValidSalesStrategies = parsedStrategies.filter(
|
|
2939
|
-
(strategy) => strategy.saleActive
|
|
2939
|
+
(strategy) => strategy.saleActive || strategy.secondaryMarketActive
|
|
2940
2940
|
);
|
|
2941
2941
|
const saleStrategies = stillValidSalesStrategies.sort(
|
|
2942
2942
|
(a, b) => (a.saleEnd ?? 0n) > (b.saleEnd ?? 0n) ? 1 : -1
|
|
@@ -4353,7 +4353,7 @@ async function mint({
|
|
|
4353
4353
|
|
|
4354
4354
|
// src/create/1155-create-helper.ts
|
|
4355
4355
|
var import_protocol_deployments10 = require("@zoralabs/protocol-deployments");
|
|
4356
|
-
var
|
|
4356
|
+
var import_viem11 = require("viem");
|
|
4357
4357
|
|
|
4358
4358
|
// src/create/contract-setup.ts
|
|
4359
4359
|
var import_protocol_deployments7 = require("@zoralabs/protocol-deployments");
|
|
@@ -4399,11 +4399,12 @@ async function getNewContractMintFee({
|
|
|
4399
4399
|
|
|
4400
4400
|
// src/create/token-setup.ts
|
|
4401
4401
|
var import_protocol_deployments9 = require("@zoralabs/protocol-deployments");
|
|
4402
|
-
var
|
|
4402
|
+
var import_viem9 = require("viem");
|
|
4403
4403
|
var semver2 = __toESM(require_semver2(), 1);
|
|
4404
4404
|
|
|
4405
4405
|
// src/create/minter-defaults.ts
|
|
4406
|
-
var
|
|
4406
|
+
var import_viem7 = require("viem");
|
|
4407
|
+
var DEFAULT_MINIMUM_MARKET_ETH = (0, import_viem7.parseEther)("0.0123321");
|
|
4407
4408
|
var DEFAULT_MARKET_COUNTDOWN = BigInt(24 * 60 * 60);
|
|
4408
4409
|
var SALE_END_FOREVER = 18446744073709551615n;
|
|
4409
4410
|
var DEFAULT_SALE_START_AND_END = {
|
|
@@ -4479,7 +4480,7 @@ var getSalesConfigWithDefaults = (salesConfig, contractName) => {
|
|
|
4479
4480
|
|
|
4480
4481
|
// src/create/minter-setup.ts
|
|
4481
4482
|
var import_protocol_deployments8 = require("@zoralabs/protocol-deployments");
|
|
4482
|
-
var
|
|
4483
|
+
var import_viem8 = require("viem");
|
|
4483
4484
|
var PERMISSION_BITS = {
|
|
4484
4485
|
MINTER: 2n ** 2n
|
|
4485
4486
|
};
|
|
@@ -4496,12 +4497,12 @@ function setupErc20Minter({
|
|
|
4496
4497
|
const erc20MinterAddress = import_protocol_deployments8.erc20MinterAddress[chainId];
|
|
4497
4498
|
if (!erc20MinterAddress)
|
|
4498
4499
|
throw new Error(`ERC20Minter not deployed on chainId ${chainId}`);
|
|
4499
|
-
const erc20MinterApproval = (0,
|
|
4500
|
+
const erc20MinterApproval = (0, import_viem8.encodeFunctionData)({
|
|
4500
4501
|
abi: import_protocol_deployments8.zoraCreator1155ImplABI,
|
|
4501
4502
|
functionName: "addPermission",
|
|
4502
4503
|
args: [BigInt(nextTokenId), erc20MinterAddress, PERMISSION_BITS.MINTER]
|
|
4503
4504
|
});
|
|
4504
|
-
const saleData = (0,
|
|
4505
|
+
const saleData = (0, import_viem8.encodeFunctionData)({
|
|
4505
4506
|
abi: import_protocol_deployments8.erc20MinterABI,
|
|
4506
4507
|
functionName: "setSale",
|
|
4507
4508
|
args: [
|
|
@@ -4516,7 +4517,7 @@ function setupErc20Minter({
|
|
|
4516
4517
|
}
|
|
4517
4518
|
]
|
|
4518
4519
|
});
|
|
4519
|
-
const callSale = (0,
|
|
4520
|
+
const callSale = (0, import_viem8.encodeFunctionData)({
|
|
4520
4521
|
abi: import_protocol_deployments8.zoraCreator1155ImplABI,
|
|
4521
4522
|
functionName: "callSale",
|
|
4522
4523
|
args: [BigInt(nextTokenId), erc20MinterAddress, saleData]
|
|
@@ -4536,7 +4537,7 @@ function setupFixedPriceMinter({
|
|
|
4536
4537
|
fundsRecipient
|
|
4537
4538
|
}) {
|
|
4538
4539
|
const fixedPriceStrategyAddress = import_protocol_deployments8.zoraCreatorFixedPriceSaleStrategyAddress[chainId];
|
|
4539
|
-
const fixedPriceApproval = (0,
|
|
4540
|
+
const fixedPriceApproval = (0, import_viem8.encodeFunctionData)({
|
|
4540
4541
|
abi: import_protocol_deployments8.zoraCreator1155ImplABI,
|
|
4541
4542
|
functionName: "addPermission",
|
|
4542
4543
|
args: [
|
|
@@ -4545,7 +4546,7 @@ function setupFixedPriceMinter({
|
|
|
4545
4546
|
PERMISSION_BITS.MINTER
|
|
4546
4547
|
]
|
|
4547
4548
|
});
|
|
4548
|
-
const saleData = (0,
|
|
4549
|
+
const saleData = (0, import_viem8.encodeFunctionData)({
|
|
4549
4550
|
abi: import_protocol_deployments8.zoraCreatorFixedPriceSaleStrategyABI,
|
|
4550
4551
|
functionName: "setSale",
|
|
4551
4552
|
args: [
|
|
@@ -4559,7 +4560,7 @@ function setupFixedPriceMinter({
|
|
|
4559
4560
|
}
|
|
4560
4561
|
]
|
|
4561
4562
|
});
|
|
4562
|
-
const callSale = (0,
|
|
4563
|
+
const callSale = (0, import_viem8.encodeFunctionData)({
|
|
4563
4564
|
abi: import_protocol_deployments8.zoraCreator1155ImplABI,
|
|
4564
4565
|
functionName: "callSale",
|
|
4565
4566
|
args: [BigInt(nextTokenId), fixedPriceStrategyAddress, saleData]
|
|
@@ -4579,12 +4580,12 @@ function setupTimedSaleMinter({
|
|
|
4579
4580
|
minimumMarketEth
|
|
4580
4581
|
}) {
|
|
4581
4582
|
const minterAddress = import_protocol_deployments8.zoraTimedSaleStrategyAddress[chainId];
|
|
4582
|
-
const minterApproval = (0,
|
|
4583
|
+
const minterApproval = (0, import_viem8.encodeFunctionData)({
|
|
4583
4584
|
abi: import_protocol_deployments8.zoraCreator1155ImplABI,
|
|
4584
4585
|
functionName: "addPermission",
|
|
4585
4586
|
args: [BigInt(tokenId), minterAddress, PERMISSION_BITS.MINTER]
|
|
4586
4587
|
});
|
|
4587
|
-
const saleData = (0,
|
|
4588
|
+
const saleData = (0, import_viem8.encodeFunctionData)({
|
|
4588
4589
|
abi: import_protocol_deployments8.zoraTimedSaleStrategyABI,
|
|
4589
4590
|
functionName: "setSaleV2",
|
|
4590
4591
|
args: [
|
|
@@ -4598,7 +4599,7 @@ function setupTimedSaleMinter({
|
|
|
4598
4599
|
}
|
|
4599
4600
|
]
|
|
4600
4601
|
});
|
|
4601
|
-
const callSale = (0,
|
|
4602
|
+
const callSale = (0, import_viem8.encodeFunctionData)({
|
|
4602
4603
|
abi: import_protocol_deployments8.zoraCreator1155ImplABI,
|
|
4603
4604
|
functionName: "callSale",
|
|
4604
4605
|
args: [BigInt(tokenId), minterAddress, saleData]
|
|
@@ -4615,13 +4616,13 @@ function setupAllowListMinter({
|
|
|
4615
4616
|
fundsRecipient
|
|
4616
4617
|
}) {
|
|
4617
4618
|
const merkleSaleStrategyAddress = import_protocol_deployments8.zoraCreatorMerkleMinterStrategyAddress[chainId];
|
|
4618
|
-
const merkleApproval = (0,
|
|
4619
|
+
const merkleApproval = (0, import_viem8.encodeFunctionData)({
|
|
4619
4620
|
abi: import_protocol_deployments8.zoraCreator1155ImplABI,
|
|
4620
4621
|
functionName: "addPermission",
|
|
4621
4622
|
args: [nextTokenId, merkleSaleStrategyAddress, PERMISSION_BITS.MINTER]
|
|
4622
4623
|
});
|
|
4623
4624
|
const merkleRoot = allowlist.presaleMerkleRoot.startsWith("0x") ? allowlist.presaleMerkleRoot : `0x${allowlist.presaleMerkleRoot}`;
|
|
4624
|
-
const saleData = (0,
|
|
4625
|
+
const saleData = (0, import_viem8.encodeFunctionData)({
|
|
4625
4626
|
abi: import_protocol_deployments8.zoraCreatorMerkleMinterStrategyABI,
|
|
4626
4627
|
functionName: "setSale",
|
|
4627
4628
|
args: [
|
|
@@ -4634,7 +4635,7 @@ function setupAllowListMinter({
|
|
|
4634
4635
|
}
|
|
4635
4636
|
]
|
|
4636
4637
|
});
|
|
4637
|
-
const callSaleMerkle = (0,
|
|
4638
|
+
const callSaleMerkle = (0, import_viem8.encodeFunctionData)({
|
|
4638
4639
|
abi: import_protocol_deployments8.zoraCreator1155ImplABI,
|
|
4639
4640
|
functionName: "callSale",
|
|
4640
4641
|
args: [BigInt(nextTokenId), merkleSaleStrategyAddress, saleData]
|
|
@@ -4674,10 +4675,10 @@ function setupMinters({ salesConfig, ...rest }) {
|
|
|
4674
4675
|
// src/create/token-setup.ts
|
|
4675
4676
|
function applyNew1155Defaults(props, ownerAddress, contractName) {
|
|
4676
4677
|
const { payoutRecipient: fundsRecipient } = props;
|
|
4677
|
-
const fundsRecipientOrOwner = fundsRecipient && fundsRecipient !==
|
|
4678
|
+
const fundsRecipientOrOwner = fundsRecipient && fundsRecipient !== import_viem9.zeroAddress ? fundsRecipient : ownerAddress;
|
|
4678
4679
|
return {
|
|
4679
4680
|
payoutRecipient: fundsRecipientOrOwner,
|
|
4680
|
-
createReferral: props.createReferral ||
|
|
4681
|
+
createReferral: props.createReferral || import_viem9.zeroAddress,
|
|
4681
4682
|
maxSupply: typeof props.maxSupply === "undefined" ? OPEN_EDITION_MINT_SIZE : BigInt(props.maxSupply),
|
|
4682
4683
|
royaltyBPS: props.royaltyBPS || 1e3,
|
|
4683
4684
|
tokenMetadataURI: props.tokenMetadataURI,
|
|
@@ -4687,22 +4688,22 @@ function applyNew1155Defaults(props, ownerAddress, contractName) {
|
|
|
4687
4688
|
function buildSetupNewToken({
|
|
4688
4689
|
tokenURI,
|
|
4689
4690
|
maxSupply = OPEN_EDITION_MINT_SIZE,
|
|
4690
|
-
createReferral =
|
|
4691
|
+
createReferral = import_viem9.zeroAddress,
|
|
4691
4692
|
contractVersion
|
|
4692
4693
|
}) {
|
|
4693
4694
|
if (contractSupportsMintRewards(contractVersion, "ERC1155")) {
|
|
4694
|
-
return (0,
|
|
4695
|
+
return (0, import_viem9.encodeFunctionData)({
|
|
4695
4696
|
abi: import_protocol_deployments9.zoraCreator1155ImplABI,
|
|
4696
4697
|
functionName: "setupNewTokenWithCreateReferral",
|
|
4697
4698
|
args: [tokenURI, BigInt(maxSupply), createReferral]
|
|
4698
4699
|
});
|
|
4699
4700
|
}
|
|
4700
|
-
if (createReferral !==
|
|
4701
|
+
if (createReferral !== import_viem9.zeroAddress) {
|
|
4701
4702
|
throw new Error(
|
|
4702
4703
|
"Contract does not support create referral, but one was provided"
|
|
4703
4704
|
);
|
|
4704
4705
|
}
|
|
4705
|
-
return (0,
|
|
4706
|
+
return (0, import_viem9.encodeFunctionData)({
|
|
4706
4707
|
abi: import_protocol_deployments9.zoraCreator1155ImplABI,
|
|
4707
4708
|
functionName: "setupNewToken",
|
|
4708
4709
|
args: [tokenURI, BigInt(maxSupply)]
|
|
@@ -4713,8 +4714,8 @@ function setupRoyaltyConfig({
|
|
|
4713
4714
|
royaltyRecipient,
|
|
4714
4715
|
nextTokenId
|
|
4715
4716
|
}) {
|
|
4716
|
-
if (royaltyBPS > 0 && royaltyRecipient !=
|
|
4717
|
-
return (0,
|
|
4717
|
+
if (royaltyBPS > 0 && royaltyRecipient != import_viem9.zeroAddress) {
|
|
4718
|
+
return (0, import_viem9.encodeFunctionData)({
|
|
4718
4719
|
abi: import_protocol_deployments9.zoraCreator1155ImplABI,
|
|
4719
4720
|
functionName: "updateRoyaltiesForToken",
|
|
4720
4721
|
args: [
|
|
@@ -4737,10 +4738,10 @@ function makeAdminMintCall({
|
|
|
4737
4738
|
if (!mintQuantity || mintQuantity <= 0 || !ownerAddress) {
|
|
4738
4739
|
return null;
|
|
4739
4740
|
}
|
|
4740
|
-
return (0,
|
|
4741
|
+
return (0, import_viem9.encodeFunctionData)({
|
|
4741
4742
|
abi: import_protocol_deployments9.zoraCreator1155ImplABI,
|
|
4742
4743
|
functionName: "adminMint",
|
|
4743
|
-
args: [ownerAddress, nextTokenId, BigInt(mintQuantity),
|
|
4744
|
+
args: [ownerAddress, nextTokenId, BigInt(mintQuantity), import_viem9.zeroAddress]
|
|
4744
4745
|
});
|
|
4745
4746
|
}
|
|
4746
4747
|
function constructCreate1155TokenCalls(props) {
|
|
@@ -4756,7 +4757,7 @@ function constructCreate1155TokenCalls(props) {
|
|
|
4756
4757
|
ownerAddress,
|
|
4757
4758
|
props.contractName
|
|
4758
4759
|
);
|
|
4759
|
-
const verifyTokenIdExpected = (0,
|
|
4760
|
+
const verifyTokenIdExpected = (0, import_viem9.encodeFunctionData)({
|
|
4760
4761
|
abi: import_protocol_deployments9.zoraCreator1155ImplABI,
|
|
4761
4762
|
functionName: "assumeLastTokenIdMatches",
|
|
4762
4763
|
args: [nextTokenId - 1n]
|
|
@@ -4811,7 +4812,7 @@ var contractSupportsMintRewards = (contractVersion, contractStandard) => {
|
|
|
4811
4812
|
};
|
|
4812
4813
|
|
|
4813
4814
|
// src/create/mint-from-create.ts
|
|
4814
|
-
var
|
|
4815
|
+
var import_viem10 = require("viem");
|
|
4815
4816
|
async function toSalesStrategyFromSubgraph({
|
|
4816
4817
|
minter,
|
|
4817
4818
|
salesConfig,
|
|
@@ -4822,12 +4823,12 @@ async function toSalesStrategyFromSubgraph({
|
|
|
4822
4823
|
saleType: "timed",
|
|
4823
4824
|
address: minter,
|
|
4824
4825
|
// for now we hardcode this
|
|
4825
|
-
mintFeePerQuantity: (0,
|
|
4826
|
+
mintFeePerQuantity: (0, import_viem10.parseEther)("0.000111"),
|
|
4826
4827
|
saleStart: salesConfig.saleStart.toString(),
|
|
4827
4828
|
// the following are not needed for now but we wanna satisfy concrete
|
|
4828
|
-
erc20Z:
|
|
4829
|
+
erc20Z: import_viem10.zeroAddress,
|
|
4829
4830
|
mintFee: 0n,
|
|
4830
|
-
pool:
|
|
4831
|
+
pool: import_viem10.zeroAddress,
|
|
4831
4832
|
secondaryActivated: false
|
|
4832
4833
|
};
|
|
4833
4834
|
}
|
|
@@ -4903,7 +4904,7 @@ var ROYALTY_BPS_DEFAULT = 1e3;
|
|
|
4903
4904
|
var getTokenIdFromCreateReceipt = (receipt) => {
|
|
4904
4905
|
for (const data of receipt.logs) {
|
|
4905
4906
|
try {
|
|
4906
|
-
const decodedLog = (0,
|
|
4907
|
+
const decodedLog = (0, import_viem11.decodeEventLog)({
|
|
4907
4908
|
abi: import_protocol_deployments10.zoraCreator1155ImplABI,
|
|
4908
4909
|
eventName: "SetupNewToken",
|
|
4909
4910
|
...data
|
|
@@ -4921,7 +4922,7 @@ var getTokenIdFromCreateReceipt = (receipt) => {
|
|
|
4921
4922
|
var getContractAddressFromReceipt = (receipt) => {
|
|
4922
4923
|
for (const data of receipt.logs) {
|
|
4923
4924
|
try {
|
|
4924
|
-
const decodedLog = (0,
|
|
4925
|
+
const decodedLog = (0, import_viem11.decodeEventLog)({
|
|
4925
4926
|
abi: import_protocol_deployments10.zoraCreator1155FactoryImplABI,
|
|
4926
4927
|
eventName: "SetupNewContract",
|
|
4927
4928
|
...data
|
|
@@ -5043,7 +5044,7 @@ async function createNew1155ContractAndToken({
|
|
|
5043
5044
|
royaltyBPS: token.royaltyBPS
|
|
5044
5045
|
});
|
|
5045
5046
|
const contractAddress = await getDeterministicContractAddress({
|
|
5046
|
-
account,
|
|
5047
|
+
account: typeof account === "string" ? account : account.address,
|
|
5047
5048
|
publicClient,
|
|
5048
5049
|
setupActions: tokenSetupActions,
|
|
5049
5050
|
chainId,
|
|
@@ -5132,7 +5133,7 @@ function prepareSetupActions({
|
|
|
5132
5133
|
setupActions: tokenSetupActions
|
|
5133
5134
|
} = constructCreate1155TokenCalls({
|
|
5134
5135
|
chainId,
|
|
5135
|
-
ownerAddress: account,
|
|
5136
|
+
ownerAddress: typeof account === "string" ? account : account.address,
|
|
5136
5137
|
contractVersion,
|
|
5137
5138
|
nextTokenId,
|
|
5138
5139
|
...token,
|
|
@@ -5205,7 +5206,7 @@ var sumBalances = (mintAccountBalances) => {
|
|
|
5205
5206
|
|
|
5206
5207
|
// src/sparks/sparks-contracts.ts
|
|
5207
5208
|
var import_protocol_deployments11 = require("@zoralabs/protocol-deployments");
|
|
5208
|
-
var
|
|
5209
|
+
var import_viem12 = require("viem");
|
|
5209
5210
|
var mintWithEthParams = ({
|
|
5210
5211
|
tokenId,
|
|
5211
5212
|
quantity,
|
|
@@ -5240,7 +5241,7 @@ var encodeCollectOnManager = ({
|
|
|
5240
5241
|
minter,
|
|
5241
5242
|
zoraCreator1155TokenId,
|
|
5242
5243
|
mintArguments
|
|
5243
|
-
}) => (0,
|
|
5244
|
+
}) => (0, import_viem12.encodeFunctionData)({
|
|
5244
5245
|
abi: import_protocol_deployments11.zoraMintsManagerImplConfig.abi,
|
|
5245
5246
|
functionName: "collect",
|
|
5246
5247
|
args: [
|
|
@@ -5360,8 +5361,8 @@ var encodePremintOnManager = ({
|
|
|
5360
5361
|
premintConfig,
|
|
5361
5362
|
premintSignature,
|
|
5362
5363
|
mintArguments,
|
|
5363
|
-
signerContract =
|
|
5364
|
-
}) => (0,
|
|
5364
|
+
signerContract = import_viem12.zeroAddress
|
|
5365
|
+
}) => (0, import_viem12.encodeFunctionData)({
|
|
5365
5366
|
abi: import_protocol_deployments11.zoraMintsManagerImplConfig.abi,
|
|
5366
5367
|
functionName: "collectPremintV2",
|
|
5367
5368
|
args: [
|
|
@@ -5428,7 +5429,7 @@ function decodeCallFailedError(error) {
|
|
|
5428
5429
|
if (error.data?.errorName !== "CallFailed")
|
|
5429
5430
|
throw new Error("Not a CallFailed error");
|
|
5430
5431
|
const internalErrorData = error.data?.args?.[0];
|
|
5431
|
-
return (0,
|
|
5432
|
+
return (0, import_viem12.decodeErrorResult)({
|
|
5432
5433
|
abi: import_protocol_deployments11.zoraMintsManagerImplABI,
|
|
5433
5434
|
data: internalErrorData
|
|
5434
5435
|
});
|
|
@@ -5494,7 +5495,7 @@ var SubgraphContractGetter = class extends SubgraphGetter {
|
|
|
5494
5495
|
|
|
5495
5496
|
// src/rewards/rewards-queries.ts
|
|
5496
5497
|
var import_protocol_deployments12 = require("@zoralabs/protocol-deployments");
|
|
5497
|
-
var
|
|
5498
|
+
var import_viem13 = require("viem");
|
|
5498
5499
|
|
|
5499
5500
|
// src/apis/multicall3.ts
|
|
5500
5501
|
var multicall3Abi = [
|
|
@@ -5600,7 +5601,7 @@ var makeClaimSecondaryRoyaltiesCalls = async ({
|
|
|
5600
5601
|
}
|
|
5601
5602
|
return erc20z.map((erc20z2) => ({
|
|
5602
5603
|
target: royaltiesAddress,
|
|
5603
|
-
callData: (0,
|
|
5604
|
+
callData: (0, import_viem13.encodeFunctionData)({
|
|
5604
5605
|
abi: import_protocol_deployments12.erc20ZRoyaltiesABI,
|
|
5605
5606
|
functionName: "claimFor",
|
|
5606
5607
|
args: [erc20z2]
|
|
@@ -5610,7 +5611,7 @@ var makeClaimSecondaryRoyaltiesCalls = async ({
|
|
|
5610
5611
|
};
|
|
5611
5612
|
var createProtocolRewardsCall = (chainId, withdrawFor) => ({
|
|
5612
5613
|
target: import_protocol_deployments12.protocolRewardsAddress[chainId],
|
|
5613
|
-
callData: (0,
|
|
5614
|
+
callData: (0, import_viem13.encodeFunctionData)({
|
|
5614
5615
|
abi: import_protocol_deployments12.protocolRewardsABI,
|
|
5615
5616
|
functionName: "withdrawFor",
|
|
5616
5617
|
args: [withdrawFor, 0n]
|
|
@@ -5618,7 +5619,7 @@ var createProtocolRewardsCall = (chainId, withdrawFor) => ({
|
|
|
5618
5619
|
allowFailure: false
|
|
5619
5620
|
});
|
|
5620
5621
|
var createMulticallParameters = (calls, account) => makeContractParameters({
|
|
5621
|
-
abi: (0,
|
|
5622
|
+
abi: (0, import_viem13.parseAbi)(multicall3Abi),
|
|
5622
5623
|
functionName: "aggregate3",
|
|
5623
5624
|
address: multicall3Address,
|
|
5624
5625
|
args: [calls],
|
|
@@ -5733,41 +5734,41 @@ var SubgraphRewardsGetter = class extends SubgraphGetter {
|
|
|
5733
5734
|
};
|
|
5734
5735
|
|
|
5735
5736
|
// src/secondary/secondary-client.ts
|
|
5736
|
-
var
|
|
5737
|
+
var import_viem18 = require("viem");
|
|
5737
5738
|
var import_protocol_deployments15 = require("@zoralabs/protocol-deployments");
|
|
5738
5739
|
|
|
5739
5740
|
// src/secondary/uniswap/uniswapQuote.ts
|
|
5740
|
-
var
|
|
5741
|
+
var import_viem17 = require("viem");
|
|
5741
5742
|
|
|
5742
5743
|
// src/secondary/uniswap/uniswapReserves.ts
|
|
5743
|
-
var
|
|
5744
|
+
var import_viem15 = require("viem");
|
|
5744
5745
|
var import_chains2 = require("viem/chains");
|
|
5745
5746
|
|
|
5746
5747
|
// src/secondary/uniswap/abis.ts
|
|
5747
|
-
var
|
|
5748
|
-
var uniswapQuoterABI = (0,
|
|
5748
|
+
var import_viem14 = require("viem");
|
|
5749
|
+
var uniswapQuoterABI = (0, import_viem14.parseAbi)([
|
|
5749
5750
|
"struct QuoteExactInputSingleParams { address tokenIn; address tokenOut; uint256 amountIn; uint24 fee; uint160 sqrtPriceLimitX96; }",
|
|
5750
5751
|
"struct QuoteExactOutputSingleParams { address tokenIn; address tokenOut; uint256 amount; uint24 fee; uint160 sqrtPriceLimitX96; }",
|
|
5751
5752
|
"function quoteExactInputSingle(QuoteExactInputSingleParams calldata params) external returns (uint256 amountOut, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate)",
|
|
5752
5753
|
"function quoteExactOutputSingle(QuoteExactOutputSingleParams calldata params) external returns (uint256 amountIn, uint160 sqrtPriceX96After, uint32 initializedTicksCrossed, uint256 gasEstimate)"
|
|
5753
5754
|
]);
|
|
5754
|
-
var uniswapV3PoolAbi = (0,
|
|
5755
|
+
var uniswapV3PoolAbi = (0, import_viem14.parseAbi)([
|
|
5755
5756
|
"function fee() external view returns (uint24)",
|
|
5756
5757
|
"function liquidity() external view returns (uint128)",
|
|
5757
5758
|
"function slot0() external view returns (uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked)",
|
|
5758
5759
|
"function token0() external view returns (address)",
|
|
5759
5760
|
"function token1() external view returns (address)"
|
|
5760
5761
|
]);
|
|
5761
|
-
var uniswapV2USDCAbi = (0,
|
|
5762
|
+
var uniswapV2USDCAbi = (0, import_viem14.parseAbi)([
|
|
5762
5763
|
"function getReserves() external view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast)"
|
|
5763
5764
|
]);
|
|
5764
5765
|
|
|
5765
5766
|
// src/secondary/uniswap/uniswapReserves.ts
|
|
5766
5767
|
var uniswapV2USDCMainnetAddress = "0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc";
|
|
5767
5768
|
function getUniswapV2USDCReserves() {
|
|
5768
|
-
const mainnetClient = (0,
|
|
5769
|
+
const mainnetClient = (0, import_viem15.createPublicClient)({
|
|
5769
5770
|
chain: import_chains2.mainnet,
|
|
5770
|
-
transport: (0,
|
|
5771
|
+
transport: (0, import_viem15.http)()
|
|
5771
5772
|
});
|
|
5772
5773
|
return mainnetClient.readContract({
|
|
5773
5774
|
address: uniswapV2USDCMainnetAddress,
|
|
@@ -5787,7 +5788,7 @@ async function getEthPriceInUSDC() {
|
|
|
5787
5788
|
}
|
|
5788
5789
|
|
|
5789
5790
|
// src/secondary/conversions.ts
|
|
5790
|
-
var
|
|
5791
|
+
var import_viem16 = require("viem");
|
|
5791
5792
|
var WEI_PER_SPARK = 1000000000000n;
|
|
5792
5793
|
function convertWeiToSparks(wei) {
|
|
5793
5794
|
return BigInt(wei) / WEI_PER_SPARK;
|
|
@@ -5796,7 +5797,7 @@ function convertWeiToUSD({
|
|
|
5796
5797
|
amount,
|
|
5797
5798
|
ethPriceInUSD
|
|
5798
5799
|
}) {
|
|
5799
|
-
const amountInEth = (0,
|
|
5800
|
+
const amountInEth = (0, import_viem16.formatEther)(amount);
|
|
5800
5801
|
return parseFloat(amountInEth) * ethPriceInUSD;
|
|
5801
5802
|
}
|
|
5802
5803
|
|
|
@@ -5881,13 +5882,13 @@ async function getPoolInfo({
|
|
|
5881
5882
|
},
|
|
5882
5883
|
// get WETH and erc20z balance for pool
|
|
5883
5884
|
{
|
|
5884
|
-
abi:
|
|
5885
|
+
abi: import_viem17.erc20Abi,
|
|
5885
5886
|
address: WETH,
|
|
5886
5887
|
functionName: "balanceOf",
|
|
5887
5888
|
args: [poolAddress]
|
|
5888
5889
|
},
|
|
5889
5890
|
{
|
|
5890
|
-
abi:
|
|
5891
|
+
abi: import_viem17.erc20Abi,
|
|
5891
5892
|
address: erc20z,
|
|
5892
5893
|
functionName: "balanceOf",
|
|
5893
5894
|
args: [poolAddress]
|
|
@@ -6114,7 +6115,7 @@ async function makeSell({
|
|
|
6114
6115
|
return makeError(ERROR_INSUFFICIENT_POOL_SUPPLY);
|
|
6115
6116
|
}
|
|
6116
6117
|
const receivedWithSlippage = calculateSlippageDown(amount, slippage);
|
|
6117
|
-
const data = (0,
|
|
6118
|
+
const data = (0, import_viem18.encodeAbiParameters)(import_protocol_deployments15.safeTransferSwapAbiParameters, [
|
|
6118
6119
|
recipient || accountAddress,
|
|
6119
6120
|
receivedWithSlippage,
|
|
6120
6121
|
0n
|