@zoralabs/protocol-sdk 0.9.5 → 0.10.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 +7 -7
- package/CHANGELOG.md +17 -2
- package/dist/anvil.d.ts +11 -1
- package/dist/anvil.d.ts.map +1 -1
- package/dist/apis/multicall3.d.ts +9 -0
- package/dist/apis/multicall3.d.ts.map +1 -0
- package/dist/apis/subgraph-getter.d.ts +9 -0
- package/dist/apis/subgraph-getter.d.ts.map +1 -0
- package/dist/create/contract-getter.d.ts +3 -6
- package/dist/create/contract-getter.d.ts.map +1 -1
- package/dist/fixtures/mint-query-results.d.ts +10 -0
- package/dist/fixtures/mint-query-results.d.ts.map +1 -0
- package/dist/fixtures/rewards-query-results.d.ts +6 -0
- package/dist/fixtures/rewards-query-results.d.ts.map +1 -0
- package/dist/index.cjs +402 -161
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +408 -161
- package/dist/index.js.map +1 -1
- package/dist/mint/subgraph-mint-getter.d.ts +3 -5
- package/dist/mint/subgraph-mint-getter.d.ts.map +1 -1
- package/dist/rewards/rewards-client.d.ts +34 -0
- package/dist/rewards/rewards-client.d.ts.map +1 -0
- package/dist/rewards/rewards-queries.d.ts +34 -0
- package/dist/rewards/rewards-queries.d.ts.map +1 -0
- package/dist/rewards/subgraph-queries.d.ts +20 -0
- package/dist/rewards/subgraph-queries.d.ts.map +1 -0
- package/dist/rewards/subgraph-rewards-getter.d.ts +15 -0
- package/dist/rewards/subgraph-rewards-getter.d.ts.map +1 -0
- package/dist/sdk.d.ts +5 -0
- package/dist/sdk.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/apis/multicall3.ts +19 -0
- package/src/apis/subgraph-getter.ts +33 -0
- package/src/create/1155-create-helper.test.ts +18 -18
- package/src/create/contract-getter.ts +7 -29
- package/src/fixtures/mint-query-results.ts +55 -0
- package/src/fixtures/rewards-query-results.ts +25 -0
- package/src/mint/mint-client.test.ts +18 -46
- package/src/mint/subgraph-mint-getter.ts +7 -27
- package/src/rewards/rewards-client.test.ts +406 -0
- package/src/rewards/rewards-client.ts +67 -0
- package/src/rewards/rewards-queries.ts +253 -0
- package/src/rewards/subgraph-queries.ts +49 -0
- package/src/rewards/subgraph-rewards-getter.ts +33 -0
- package/src/sdk.ts +18 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @zoralabs/protocol-sdk@0.
|
|
2
|
+
> @zoralabs/protocol-sdk@0.10.0 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
|
+
ESM dist/index.js 201.75 KB
|
|
14
|
+
ESM dist/index.js.map 417.86 KB
|
|
15
|
+
ESM ⚡️ Build success in 313ms
|
|
16
|
+
CJS dist/index.cjs 207.89 KB
|
|
17
|
+
CJS dist/index.cjs.map 419.77 KB
|
|
18
|
+
CJS ⚡️ Build success in 313ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
# @zoralabs/protocol-sdk
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fc4a7f65: Support viewing and withdrawing protocol rewards and secondary royalties balances from the sdk, using the new methods `getRewardsBalances` and `withdrawRewards`.
|
|
8
|
+
|
|
9
|
+
## 0.9.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 24520e9a: Fix sdk setSale for v2 params
|
|
14
|
+
- Updated dependencies [247ebc86]
|
|
15
|
+
- Updated dependencies [24520e9a]
|
|
16
|
+
- @zoralabs/protocol-deployments@0.3.2
|
|
17
|
+
|
|
3
18
|
## 0.9.5
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
6
21
|
|
|
7
|
-
- 879a019a: - Fixed types, defaults, and queries for v2 timed sales
|
|
22
|
+
- 879a019a: - Fixed types, defaults, and queries for v2 timed sales
|
|
8
23
|
|
|
9
24
|
## 0.9.4
|
|
10
25
|
|
|
@@ -188,7 +203,7 @@
|
|
|
188
203
|
|
|
189
204
|
### Patch Changes
|
|
190
205
|
|
|
191
|
-
- 825e5f7: Adds optional `createReferral` to `createNew1155Token` params
|
|
206
|
+
- 825e5f7: Adds optional `createReferral` to `createNew1155Token` params
|
|
192
207
|
|
|
193
208
|
## 0.5.8
|
|
194
209
|
|
package/dist/anvil.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Account, Chain, PublicClient, SimulateContractReturnType, TestClient, Transport, WalletClient } from "viem";
|
|
2
|
+
import { SimulateContractParametersWithAccount } from "./types";
|
|
2
3
|
export interface AnvilViemClientsTest {
|
|
3
4
|
viemClients: {
|
|
4
5
|
walletClient: WalletClient;
|
|
@@ -32,5 +33,14 @@ export declare const anvilTest: import("vitest").TestAPI<{
|
|
|
32
33
|
chain: Chain;
|
|
33
34
|
};
|
|
34
35
|
}>;
|
|
35
|
-
export declare function
|
|
36
|
+
export declare function simulateAndWriteContractWithRetries({ parameters, walletClient, publicClient, }: {
|
|
37
|
+
parameters: SimulateContractParametersWithAccount;
|
|
38
|
+
walletClient: WalletClient;
|
|
39
|
+
publicClient: PublicClient;
|
|
40
|
+
}): Promise<import("viem").TransactionReceipt>;
|
|
41
|
+
export declare function writeContractWithRetries({ request, walletClient, publicClient, }: {
|
|
42
|
+
request: SimulateContractReturnType<any, any, any, Chain, Account>["request"];
|
|
43
|
+
walletClient: WalletClient;
|
|
44
|
+
publicClient: PublicClient;
|
|
45
|
+
}): Promise<import("viem").TransactionReceipt>;
|
|
36
46
|
//# sourceMappingURL=anvil.d.ts.map
|
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,SAAS,EACT,YAAY,EAKb,MAAM,MAAM,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;AAGd,OAAO,EAAE,qCAAqC,EAAE,MAAM,SAAS,CAAC;AAEhE,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,mCAAmC,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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Address, Hex } from "viem";
|
|
2
|
+
export declare const multicall3Abi: readonly ["struct Call { address target; bytes callData; }", "struct Call3 { address target; bool allowFailure; bytes callData; }", "struct Call3Value { address target; bool allowFailure; uint256 value; bytes callData; }", "struct Result { bool success; bytes returnData; }", "function aggregate(Call[] calldata calls) public payable returns (uint256 blockNumber, bytes[] memory returnData)", "function aggregate3(Call3[] calldata calls) public payable returns (Result[] memory returnData)", "function aggregate3Value(Call3Value[] calldata calls) public payable returns (Result[] memory returnData)"];
|
|
3
|
+
export declare const multicall3Address = "0xcA11bde05977b3631167028862bE2a173976CA11";
|
|
4
|
+
export type Multicall3Call3 = {
|
|
5
|
+
target: Address;
|
|
6
|
+
allowFailure: boolean;
|
|
7
|
+
callData: Hex;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=multicall3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multicall3.d.ts","sourceRoot":"","sources":["../../src/apis/multicall3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEpC,eAAO,MAAM,aAAa,0lBAQhB,CAAC;AAEX,eAAO,MAAM,iBAAiB,+CAA+C,CAAC;AAE9E,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,GAAG,CAAC;CACf,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NetworkConfig } from "./chain-constants";
|
|
2
|
+
import { ISubgraphQuerier, ISubgraphQuery } from "./subgraph-querier";
|
|
3
|
+
export declare class SubgraphGetter {
|
|
4
|
+
readonly subgraphQuerier: ISubgraphQuerier;
|
|
5
|
+
networkConfig: NetworkConfig;
|
|
6
|
+
constructor(chainId: number, subgraphQuerier?: ISubgraphQuerier);
|
|
7
|
+
querySubgraphWithRetries<T>({ query, variables, parseResponseData, }: ISubgraphQuery<T>): Promise<T | undefined>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=subgraph-getter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subgraph-getter.d.ts","sourceRoot":"","sources":["../../src/apis/subgraph-getter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EACL,gBAAgB,EAChB,cAAc,EAEf,MAAM,oBAAoB,CAAC;AAG5B,qBAAa,cAAc;IACzB,SAAgB,eAAe,EAAE,gBAAgB,CAAC;IAClD,aAAa,EAAE,aAAa,CAAC;gBAEjB,OAAO,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,gBAAgB;IAMzD,wBAAwB,CAAC,CAAC,EAAE,EAChC,KAAK,EACL,SAAS,EACT,iBAAiB,GAClB,EAAE,cAAc,CAAC,CAAC,CAAC;CASrB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ISubgraphQuerier, ISubgraphQuery } from "src/apis/subgraph-querier";
|
|
1
|
+
import { ISubgraphQuerier } from "src/apis/subgraph-querier";
|
|
3
2
|
import { Address } from "viem";
|
|
3
|
+
import { SubgraphGetter } from "src/apis/subgraph-getter";
|
|
4
4
|
export interface IContractGetter {
|
|
5
5
|
getContractInfo: (params: {
|
|
6
6
|
contractAddress: Address;
|
|
@@ -12,11 +12,8 @@ export interface IContractGetter {
|
|
|
12
12
|
mintFee: bigint;
|
|
13
13
|
}>;
|
|
14
14
|
}
|
|
15
|
-
export declare class SubgraphContractGetter implements IContractGetter {
|
|
16
|
-
readonly subgraphQuerier: ISubgraphQuerier;
|
|
17
|
-
networkConfig: NetworkConfig;
|
|
15
|
+
export declare class SubgraphContractGetter extends SubgraphGetter implements IContractGetter {
|
|
18
16
|
constructor(chainId: number, subgraphQuerier?: ISubgraphQuerier);
|
|
19
|
-
querySubgraphWithRetries<T>({ query, variables, parseResponseData, }: ISubgraphQuery<T>): Promise<T | undefined>;
|
|
20
17
|
getContractInfo({ contractAddress, retries, }: {
|
|
21
18
|
contractAddress: Address;
|
|
22
19
|
retries?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-getter.d.ts","sourceRoot":"","sources":["../../src/create/contract-getter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"contract-getter.d.ts","sourceRoot":"","sources":["../../src/create/contract-getter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG/B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,MAAM,WAAW,eAAe;IAC9B,eAAe,EAAE,CAAC,MAAM,EAAE;QACxB,eAAe,EAAE,OAAO,CAAC;QACzB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,KAAK,OAAO,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,MAAM,CAAC;QACxB,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;CACJ;AAED,qBAAa,sBACX,SAAQ,cACR,YAAW,eAAe;gBAEd,OAAO,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,gBAAgB;IAIzD,eAAe,CAAC,EACpB,eAAe,EACf,OAAW,GACZ,EAAE;QACD,eAAe,EAAE,OAAO,CAAC;QACzB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC;QACV,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,MAAM,CAAC;QACxB,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CA8BH"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Address } from "viem";
|
|
2
|
+
import { TokenQueryResult } from "../mint/subgraph-queries";
|
|
3
|
+
export declare const mockTimedSaleStrategyTokenQueryResult: ({ tokenId, contractAddress, contractVersion, chainId, saleEnd, }: {
|
|
4
|
+
tokenId: bigint;
|
|
5
|
+
contractAddress: Address;
|
|
6
|
+
contractVersion: string;
|
|
7
|
+
chainId: number;
|
|
8
|
+
saleEnd?: bigint;
|
|
9
|
+
}) => TokenQueryResult;
|
|
10
|
+
//# sourceMappingURL=mint-query-results.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mint-query-results.d.ts","sourceRoot":"","sources":["../../src/fixtures/mint-query-results.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA2B,MAAM,MAAM,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,eAAO,MAAM,qCAAqC,qEAM/C;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAG,gBAqCF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Address } from "viem";
|
|
2
|
+
import { CreatorERC20zQueryResult } from "../rewards/subgraph-queries";
|
|
3
|
+
export declare const mockRewardsQueryResults: ({ erc20z, }: {
|
|
4
|
+
erc20z: Address[];
|
|
5
|
+
}) => CreatorERC20zQueryResult;
|
|
6
|
+
//# sourceMappingURL=rewards-query-results.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewards-query-results.d.ts","sourceRoot":"","sources":["../../src/fixtures/rewards-query-results.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAEL,wBAAwB,EACzB,MAAM,6BAA6B,CAAC;AAcrC,eAAO,MAAM,uBAAuB,gBAEjC;IACD,MAAM,EAAE,OAAO,EAAE,CAAC;CACnB,KAAG,wBAEF,CAAC"}
|