@zoralabs/protocol-sdk 0.5.12 → 0.5.14
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 +6 -6
- package/CHANGELOG.md +16 -0
- package/dist/apis/chain-constants.d.ts.map +1 -1
- package/dist/apis/generated/premint-api-types.d.ts +1 -1
- package/dist/apis/generated/premint-api-types.d.ts.map +1 -1
- package/dist/index.cjs +1482 -11683
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1468 -11678
- package/dist/index.js.map +1 -1
- package/dist/mints/mints-contracts.d.ts +127 -154
- package/dist/mints/mints-contracts.d.ts.map +1 -1
- package/dist/mints/mints-eth-unwrapper-and-caller.d.ts +1 -24
- package/dist/mints/mints-eth-unwrapper-and-caller.d.ts.map +1 -1
- package/dist/mints/mints-queries.d.ts.map +1 -1
- package/dist/premint/contract-types.d.ts +2 -121
- package/dist/premint/contract-types.d.ts.map +1 -1
- package/dist/premint/conversions.d.ts +15 -35
- package/dist/premint/conversions.d.ts.map +1 -1
- package/dist/premint/premint-api-client.d.ts +1 -1
- package/dist/premint/premint-api-client.d.ts.map +1 -1
- package/dist/premint/premint-client.d.ts +2717 -4
- package/dist/premint/premint-client.d.ts.map +1 -1
- package/dist/premint/preminter.d.ts +3 -17
- package/dist/premint/preminter.d.ts.map +1 -1
- package/dist/preminter.d.ts +1 -1
- package/package.json +2 -3
- package/src/apis/chain-constants.ts +8 -0
- package/src/apis/generated/premint-api-types.ts +1 -0
- package/src/mint/mint-api-client.ts +3 -3
- package/src/mints/mints-contracts.test.ts +3 -5
- package/src/mints/mints-contracts.ts +16 -128
- package/src/mints/mints-queries.ts +1 -2
- package/src/premint/contract-types.ts +4 -106
- package/src/premint/conversions.ts +2 -1
- package/src/premint/premint-api-client.ts +1 -1
- package/src/premint/premint-client.test.ts +17 -6
- package/src/premint/premint-client.ts +28 -23
- package/src/premint/preminter.test.ts +239 -143
- package/src/premint/preminter.ts +11 -64
- package/test-integration/premint-client.test.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"premint-client.d.ts","sourceRoot":"","sources":["../../src/premint/premint-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,GAAG,EACH,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"premint-client.d.ts","sourceRoot":"","sources":["../../src/premint/premint-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,GAAG,EACH,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACb,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,qCAAqC,EAAE,MAAM,gCAAgC,CAAC;AAavF,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EAIxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,MAAM,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,KAAK,kBAAkB,GAAG,wBAAwB,CAChD,OAAO,qCAAqC,EAC5C,aAAa,CACd,CAAC,MAAM,CAAC,CAAC;AAEV,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAC;IACxB,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;CAC3B,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,IAAI,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6EF;AAED,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,UAAU,EACV,YAAY,GACb,EAAE;IACD,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B,iBAEA"}
|
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
import { Address } from "abitype";
|
|
2
2
|
import { zoraCreator1155ImplABI } from "@zoralabs/protocol-deployments";
|
|
3
|
-
import {
|
|
4
|
-
import { ContractCreationConfig, PremintConfig, PremintConfigForTokenCreationConfig, PremintConfigV1, PremintConfigV2, PremintConfigVersion, PremintConfigWithVersion, TokenCreationConfig } from "
|
|
3
|
+
import { Hex, PublicClient, GetEventArgs } from "viem";
|
|
4
|
+
import { ContractCreationConfig, PremintConfig, PremintConfigForTokenCreationConfig, PremintConfigV1, PremintConfigV2, PremintConfigVersion, PremintConfigWithVersion, TokenCreationConfig } from "@zoralabs/protocol-deployments";
|
|
5
5
|
import { MintCosts } from "src/mint/mint-client";
|
|
6
|
-
export declare const getPremintExecutorAddress: () =>
|
|
7
|
-
/**
|
|
8
|
-
* Creates a typed data definition for a premint config. Works for all versions of the premint config by specifying the premintConfigVersion.
|
|
9
|
-
*
|
|
10
|
-
* @param params.verifyingContract the address of the 1155 contract
|
|
11
|
-
* @param params.chainId the chain id the premint is signed for
|
|
12
|
-
* @param params.premintConfigVersion the version of the premint config
|
|
13
|
-
* @param params.premintConfig the premint config
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
export declare const premintTypedDataDefinition: <T extends PremintConfigVersion>({ verifyingContract, chainId, premintConfigVersion: version, premintConfig, }: {
|
|
17
|
-
verifyingContract: Address;
|
|
18
|
-
chainId: number;
|
|
19
|
-
} & PremintConfigWithVersion<T>) => TypedDataDefinition;
|
|
6
|
+
export declare const getPremintExecutorAddress: () => `0x${string}`;
|
|
20
7
|
export type IsValidSignatureReturn = {
|
|
21
8
|
isAuthorized: boolean;
|
|
22
9
|
recoveredAddress?: Address;
|
|
@@ -94,7 +81,6 @@ export declare function getPremintCollectionAddress({ collection, publicClient,
|
|
|
94
81
|
collection: ContractCreationConfig;
|
|
95
82
|
publicClient: PublicClient;
|
|
96
83
|
}): Promise<Address>;
|
|
97
|
-
export declare function markPremintDeleted<T extends PremintConfig>(premintConfig: T): T;
|
|
98
84
|
export declare function applyUpdateToPremint({ uid, version, tokenConfig, tokenConfigUpdates, }: {
|
|
99
85
|
tokenConfig: TokenCreationConfig;
|
|
100
86
|
tokenConfigUpdates: Partial<TokenCreationConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preminter.d.ts","sourceRoot":"","sources":["../../src/premint/preminter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAEL,sBAAsB,
|
|
1
|
+
{"version":3,"file":"preminter.d.ts","sourceRoot":"","sources":["../../src/premint/preminter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAEL,sBAAsB,EAKvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEL,GAAG,EACH,YAAY,EAMZ,YAAY,EAEb,MAAM,MAAM,CAAC;AACd,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,mCAAmC,EACnC,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,SAAS,EAA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AeA;AAED,wBAAsB,mBAAmB,CAAC,EACxC,YAAY,EACZ,aAAa,EACb,UAAU,EACV,cAAc,GACf,EAAE;IACD,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,YAAY,CAAC;CAC5B,GAAG,OAAO,CAAC,SAAS,CAAC,CAQrB;AAED,wBAAgB,wBAAwB,CAAC,EACvC,YAA0B,EAC1B,gBAA8B,GAC/B,EAAE;IACD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,GAAG,OAAO,EAAE,CAEZ;AAED,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAI1E"}
|
package/dist/preminter.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare const preminterTypedDataDefinition: ({ verifyingContract, premint
|
|
|
23
23
|
}[];
|
|
24
24
|
};
|
|
25
25
|
} & {
|
|
26
|
-
primaryType: "
|
|
26
|
+
primaryType: "CreatorAttribution" | "TokenCreationConfig";
|
|
27
27
|
domain?: {
|
|
28
28
|
chainId?: number | undefined;
|
|
29
29
|
name?: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zoralabs/protocol-sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.14",
|
|
4
4
|
"repository": "https://github.com/ourzora/zora-protocol",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -31,12 +31,11 @@
|
|
|
31
31
|
"viem": "^2.9.19"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"abitype": "^1.0.2",
|
|
35
34
|
"@lavamoat/preinstall-always-fail": "2.0.0",
|
|
36
35
|
"@reservoir0x/relay-sdk": "^0.3.8",
|
|
37
36
|
"@reservoir0x/reservoir-sdk": "^2.0.11",
|
|
37
|
+
"abitype": "^1.0.2",
|
|
38
38
|
"graphql-prettier": "^1.0.6",
|
|
39
|
-
"graphql-request": "^6.1.0",
|
|
40
39
|
"typescript": "^5.2.2",
|
|
41
40
|
"vite": "^4.5.0",
|
|
42
41
|
"vitest": "^0.34.6",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
arbitrum,
|
|
3
3
|
base,
|
|
4
|
+
baseSepolia,
|
|
4
5
|
foundry,
|
|
5
6
|
mainnet,
|
|
6
7
|
optimism,
|
|
@@ -74,6 +75,13 @@ export const networkConfigByChain: Record<number, NetworkConfig> = {
|
|
|
74
75
|
zoraBackendChainName: "BASE-MAINNET",
|
|
75
76
|
subgraphUrl: getSubgraph("zora-create-base-mainnet", "stable"),
|
|
76
77
|
},
|
|
78
|
+
[baseSepolia.id]: {
|
|
79
|
+
chainId: baseSepolia.id,
|
|
80
|
+
isTestnet: true,
|
|
81
|
+
zoraCollectPathChainName: "bsep",
|
|
82
|
+
zoraBackendChainName: "BASE-SEPOLIA",
|
|
83
|
+
subgraphUrl: getSubgraph("zora-create-base-sepolia", "stable"),
|
|
84
|
+
},
|
|
77
85
|
[foundry.id]: {
|
|
78
86
|
chainId: foundry.id,
|
|
79
87
|
isTestnet: true,
|
|
@@ -60,17 +60,17 @@ export class MintAPIClient {
|
|
|
60
60
|
maxTokensPerAddress
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
|
|
64
64
|
query ($id: ID!) {
|
|
65
65
|
zoraCreateToken(id: $id) {
|
|
66
66
|
id
|
|
67
67
|
contract {
|
|
68
68
|
mintFeePerQuantity
|
|
69
|
-
salesStrategies(where: {type: "FIXED_PRICE"}) {
|
|
69
|
+
salesStrategies(where: { type: "FIXED_PRICE" }) {
|
|
70
70
|
...SaleStrategy
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
salesStrategies(where: {type: "FIXED_PRICE"}) {
|
|
73
|
+
salesStrategies(where: { type: "FIXED_PRICE" }) {
|
|
74
74
|
...SaleStrategy
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
zoraMints1155Address,
|
|
12
12
|
zoraMintsManagerImplABI,
|
|
13
13
|
zoraMintsManagerImplAddress,
|
|
14
|
+
PremintMintArguments,
|
|
15
|
+
premintTypedDataDefinition,
|
|
14
16
|
} from "@zoralabs/protocol-deployments";
|
|
15
17
|
import {
|
|
16
18
|
Address,
|
|
@@ -30,11 +32,7 @@ import {
|
|
|
30
32
|
makePermitToCollectPremintOrNonPremint,
|
|
31
33
|
} from "./mints-contracts";
|
|
32
34
|
import { getPremintCollectionAddress } from "src/premint/preminter";
|
|
33
|
-
import {
|
|
34
|
-
MintArguments as PremintMintArguments,
|
|
35
|
-
PremintConfigVersion,
|
|
36
|
-
} from "src/premint/contract-types";
|
|
37
|
-
import { premintTypedDataDefinition } from "src/premint/preminter";
|
|
35
|
+
import { PremintConfigVersion } from "src/premint/contract-types";
|
|
38
36
|
import { zora } from "viem/chains";
|
|
39
37
|
import {
|
|
40
38
|
fixedPriceMinterMinterArguments,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
+
mintsSafeTransferBatchTypedDataDefinition,
|
|
3
|
+
mintsSafeTransferTypedDataDefinition,
|
|
2
4
|
zoraMints1155Config,
|
|
3
5
|
zoraMintsManagerImplABI,
|
|
4
6
|
zoraMintsManagerImplAddress,
|
|
@@ -6,9 +8,9 @@ import {
|
|
|
6
8
|
} from "@zoralabs/protocol-deployments";
|
|
7
9
|
import { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from "abitype";
|
|
8
10
|
import {
|
|
9
|
-
|
|
11
|
+
PremintMintArguments,
|
|
10
12
|
PremintConfigV2,
|
|
11
|
-
} from "
|
|
13
|
+
} from "@zoralabs/protocol-deployments";
|
|
12
14
|
import { ContractCreationConfig } from "src/preminter";
|
|
13
15
|
import { makeSimulateContractParamaters } from "src/utils";
|
|
14
16
|
import {
|
|
@@ -19,7 +21,6 @@ import {
|
|
|
19
21
|
PublicClient,
|
|
20
22
|
ReadContractParameters,
|
|
21
23
|
SignTypedDataParameters,
|
|
22
|
-
TypedData,
|
|
23
24
|
decodeErrorResult,
|
|
24
25
|
encodeFunctionData,
|
|
25
26
|
zeroAddress,
|
|
@@ -230,11 +231,13 @@ export function makePermitTransferBatchAndTypeData({
|
|
|
230
231
|
safeTransferData,
|
|
231
232
|
};
|
|
232
233
|
|
|
233
|
-
const typedData =
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
const typedData: SignTypedDataParameters = {
|
|
235
|
+
...mintsSafeTransferBatchTypedDataDefinition({
|
|
236
|
+
chainId,
|
|
237
|
+
message: permit,
|
|
238
|
+
}),
|
|
236
239
|
account: mintsOwner,
|
|
237
|
-
}
|
|
240
|
+
};
|
|
238
241
|
|
|
239
242
|
return {
|
|
240
243
|
permit,
|
|
@@ -283,11 +286,13 @@ export function makePermitTransferTypeData({
|
|
|
283
286
|
safeTransferData,
|
|
284
287
|
};
|
|
285
288
|
|
|
286
|
-
const typedData =
|
|
287
|
-
|
|
288
|
-
|
|
289
|
+
const typedData: SignTypedDataParameters = {
|
|
290
|
+
...mintsSafeTransferTypedDataDefinition({
|
|
291
|
+
chainId,
|
|
292
|
+
message: permit,
|
|
293
|
+
}),
|
|
289
294
|
account: mintsOwner,
|
|
290
|
-
}
|
|
295
|
+
};
|
|
291
296
|
|
|
292
297
|
return {
|
|
293
298
|
permit,
|
|
@@ -439,123 +444,6 @@ export type CollectMintArguments = AbiParametersToPrimitiveTypes<
|
|
|
439
444
|
ExtractAbiFunction<typeof zoraMintsManagerImplConfig.abi, "collect">["inputs"]
|
|
440
445
|
>[3];
|
|
441
446
|
|
|
442
|
-
function makeTypeData<
|
|
443
|
-
const TTypedData extends TypedData | { [key: string]: unknown },
|
|
444
|
-
TPrimaryType extends string,
|
|
445
|
-
>(args: SignTypedDataParameters<TTypedData, TPrimaryType>) {
|
|
446
|
-
return args;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
export function permitBatchTypedDataDefinition({
|
|
450
|
-
permit,
|
|
451
|
-
chainId,
|
|
452
|
-
account,
|
|
453
|
-
}: {
|
|
454
|
-
permit: PermitSafeTransferBatch;
|
|
455
|
-
chainId: keyof typeof zoraMints1155Config.address;
|
|
456
|
-
account: Account | Address;
|
|
457
|
-
}) {
|
|
458
|
-
return makeTypeData({
|
|
459
|
-
primaryType: "Permit",
|
|
460
|
-
types: {
|
|
461
|
-
Permit: [
|
|
462
|
-
{
|
|
463
|
-
name: "owner",
|
|
464
|
-
type: "address",
|
|
465
|
-
},
|
|
466
|
-
{
|
|
467
|
-
name: "to",
|
|
468
|
-
type: "address",
|
|
469
|
-
},
|
|
470
|
-
{
|
|
471
|
-
name: "tokenIds",
|
|
472
|
-
type: "uint256[]",
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
name: "quantities",
|
|
476
|
-
type: "uint256[]",
|
|
477
|
-
},
|
|
478
|
-
{
|
|
479
|
-
name: "safeTransferData",
|
|
480
|
-
type: "bytes",
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
name: "nonce",
|
|
484
|
-
type: "uint256",
|
|
485
|
-
},
|
|
486
|
-
{
|
|
487
|
-
name: "deadline",
|
|
488
|
-
type: "uint256",
|
|
489
|
-
},
|
|
490
|
-
],
|
|
491
|
-
},
|
|
492
|
-
message: permit,
|
|
493
|
-
domain: {
|
|
494
|
-
chainId,
|
|
495
|
-
name: "Mints",
|
|
496
|
-
version: "1",
|
|
497
|
-
verifyingContract: zoraMints1155Config.address[chainId],
|
|
498
|
-
},
|
|
499
|
-
// signing account must be permit owner
|
|
500
|
-
account,
|
|
501
|
-
});
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
export function permitTransferTypedDataDefinition({
|
|
505
|
-
permit,
|
|
506
|
-
chainId,
|
|
507
|
-
account,
|
|
508
|
-
}: {
|
|
509
|
-
permit: PermitSafeTransfer;
|
|
510
|
-
chainId: keyof typeof zoraMints1155Config.address;
|
|
511
|
-
account: Account | Address;
|
|
512
|
-
}) {
|
|
513
|
-
return makeTypeData({
|
|
514
|
-
primaryType: "PermitSafeTransfer",
|
|
515
|
-
types: {
|
|
516
|
-
PermitSafeTransfer: [
|
|
517
|
-
{
|
|
518
|
-
name: "owner",
|
|
519
|
-
type: "address",
|
|
520
|
-
},
|
|
521
|
-
{
|
|
522
|
-
name: "to",
|
|
523
|
-
type: "address",
|
|
524
|
-
},
|
|
525
|
-
{
|
|
526
|
-
name: "tokenId",
|
|
527
|
-
type: "uint256",
|
|
528
|
-
},
|
|
529
|
-
{
|
|
530
|
-
name: "quantity",
|
|
531
|
-
type: "uint256",
|
|
532
|
-
},
|
|
533
|
-
{
|
|
534
|
-
name: "safeTransferData",
|
|
535
|
-
type: "bytes",
|
|
536
|
-
},
|
|
537
|
-
{
|
|
538
|
-
name: "nonce",
|
|
539
|
-
type: "uint256",
|
|
540
|
-
},
|
|
541
|
-
{
|
|
542
|
-
name: "deadline",
|
|
543
|
-
type: "uint256",
|
|
544
|
-
},
|
|
545
|
-
],
|
|
546
|
-
},
|
|
547
|
-
message: permit,
|
|
548
|
-
domain: {
|
|
549
|
-
chainId,
|
|
550
|
-
name: "Mints",
|
|
551
|
-
version: "1",
|
|
552
|
-
verifyingContract: zoraMints1155Config.address[chainId],
|
|
553
|
-
},
|
|
554
|
-
// signing account must be permit owner
|
|
555
|
-
account,
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
|
|
559
447
|
/**
|
|
560
448
|
* Can be used to decode an a CallFailed error from the ZoraMints1155 contract when it has called a function on the ZoraMintsManager.
|
|
561
449
|
* @param error
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Address } from "viem";
|
|
2
|
-
import { gql } from "graphql-request";
|
|
3
2
|
|
|
4
3
|
export const getMintsAccountBalanceWithPriceQuery = (account: Address) => {
|
|
5
|
-
const query =
|
|
4
|
+
const query = `
|
|
6
5
|
query GetMintAccountBalances($account: String!) {
|
|
7
6
|
mintAccountBalances(where: { account: $account }) {
|
|
8
7
|
balance
|
|
@@ -1,109 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { zoraCreator1155PremintExecutorImplABI as preminterAbi } from "@zoralabs/protocol-deployments";
|
|
3
|
-
|
|
4
|
-
type PremintV1Inputs = ExtractAbiFunction<
|
|
5
|
-
typeof preminterAbi,
|
|
6
|
-
"premintV1"
|
|
7
|
-
>["inputs"];
|
|
8
|
-
|
|
9
|
-
type PremintV1HashDataTypes = AbiParametersToPrimitiveTypes<PremintV1Inputs>;
|
|
10
|
-
|
|
11
|
-
export type ContractCreationConfig = PremintV1HashDataTypes[0];
|
|
12
|
-
|
|
13
|
-
export type PremintConfigV1 = PremintV1HashDataTypes[1];
|
|
14
|
-
export type TokenCreationConfigV1 = PremintConfigV1["tokenConfig"];
|
|
15
|
-
|
|
16
|
-
export type MintArguments = PremintV1HashDataTypes[4];
|
|
17
|
-
|
|
18
|
-
type PremintV2Inputs = ExtractAbiFunction<
|
|
19
|
-
typeof preminterAbi,
|
|
20
|
-
"premintV2"
|
|
21
|
-
>["inputs"];
|
|
22
|
-
|
|
23
|
-
type PremintV2HashDataTypes = AbiParametersToPrimitiveTypes<PremintV2Inputs>;
|
|
24
|
-
|
|
25
|
-
export type PremintConfigV2 = PremintV2HashDataTypes[1];
|
|
26
|
-
export type TokenCreationConfigV2 = PremintConfigV2["tokenConfig"];
|
|
27
|
-
|
|
28
|
-
export const v1Types = {
|
|
29
|
-
CreatorAttribution: [
|
|
30
|
-
{ name: "tokenConfig", type: "TokenCreationConfig" },
|
|
31
|
-
// unique id scoped to the contract and token to create.
|
|
32
|
-
// ensure that a signature can be replaced, as long as the replacement
|
|
33
|
-
// has the same uid, and a newer version.
|
|
34
|
-
{ name: "uid", type: "uint32" },
|
|
35
|
-
{ name: "version", type: "uint32" },
|
|
36
|
-
// if this update should result in the signature being deleted.
|
|
37
|
-
{ name: "deleted", type: "bool" },
|
|
38
|
-
],
|
|
39
|
-
TokenCreationConfig: [
|
|
40
|
-
{ name: "tokenURI", type: "string" },
|
|
41
|
-
{ name: "maxSupply", type: "uint256" },
|
|
42
|
-
{ name: "maxTokensPerAddress", type: "uint64" },
|
|
43
|
-
{ name: "pricePerToken", type: "uint96" },
|
|
44
|
-
{ name: "mintStart", type: "uint64" },
|
|
45
|
-
{ name: "mintDuration", type: "uint64" },
|
|
46
|
-
{ name: "royaltyMintSchedule", type: "uint32" },
|
|
47
|
-
{ name: "royaltyBPS", type: "uint32" },
|
|
48
|
-
{ name: "royaltyRecipient", type: "address" },
|
|
49
|
-
{ name: "fixedPriceMinter", type: "address" },
|
|
50
|
-
],
|
|
51
|
-
} as const;
|
|
52
|
-
|
|
53
|
-
export const v2Types = {
|
|
54
|
-
CreatorAttribution: [
|
|
55
|
-
{ name: "tokenConfig", type: "TokenCreationConfig" },
|
|
56
|
-
// unique id scoped to the contract and token to create.
|
|
57
|
-
// ensure that a signature can be replaced, as long as the replacement
|
|
58
|
-
// has the same uid, and a newer version.
|
|
59
|
-
{ name: "uid", type: "uint32" },
|
|
60
|
-
{ name: "version", type: "uint32" },
|
|
61
|
-
// if this update should result in the signature being deleted.
|
|
62
|
-
{ name: "deleted", type: "bool" },
|
|
63
|
-
],
|
|
64
|
-
TokenCreationConfig: [
|
|
65
|
-
{ name: "tokenURI", type: "string" },
|
|
66
|
-
{ name: "maxSupply", type: "uint256" },
|
|
67
|
-
{ name: "maxTokensPerAddress", type: "uint64" },
|
|
68
|
-
{ name: "pricePerToken", type: "uint96" },
|
|
69
|
-
{ name: "mintStart", type: "uint64" },
|
|
70
|
-
{ name: "mintDuration", type: "uint64" },
|
|
71
|
-
{ name: "royaltyBPS", type: "uint32" },
|
|
72
|
-
{ name: "payoutRecipient", type: "address" },
|
|
73
|
-
{ name: "fixedPriceMinter", type: "address" },
|
|
74
|
-
{ name: "createReferral", type: "address" },
|
|
75
|
-
],
|
|
76
|
-
} as const;
|
|
77
|
-
|
|
78
|
-
export const PreminterDomain = "Preminter";
|
|
1
|
+
import { PremintConfigVersion as PremintConfigVersionOrig } from "@zoralabs/protocol-deployments";
|
|
79
2
|
|
|
80
3
|
export enum PremintConfigVersion {
|
|
81
|
-
V1 =
|
|
82
|
-
V2 =
|
|
4
|
+
V1 = PremintConfigVersionOrig.V1,
|
|
5
|
+
V2 = PremintConfigVersionOrig.V2,
|
|
6
|
+
V3 = PremintConfigVersionOrig.V3,
|
|
83
7
|
}
|
|
84
|
-
|
|
85
|
-
export type PremintConfigForVersion<T extends PremintConfigVersion> =
|
|
86
|
-
T extends PremintConfigVersion.V1 ? PremintConfigV1 : PremintConfigV2;
|
|
87
|
-
|
|
88
|
-
export type PremintConfigWithVersion<T extends PremintConfigVersion> = {
|
|
89
|
-
premintConfig: PremintConfigForVersion<T>;
|
|
90
|
-
premintConfigVersion: T;
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export type PremintConfigAndVersion =
|
|
94
|
-
| PremintConfigWithVersion<PremintConfigVersion.V1>
|
|
95
|
-
| PremintConfigWithVersion<PremintConfigVersion.V2>;
|
|
96
|
-
|
|
97
|
-
export type PremintConfig = PremintConfigV1 | PremintConfigV2;
|
|
98
|
-
export type TokenCreationConfig = TokenCreationConfigV1 | TokenCreationConfigV2;
|
|
99
|
-
|
|
100
|
-
export type PremintConfigForTokenCreationConfig<T extends TokenCreationConfig> =
|
|
101
|
-
T extends TokenCreationConfigV1 ? PremintConfigV1 : PremintConfigV2;
|
|
102
|
-
|
|
103
|
-
export type TokenConfigForVersion<T extends PremintConfigVersion> =
|
|
104
|
-
PremintConfigForVersion<T>["tokenConfig"];
|
|
105
|
-
|
|
106
|
-
export type TokenConfigWithVersion<T extends PremintConfigVersion> = {
|
|
107
|
-
tokenConfig: TokenConfigForVersion<T>;
|
|
108
|
-
premintConfigVersion: T;
|
|
109
|
-
};
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
PremintConfigV2,
|
|
9
9
|
PremintConfigVersion,
|
|
10
10
|
PremintConfigWithVersion,
|
|
11
|
-
} from "
|
|
11
|
+
} from "@zoralabs/protocol-deployments";
|
|
12
12
|
import { PremintSignatureGetResponse } from "./premint-api-client";
|
|
13
13
|
|
|
14
14
|
export const convertCollectionFromApi = (
|
|
@@ -16,6 +16,7 @@ export const convertCollectionFromApi = (
|
|
|
16
16
|
): ContractCreationConfig => ({
|
|
17
17
|
...collection,
|
|
18
18
|
contractAdmin: collection.contractAdmin as Address,
|
|
19
|
+
additionalAdmins: [],
|
|
19
20
|
});
|
|
20
21
|
|
|
21
22
|
/**
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { foundry } from "viem/chains";
|
|
1
|
+
import { foundry, zoraSepolia } from "viem/chains";
|
|
2
2
|
import { describe, expect, vi } from "vitest";
|
|
3
3
|
|
|
4
4
|
import { createPremintClient } from "./premint-client";
|
|
5
|
-
import { anvilTest } from "src/anvil";
|
|
6
5
|
import { PremintConfigVersion } from "./contract-types";
|
|
7
6
|
import { getDefaultFixedPriceMinterAddress } from "./preminter";
|
|
7
|
+
import { forkUrls, makeAnvilTest } from "src/anvil";
|
|
8
|
+
|
|
9
|
+
const anvilTest = makeAnvilTest({
|
|
10
|
+
forkUrl: forkUrls.zoraSepolia,
|
|
11
|
+
forkBlockNumber: 8869648,
|
|
12
|
+
anvilChainId: zoraSepolia.id,
|
|
13
|
+
});
|
|
8
14
|
|
|
9
15
|
describe("ZoraCreator1155Premint - v1 signatures", () => {
|
|
10
16
|
anvilTest(
|
|
@@ -32,6 +38,7 @@ describe("ZoraCreator1155Premint - v1 signatures", () => {
|
|
|
32
38
|
contractName: "Testing Contract",
|
|
33
39
|
contractURI:
|
|
34
40
|
"ipfs://bafkreiainxen4b4wz4ubylvbhons6rembxdet4a262nf2lziclqvv7au3e",
|
|
41
|
+
additionalAdmins: [],
|
|
35
42
|
},
|
|
36
43
|
tokenCreationConfig: {
|
|
37
44
|
tokenURI:
|
|
@@ -47,6 +54,7 @@ describe("ZoraCreator1155Premint - v1 signatures", () => {
|
|
|
47
54
|
contractName: "Testing Contract",
|
|
48
55
|
contractURI:
|
|
49
56
|
"ipfs://bafkreiainxen4b4wz4ubylvbhons6rembxdet4a262nf2lziclqvv7au3e",
|
|
57
|
+
additionalAdmins: [],
|
|
50
58
|
},
|
|
51
59
|
premintConfig: {
|
|
52
60
|
deleted: false,
|
|
@@ -68,7 +76,7 @@ describe("ZoraCreator1155Premint - v1 signatures", () => {
|
|
|
68
76
|
},
|
|
69
77
|
premintConfigVersion: PremintConfigVersion.V1,
|
|
70
78
|
signature:
|
|
71
|
-
"
|
|
79
|
+
"0x4d191dd60d428adfe507932a1758bee8ac5bbb77dcd3c05840c237416a3a25035bb8cc7c62177a4e9acb5f40c4032cdb3dbfefdd1575f2c3b4c57945b2076e2e1c",
|
|
72
80
|
};
|
|
73
81
|
|
|
74
82
|
expect(premintClient.apiClient.postSignature).toHaveBeenCalledWith(
|
|
@@ -95,6 +103,7 @@ describe("ZoraCreator1155Premint - v1 signatures", () => {
|
|
|
95
103
|
contractName: "Testing Contract",
|
|
96
104
|
contractURI:
|
|
97
105
|
"ipfs://bafkreiainxen4b4wz4ubylvbhons6rembxdet4a262nf2lziclqvv7au3e",
|
|
106
|
+
additionalAdmins: [],
|
|
98
107
|
},
|
|
99
108
|
premintConfig: {
|
|
100
109
|
deleted: false,
|
|
@@ -116,7 +125,7 @@ describe("ZoraCreator1155Premint - v1 signatures", () => {
|
|
|
116
125
|
},
|
|
117
126
|
premintConfigVersion: PremintConfigVersion.V1,
|
|
118
127
|
signature:
|
|
119
|
-
"
|
|
128
|
+
"0x4d191dd60d428adfe507932a1758bee8ac5bbb77dcd3c05840c237416a3a25035bb8cc7c62177a4e9acb5f40c4032cdb3dbfefdd1575f2c3b4c57945b2076e2e1c",
|
|
120
129
|
});
|
|
121
130
|
|
|
122
131
|
premintClient.apiClient.postSignature = vi.fn();
|
|
@@ -189,6 +198,7 @@ describe("ZoraCreator1155Premint - v2 signatures", () => {
|
|
|
189
198
|
contractName: "Testing Contract Premint V2",
|
|
190
199
|
contractURI:
|
|
191
200
|
"ipfs://bafkreiainxen4b4wz4ubylvbhons6rembxdet4a262nf2lziclqvv7au3e",
|
|
201
|
+
additionalAdmins: [],
|
|
192
202
|
},
|
|
193
203
|
premintConfigVersion: PremintConfigVersion.V2,
|
|
194
204
|
tokenCreationConfig: {
|
|
@@ -206,11 +216,12 @@ describe("ZoraCreator1155Premint - v2 signatures", () => {
|
|
|
206
216
|
contractName: "Testing Contract Premint V2",
|
|
207
217
|
contractURI:
|
|
208
218
|
"ipfs://bafkreiainxen4b4wz4ubylvbhons6rembxdet4a262nf2lziclqvv7au3e",
|
|
219
|
+
additionalAdmins: [],
|
|
209
220
|
},
|
|
210
221
|
premintConfig: {
|
|
211
222
|
deleted: false,
|
|
212
223
|
tokenConfig: {
|
|
213
|
-
fixedPriceMinter: "
|
|
224
|
+
fixedPriceMinter: "0x6d28164C3CE04A190D5F9f0f8881fc807EAD975A",
|
|
214
225
|
maxSupply: 18446744073709551615n,
|
|
215
226
|
maxTokensPerAddress: 0n,
|
|
216
227
|
mintDuration: 604800n,
|
|
@@ -227,7 +238,7 @@ describe("ZoraCreator1155Premint - v2 signatures", () => {
|
|
|
227
238
|
},
|
|
228
239
|
premintConfigVersion: PremintConfigVersion.V2,
|
|
229
240
|
signature:
|
|
230
|
-
"
|
|
241
|
+
"0x5cc8c0ab240920282cf936d8b5eb1dd151a91ad78cc4e89f8ddeae6ea432ce7904a38e145b734bdd438f18d457451cb1ae28beb2c44bda71d58638dfcc071e1b1c",
|
|
231
242
|
};
|
|
232
243
|
|
|
233
244
|
expect(premintClient.apiClient.postSignature).toHaveBeenCalledWith(
|