@zero-tech/zauction-sdk 0.0.58 → 0.0.61
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/lib/actions/acceptBid.js +25 -7
- package/lib/actions/acceptBid.js.map +1 -1
- package/lib/actions/approveDomainTransfer.d.ts +2 -0
- package/lib/actions/approveDomainTransfer.js +14 -0
- package/lib/actions/approveDomainTransfer.js.map +1 -0
- package/lib/actions/approveSpender.d.ts +2 -0
- package/lib/actions/approveSpender.js +13 -0
- package/lib/actions/approveSpender.js.map +1 -0
- package/lib/actions/buyNow.d.ts +3 -0
- package/lib/actions/buyNow.js +54 -0
- package/lib/actions/buyNow.js.map +1 -0
- package/lib/actions/cancelBid.d.ts +4 -0
- package/lib/actions/cancelBid.js +20 -0
- package/lib/actions/cancelBid.js.map +1 -0
- package/lib/actions/getPaymentTokenAllowance.d.ts +2 -0
- package/lib/actions/getPaymentTokenAllowance.js +12 -0
- package/lib/actions/getPaymentTokenAllowance.js.map +1 -0
- package/lib/actions/index.d.ts +5 -0
- package/lib/actions/index.js +5 -0
- package/lib/actions/index.js.map +1 -1
- package/lib/actions/isZAuctionApproved.d.ts +1 -3
- package/lib/actions/isZAuctionApproved.js +2 -6
- package/lib/actions/isZAuctionApproved.js.map +1 -1
- package/lib/actions/placeBid.d.ts +2 -2
- package/lib/actions/placeBid.js +15 -8
- package/lib/actions/placeBid.js.map +1 -1
- package/lib/api/actions/helpers.js +2 -0
- package/lib/api/actions/helpers.js.map +1 -1
- package/lib/api/types.d.ts +2 -1
- package/lib/contracts/index.d.ts +2 -2
- package/lib/contracts/index.js +6 -9
- package/lib/contracts/index.js.map +1 -1
- package/lib/contracts/types/factories/IZNSHub__factory.d.ts +22 -0
- package/lib/contracts/types/factories/IZNSHub__factory.js +289 -0
- package/lib/contracts/types/factories/IZNSHub__factory.js.map +1 -0
- package/lib/contracts/types/factories/ZAuction__factory.js +373 -36
- package/lib/contracts/types/factories/ZAuction__factory.js.map +1 -1
- package/lib/contracts/types/index.d.ts +2 -0
- package/lib/contracts/types/index.js +3 -1
- package/lib/contracts/types/index.js.map +1 -1
- package/lib/index.js +131 -94
- package/lib/index.js.map +1 -1
- package/lib/subgraph/actions/index.d.ts +1 -0
- package/lib/subgraph/actions/index.js +1 -0
- package/lib/subgraph/actions/index.js.map +1 -1
- package/lib/subgraph/actions/listAllSales.js +1 -1
- package/lib/subgraph/actions/listAllSales.js.map +1 -1
- package/lib/subgraph/actions/listBuyNowSales.d.ts +3 -0
- package/lib/subgraph/actions/listBuyNowSales.js +29 -0
- package/lib/subgraph/actions/listBuyNowSales.js.map +1 -0
- package/lib/subgraph/actions/listSales.js +1 -1
- package/lib/subgraph/actions/listSales.js.map +1 -1
- package/lib/subgraph/client.d.ts +2 -1
- package/lib/subgraph/client.js +3 -0
- package/lib/subgraph/client.js.map +1 -1
- package/lib/subgraph/queries.d.ts +1 -0
- package/lib/subgraph/queries.js +18 -1
- package/lib/subgraph/queries.js.map +1 -1
- package/lib/subgraph/types.d.ts +12 -0
- package/lib/types.d.ts +27 -10
- package/lib/types.js.map +1 -1
- package/package.json +3 -2
package/lib/types.d.ts
CHANGED
@@ -6,28 +6,35 @@ export interface Config {
|
|
6
6
|
subgraphUri: string;
|
7
7
|
zAuctionAddress: string;
|
8
8
|
zAuctionLegacyAddress: string;
|
9
|
-
|
9
|
+
wildTokenAddress: string;
|
10
|
+
znsHubAddress: string;
|
10
11
|
web3Provider: ethers.providers.Web3Provider;
|
11
12
|
}
|
12
13
|
export interface Instance {
|
13
14
|
listSales: (tokenId: string) => Promise<TokenSale[]>;
|
14
|
-
|
15
|
+
listBuyNowSales: (tokenId: string) => Promise<TokenBuy[]>;
|
16
|
+
listAllSales: (networkId: string) => Promise<TokenSaleCollection>;
|
15
17
|
listBids: (tokenIds: string[]) => Promise<TokenBidCollection>;
|
16
18
|
listBidsByAccount: (account: string) => Promise<Bid[]>;
|
17
19
|
placeBid: (params: NewBidParameters, signer: ethers.Signer, statusCallback?: PlaceBidStatusCallback) => Promise<void>;
|
18
20
|
isZAuctionApprovedToTransferNftByBid: (account: string, bid: Bid) => Promise<boolean>;
|
19
|
-
isZAuctionApprovedToTransferNft: (account: string) => Promise<boolean>;
|
20
|
-
|
21
|
+
isZAuctionApprovedToTransferNft: (account: string, contractAddress: string) => Promise<boolean>;
|
22
|
+
isZAuctionApprovedToTransferNftLegacy: (account: string, contractAddress: string) => Promise<boolean>;
|
21
23
|
getZAuctionSpendAllowanceByBid: (account: string, bid: Bid) => Promise<ethers.BigNumber>;
|
22
|
-
|
24
|
+
getZAuctionSpendAllowanceByToken: (account: string, tokenId: string) => Promise<ethers.BigNumber>;
|
25
|
+
getZAuctionSpendAllowance: (paymentTokenAddress: string, account: string) => Promise<ethers.BigNumber>;
|
26
|
+
getZAuctionSpendAllowanceLegacy: (account: string) => Promise<ethers.BigNumber>;
|
27
|
+
setNetworkPaymentToken: (networkId: string, domainNetworkToken: string, signer: ethers.Signer) => Promise<ethers.ContractTransaction>;
|
28
|
+
getPaymentTokenForDomain: (domainTokenId: string) => Promise<string>;
|
23
29
|
approveZAuctionSpendTradeTokensByBid: (bid: Bid, signer: ethers.Signer) => Promise<ethers.ContractTransaction>;
|
24
|
-
|
25
|
-
|
30
|
+
approveZAuctionSpendTradeTokensByToken: (tokenId: string, signer: ethers.Signer) => Promise<ethers.ContractTransaction>;
|
31
|
+
approveZAuctionSpendTradeTokens: (paymentTokenAddress: string, signer: ethers.Signer) => Promise<ethers.ContractTransaction>;
|
26
32
|
approveZAuctionTransferNftByBid: (bid: Bid, signer: ethers.Signer) => Promise<ethers.ContractTransaction>;
|
33
|
+
approveZAuctionTransferNft: (domainContractAddress: string, signer: ethers.Signer) => Promise<ethers.ContractTransaction>;
|
27
34
|
acceptBid: (bid: Bid, signer: ethers.Signer) => Promise<ethers.ContractTransaction>;
|
28
|
-
cancelBid: (
|
35
|
+
cancelBid: (bid: Bid, cancelOnChain: boolean, signer: ethers.Signer) => Promise<ethers.ContractTransaction | void>;
|
29
36
|
buyNow: (params: BuyNowParams, signer: ethers.Signer) => Promise<ethers.ContractTransaction>;
|
30
|
-
getBuyNowPrice: (tokenId: string) => Promise<
|
37
|
+
getBuyNowPrice: (tokenId: string) => Promise<BuyNowListing>;
|
31
38
|
setBuyNowPrice: (params: BuyNowParams, signer: ethers.Signer) => Promise<ethers.ContractTransaction>;
|
32
39
|
cancelBuyNow: (tokenId: string, signer: ethers.Signer) => Promise<ethers.ContractTransaction>;
|
33
40
|
}
|
@@ -39,6 +46,14 @@ export interface TokenSale {
|
|
39
46
|
seller: string;
|
40
47
|
timestamp: string;
|
41
48
|
}
|
49
|
+
export interface TokenBuy {
|
50
|
+
buyer: string;
|
51
|
+
seller: string;
|
52
|
+
amount: string;
|
53
|
+
contract: string;
|
54
|
+
tokenId: string;
|
55
|
+
timestamp: string;
|
56
|
+
}
|
42
57
|
export interface TokenSaleCollection {
|
43
58
|
[tokenId: string]: TokenSale[];
|
44
59
|
}
|
@@ -61,8 +76,10 @@ export interface NewBidParameters {
|
|
61
76
|
export interface BuyNowParams {
|
62
77
|
amount: string;
|
63
78
|
tokenId: string;
|
79
|
+
paymentToken: string;
|
64
80
|
}
|
65
|
-
export interface
|
81
|
+
export interface BuyNowListing {
|
66
82
|
price: ethers.BigNumber;
|
67
83
|
holder: string;
|
84
|
+
paymentToken: string;
|
68
85
|
}
|
package/lib/types.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAkIA,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,2DAAQ,CAAA;IACR,yDAAO,CAAA;IACP,+DAAU,CAAA;IACV,6DAAS,CAAA;AACX,CAAC,EALW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAKzB"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zero-tech/zauction-sdk",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.61",
|
4
4
|
"main": "lib/index.js",
|
5
5
|
"types": "lib/index.d.ts",
|
6
6
|
"repository": "git@github.com:zer0-os/zAuction-SDK.git",
|
@@ -16,7 +16,7 @@
|
|
16
16
|
"build": "tsc --build --verbose ./tsconfig.build.json",
|
17
17
|
"lint": "eslint --fix src",
|
18
18
|
"style": "prettier --write ./src/**/*.ts",
|
19
|
-
"test": "mocha -r ts-node/register 'test
|
19
|
+
"test": "mocha -r ts-node/register 'test/**/e2e.test.ts' --exit --timeout 150000",
|
20
20
|
"typechain": "typechain --target ethers-v5 --out-dir src/contracts/types/ \"abi/**/*.json\""
|
21
21
|
},
|
22
22
|
"devDependencies": {
|
@@ -30,6 +30,7 @@
|
|
30
30
|
"@typescript-eslint/parser": "4.31.0",
|
31
31
|
"chai": "4.3.4",
|
32
32
|
"chai-as-promised": "7.1.1",
|
33
|
+
"dotenv": "16.0.0",
|
33
34
|
"eslint": "7.32.0",
|
34
35
|
"eslint-plugin-prettier": "4.0.0",
|
35
36
|
"ethers": "5.4.6",
|