@zoralabs/protocol-sdk 0.9.4-PRE.0 → 0.9.4

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.
@@ -1,18 +1,18 @@
1
-
2
- > @zoralabs/protocol-sdk@0.9.4-PRE.0 build /Users/danovedzora/source/zora-protocol/packages/protocol-sdk
3
- > pnpm tsup
4
-
5
- CLI Building entry: src/index.ts
6
- CLI Using tsconfig: tsconfig.build.json
7
- CLI tsup v7.3.0
8
- CLI Using tsup config: /Users/danovedzora/source/zora-protocol/packages/protocol-sdk/tsup.config.ts
9
- CLI Target: es2021
10
- CLI Cleaning output folder
11
- CJS Build start
12
- ESM Build start
13
- CJS dist/index.cjs 200.28 KB
14
- CJS dist/index.cjs.map 402.68 KB
15
- CJS ⚡️ Build success in 53ms
16
- ESM dist/index.js 194.39 KB
17
- ESM dist/index.js.map 400.66 KB
18
- ESM ⚡️ Build success in 53ms
1
+
2
+ > @zoralabs/protocol-sdk@0.9.4 build /home/runner/work/zora-protocol-private/zora-protocol-private/packages/protocol-sdk
3
+ > pnpm tsup
4
+
5
+ CLI Building entry: src/index.ts
6
+ CLI Using tsconfig: tsconfig.build.json
7
+ CLI tsup v7.3.0
8
+ CLI Using tsup config: /home/runner/work/zora-protocol-private/zora-protocol-private/packages/protocol-sdk/tsup.config.ts
9
+ CLI Target: es2021
10
+ CLI Cleaning output folder
11
+ CJS Build start
12
+ ESM Build start
13
+ CJS dist/index.cjs 200.24 KB
14
+ CJS dist/index.cjs.map 402.59 KB
15
+ CJS ⚡️ Build success in 264ms
16
+ ESM dist/index.js 194.34 KB
17
+ ESM dist/index.js.map 400.58 KB
18
+ ESM ⚡️ Build success in 314ms
package/CHANGELOG.md CHANGED
@@ -1,11 +1,14 @@
1
1
  # @zoralabs/protocol-sdk
2
2
 
3
- ## 0.9.4-PRE.0
3
+ ## 0.9.4
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [6fa9e6c3]
8
- - @zoralabs/protocol-deployments@0.3.1-PRE.0
7
+ - b9fcab20: Removed unneeded async in token setup
8
+ - Updated dependencies [d221894d]
9
+ - Updated dependencies [f94e5f03]
10
+ - Updated dependencies [1b4d5ee7]
11
+ - @zoralabs/protocol-deployments@0.3.1
9
12
 
10
13
  ## 0.9.3
11
14
 
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Zora Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/anvil.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Chain, PublicClient, TestClient, Transport, WalletClient } from "viem";
1
+ import { Account, Chain, PublicClient, SimulateContractReturnType, TestClient, Transport, WalletClient } from "viem";
2
2
  export interface AnvilViemClientsTest {
3
3
  viemClients: {
4
4
  walletClient: WalletClient;
@@ -22,7 +22,6 @@ export declare const makeAnvilTest: ({ forkUrl, forkBlockNumber, anvilChainId, }
22
22
  }>;
23
23
  export declare const forkUrls: {
24
24
  zoraMainnet: string;
25
- zoraGoerli: string;
26
25
  zoraSepolia: string;
27
26
  };
28
27
  export declare const anvilTest: import("vitest").TestAPI<{
@@ -33,4 +32,5 @@ export declare const anvilTest: import("vitest").TestAPI<{
33
32
  chain: Chain;
34
33
  };
35
34
  }>;
35
+ export declare function writeContractWithRetries(request: SimulateContractReturnType<any, any, any, Chain, Account>["request"], walletClient: WalletClient, publicClient: PublicClient): Promise<import("viem").TransactionReceipt>;
36
36
  //# sourceMappingURL=anvil.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"anvil.d.ts","sourceRoot":"","sources":["../src/anvil.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,EACL,YAAY,EACZ,UAAU,EACV,SAAS,EACT,YAAY,EAKb,MAAM,MAAM,CAAC;AAGd,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE;QACX,YAAY,EAAE,YAAY,CAAC;QAE3B,YAAY,EAAE,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC7C,UAAU,EAAE,UAAU,CAAC;QACvB,KAAK,EAAE,KAAK,CAAC;KACd,CAAC;CACH;AAUD,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,aAAa,gDAIvB,qBAAqB;;sBA1BN,YAAY;sBAEZ,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC;oBAChC,UAAU;eACf,KAAK;;EA+EZ,CAAC;AAEL,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF,eAAO,MAAM,SAAS;;sBA3FJ,YAAY;sBAEZ,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC;oBAChC,UAAU;eACf,KAAK;;EA2Fd,CAAC"}
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,SAAS,EACT,YAAY,EAKb,MAAM,MAAM,CAAC;AAId,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE;QACX,YAAY,EAAE,YAAY,CAAC;QAE3B,YAAY,EAAE,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC7C,UAAU,EAAE,UAAU,CAAC;QACvB,KAAK,EAAE,KAAK,CAAC;KACd,CAAC;CACH;AAUD,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,aAAa,gDAIvB,qBAAqB;;sBA1BN,YAAY;sBAEZ,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC;oBAChC,UAAU;eACf,KAAK;;EA+EZ,CAAC;AAEL,eAAO,MAAM,QAAQ;;;CAGpB,CAAC;AAEF,eAAO,MAAM,SAAS;;sBA1FJ,YAAY;sBAEZ,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC;oBAChC,UAAU;eACf,KAAK;;EA0Fd,CAAC;AAEH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,0BAA0B,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,EAC7E,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,8CAwB3B"}
@@ -22,7 +22,7 @@ export declare const get: <T>(url: string) => Promise<T>;
22
22
  * @throws Error when HTTP response fails
23
23
  */
24
24
  export declare const post: <T>(url: string, data: any) => Promise<T>;
25
- export declare const retries: <T>(tryFn: () => T, maxTries?: number, linearBackoffMS?: number) => Promise<T>;
25
+ export declare const retries: <T>(tryFn: () => T, maxTries?: number, linearBackoffMS?: number, shouldRetry?: (err: any) => boolean) => Promise<T>;
26
26
  export interface IHttpClient {
27
27
  get: typeof get;
28
28
  post: typeof post;
@@ -1 +1 @@
1
- {"version":3,"file":"http-api-base.d.ts","sourceRoot":"","sources":["../../src/apis/http-api-base.ts"],"names":[],"mappings":"AAEA,qBAAa,gBAAgB,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,KAAK;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,CAAC,CAAC;gBACI,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG;CAMvD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,GAAU,CAAC,OAAO,MAAM,eAcvC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,GAAU,CAAC,OAAO,MAAM,QAAQ,GAAG,eAiCnD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,CAAC,SACtB,MAAM,CAAC,aACJ,MAAM,oBACC,MAAM,KACtB,OAAO,CAAC,CAAC,CAWX,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,OAAO,GAAG,CAAC;IAChB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,OAAO,CAAC;CACzB;AAED,eAAO,MAAM,UAAU,EAAE,WAIxB,CAAC"}
1
+ {"version":3,"file":"http-api-base.d.ts","sourceRoot":"","sources":["../../src/apis/http-api-base.ts"],"names":[],"mappings":"AAEA,qBAAa,gBAAgB,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,KAAK;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,CAAC,CAAC;gBACI,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG;CAMvD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,GAAU,CAAC,OAAO,MAAM,eAcvC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,GAAU,CAAC,OAAO,MAAM,QAAQ,GAAG,eAiCnD,CAAC;AAMF,eAAO,MAAM,OAAO,GAAU,CAAC,SACtB,MAAM,CAAC,aACJ,MAAM,oBACC,MAAM,gBACV,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,KACjC,OAAO,CAAC,CAAC,CAOX,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,OAAO,GAAG,CAAC;IAChB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,OAAO,CAAC;CACzB;AAED,eAAO,MAAM,UAAU,EAAE,WAIxB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { SalesConfigParamsType, ConcreteSalesConfig } from "./types";
2
2
  export declare const SALE_END_FOREVER = 18446744073709551615n;
3
3
  export declare const parseNameIntoSymbol: (name: string) => string;
4
- export declare const getSalesConfigWithDefaults: (salesConfig: SalesConfigParamsType | undefined, contractName: string) => Promise<ConcreteSalesConfig>;
4
+ export declare const getSalesConfigWithDefaults: (salesConfig: SalesConfigParamsType | undefined, contractName: string) => ConcreteSalesConfig;
5
5
  //# sourceMappingURL=minter-defaults.d.ts.map
@@ -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,gBAAgB,wBAAwB,CAAC;AAuCtD,eAAO,MAAM,mBAAmB,SAAU,MAAM,WAsB/C,CAAC;AAkCF,eAAO,MAAM,0BAA0B,gBACxB,qBAAqB,GAAG,SAAS,gBAChC,MAAM,KACnB,OAAO,CAAC,mBAAmB,CAa7B,CAAC"}
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,gBAAgB,wBAAwB,CAAC;AAuCtD,eAAO,MAAM,mBAAmB,SAAU,MAAM,WAsB/C,CAAC;AAkCF,eAAO,MAAM,0BAA0B,gBACxB,qBAAqB,GAAG,SAAS,gBAChC,MAAM,KACnB,mBAaF,CAAC"}
@@ -5,10 +5,10 @@ export declare function constructCreate1155TokenCalls(props: CreateNew1155TokenP
5
5
  chainId: number;
6
6
  } & {
7
7
  contractName: string;
8
- }): Promise<{
8
+ }): {
9
9
  setupActions: `0x${string}`[];
10
10
  newToken: New1155Token;
11
11
  minter: Address;
12
- }>;
12
+ };
13
13
  export declare const contractSupportsMintRewards: (contractVersion?: string | null, contractStandard?: "ERC721" | "ERC1155") => boolean;
14
14
  //# sourceMappingURL=token-setup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"token-setup.d.ts","sourceRoot":"","sources":["../../src/create/token-setup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAwC,MAAM,MAAM,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAgH/E,wBAAsB,6BAA6B,CACjD,KAAK,EAAE,uBAAuB,GAC5B,aAAa,GAAG;IACd,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG;IACF,YAAY,EAAE,MAAM,CAAC;CACtB,GACF,OAAO,CAAC;IACT,YAAY,EAAE,KAAK,MAAM,EAAE,EAAE,CAAC;IAC9B,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC,CA4DD;AAED,eAAO,MAAM,2BAA2B,qBACpB,MAAM,GAAG,IAAI,qBACZ,QAAQ,GAAG,SAAS,YAexC,CAAC"}
1
+ {"version":3,"file":"token-setup.d.ts","sourceRoot":"","sources":["../../src/create/token-setup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAwC,MAAM,MAAM,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AA6G/E,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,uBAAuB,GAC5B,aAAa,GAAG;IACd,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG;IACF,YAAY,EAAE,MAAM,CAAC;CACtB,GACF;IACD,YAAY,EAAE,KAAK,MAAM,EAAE,EAAE,CAAC;IAC9B,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CA4DA;AAED,eAAO,MAAM,2BAA2B,qBACpB,MAAM,GAAG,IAAI,qBACZ,QAAQ,GAAG,SAAS,YAexC,CAAC"}
package/dist/index.cjs CHANGED
@@ -2643,10 +2643,10 @@ var post = async (url, data) => {
2643
2643
  }
2644
2644
  return await response.json();
2645
2645
  };
2646
- var retries = async (tryFn, maxTries = 3, linearBackoffMS = 200) => {
2647
- const shouldRetry = (err) => {
2648
- return err instanceof BadResponseError && err.status >= 500;
2649
- };
2646
+ var defaultShouldRetry = (err) => {
2647
+ return err instanceof BadResponseError && err.status >= 500;
2648
+ };
2649
+ var retries = async (tryFn, maxTries = 3, linearBackoffMS = 200, shouldRetry = defaultShouldRetry) => {
2650
2650
  return retriesGeneric({
2651
2651
  tryFn,
2652
2652
  maxTries,
@@ -4364,7 +4364,7 @@ var parseNameIntoSymbol = (name) => {
4364
4364
  }
4365
4365
  return result;
4366
4366
  };
4367
- var timedSaleSettingsWithDefaults = async (params, contractName) => {
4367
+ var timedSaleSettingsWithDefaults = (params, contractName) => {
4368
4368
  const erc20Name = params.erc20Name || contractName;
4369
4369
  const symbol = params.erc20Symbol || parseNameIntoSymbol(erc20Name);
4370
4370
  return {
@@ -4380,7 +4380,7 @@ var isErc20 = (salesConfig) => salesConfig.type === "erc20Mint";
4380
4380
  var isFixedPrice = (salesConfig) => {
4381
4381
  return salesConfig.type === "fixedPrice" || salesConfig.pricePerToken > 0n;
4382
4382
  };
4383
- var getSalesConfigWithDefaults = async (salesConfig, contractName) => {
4383
+ var getSalesConfigWithDefaults = (salesConfig, contractName) => {
4384
4384
  if (!salesConfig)
4385
4385
  return timedSaleSettingsWithDefaults({}, contractName);
4386
4386
  if (isAllowList(salesConfig)) {
@@ -4588,7 +4588,7 @@ function setupMinters({ salesConfig, ...rest }) {
4588
4588
  }
4589
4589
 
4590
4590
  // src/create/token-setup.ts
4591
- async function applyNew1155Defaults(props, ownerAddress, contractName) {
4591
+ function applyNew1155Defaults(props, ownerAddress, contractName) {
4592
4592
  const { payoutRecipient: fundsRecipient } = props;
4593
4593
  const fundsRecipientOrOwner = fundsRecipient && fundsRecipient !== import_viem8.zeroAddress ? fundsRecipient : ownerAddress;
4594
4594
  return {
@@ -4597,10 +4597,7 @@ async function applyNew1155Defaults(props, ownerAddress, contractName) {
4597
4597
  maxSupply: typeof props.maxSupply === "undefined" ? OPEN_EDITION_MINT_SIZE : BigInt(props.maxSupply),
4598
4598
  royaltyBPS: props.royaltyBPS || 1e3,
4599
4599
  tokenMetadataURI: props.tokenMetadataURI,
4600
- salesConfig: await getSalesConfigWithDefaults(
4601
- props.salesConfig,
4602
- contractName
4603
- )
4600
+ salesConfig: getSalesConfigWithDefaults(props.salesConfig, contractName)
4604
4601
  };
4605
4602
  }
4606
4603
  function buildSetupNewToken({
@@ -4662,7 +4659,7 @@ function makeAdminMintCall({
4662
4659
  args: [ownerAddress, nextTokenId, BigInt(mintQuantity), import_viem8.zeroAddress]
4663
4660
  });
4664
4661
  }
4665
- async function constructCreate1155TokenCalls(props) {
4662
+ function constructCreate1155TokenCalls(props) {
4666
4663
  const {
4667
4664
  chainId,
4668
4665
  nextTokenId,
@@ -4670,7 +4667,7 @@ async function constructCreate1155TokenCalls(props) {
4670
4667
  ownerAddress,
4671
4668
  contractVersion
4672
4669
  } = props;
4673
- const new1155TokenPropsWithDefaults = await applyNew1155Defaults(
4670
+ const new1155TokenPropsWithDefaults = applyNew1155Defaults(
4674
4671
  props,
4675
4672
  ownerAddress,
4676
4673
  props.contractName
@@ -4945,7 +4942,7 @@ async function createNew1155ContractAndToken({
4945
4942
  minter,
4946
4943
  newToken,
4947
4944
  setupActions: tokenSetupActions
4948
- } = await prepareSetupActions({
4945
+ } = prepareSetupActions({
4949
4946
  chainId,
4950
4947
  account,
4951
4948
  contractVersion,
@@ -5005,7 +5002,7 @@ async function createNew1155Token({
5005
5002
  minter,
5006
5003
  newToken,
5007
5004
  setupActions: tokenSetupActions
5008
- } = await prepareSetupActions({
5005
+ } = prepareSetupActions({
5009
5006
  chainId,
5010
5007
  account,
5011
5008
  contractVersion,
@@ -5037,7 +5034,7 @@ async function createNew1155Token({
5037
5034
  prepareMint
5038
5035
  };
5039
5036
  }
5040
- async function prepareSetupActions({
5037
+ function prepareSetupActions({
5041
5038
  chainId,
5042
5039
  account,
5043
5040
  contractVersion,
@@ -5050,7 +5047,7 @@ async function prepareSetupActions({
5050
5047
  minter,
5051
5048
  newToken,
5052
5049
  setupActions: tokenSetupActions
5053
- } = await constructCreate1155TokenCalls({
5050
+ } = constructCreate1155TokenCalls({
5054
5051
  chainId,
5055
5052
  ownerAddress: account,
5056
5053
  contractVersion,