@zoralabs/protocol-sdk 0.5.16 → 0.6.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 +6 -6
- package/CHANGELOG.md +24 -0
- package/README.md +1 -416
- package/dist/apis/generated/premint-api-types.d.ts +9 -2
- package/dist/apis/generated/premint-api-types.d.ts.map +1 -1
- package/dist/create/1155-create-helper.d.ts +16 -55
- package/dist/create/1155-create-helper.d.ts.map +1 -1
- package/dist/create/contract-setup.d.ts +14 -0
- package/dist/create/contract-setup.d.ts.map +1 -0
- package/dist/create/token-setup.d.ts +27 -0
- package/dist/create/token-setup.d.ts.map +1 -0
- package/dist/create/types.d.ts +45 -0
- package/dist/create/types.d.ts.map +1 -0
- package/dist/index.cjs +1392 -931
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1356 -907
- package/dist/index.js.map +1 -1
- package/dist/mint/mint-client.d.ts +4083 -43
- package/dist/mint/mint-client.d.ts.map +1 -1
- package/dist/mint/subgraph-mint-getter.d.ts +17 -0
- package/dist/mint/subgraph-mint-getter.d.ts.map +1 -0
- package/dist/mint/types.d.ts +79 -0
- package/dist/mint/types.d.ts.map +1 -0
- package/dist/mints/mints-contracts.d.ts +24 -24
- package/dist/premint/contract-types.d.ts +21 -0
- package/dist/premint/contract-types.d.ts.map +1 -1
- package/dist/premint/conversions.d.ts +12 -22
- package/dist/premint/conversions.d.ts.map +1 -1
- package/dist/premint/premint-api-client.d.ts +28 -14
- package/dist/premint/premint-api-client.d.ts.map +1 -1
- package/dist/premint/premint-client.d.ts +83 -67
- package/dist/premint/premint-client.d.ts.map +1 -1
- package/dist/premint/preminter.d.ts +42 -18
- package/dist/premint/preminter.d.ts.map +1 -1
- package/dist/sdk.d.ts +43 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/utils.d.ts +17 -6870
- package/dist/utils.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/apis/generated/premint-api-types.ts +9 -2
- package/src/create/1155-create-helper.test.ts +235 -56
- package/src/create/1155-create-helper.ts +141 -309
- package/src/create/contract-setup.ts +88 -0
- package/src/create/token-setup.ts +379 -0
- package/src/create/types.ts +57 -0
- package/src/index.ts +11 -1
- package/src/mint/mint-client.test.ts +50 -61
- package/src/mint/mint-client.ts +321 -157
- package/src/mint/{mint-api-client.ts → subgraph-mint-getter.ts} +2 -25
- package/src/mint/types.ts +122 -0
- package/src/mints/mints-contracts.test.ts +3 -3
- package/src/mints/mints-contracts.ts +4 -4
- package/src/premint/contract-types.ts +32 -1
- package/src/premint/conversions.ts +31 -9
- package/src/premint/premint-api-client.ts +58 -46
- package/src/premint/premint-client.test.ts +153 -125
- package/src/premint/premint-client.ts +316 -330
- package/src/premint/preminter.test.ts +156 -5
- package/src/premint/preminter.ts +145 -44
- package/src/sdk.ts +98 -0
- package/src/utils.ts +30 -23
- package/test-integration/premint-client.test.ts +8 -8
- package/dist/mint/mint-api-client.d.ts +0 -35
- package/dist/mint/mint-api-client.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mint-client.d.ts","sourceRoot":"","sources":["../../src/mint/mint-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,
|
|
1
|
+
{"version":3,"file":"mint-client.d.ts","sourceRoot":"","sources":["../../src/mint/mint-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAIP,OAAO,EACP,0BAA0B,EAE3B,MAAM,MAAM,CAAC;AAQd,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAEL,YAAY,EAEb,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,WAAW,EACX,uBAAuB,EAExB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAC/B,qBAAqB,EAErB,oBAAoB,EACpB,sBAAsB,EAGvB,MAAM,SA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../apis/http-api-base";
|
|
3
|
+
import { NetworkConfig } from "src/apis/chain-constants";
|
|
4
|
+
import { GenericTokenIdTypes } from "src/types";
|
|
5
|
+
import { IMintGetter, SalesConfigAndTokenInfo, SaleType } from "./types";
|
|
6
|
+
export declare const getApiNetworkConfigForChain: (chainId: number) => NetworkConfig;
|
|
7
|
+
export declare class SubgraphMintGetter implements IMintGetter {
|
|
8
|
+
httpClient: IHttpClient;
|
|
9
|
+
networkConfig: NetworkConfig;
|
|
10
|
+
constructor(chainId: number, httpClient?: IHttpClient);
|
|
11
|
+
getSalesConfigAndTokenInfo({ tokenAddress, tokenId, saleType, }: {
|
|
12
|
+
tokenAddress: Address;
|
|
13
|
+
tokenId?: GenericTokenIdTypes;
|
|
14
|
+
saleType?: SaleType;
|
|
15
|
+
}): Promise<SalesConfigAndTokenInfo>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=subgraph-mint-getter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subgraph-mint-getter.d.ts","sourceRoot":"","sources":["../../src/mint/subgraph-mint-getter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAEL,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAwB,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAkCzE,eAAO,MAAM,2BAA2B,YAAa,MAAM,KAAG,aAK7D,CAAC;AAEF,qBAAa,kBAAmB,YAAW,WAAW;IACpD,UAAU,EAAE,WAAW,CAAC;IACxB,aAAa,EAAE,aAAa,CAAC;gBAEjB,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,WAAW;IAK/C,0BAA0B,CAAC,EAC/B,YAAY,EACZ,OAAO,EACP,QAAQ,GACT,EAAE;QACD,YAAY,EAAE,OAAO,CAAC;QACtB,OAAO,CAAC,EAAE,mBAAmB,CAAC;QAC9B,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACrB,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAwFrC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Account, Address } from "viem";
|
|
2
|
+
import { GenericTokenIdTypes } from "src/types";
|
|
3
|
+
export type MintParameters<MintType> = {
|
|
4
|
+
/** Type of the collection to be minted. */
|
|
5
|
+
mintType: MintType;
|
|
6
|
+
};
|
|
7
|
+
export type Erc1155MintParameters = MintParameters<"1155"> & {
|
|
8
|
+
/** Token id to mint */
|
|
9
|
+
tokenId: GenericTokenIdTypes;
|
|
10
|
+
};
|
|
11
|
+
export type Erc721MintParameters = MintParameters<"721">;
|
|
12
|
+
export type OnChainMintParameters = Erc1155MintParameters | Erc721MintParameters;
|
|
13
|
+
export type PremintMintParameters = MintParameters<"premint"> & {
|
|
14
|
+
/** uid of the Premint to mint */
|
|
15
|
+
uid: number;
|
|
16
|
+
};
|
|
17
|
+
export type MintType = "1155" | "721" | "premint";
|
|
18
|
+
export type MintTypes = Erc1155MintParameters | Erc721MintParameters | PremintMintParameters;
|
|
19
|
+
export declare const isOnChainMint: (mint: MintTypes) => mint is OnChainMintParameters;
|
|
20
|
+
export declare const is1155Mint: (mint: MintTypes) => mint is Erc1155MintParameters;
|
|
21
|
+
export type MakeMintParametersArgumentsBase = {
|
|
22
|
+
/** Premint contract address */
|
|
23
|
+
tokenContract: Address;
|
|
24
|
+
/** Account to execute the mint */
|
|
25
|
+
minterAccount: Account | Address;
|
|
26
|
+
/** Quantity of tokens to mint. Defaults to 1 */
|
|
27
|
+
quantityToMint: number | bigint;
|
|
28
|
+
/** Comment to add to the mint */
|
|
29
|
+
mintComment?: string;
|
|
30
|
+
/** Address to receive the mint referral reward */
|
|
31
|
+
mintReferral?: Address;
|
|
32
|
+
/** Address to receive the minted tokens. Defaults to the minting account */
|
|
33
|
+
mintRecipient?: Address;
|
|
34
|
+
};
|
|
35
|
+
export type Make1155MintArguments = MakeMintParametersArgumentsBase & Erc1155MintParameters & {
|
|
36
|
+
saleType?: SaleType;
|
|
37
|
+
};
|
|
38
|
+
export type Make721MintArguments = MakeMintParametersArgumentsBase & Erc721MintParameters & {
|
|
39
|
+
saleType?: SaleType;
|
|
40
|
+
};
|
|
41
|
+
export type MakePremintMintParametersArguments = MakeMintParametersArgumentsBase & PremintMintParameters & {
|
|
42
|
+
/** Account to receive first minter reward, if this mint brings the premint onchain */
|
|
43
|
+
firstMinter?: Address;
|
|
44
|
+
};
|
|
45
|
+
export type MakeMintParametersArguments = Make1155MintArguments | Make721MintArguments | MakePremintMintParametersArguments;
|
|
46
|
+
export type GetMintCostsParameters = {
|
|
47
|
+
/** Address of token contract/collection to get the mint costs for */
|
|
48
|
+
collection: Address;
|
|
49
|
+
/** Quantity of tokens that will be minted */
|
|
50
|
+
quantityMinted: number | bigint;
|
|
51
|
+
} & MintTypes;
|
|
52
|
+
export type SaleType = "fixedPrice" | "erc20";
|
|
53
|
+
type SaleStrategy<T extends SaleType> = {
|
|
54
|
+
saleType: T;
|
|
55
|
+
address: Address;
|
|
56
|
+
pricePerToken: bigint;
|
|
57
|
+
saleEnd: string;
|
|
58
|
+
saleStart: string;
|
|
59
|
+
maxTokensPerAddress: bigint;
|
|
60
|
+
};
|
|
61
|
+
type FixedPriceSaleStrategy = SaleStrategy<"fixedPrice">;
|
|
62
|
+
type ERC20SaleStrategy = SaleStrategy<"erc20"> & {
|
|
63
|
+
currency: Address;
|
|
64
|
+
};
|
|
65
|
+
type SaleStrategies = FixedPriceSaleStrategy | ERC20SaleStrategy;
|
|
66
|
+
export declare function isErc20SaleStrategy(salesConfig: SaleStrategies): salesConfig is ERC20SaleStrategy;
|
|
67
|
+
export type SalesConfigAndTokenInfo = {
|
|
68
|
+
salesConfig: SaleStrategies;
|
|
69
|
+
mintFeePerQuantity: bigint;
|
|
70
|
+
};
|
|
71
|
+
export interface IMintGetter {
|
|
72
|
+
getSalesConfigAndTokenInfo({ tokenAddress, tokenId, saleType, }: {
|
|
73
|
+
tokenAddress: Address;
|
|
74
|
+
tokenId?: GenericTokenIdTypes;
|
|
75
|
+
saleType?: SaleType;
|
|
76
|
+
}): Promise<SalesConfigAndTokenInfo>;
|
|
77
|
+
}
|
|
78
|
+
export {};
|
|
79
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/mint/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,MAAM,MAAM,cAAc,CAAC,QAAQ,IAAI;IACrC,2CAA2C;IAC3C,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG;IAC3D,uBAAuB;IACvB,OAAO,EAAE,mBAAmB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEzD,MAAM,MAAM,qBAAqB,GAC7B,qBAAqB,GACrB,oBAAoB,CAAC;AAEzB,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,SAAS,CAAC,GAAG;IAC9D,iCAAiC;IACjC,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;AAElD,MAAM,MAAM,SAAS,GACjB,qBAAqB,GACrB,oBAAoB,GACpB,qBAAqB,CAAC;AAE1B,eAAO,MAAM,aAAa,SAAU,SAAS,kCAChB,CAAC;AAE9B,eAAO,MAAM,UAAU,SAAU,SAAS,kCAChB,CAAC;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AAC;CAC7B,CAAC;AAEF,KAAK,sBAAsB,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;AAEzD,KAAK,iBAAiB,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG;IAC/C,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,cAAc,GAAG,sBAAsB,GAAG,iBAAiB,CAAC;AAEjE,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,cAAc,GAC1B,WAAW,IAAI,iBAAiB,CAElC;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,WAAW,EAAE,cAAc,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,0BAA0B,CAAC,EACzB,YAAY,EACZ,OAAO,EACP,QAAQ,GACT,EAAE;QACD,YAAY,EAAE,OAAO,CAAC;QACtB,OAAO,CAAC,EAAE,mBAAmB,CAAC;QAC9B,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACrB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACtC"}
|
|
@@ -4777,6 +4777,14 @@ export declare function decodeCallFailedError(error: ContractFunctionRevertedErr
|
|
|
4777
4777
|
};
|
|
4778
4778
|
args: readonly [];
|
|
4779
4779
|
errorName: "ERC1155_MINT_TO_ZERO_ADDRESS";
|
|
4780
|
+
} | {
|
|
4781
|
+
abiItem: {
|
|
4782
|
+
readonly type: "error";
|
|
4783
|
+
readonly inputs: readonly [];
|
|
4784
|
+
readonly name: "ERC20TransferSlippage";
|
|
4785
|
+
};
|
|
4786
|
+
args: readonly [];
|
|
4787
|
+
errorName: "ERC20TransferSlippage";
|
|
4780
4788
|
} | {
|
|
4781
4789
|
abiItem: {
|
|
4782
4790
|
readonly type: "error";
|
|
@@ -5049,6 +5057,22 @@ export declare function decodeCallFailedError(error: ContractFunctionRevertedErr
|
|
|
5049
5057
|
};
|
|
5050
5058
|
args: readonly [bigint, bigint];
|
|
5051
5059
|
errorName: "TokenIdMismatch";
|
|
5060
|
+
} | {
|
|
5061
|
+
abiItem: {
|
|
5062
|
+
readonly type: "error";
|
|
5063
|
+
readonly inputs: readonly [{
|
|
5064
|
+
readonly name: "expected";
|
|
5065
|
+
readonly internalType: "string";
|
|
5066
|
+
readonly type: "string";
|
|
5067
|
+
}, {
|
|
5068
|
+
readonly name: "actual";
|
|
5069
|
+
readonly internalType: "string";
|
|
5070
|
+
readonly type: "string";
|
|
5071
|
+
}];
|
|
5072
|
+
readonly name: "UpgradeToMismatchedContractName";
|
|
5073
|
+
};
|
|
5074
|
+
args: readonly [string, string];
|
|
5075
|
+
errorName: "UpgradeToMismatchedContractName";
|
|
5052
5076
|
} | {
|
|
5053
5077
|
abiItem: {
|
|
5054
5078
|
readonly type: "error";
|
|
@@ -5113,30 +5137,6 @@ export declare function decodeCallFailedError(error: ContractFunctionRevertedErr
|
|
|
5113
5137
|
};
|
|
5114
5138
|
args: readonly [];
|
|
5115
5139
|
errorName: "premintSignerContractNotAContract";
|
|
5116
|
-
} | {
|
|
5117
|
-
abiItem: {
|
|
5118
|
-
readonly type: "error";
|
|
5119
|
-
readonly inputs: readonly [];
|
|
5120
|
-
readonly name: "ERC20TransferSlippage";
|
|
5121
|
-
};
|
|
5122
|
-
args: readonly [];
|
|
5123
|
-
errorName: "ERC20TransferSlippage";
|
|
5124
|
-
} | {
|
|
5125
|
-
abiItem: {
|
|
5126
|
-
readonly type: "error";
|
|
5127
|
-
readonly inputs: readonly [{
|
|
5128
|
-
readonly name: "expected";
|
|
5129
|
-
readonly internalType: "string";
|
|
5130
|
-
readonly type: "string";
|
|
5131
|
-
}, {
|
|
5132
|
-
readonly name: "actual";
|
|
5133
|
-
readonly internalType: "string";
|
|
5134
|
-
readonly type: "string";
|
|
5135
|
-
}];
|
|
5136
|
-
readonly name: "UpgradeToMismatchedContractName";
|
|
5137
|
-
};
|
|
5138
|
-
args: readonly [string, string];
|
|
5139
|
-
errorName: "UpgradeToMismatchedContractName";
|
|
5140
5140
|
} | {
|
|
5141
5141
|
abiItem: {
|
|
5142
5142
|
readonly type: "error";
|
|
@@ -1,6 +1,27 @@
|
|
|
1
|
+
import { ContractCreationConfig } from "@zoralabs/protocol-deployments";
|
|
2
|
+
import { Address } from "viem";
|
|
1
3
|
export declare enum PremintConfigVersion {
|
|
2
4
|
V1 = "1",
|
|
3
5
|
V2 = "2",
|
|
4
6
|
V3 = "3"
|
|
5
7
|
}
|
|
8
|
+
export type ContractCreationConfigWithOptionalAdditionalAdmins = Omit<ContractCreationConfig, "additionalAdmins"> & {
|
|
9
|
+
/** Optional: if there are additional admins accounts that should be added as contract wide admins upon contract creation. */
|
|
10
|
+
additionalAdmins?: Address[];
|
|
11
|
+
};
|
|
12
|
+
export type ContractCreationConfigAndAddress = {
|
|
13
|
+
/** Parameters for creating the contract for new premints. */
|
|
14
|
+
collection?: ContractCreationConfigWithOptionalAdditionalAdmins;
|
|
15
|
+
/** Premint collection address */
|
|
16
|
+
collectionAddress: Address;
|
|
17
|
+
};
|
|
18
|
+
export type ContractCreationConfigOrAddress = {
|
|
19
|
+
/** Parameters for creating the contract for new premints. */
|
|
20
|
+
contract: ContractCreationConfigWithOptionalAdditionalAdmins;
|
|
21
|
+
contractAddress?: undefined;
|
|
22
|
+
} | {
|
|
23
|
+
contract?: undefined;
|
|
24
|
+
/** Premint collection address */
|
|
25
|
+
contractAddress: Address;
|
|
26
|
+
};
|
|
6
27
|
//# sourceMappingURL=contract-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-types.d.ts","sourceRoot":"","sources":["../../src/premint/contract-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contract-types.d.ts","sourceRoot":"","sources":["../../src/premint/contract-types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAEvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,oBAAY,oBAAoB;IAC9B,EAAE,MAA8B;IAChC,EAAE,MAA8B;IAChC,EAAE,MAA8B;CACjC;AAED,MAAM,MAAM,kDAAkD,GAAG,IAAI,CACnE,sBAAsB,EACtB,kBAAkB,CACnB,GAAG;IACF,6HAA6H;IAC7H,gBAAgB,CAAC,EAAE,OAAO,EAAE,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,6DAA6D;IAC7D,UAAU,CAAC,EAAE,kDAAkD,CAAC;IAChE,iCAAiC;IACjC,iBAAiB,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,+BAA+B,GACvC;IACE,6DAA6D;IAC7D,QAAQ,EAAE,kDAAkD,CAAC;IAC7D,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B,GACD;IACE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iCAAiC;IACjC,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC"}
|
|
@@ -2,7 +2,8 @@ import { paths } from "src/apis/generated/premint-api-types";
|
|
|
2
2
|
import { Hex } from "viem";
|
|
3
3
|
import { ContractCreationConfig, PremintConfigAndVersion, PremintConfigV1, PremintConfigV2, PremintConfigVersion, PremintConfigWithVersion } from "@zoralabs/protocol-deployments";
|
|
4
4
|
import { PremintSignatureGetResponse } from "./premint-api-client";
|
|
5
|
-
|
|
5
|
+
import { ContractCreationConfigOrAddress } from "./contract-types";
|
|
6
|
+
export declare const convertCollectionFromApi: (collection: PremintSignatureGetResponse["collection"]) => ContractCreationConfig | undefined;
|
|
6
7
|
/**
|
|
7
8
|
* Convert server to on-chain types for a premint
|
|
8
9
|
*
|
|
@@ -11,32 +12,20 @@ export declare const convertCollectionFromApi: (collection: PremintSignatureGetR
|
|
|
11
12
|
*/
|
|
12
13
|
export declare const convertPremintFromApi: (premint: PremintSignatureGetResponse["premint"]) => PremintConfigAndVersion;
|
|
13
14
|
export declare const convertGetPremintApiResponse: (response: PremintSignatureGetResponse) => {
|
|
14
|
-
collection:
|
|
15
|
-
|
|
16
|
-
contractURI: string;
|
|
17
|
-
contractName: string;
|
|
18
|
-
additionalAdmins: readonly `0x${string}`[];
|
|
19
|
-
};
|
|
15
|
+
collection: ContractCreationConfig | undefined;
|
|
16
|
+
collectionAddress: `0x${string}`;
|
|
20
17
|
signature: `0x${string}`;
|
|
21
18
|
premintConfig: PremintConfigV1;
|
|
22
19
|
premintConfigVersion: PremintConfigVersion.V1;
|
|
23
20
|
} | {
|
|
24
|
-
collection:
|
|
25
|
-
|
|
26
|
-
contractURI: string;
|
|
27
|
-
contractName: string;
|
|
28
|
-
additionalAdmins: readonly `0x${string}`[];
|
|
29
|
-
};
|
|
21
|
+
collection: ContractCreationConfig | undefined;
|
|
22
|
+
collectionAddress: `0x${string}`;
|
|
30
23
|
signature: `0x${string}`;
|
|
31
24
|
premintConfig: PremintConfigV2;
|
|
32
25
|
premintConfigVersion: PremintConfigVersion.V2;
|
|
33
26
|
} | {
|
|
34
|
-
collection:
|
|
35
|
-
|
|
36
|
-
contractURI: string;
|
|
37
|
-
contractName: string;
|
|
38
|
-
additionalAdmins: readonly `0x${string}`[];
|
|
39
|
-
};
|
|
27
|
+
collection: ContractCreationConfig | undefined;
|
|
28
|
+
collectionAddress: `0x${string}`;
|
|
40
29
|
signature: `0x${string}`;
|
|
41
30
|
premintConfig: import("@zoralabs/protocol-deployments").PremintConfigV3;
|
|
42
31
|
premintConfigVersion: PremintConfigVersion.V3;
|
|
@@ -50,9 +39,10 @@ export type PremintSignatureResponse = SignaturePostType["responses"][200]["cont
|
|
|
50
39
|
* @param param0
|
|
51
40
|
* @returns
|
|
52
41
|
*/
|
|
53
|
-
export declare const encodePostSignatureInput: <T extends PremintConfigVersion>({ collection, premintConfigVersion, premintConfig, signature, chainId, }: {
|
|
54
|
-
collection: ContractCreationConfig;
|
|
42
|
+
export declare const encodePostSignatureInput: <T extends PremintConfigVersion>({ contract: collection, contractAddress: collectionAddress, premintConfigVersion, premintConfig, signature, chainId, }: {
|
|
55
43
|
signature: Hex;
|
|
56
44
|
chainId: number;
|
|
57
|
-
} & PremintConfigWithVersion<T>) => PremintSignatureRequestBody;
|
|
45
|
+
} & PremintConfigWithVersion<T> & ContractCreationConfigOrAddress) => PremintSignatureRequestBody;
|
|
46
|
+
export declare const isPremintConfigV1: (premintConfigAndVersion: PremintConfigAndVersion) => premintConfigAndVersion is PremintConfigWithVersion<PremintConfigVersion.V1>;
|
|
47
|
+
export declare const isPremintConfigV2: (premintConfigAndVersion: PremintConfigAndVersion) => premintConfigAndVersion is PremintConfigWithVersion<PremintConfigVersion.V2>;
|
|
58
48
|
//# sourceMappingURL=conversions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversions.d.ts","sourceRoot":"","sources":["../../src/premint/conversions.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAW,GAAG,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAEnE,eAAO,MAAM,wBAAwB,eACvB,2BAA2B,CAAC,YAAY,CAAC,KACpD,
|
|
1
|
+
{"version":3,"file":"conversions.d.ts","sourceRoot":"","sources":["../../src/premint/conversions.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAW,GAAG,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,+BAA+B,EAAE,MAAM,kBAAkB,CAAC;AAEnE,eAAO,MAAM,wBAAwB,eACvB,2BAA2B,CAAC,YAAY,CAAC,KACpD,sBAAsB,GAAG,SAU3B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,YACvB,2BAA2B,CAAC,SAAS,CAAC,KAC9C,uBAgDF,CAAC;AAEF,eAAO,MAAM,4BAA4B,aAC7B,2BAA2B;;;;;;;;;;;;;;;;;;CAMrC,CAAC;AAkCH,eAAO,MAAM,mBAAmB,6GAGC,2BAA2B,CAAC,SAAS,CAQrE,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAC5D,MAAM,MAAM,2BAA2B,GACrC,iBAAiB,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAClE,MAAM,MAAM,wBAAwB,GAClC,iBAAiB,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAErE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;eAQxB,GAAG;aACL,MAAM;sEAEmB,2BAWlC,CAAC;AAEH,eAAO,MAAM,iBAAiB,4BACH,uBAAuB,iFAEwB,CAAC;AAE3E,eAAO,MAAM,iBAAiB,4BACH,uBAAuB,iFAEwB,CAAC"}
|
|
@@ -1,32 +1,46 @@
|
|
|
1
1
|
import { IHttpClient } from "../apis/http-api-base";
|
|
2
2
|
import { components, paths } from "../apis/generated/premint-api-types";
|
|
3
3
|
import { ZORA_API_BASE } from "../constants";
|
|
4
|
-
import { NetworkConfig } from "src/apis/chain-constants";
|
|
5
4
|
import { ContractCreationConfig, PremintConfigAndVersion, PremintConfigVersion, PremintConfigWithVersion } from "@zoralabs/protocol-deployments";
|
|
6
5
|
import { Address, Hex } from "viem";
|
|
7
6
|
import { PremintSignatureResponse } from "./conversions";
|
|
7
|
+
import { ContractCreationConfigOrAddress } from "./contract-types";
|
|
8
8
|
type PremintNextUIDGetType = paths["/signature/{chain_name}/{collection_address}/next_uid"]["get"];
|
|
9
9
|
export type PremintNextUIDGetResponse = PremintNextUIDGetType["responses"][200]["content"]["application/json"];
|
|
10
10
|
type SignaturePremintGetType = paths["/signature/{chain_name}/{collection_address}/{uid}"]["get"];
|
|
11
11
|
export type PremintSignatureGetResponse = SignaturePremintGetType["responses"][200]["content"]["application/json"];
|
|
12
12
|
export type PremintCollection = PremintSignatureGetResponse["collection"];
|
|
13
13
|
export type BackendChainNames = components["schemas"]["ChainName"];
|
|
14
|
-
declare
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
export declare const getSignature: ({ collectionAddress, uid, chainId, httpClient: { retries, get }, }: {
|
|
15
|
+
collectionAddress: Address;
|
|
16
|
+
uid: number;
|
|
17
|
+
chainId: number;
|
|
18
|
+
httpClient?: Pick<IHttpClient, "retries" | "get"> | undefined;
|
|
19
|
+
}) => Promise<{
|
|
20
|
+
signature: Hex;
|
|
21
|
+
collection: ContractCreationConfig | undefined;
|
|
22
|
+
collectionAddress: Address;
|
|
23
|
+
} & PremintConfigAndVersion>;
|
|
24
|
+
export interface IPremintGetter {
|
|
25
|
+
getSignature(params: {
|
|
24
26
|
collectionAddress: Address;
|
|
25
27
|
uid: number;
|
|
26
|
-
})
|
|
28
|
+
}): ReturnType<typeof getSignature>;
|
|
29
|
+
}
|
|
30
|
+
export interface IPremintAPI {
|
|
31
|
+
getSignature: IPremintGetter["getSignature"];
|
|
32
|
+
getNextUID(collectionAddress: Address): Promise<number>;
|
|
33
|
+
postSignature<T extends PremintConfigVersion>(params: {
|
|
27
34
|
signature: Hex;
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
} & PremintConfigWithVersion<T> & ContractCreationConfigOrAddress): Promise<PremintSignatureResponse>;
|
|
36
|
+
}
|
|
37
|
+
declare class PremintAPIClient implements IPremintAPI {
|
|
38
|
+
chainId: number;
|
|
39
|
+
httpClient: IHttpClient;
|
|
40
|
+
constructor(chainId: number, httpClient?: IHttpClient);
|
|
41
|
+
postSignature: IPremintAPI["postSignature"];
|
|
42
|
+
getNextUID: IPremintAPI["getNextUID"];
|
|
43
|
+
getSignature: IPremintAPI["getSignature"];
|
|
30
44
|
}
|
|
31
45
|
export { ZORA_API_BASE, PremintAPIClient };
|
|
32
46
|
//# sourceMappingURL=premint-api-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"premint-api-client.d.ts","sourceRoot":"","sources":["../../src/premint/premint-api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"premint-api-client.d.ts","sourceRoot":"","sources":["../../src/premint/premint-api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAEL,wBAAwB,EAGzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,+BAA+B,EAAE,MAAM,kBAAkB,CAAC;AAEnE,KAAK,qBAAqB,GACxB,KAAK,CAAC,uDAAuD,CAAC,CAAC,KAAK,CAAC,CAAC;AAGxE,MAAM,MAAM,yBAAyB,GACnC,qBAA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a,EAAE,WAAW,CAAC,eAAe,CAAC,CAazC;IAEF,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAOxB;IAEb,YAAY,EAAE,WAAW,CAAC,cAAc,CAAC,CAUvC;CACH;AAED,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { Account, Address,
|
|
2
|
-
import { zoraCreator1155PremintExecutorImplABI } from "@zoralabs/protocol-deployments";
|
|
3
|
-
import { PremintConfigVersion, ContractCreationConfig,
|
|
4
|
-
import {
|
|
1
|
+
import type { Account, Address, Hex, SimulateContractParameters, TransactionReceipt, TypedDataDefinition, WalletClient } from "viem";
|
|
2
|
+
import { PremintConfigAndVersion, zoraCreator1155PremintExecutorImplABI } from "@zoralabs/protocol-deployments";
|
|
3
|
+
import { PremintConfigVersion, ContractCreationConfig, TokenCreationConfigV1, TokenCreationConfigV2, TokenCreationConfig, PremintConfigWithVersion } from "@zoralabs/protocol-deployments";
|
|
4
|
+
import { IPremintAPI, IPremintGetter } from "./premint-api-client";
|
|
5
5
|
import type { DecodeEventLogReturnType } from "viem";
|
|
6
|
-
import { IHttpClient } from "src/apis/http-api-base";
|
|
7
6
|
import { MintCosts } from "src/mint/mint-client";
|
|
8
|
-
import {
|
|
7
|
+
import { PublicClient } from "src/utils";
|
|
8
|
+
import { ContractCreationConfigOrAddress } from "./contract-types";
|
|
9
|
+
import { MakePremintMintParametersArguments } from "src/mint/types";
|
|
9
10
|
type PremintedV2LogType = DecodeEventLogReturnType<typeof zoraCreator1155PremintExecutorImplABI, "PremintedV2">["args"];
|
|
10
11
|
type URLSReturnType = {
|
|
11
12
|
explorer: null | string;
|
|
@@ -14,6 +15,26 @@ type URLSReturnType = {
|
|
|
14
15
|
};
|
|
15
16
|
export declare const defaultTokenConfigV1MintArguments: () => Omit<TokenCreationConfigV1, "fixedPriceMinter" | "tokenURI" | "royaltyRecipient">;
|
|
16
17
|
export declare const defaultTokenConfigV2MintArguments: () => Omit<TokenCreationConfigV2, "fixedPriceMinter" | "tokenURI" | "payoutRecipient" | "createReferral">;
|
|
18
|
+
type TokenConfigInput = {
|
|
19
|
+
/** Metadata URI of the token to create. */
|
|
20
|
+
tokenURI: string;
|
|
21
|
+
/** Account to receive creator rewards if it's a free mint, and token price value if its a paid mint. Defaults to the premint signing account. */
|
|
22
|
+
payoutRecipient: Address;
|
|
23
|
+
/** Optional: account to receive the create referral award. */
|
|
24
|
+
createReferral?: Address;
|
|
25
|
+
/** Optional: max supply of tokens that can be minted. Defaults to unlimited. */
|
|
26
|
+
maxSupply?: bigint;
|
|
27
|
+
/** Optional: max tokens that can be minted for an address, 0 if unlimited. Defaults to unlimited. */
|
|
28
|
+
maxTokensPerAddress?: bigint;
|
|
29
|
+
/** Optional: price per token, if this is a paid mint. 0 if a free mint. Defaults to 0, or a free mint. */
|
|
30
|
+
pricePerToken?: bigint;
|
|
31
|
+
/** Optional: duration of the mint, starting from the time the premint is brought onchain. 0 for infinite. Defaults to infinite. */
|
|
32
|
+
mintDuration?: bigint;
|
|
33
|
+
/** Optional: earliest time the premint can be brought onchain and minted. 0 for immediately. Defaults to immediately. */
|
|
34
|
+
mintStart?: bigint;
|
|
35
|
+
/** Optional: The royalty amount in basis points for secondary sales, in basis points. Defaults to 1000. */
|
|
36
|
+
royaltyBPS?: number;
|
|
37
|
+
};
|
|
17
38
|
/**
|
|
18
39
|
* Gets the preminted log from receipt
|
|
19
40
|
*
|
|
@@ -24,12 +45,18 @@ export declare function getPremintedLogFromReceipt(receipt: TransactionReceipt):
|
|
|
24
45
|
/**
|
|
25
46
|
* Preminter API to access ZORA Premint functionality.
|
|
26
47
|
*/
|
|
27
|
-
declare class PremintClient {
|
|
28
|
-
readonly apiClient:
|
|
48
|
+
export declare class PremintClient {
|
|
49
|
+
readonly apiClient: IPremintAPI;
|
|
29
50
|
readonly publicClient: PublicClient;
|
|
30
|
-
readonly
|
|
31
|
-
constructor(
|
|
32
|
-
|
|
51
|
+
readonly chainId: number;
|
|
52
|
+
constructor({ chainId, publicClient, premintApi, }: {
|
|
53
|
+
chainId: number;
|
|
54
|
+
publicClient: PublicClient;
|
|
55
|
+
premintApi: IPremintAPI;
|
|
56
|
+
});
|
|
57
|
+
getDataFromPremintReceipt(receipt: TransactionReceipt, blockExplorerUrl?: string): {
|
|
58
|
+
tokenId: bigint | undefined;
|
|
59
|
+
collectionAddres: `0x${string}` | undefined;
|
|
33
60
|
premintedLog: {
|
|
34
61
|
contractAddress: `0x${string}`;
|
|
35
62
|
tokenId: bigint;
|
|
@@ -60,7 +87,7 @@ declare class PremintClient {
|
|
|
60
87
|
* @param parameters - Parameters for creating the premint {@link CreatePremintParameters}
|
|
61
88
|
* @returns A PremintReturn. {@link PremintReturn}
|
|
62
89
|
*/
|
|
63
|
-
createPremint
|
|
90
|
+
createPremint(parameters: CreatePremintParameters): Promise<PremintReturn<any>>;
|
|
64
91
|
/**
|
|
65
92
|
* Fetches given premint data from the ZORA API.
|
|
66
93
|
*
|
|
@@ -68,44 +95,20 @@ declare class PremintClient {
|
|
|
68
95
|
* @param uid UID for the desired premint
|
|
69
96
|
* @returns PremintSignatureGetResponse of premint data from the API
|
|
70
97
|
*/
|
|
71
|
-
|
|
98
|
+
getPremint({ address, uid }: {
|
|
72
99
|
address: Address;
|
|
73
100
|
uid: number;
|
|
74
101
|
}): Promise<{
|
|
75
102
|
signature: `0x${string}`;
|
|
76
|
-
collection:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
contractName: string;
|
|
80
|
-
additionalAdmins: readonly `0x${string}`[];
|
|
81
|
-
};
|
|
82
|
-
} & import("@zoralabs/protocol-deployments").PremintConfigAndVersion>;
|
|
103
|
+
collection: ContractCreationConfig | undefined;
|
|
104
|
+
collectionAddress: `0x${string}`;
|
|
105
|
+
} & PremintConfigAndVersion>;
|
|
83
106
|
/**
|
|
84
107
|
* Gets the deterministic contract address for a premint collection
|
|
85
108
|
* @param collection Collection to get the address for
|
|
86
109
|
* @returns deterministic contract address
|
|
87
110
|
*/
|
|
88
111
|
getCollectionAddress(collection: ContractCreationConfig): Promise<`0x${string}`>;
|
|
89
|
-
/**
|
|
90
|
-
* Check user signature for v1
|
|
91
|
-
*
|
|
92
|
-
* @param data Signature data from the API
|
|
93
|
-
* @returns isValid = signature is valid or not, recoveredSigner = signer from contract
|
|
94
|
-
*/
|
|
95
|
-
isValidSignature<T extends PremintConfigVersion>({ signature, collection, premintConfig, premintConfigVersion, }: {
|
|
96
|
-
signature: Hex;
|
|
97
|
-
collection: ContractCreationConfig;
|
|
98
|
-
premintConfig: PremintConfigForVersion<T>;
|
|
99
|
-
premintConfigVersion?: T;
|
|
100
|
-
}): Promise<{
|
|
101
|
-
isValid: boolean;
|
|
102
|
-
recoveredSigner: Address | undefined;
|
|
103
|
-
}>;
|
|
104
|
-
protected makeUrls({ uid, address, tokenId, }: {
|
|
105
|
-
uid?: number;
|
|
106
|
-
tokenId?: bigint;
|
|
107
|
-
address?: Address;
|
|
108
|
-
}): URLSReturnType;
|
|
109
112
|
getMintCosts({ tokenContract, quantityToMint, pricePerToken, }: {
|
|
110
113
|
quantityToMint: bigint;
|
|
111
114
|
tokenContract: Address;
|
|
@@ -118,7 +121,7 @@ declare class PremintClient {
|
|
|
118
121
|
* @param parameters - Parameters for collecting the Premint {@link MakeMintParametersArguments}
|
|
119
122
|
* @returns receipt, log, zoraURL
|
|
120
123
|
*/
|
|
121
|
-
makeMintParameters(
|
|
124
|
+
makeMintParameters({ minterAccount, tokenContract, uid, mintArguments, firstMinter, }: MakeMintParametersArguments): Promise<SimulateContractParameters<readonly [{
|
|
122
125
|
readonly stateMutability: "nonpayable";
|
|
123
126
|
readonly type: "constructor";
|
|
124
127
|
readonly inputs: readonly [{
|
|
@@ -1465,33 +1468,46 @@ declare class PremintClient {
|
|
|
1465
1468
|
readonly type: "error";
|
|
1466
1469
|
readonly inputs: readonly [];
|
|
1467
1470
|
readonly name: "premintSignerContractNotAContract";
|
|
1468
|
-
}], "
|
|
1471
|
+
}], "premint", any, any, any, `0x${string}` | Account>>;
|
|
1469
1472
|
}
|
|
1470
|
-
export declare function
|
|
1471
|
-
|
|
1473
|
+
export declare function getDataFromPremintReceipt(receipt: TransactionReceipt, chainId: number, blockExplorerUrl?: string): {
|
|
1474
|
+
tokenId: bigint | undefined;
|
|
1475
|
+
collectionAddres: `0x${string}` | undefined;
|
|
1476
|
+
premintedLog: {
|
|
1477
|
+
contractAddress: `0x${string}`;
|
|
1478
|
+
tokenId: bigint;
|
|
1479
|
+
createdNewContract: boolean;
|
|
1480
|
+
uid: number;
|
|
1481
|
+
minter: `0x${string}`;
|
|
1482
|
+
quantityMinted: bigint;
|
|
1483
|
+
} | undefined;
|
|
1484
|
+
urls: URLSReturnType;
|
|
1485
|
+
};
|
|
1472
1486
|
/** ======= ADMIN ======= */
|
|
1473
1487
|
export type SignAndSubmitParams = {
|
|
1474
1488
|
/** The WalletClient used to sign the premint */
|
|
1475
1489
|
walletClient: WalletClient;
|
|
1476
|
-
|
|
1477
|
-
account: Account | Address;
|
|
1478
|
-
/** If the signature should be checked before submitting it to the api */
|
|
1479
|
-
checkSignature?: boolean;
|
|
1480
|
-
};
|
|
1490
|
+
} & CheckSignatureParams;
|
|
1481
1491
|
export type SignAndSubmitReturn = {
|
|
1482
1492
|
/** The signature of the Premint */
|
|
1483
1493
|
signature: Hex;
|
|
1484
1494
|
/** The account that signed the Premint */
|
|
1485
1495
|
signerAccount: Account | Address;
|
|
1486
1496
|
};
|
|
1497
|
+
export type CheckSignatureParams = {
|
|
1498
|
+
/** If the premint signature should be validated before submitting to the API */
|
|
1499
|
+
checkSignature: true;
|
|
1500
|
+
/** Account that signed the premint */
|
|
1501
|
+
account: Account | Address;
|
|
1502
|
+
} | {
|
|
1503
|
+
/** If the premint signature should be validated before submitting to the API */
|
|
1504
|
+
checkSignature?: false;
|
|
1505
|
+
account?: Account | Address;
|
|
1506
|
+
};
|
|
1487
1507
|
export type SubmitParams = {
|
|
1488
1508
|
/** The signature of the Premint */
|
|
1489
1509
|
signature: Hex;
|
|
1490
|
-
|
|
1491
|
-
checkSignature?: boolean;
|
|
1492
|
-
/** The account that signed the premint */
|
|
1493
|
-
signerAccount: Account | Address;
|
|
1494
|
-
};
|
|
1510
|
+
} & CheckSignatureParams;
|
|
1495
1511
|
type PremintReturn<T extends PremintConfigVersion> = {
|
|
1496
1512
|
/** The typedDataDefinition of the Premint which is to be signed the creator. */
|
|
1497
1513
|
typedDataDefinition: TypedDataDefinition;
|
|
@@ -1503,20 +1519,12 @@ type PremintReturn<T extends PremintConfigVersion> = {
|
|
|
1503
1519
|
submit: (params: SubmitParams) => void;
|
|
1504
1520
|
} & PremintConfigWithVersion<T>;
|
|
1505
1521
|
/** CREATE */
|
|
1506
|
-
type CreatePremintParameters
|
|
1507
|
-
/** The account to receive the creator reward if it's a free mint, and the paid mint fee if it's a paid mint */
|
|
1508
|
-
payoutRecipient: Address;
|
|
1509
|
-
/** Collection information for the mint */
|
|
1510
|
-
collection: ContractCreationConfigWithoutAdditionalAdmins;
|
|
1522
|
+
type CreatePremintParameters = {
|
|
1511
1523
|
/** tokenCreationConfig Token creation settings, optional settings are overridden with sensible defaults */
|
|
1512
|
-
|
|
1513
|
-
tokenURI: string;
|
|
1514
|
-
};
|
|
1515
|
-
/** Premint config version to use, defaults to V2 */
|
|
1516
|
-
premintConfigVersion?: T;
|
|
1524
|
+
token: TokenConfigInput;
|
|
1517
1525
|
/** uid the UID to use – optional and retrieved as a fresh UID from ZORA by default. */
|
|
1518
1526
|
uid?: number;
|
|
1519
|
-
};
|
|
1527
|
+
} & ContractCreationConfigOrAddress;
|
|
1520
1528
|
/** UPDATE */
|
|
1521
1529
|
export type UpdatePremintParams = {
|
|
1522
1530
|
/** uid of the Premint to update */
|
|
@@ -1551,12 +1559,20 @@ export type MakeMintParametersArguments = {
|
|
|
1551
1559
|
/** Address to receive the minted tokens */
|
|
1552
1560
|
mintRecipient?: Address;
|
|
1553
1561
|
};
|
|
1562
|
+
/** Account to receive first minter reward, if this mint brings the premint onchain */
|
|
1563
|
+
firstMinter?: Address;
|
|
1554
1564
|
};
|
|
1555
|
-
|
|
1565
|
+
/** ======== MINTING ======== */
|
|
1566
|
+
export declare function collectPremint({ uid, tokenContract, minterAccount, quantityToMint, mintComment, mintReferral, mintRecipient, firstMinter, premintGetter, publicClient, }: Omit<MakePremintMintParametersArguments, "mintType"> & {
|
|
1567
|
+
premintGetter: IPremintGetter;
|
|
1568
|
+
publicClient: PublicClient;
|
|
1569
|
+
}): Promise<SimulateContractParameters<typeof zoraCreator1155PremintExecutorImplABI, "premint", any, any, any, Account | Address>>;
|
|
1570
|
+
export declare function makeUrls({ uid, address, tokenId, chainId, blockExplorerUrl, }: {
|
|
1556
1571
|
uid?: number;
|
|
1557
1572
|
tokenId?: bigint;
|
|
1558
1573
|
address?: Address;
|
|
1559
|
-
|
|
1574
|
+
chainId: number;
|
|
1575
|
+
blockExplorerUrl?: string;
|
|
1560
1576
|
}): URLSReturnType;
|
|
1561
1577
|
export {};
|
|
1562
1578
|
//# sourceMappingURL=premint-client.d.ts.map
|