@zoralabs/coins-sdk 0.0.2-sdkalpha.8 → 0.0.2
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/README.md +834 -410
- package/dist/actions/createCoin.d.ts +4 -3
- package/dist/actions/createCoin.d.ts.map +1 -1
- package/dist/actions/tradeCoin.d.ts +5 -4
- package/dist/actions/tradeCoin.d.ts.map +1 -1
- package/dist/actions/updateCoinURI.d.ts +4 -3
- package/dist/actions/updateCoinURI.d.ts.map +1 -1
- package/dist/actions/updatePayoutRecipient.d.ts +4 -3
- package/dist/actions/updatePayoutRecipient.d.ts.map +1 -1
- package/dist/api/explore.d.ts +9 -10
- package/dist/api/explore.d.ts.map +1 -1
- package/dist/api/queries.d.ts +105 -11
- package/dist/api/queries.d.ts.map +1 -1
- package/dist/api/query-types.d.ts +3 -0
- package/dist/api/query-types.d.ts.map +1 -0
- package/dist/index.cjs +55 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/actions/createCoin.ts +2 -2
- package/src/actions/tradeCoin.ts +3 -4
- package/src/actions/updateCoinURI.ts +2 -2
- package/src/actions/updatePayoutRecipient.ts +2 -2
- package/src/api/explore.ts +36 -25
- package/src/api/queries.ts +22 -9
- package/src/api/query-types.ts +8 -0
- package/src/index.ts +1 -0
- package/dist/utils/retries.d.ts +0 -7
- package/dist/utils/retries.d.ts.map +0 -1
- package/src/utils/retries.ts +0 -49
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { zoraFactoryImplABI } from "@zoralabs/coins";
|
|
2
|
-
import { Address,
|
|
2
|
+
import { Address, TransactionReceipt, WalletClient, SimulateContractParameters, ContractEventArgsFromTopics } from "viem";
|
|
3
|
+
import { GenericPublicClient } from "src/utils/genericPublicClient";
|
|
3
4
|
export type CoinDeploymentLogArgs = ContractEventArgsFromTopics<typeof zoraFactoryImplABI, "CoinCreated">;
|
|
4
5
|
export type CreateCoinArgs = {
|
|
5
6
|
name: string;
|
|
@@ -18,11 +19,11 @@ export declare function createCoinCall({ name, symbol, uri, owners, payoutRecipi
|
|
|
18
19
|
* @returns The deployment information if found
|
|
19
20
|
*/
|
|
20
21
|
export declare function getCoinCreateFromLogs(receipt: TransactionReceipt): CoinDeploymentLogArgs | undefined;
|
|
21
|
-
export declare function createCoin(call: CreateCoinArgs, walletClient: WalletClient, publicClient:
|
|
22
|
+
export declare function createCoin(call: CreateCoinArgs, walletClient: WalletClient, publicClient: GenericPublicClient, options?: {
|
|
22
23
|
gasMultiplier?: number;
|
|
23
24
|
}): Promise<{
|
|
24
25
|
hash: `0x${string}`;
|
|
25
|
-
receipt:
|
|
26
|
+
receipt: any;
|
|
26
27
|
address: `0x${string}` | undefined;
|
|
27
28
|
deployment: {
|
|
28
29
|
caller: `0x${string}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCoin.d.ts","sourceRoot":"","sources":["../../src/actions/createCoin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EACL,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"createCoin.d.ts","sourceRoot":"","sources":["../../src/actions/createCoin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EACL,OAAO,EACP,kBAAkB,EAClB,YAAY,EACZ,0BAA0B,EAC1B,2BAA2B,EAE5B,MAAM,MAAM,CAAC;AAGd,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,MAAM,qBAAqB,GAAG,2BAA2B,CAC7D,OAAO,kBAAkB,EACzB,aAAa,CACd,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,MAAM,EACN,GAAG,EACH,MAAM,EACN,eAAe,EACf,kBAAuB,EACvB,SAAmB,EACnB,gBAA+D,GAChE,EAAE,cAAc,GAAG,0BAA0B,CAC5C,OAAO,kBAAkB,EACzB,QAAQ,CACT,CAuBA;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,kBAAkB,GAC1B,qBAAqB,GAAG,SAAS,CAMnC;AAGD,wBAAsB,UAAU,CAC9B,IAAI,EAAE,cAAc,EACpB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,mBAAmB,EACjC,OAAO,CAAC,EAAE;IACR,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;;;;;;;;;;;;;;;;GAuBF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { coinABI } from "@zoralabs/coins";
|
|
2
|
-
import { Address,
|
|
2
|
+
import { Address, TransactionReceipt, WalletClient, SimulateContractParameters, ContractEventArgsFromTopics } from "viem";
|
|
3
|
+
import { GenericPublicClient } from "src/utils/genericPublicClient";
|
|
3
4
|
export type SellEventArgs = ContractEventArgsFromTopics<typeof coinABI, "CoinSell">;
|
|
4
5
|
export type BuyEventArgs = ContractEventArgsFromTopics<typeof coinABI, "CoinBuy">;
|
|
5
6
|
export type TradeEventArgs = SellEventArgs | BuyEventArgs;
|
|
@@ -14,7 +15,7 @@ export type TradeEventArgs = SellEventArgs | BuyEventArgs;
|
|
|
14
15
|
export declare function simulateBuy({ target, requestedOrderSize, publicClient, }: {
|
|
15
16
|
target: Address;
|
|
16
17
|
requestedOrderSize: bigint;
|
|
17
|
-
publicClient:
|
|
18
|
+
publicClient: GenericPublicClient;
|
|
18
19
|
}): Promise<{
|
|
19
20
|
orderSize: bigint;
|
|
20
21
|
amountOut: bigint;
|
|
@@ -66,9 +67,9 @@ export declare function getTradeFromLogs(receipt: TransactionReceipt, direction:
|
|
|
66
67
|
* trade: TradeEventArgs | undefined
|
|
67
68
|
* }>} The transaction result with trade details
|
|
68
69
|
*/
|
|
69
|
-
export declare function tradeCoin(params: TradeParams, walletClient: WalletClient, publicClient:
|
|
70
|
+
export declare function tradeCoin(params: TradeParams, walletClient: WalletClient, publicClient: GenericPublicClient): Promise<{
|
|
70
71
|
hash: `0x${string}`;
|
|
71
|
-
receipt:
|
|
72
|
+
receipt: any;
|
|
72
73
|
trade: TradeEventArgs | undefined;
|
|
73
74
|
}>;
|
|
74
75
|
//# sourceMappingURL=tradeCoin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tradeCoin.d.ts","sourceRoot":"","sources":["../../src/actions/tradeCoin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EACL,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"tradeCoin.d.ts","sourceRoot":"","sources":["../../src/actions/tradeCoin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EACL,OAAO,EACP,kBAAkB,EAClB,YAAY,EACZ,0BAA0B,EAG1B,2BAA2B,EAE5B,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGpE,MAAM,MAAM,aAAa,GAAG,2BAA2B,CACrD,OAAO,OAAO,EACd,UAAU,CACX,CAAC;AACF,MAAM,MAAM,YAAY,GAAG,2BAA2B,CACpD,OAAO,OAAO,EACd,SAAS,CAC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} from "viem";
|
|
2
|
+
import { GenericPublicClient } from "src/utils/genericPublicClient";
|
|
2
3
|
export type UpdateCoinURIArgs = {
|
|
3
4
|
coin: Address;
|
|
4
5
|
newURI: string;
|
|
5
6
|
};
|
|
6
7
|
export declare function updateCoinURICall({ newURI, coin, }: UpdateCoinURIArgs): SimulateContractParameters;
|
|
7
|
-
export declare function updateCoinURI(args: UpdateCoinURIArgs, walletClient: WalletClient, publicClient:
|
|
8
|
+
export declare function updateCoinURI(args: UpdateCoinURIArgs, walletClient: WalletClient, publicClient: GenericPublicClient): Promise<{
|
|
8
9
|
hash: `0x${string}`;
|
|
9
|
-
receipt:
|
|
10
|
+
receipt: any;
|
|
10
11
|
uriUpdated: ({
|
|
11
12
|
address: Address;
|
|
12
13
|
blockHash: `0x${string}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateCoinURI.d.ts","sourceRoot":"","sources":["../../src/actions/updateCoinURI.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EAEP,
|
|
1
|
+
{"version":3,"file":"updateCoinURI.d.ts","sourceRoot":"","sources":["../../src/actions/updateCoinURI.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EAEP,0BAA0B,EAC1B,YAAY,EACb,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,IAAI,GACL,EAAE,iBAAiB,GAAG,0BAA0B,CAWhD;AAED,wBAAsB,aAAa,CACjC,IAAI,EAAE,iBAAiB,EACvB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,mBAAmB;;;;;;;;;;;;;;;;;GAgBlC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Address,
|
|
1
|
+
import { Address, SimulateContractParameters, WalletClient } from "viem";
|
|
2
|
+
import { GenericPublicClient } from "src/utils/genericPublicClient";
|
|
2
3
|
export type UpdatePayoutRecipientArgs = {
|
|
3
4
|
coin: Address;
|
|
4
5
|
newPayoutRecipient: string;
|
|
5
6
|
};
|
|
6
7
|
export declare function updatePayoutRecipientCall({ newPayoutRecipient, coin, }: UpdatePayoutRecipientArgs): SimulateContractParameters;
|
|
7
|
-
export declare function updatePayoutRecipient(args: UpdatePayoutRecipientArgs, walletClient: WalletClient, publicClient:
|
|
8
|
+
export declare function updatePayoutRecipient(args: UpdatePayoutRecipientArgs, walletClient: WalletClient, publicClient: GenericPublicClient): Promise<{
|
|
8
9
|
hash: `0x${string}`;
|
|
9
|
-
receipt:
|
|
10
|
+
receipt: any;
|
|
10
11
|
payoutRecipientUpdated: ({
|
|
11
12
|
address: Address;
|
|
12
13
|
blockHash: `0x${string}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updatePayoutRecipient.d.ts","sourceRoot":"","sources":["../../src/actions/updatePayoutRecipient.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EAEP,
|
|
1
|
+
{"version":3,"file":"updatePayoutRecipient.d.ts","sourceRoot":"","sources":["../../src/actions/updatePayoutRecipient.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EAEP,0BAA0B,EAC1B,YAAY,EACb,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,EACxC,kBAAkB,EAClB,IAAI,GACL,EAAE,yBAAyB,GAAG,0BAA0B,CAOxD;AAED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,yBAAyB,EAC/B,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,mBAAmB;;;;;;;;;;;;;;;;;;;;;GAgBlC"}
|
package/dist/api/explore.d.ts
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import type { GetExploreData, GetExploreResponse } from "../client/types.gen";
|
|
2
|
-
import {
|
|
2
|
+
import { RequestOptionsType } from "./query-types";
|
|
3
3
|
/**
|
|
4
4
|
* The inner type for the explore queries that omits listType.
|
|
5
5
|
* This is used to create the query object for the explore queries.
|
|
6
6
|
*/
|
|
7
|
-
export type
|
|
8
|
-
query: Omit<GetExploreData["query"], "listType">;
|
|
9
|
-
} & Omit<GetExploreData, "query">;
|
|
7
|
+
export type QueryRequestType = Omit<GetExploreData["query"], "listType">;
|
|
10
8
|
type ExploreResponse = {
|
|
11
9
|
data?: GetExploreResponse;
|
|
12
10
|
};
|
|
13
11
|
export type ListType = GetExploreData["query"]["listType"];
|
|
14
12
|
export type { ExploreResponse };
|
|
13
|
+
export type { GetExploreData };
|
|
15
14
|
/** Get top gaining coins */
|
|
16
|
-
export declare const getCoinsTopGainers:
|
|
15
|
+
export declare const getCoinsTopGainers: (query?: QueryRequestType, options?: RequestOptionsType<GetExploreData>) => Promise<ExploreResponse>;
|
|
17
16
|
/** Get coins with highest 24h volume */
|
|
18
|
-
export declare const getCoinsTopVolume24h:
|
|
17
|
+
export declare const getCoinsTopVolume24h: (query?: QueryRequestType, options?: RequestOptionsType<GetExploreData>) => Promise<ExploreResponse>;
|
|
19
18
|
/** Get most valuable coins */
|
|
20
|
-
export declare const getCoinsMostValuable:
|
|
19
|
+
export declare const getCoinsMostValuable: (query?: QueryRequestType, options?: RequestOptionsType<GetExploreData>) => Promise<ExploreResponse>;
|
|
21
20
|
/** Get newly created coins */
|
|
22
|
-
export declare const getCoinsNew:
|
|
21
|
+
export declare const getCoinsNew: (query?: QueryRequestType, options?: RequestOptionsType<GetExploreData>) => Promise<ExploreResponse>;
|
|
23
22
|
/** Get recently traded coins */
|
|
24
|
-
export declare const getCoinsLastTraded:
|
|
23
|
+
export declare const getCoinsLastTraded: (query?: QueryRequestType, options?: RequestOptionsType<GetExploreData>) => Promise<ExploreResponse>;
|
|
25
24
|
/** Get recently traded unique coins */
|
|
26
|
-
export declare const getCoinsLastTradedUnique:
|
|
25
|
+
export declare const getCoinsLastTradedUnique: (query?: QueryRequestType, options?: RequestOptionsType<GetExploreData>) => Promise<ExploreResponse>;
|
|
27
26
|
//# sourceMappingURL=explore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explore.d.ts","sourceRoot":"","sources":["../../src/api/explore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"explore.d.ts","sourceRoot":"","sources":["../../src/api/explore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC;AAEzE,KAAK,eAAe,GAAG;IAAE,IAAI,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAC;AAErD,MAAM,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC;AAE3D,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC,YAAY,EAAE,cAAc,EAAE,CAAC;AAgB/B,4BAA4B;AAC5B,eAAO,MAAM,kBAAkB,WACtB,gBAAgB,YACb,kBAAkB,CAAC,cAAc,CAAC,KAC3C,OAAO,CAAC,eAAe,CACyB,CAAC;AAEpD,wCAAwC;AACxC,eAAO,MAAM,oBAAoB,WACxB,gBAAgB,YACb,kBAAkB,CAAC,cAAc,CAAC,KAC3C,OAAO,CAAC,eAAe,CAC4B,CAAC;AAEvD,8BAA8B;AAC9B,eAAO,MAAM,oBAAoB,WACxB,gBAAgB,YACb,kBAAkB,CAAC,cAAc,CAAC,KAC3C,OAAO,CAAC,eAAe,CAC2B,CAAC;AAEtD,8BAA8B;AAC9B,eAAO,MAAM,WAAW,WACf,gBAAgB,YACb,kBAAkB,CAAC,cAAc,CAAC,KAC3C,OAAO,CAAC,eAAe,CAA8C,CAAC;AAEzE,gCAAgC;AAChC,eAAO,MAAM,kBAAkB,WACtB,gBAAgB,YACb,kBAAkB,CAAC,cAAc,CAAC,KAC3C,OAAO,CAAC,eAAe,CACyB,CAAC;AAEpD,uCAAuC;AACvC,eAAO,MAAM,wBAAwB,WAC5B,gBAAgB,YACb,kBAAkB,CAAC,cAAc,CAAC,KAC3C,OAAO,CAAC,eAAe,CACgC,CAAC"}
|
package/dist/api/queries.d.ts
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import { GetCoinCommentsData, GetCoinCommentsResponse, GetCoinData, GetCoinResponse, GetCoinsResponse, GetProfileBalancesData, GetProfileData, GetProfileResponse } from "../client/types.gen";
|
|
1
|
+
import { GetCoinCommentsData, GetCoinCommentsResponse, GetCoinData, GetCoinResponse, GetCoinsData, GetCoinsResponse, GetProfileBalancesData, GetProfileData, GetProfileResponse } from "../client/types.gen";
|
|
2
|
+
import { RequestOptionsType } from "./query-types";
|
|
2
3
|
type APIQueryDataResponse<T> = Promise<{
|
|
3
4
|
data?: T;
|
|
4
5
|
}>;
|
|
5
6
|
export type { APIQueryDataResponse };
|
|
6
7
|
type GetCoinQuery = GetCoinData["query"];
|
|
7
|
-
export type { GetCoinQuery };
|
|
8
|
+
export type { GetCoinQuery, GetCoinData };
|
|
8
9
|
export type { GetCoinResponse } from "../client/types.gen";
|
|
9
|
-
export
|
|
10
|
+
export type CoinData = NonNullable<GetCoinResponse["zora20Token"]>;
|
|
11
|
+
export declare const getCoin: (query: GetCoinQuery, options?: RequestOptionsType<GetCoinData>) => Promise<{
|
|
10
12
|
data?: GetCoinResponse;
|
|
11
13
|
}>;
|
|
12
14
|
type GetCoinsQuery = {
|
|
13
15
|
coinAddresses: string[];
|
|
14
16
|
chainId?: number;
|
|
15
17
|
};
|
|
16
|
-
export type { GetCoinsQuery };
|
|
18
|
+
export type { GetCoinsQuery, GetCoinsData };
|
|
17
19
|
export type { GetCoinsResponse } from "../client/types.gen";
|
|
18
|
-
export declare const getCoins: ({ coinAddresses, chainId
|
|
20
|
+
export declare const getCoins: ({ coinAddresses, chainId }: GetCoinsQuery, options?: RequestOptionsType<GetCoinsData>) => APIQueryDataResponse<GetCoinsResponse>;
|
|
19
21
|
type GetCoinCommentsQuery = GetCoinCommentsData["query"];
|
|
20
|
-
export type { GetCoinCommentsQuery };
|
|
22
|
+
export type { GetCoinCommentsQuery, GetCoinCommentsData };
|
|
21
23
|
export type { GetCoinCommentsResponse } from "../client/types.gen";
|
|
22
|
-
export declare const getCoinComments: (query: GetCoinCommentsQuery) => APIQueryDataResponse<GetCoinCommentsResponse>;
|
|
24
|
+
export declare const getCoinComments: (query: GetCoinCommentsQuery, options?: RequestOptionsType<GetCoinCommentsData>) => APIQueryDataResponse<GetCoinCommentsResponse>;
|
|
23
25
|
type GetProfileQuery = GetProfileData["query"];
|
|
24
|
-
export type { GetProfileQuery };
|
|
26
|
+
export type { GetProfileQuery, GetProfileData };
|
|
25
27
|
export type { GetProfileResponse } from "../client/types.gen";
|
|
26
|
-
export declare const getProfile: (query: GetProfileQuery) => APIQueryDataResponse<GetProfileResponse>;
|
|
28
|
+
export declare const getProfile: (query: GetProfileQuery, options?: RequestOptionsType<GetProfileData>) => APIQueryDataResponse<GetProfileResponse>;
|
|
27
29
|
type GetProfileBalancesQuery = GetProfileBalancesData["query"];
|
|
28
|
-
export type { GetProfileBalancesQuery };
|
|
30
|
+
export type { GetProfileBalancesQuery, GetProfileBalancesData };
|
|
29
31
|
export type { GetProfileBalancesResponse } from "../client/types.gen";
|
|
30
|
-
export declare const getProfileBalances: (query: GetProfileBalancesData["query"]) => Promise<({
|
|
32
|
+
export declare const getProfileBalances: (query: GetProfileBalancesData["query"], options?: RequestOptionsType<GetProfileBalancesData>) => Promise<(({
|
|
31
33
|
data: undefined;
|
|
32
34
|
error: unknown;
|
|
33
35
|
} | {
|
|
@@ -124,5 +126,97 @@ export declare const getProfileBalances: (query: GetProfileBalancesData["query"]
|
|
|
124
126
|
}) & {
|
|
125
127
|
request: Request;
|
|
126
128
|
response: Response;
|
|
129
|
+
}) | {
|
|
130
|
+
data: {
|
|
131
|
+
profile?: string;
|
|
132
|
+
id?: string;
|
|
133
|
+
handle?: string;
|
|
134
|
+
avatar?: {
|
|
135
|
+
previewImage?: string;
|
|
136
|
+
blurhash?: string;
|
|
137
|
+
small?: string;
|
|
138
|
+
};
|
|
139
|
+
coinBalances?: {
|
|
140
|
+
count?: number;
|
|
141
|
+
edges?: Array<{
|
|
142
|
+
node?: {
|
|
143
|
+
balance?: string;
|
|
144
|
+
id?: string;
|
|
145
|
+
coin?: {
|
|
146
|
+
id?: string;
|
|
147
|
+
name?: string;
|
|
148
|
+
description?: string;
|
|
149
|
+
address?: string;
|
|
150
|
+
symbol?: string;
|
|
151
|
+
totalSupply?: string;
|
|
152
|
+
totalVolume?: string;
|
|
153
|
+
volume24h?: string;
|
|
154
|
+
createdAt?: string;
|
|
155
|
+
creatorAddress?: string;
|
|
156
|
+
creatorEarnings?: Array<{
|
|
157
|
+
amount?: {
|
|
158
|
+
currency?: {
|
|
159
|
+
address?: string;
|
|
160
|
+
};
|
|
161
|
+
amountRaw?: string;
|
|
162
|
+
amountDecimal?: number;
|
|
163
|
+
};
|
|
164
|
+
amountUsd?: string;
|
|
165
|
+
}>;
|
|
166
|
+
marketCap?: string;
|
|
167
|
+
marketCapDelta24h?: string;
|
|
168
|
+
chainId?: number;
|
|
169
|
+
creatorProfile?: string;
|
|
170
|
+
handle?: string;
|
|
171
|
+
avatar?: {
|
|
172
|
+
previewImage?: string;
|
|
173
|
+
blurhash?: string;
|
|
174
|
+
small?: string;
|
|
175
|
+
};
|
|
176
|
+
media?: {
|
|
177
|
+
mimeType?: string;
|
|
178
|
+
originalUri?: string;
|
|
179
|
+
format?: string;
|
|
180
|
+
previewImage?: string;
|
|
181
|
+
medium?: string;
|
|
182
|
+
blurhash?: string;
|
|
183
|
+
};
|
|
184
|
+
transfers?: {
|
|
185
|
+
count?: number;
|
|
186
|
+
};
|
|
187
|
+
uniqueHolders?: number;
|
|
188
|
+
zoraComments?: {
|
|
189
|
+
pageInfo?: {
|
|
190
|
+
endCursor?: string;
|
|
191
|
+
hasNextPage?: boolean;
|
|
192
|
+
};
|
|
193
|
+
count?: number;
|
|
194
|
+
edges?: Array<{
|
|
195
|
+
node?: string;
|
|
196
|
+
txHash?: string;
|
|
197
|
+
comment?: string;
|
|
198
|
+
userAddress?: string;
|
|
199
|
+
timestamp?: number;
|
|
200
|
+
userProfile?: string;
|
|
201
|
+
id?: string;
|
|
202
|
+
handle?: string;
|
|
203
|
+
avatar?: {
|
|
204
|
+
previewImage?: string;
|
|
205
|
+
blurhash?: string;
|
|
206
|
+
small?: string;
|
|
207
|
+
};
|
|
208
|
+
}>;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
}>;
|
|
213
|
+
pageInfo?: {
|
|
214
|
+
hasNextPage?: boolean;
|
|
215
|
+
endCursor?: string;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
request: Request;
|
|
220
|
+
response: Response;
|
|
127
221
|
}>;
|
|
128
222
|
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/api/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,EACd,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;
|
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CAAC;sCAAgC,CAAC;uCAAiC,CAAC;2CAAqC,CAAC;yCAAmC,CAAC;2CAAqC,CAAC;kCAA6H,CAAC;sCAAgC,CAAC;sCAAgC,CAAC;gDAAkC,CAAC;4CAAoC,CAAC;yCAAiC,CAAC;;;;;;;oBAA6K,CAAC;2BAA0G,CAAC;yBAAiH,CAAC;;;;;;EADlyT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-types.d.ts","sourceRoot":"","sources":["../../src/api/query-types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,OAAO,IAAI,aAAa,EACxB,UAAU,EACX,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,kBAAkB,CAAC,KAAK,SAAS,UAAU,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -96,6 +96,37 @@ async function createCoin(call, walletClient, publicClient, options) {
|
|
|
96
96
|
|
|
97
97
|
|
|
98
98
|
|
|
99
|
+
async function simulateBuy({
|
|
100
|
+
target,
|
|
101
|
+
requestedOrderSize,
|
|
102
|
+
publicClient
|
|
103
|
+
}) {
|
|
104
|
+
const numberResult = await publicClient.simulateContract({
|
|
105
|
+
address: target,
|
|
106
|
+
abi: _coins.coinABI,
|
|
107
|
+
functionName: "buy",
|
|
108
|
+
args: [
|
|
109
|
+
_viem.zeroAddress,
|
|
110
|
+
requestedOrderSize,
|
|
111
|
+
0n,
|
|
112
|
+
// minAmountOut
|
|
113
|
+
0n,
|
|
114
|
+
// sqrtPriceLimitX96
|
|
115
|
+
_viem.zeroAddress
|
|
116
|
+
// tradeReferrer
|
|
117
|
+
],
|
|
118
|
+
// We want to ensure that the multicall3 contract has enough ETH to buy in the simulation
|
|
119
|
+
stateOverride: [
|
|
120
|
+
{
|
|
121
|
+
address: _chains.baseSepolia.contracts.multicall3.address,
|
|
122
|
+
balance: _viem.parseEther.call(void 0, "10000000")
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
});
|
|
126
|
+
const orderSize = numberResult.result[0];
|
|
127
|
+
const amountOut = numberResult.result[1];
|
|
128
|
+
return { orderSize, amountOut };
|
|
129
|
+
}
|
|
99
130
|
function tradeCoinCall({
|
|
100
131
|
target,
|
|
101
132
|
direction,
|
|
@@ -425,16 +456,14 @@ function getApiKeyMeta() {
|
|
|
425
456
|
}
|
|
426
457
|
|
|
427
458
|
// src/api/queries.ts
|
|
428
|
-
var getCoin2 = async (query) => {
|
|
459
|
+
var getCoin2 = async (query, options) => {
|
|
429
460
|
return await getCoin({
|
|
461
|
+
...options,
|
|
430
462
|
query,
|
|
431
463
|
meta: getApiKeyMeta()
|
|
432
464
|
});
|
|
433
465
|
};
|
|
434
|
-
var getCoins2 = async ({
|
|
435
|
-
coinAddresses,
|
|
436
|
-
chainId
|
|
437
|
-
}) => {
|
|
466
|
+
var getCoins2 = async ({ coinAddresses, chainId }, options) => {
|
|
438
467
|
return await getCoins({
|
|
439
468
|
query: {
|
|
440
469
|
coins: coinAddresses.map((collectionAddress) => ({
|
|
@@ -442,40 +471,44 @@ var getCoins2 = async ({
|
|
|
442
471
|
collectionAddress
|
|
443
472
|
}))
|
|
444
473
|
},
|
|
445
|
-
meta: getApiKeyMeta()
|
|
474
|
+
meta: getApiKeyMeta(),
|
|
475
|
+
...options
|
|
446
476
|
});
|
|
447
477
|
};
|
|
448
|
-
var getCoinComments2 = async (query) => {
|
|
478
|
+
var getCoinComments2 = async (query, options) => {
|
|
449
479
|
return await getCoinComments({
|
|
450
480
|
query,
|
|
451
|
-
meta: getApiKeyMeta()
|
|
481
|
+
meta: getApiKeyMeta(),
|
|
482
|
+
...options
|
|
452
483
|
});
|
|
453
484
|
};
|
|
454
|
-
var getProfile2 = async (query) => {
|
|
485
|
+
var getProfile2 = async (query, options) => {
|
|
455
486
|
return await getProfile({
|
|
456
487
|
query,
|
|
457
|
-
meta: getApiKeyMeta()
|
|
488
|
+
meta: getApiKeyMeta(),
|
|
489
|
+
...options
|
|
458
490
|
});
|
|
459
491
|
};
|
|
460
|
-
var getProfileBalances2 = async (query) => {
|
|
492
|
+
var getProfileBalances2 = async (query, options) => {
|
|
461
493
|
return await getProfileBalances({
|
|
462
494
|
query,
|
|
463
|
-
meta: getApiKeyMeta()
|
|
495
|
+
meta: getApiKeyMeta(),
|
|
496
|
+
...options
|
|
464
497
|
});
|
|
465
498
|
};
|
|
466
499
|
|
|
467
500
|
// src/api/explore.ts
|
|
468
|
-
var createExploreQuery = (listType, options) => getExplore({
|
|
501
|
+
var createExploreQuery = (query, listType, options) => getExplore({
|
|
469
502
|
...options,
|
|
470
|
-
query: { ...
|
|
503
|
+
query: { ...query, listType },
|
|
471
504
|
meta: getApiKeyMeta()
|
|
472
505
|
});
|
|
473
|
-
var getCoinsTopGainers = (options) => createExploreQuery("TOP_GAINERS", options);
|
|
474
|
-
var getCoinsTopVolume24h = (options) => createExploreQuery("TOP_VOLUME_24H", options);
|
|
475
|
-
var getCoinsMostValuable = (options) => createExploreQuery("MOST_VALUABLE", options);
|
|
476
|
-
var getCoinsNew = (options) => createExploreQuery("NEW", options);
|
|
477
|
-
var getCoinsLastTraded = (options) => createExploreQuery("LAST_TRADED", options);
|
|
478
|
-
var getCoinsLastTradedUnique = (options) => createExploreQuery("LAST_TRADED_UNIQUE", options);
|
|
506
|
+
var getCoinsTopGainers = (query = {}, options) => createExploreQuery(query, "TOP_GAINERS", options);
|
|
507
|
+
var getCoinsTopVolume24h = (query = {}, options) => createExploreQuery(query, "TOP_VOLUME_24H", options);
|
|
508
|
+
var getCoinsMostValuable = (query = {}, options) => createExploreQuery(query, "MOST_VALUABLE", options);
|
|
509
|
+
var getCoinsNew = (query = {}, options) => createExploreQuery(query, "NEW", options);
|
|
510
|
+
var getCoinsLastTraded = (query = {}, options) => createExploreQuery(query, "LAST_TRADED", options);
|
|
511
|
+
var getCoinsLastTradedUnique = (query = {}, options) => createExploreQuery(query, "LAST_TRADED_UNIQUE", options);
|
|
479
512
|
|
|
480
513
|
// src/metadata/cleanAndValidateMetadataURI.ts
|
|
481
514
|
function cleanAndValidateMetadataURI(uri) {
|
|
@@ -564,5 +597,6 @@ async function validateMetadataURIContent(metadataURI) {
|
|
|
564
597
|
|
|
565
598
|
|
|
566
599
|
|
|
567
|
-
|
|
600
|
+
|
|
601
|
+
exports.cleanAndValidateMetadataURI = cleanAndValidateMetadataURI; exports.createCoin = createCoin; exports.createCoinCall = createCoinCall; exports.getCoin = getCoin2; exports.getCoinComments = getCoinComments2; exports.getCoinCreateFromLogs = getCoinCreateFromLogs; exports.getCoins = getCoins2; exports.getCoinsLastTraded = getCoinsLastTraded; exports.getCoinsLastTradedUnique = getCoinsLastTradedUnique; exports.getCoinsMostValuable = getCoinsMostValuable; exports.getCoinsNew = getCoinsNew; exports.getCoinsTopGainers = getCoinsTopGainers; exports.getCoinsTopVolume24h = getCoinsTopVolume24h; exports.getOnchainCoinDetails = getOnchainCoinDetails; exports.getProfile = getProfile2; exports.getProfileBalances = getProfileBalances2; exports.getTradeFromLogs = getTradeFromLogs; exports.setApiKey = setApiKey; exports.simulateBuy = simulateBuy; exports.tradeCoin = tradeCoin; exports.tradeCoinCall = tradeCoinCall; exports.updateCoinURI = updateCoinURI; exports.updateCoinURICall = updateCoinURICall; exports.updatePayoutRecipient = updatePayoutRecipient; exports.updatePayoutRecipientCall = updatePayoutRecipientCall; exports.validateMetadataJSON = validateMetadataJSON; exports.validateMetadataURIContent = validateMetadataURIContent;
|
|
568
602
|
//# sourceMappingURL=index.cjs.map
|