@zoralabs/protocol-sdk 0.7.1 → 0.7.2-ALLOWLIST.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/CHANGELOG.md +6 -0
- package/dist/allow-list/allow-list-client.d.ts +25 -0
- package/dist/allow-list/allow-list-client.d.ts.map +1 -0
- package/dist/allow-list/types.d.ts +14 -0
- package/dist/allow-list/types.d.ts.map +1 -0
- package/dist/apis/generated/allow-list-api-types.d.ts +288 -0
- package/dist/apis/generated/allow-list-api-types.d.ts.map +1 -0
- package/dist/apis/http-api-base.d.ts.map +1 -1
- package/dist/create/1155-create-helper.d.ts +1 -0
- package/dist/create/1155-create-helper.d.ts.map +1 -1
- package/dist/create/token-setup.d.ts +3 -4
- package/dist/create/token-setup.d.ts.map +1 -1
- package/dist/create/types.d.ts +24 -4
- package/dist/create/types.d.ts.map +1 -1
- package/dist/index.cjs +219 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +220 -40
- package/dist/index.js.map +1 -1
- package/dist/mint/mint-queries.d.ts +3 -1
- package/dist/mint/mint-queries.d.ts.map +1 -1
- package/dist/mint/mint-transactions.d.ts +5 -3
- package/dist/mint/mint-transactions.d.ts.map +1 -1
- package/dist/mint/subgraph-mint-getter.d.ts.map +1 -1
- package/dist/mint/subgraph-queries.d.ts +27 -13
- package/dist/mint/subgraph-queries.d.ts.map +1 -1
- package/dist/mint/types.d.ts +22 -11
- package/dist/mint/types.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/allow-list/allow-list-client.ts +102 -0
- package/src/allow-list/types.ts +15 -0
- package/src/apis/generated/allow-list-api-types.ts +288 -0
- package/src/apis/http-api-base.ts +12 -0
- package/src/create/1155-create-helper.ts +17 -0
- package/src/create/token-setup.ts +116 -19
- package/src/create/types.ts +32 -4
- package/src/index.ts +4 -0
- package/src/mint/mint-queries.ts +6 -0
- package/src/mint/mint-transactions.ts +72 -6
- package/src/mint/subgraph-mint-getter.ts +12 -3
- package/src/mint/subgraph-queries.ts +39 -17
- package/src/mint/types.ts +38 -12
- package/yarn-error.log +8602 -0
- package/.turbo/turbo-build.log +0 -15
- package/src/create/1155-create-helper.test.ts +0 -325
- package/src/mint/mint-client.test.ts +0 -263
- package/src/mints/mints-contracts.test.ts +0 -529
- package/src/mints/mints-eth-unwrapper-and-caller.test.ts +0 -467
- package/src/mints/mints-queries.test.ts +0 -105
- package/src/premint/premint-client.test.ts +0 -290
- package/src/premint/preminter.test.ts +0 -866
- package/test-integration/setup-test-contracts.ts +0 -96
- package/tsconfig.build.json +0 -10
- package/tsup.config.ts +0 -12
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createCollectorClient,
|
|
3
|
-
createCreatorClient,
|
|
4
|
-
getPremintCollectionAddress,
|
|
5
|
-
} from "src";
|
|
6
|
-
import {
|
|
7
|
-
LocalAccount,
|
|
8
|
-
createPublicClient,
|
|
9
|
-
createWalletClient,
|
|
10
|
-
http,
|
|
11
|
-
parseEther,
|
|
12
|
-
} from "viem";
|
|
13
|
-
import { privateKeyToAccount } from "viem/accounts";
|
|
14
|
-
import { zoraSepolia } from "viem/chains";
|
|
15
|
-
|
|
16
|
-
const publicClient = createPublicClient({
|
|
17
|
-
chain: zoraSepolia,
|
|
18
|
-
transport: http(),
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const walletClient = createWalletClient({
|
|
22
|
-
chain: zoraSepolia,
|
|
23
|
-
transport: http(),
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const creatorClient = createCreatorClient({
|
|
27
|
-
chainId: zoraSepolia.id,
|
|
28
|
-
publicClient,
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const collectorClient = createCollectorClient({
|
|
32
|
-
chainId: zoraSepolia.id,
|
|
33
|
-
publicClient,
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
export const createPremintsOnContract = async ({
|
|
37
|
-
creatorAccount,
|
|
38
|
-
}: {
|
|
39
|
-
creatorAccount: LocalAccount;
|
|
40
|
-
}) => {
|
|
41
|
-
const collectionAddress = await getPremintCollectionAddress({
|
|
42
|
-
publicClient,
|
|
43
|
-
contract: {
|
|
44
|
-
contractAdmin: creatorAccount.address,
|
|
45
|
-
contractName: "testContract",
|
|
46
|
-
contractURI:
|
|
47
|
-
"ipfs://bafkreiainxen4b4wz4ubylvbhons6rembxdet4a262nf2lziclqvv7au3e",
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
console.log({ collectionAddress });
|
|
52
|
-
|
|
53
|
-
const { typedDataDefinition, submit } = await creatorClient.createPremint({
|
|
54
|
-
contract: {
|
|
55
|
-
contractAdmin: creatorAccount.address,
|
|
56
|
-
contractName: "testContract",
|
|
57
|
-
contractURI:
|
|
58
|
-
"ipfs://bafkreiainxen4b4wz4ubylvbhons6rembxdet4a262nf2lziclqvv7au3e",
|
|
59
|
-
},
|
|
60
|
-
token: {
|
|
61
|
-
payoutRecipient: creatorAccount.address,
|
|
62
|
-
tokenURI:
|
|
63
|
-
"ipfs://bafkreice23maski3x52tsfqgxstx3kbiifnt5jotg3a5ynvve53c4soi2u",
|
|
64
|
-
pricePerToken: parseEther("0.001"),
|
|
65
|
-
},
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
const signature = await walletClient.signTypedData({
|
|
69
|
-
account: creatorAccount,
|
|
70
|
-
...typedDataDefinition,
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
await submit({
|
|
74
|
-
signature,
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
const mints = await collectorClient.getTokensOfContract({
|
|
78
|
-
tokenContract: collectionAddress,
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
console.log({ mints: mints.map((x) => x.mintable) });
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const setupTestContracts = async () => {
|
|
85
|
-
const creatorAccount = privateKeyToAccount(
|
|
86
|
-
// random private key created by cast
|
|
87
|
-
"0x0d32fcabfe28c779974a77dc635163f062be2bc0b10eea62994235617b44092f",
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
// create 2 premints on a contract
|
|
91
|
-
await createPremintsOnContract({
|
|
92
|
-
creatorAccount,
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
setupTestContracts();
|
package/tsconfig.build.json
DELETED
package/tsup.config.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "tsup";
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
entry: ["src/index.ts"],
|
|
5
|
-
sourcemap: true,
|
|
6
|
-
clean: true,
|
|
7
|
-
tsconfig: "tsconfig.build.json",
|
|
8
|
-
dts: false,
|
|
9
|
-
format: ["cjs", "esm"],
|
|
10
|
-
onSuccess:
|
|
11
|
-
"tsc --project tsconfig.build.json --emitDeclarationOnly --declaration --declarationMap",
|
|
12
|
-
});
|