punkkit-sdk 1.0.13 → 1.0.14
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/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +21 -0
- package/dist/index.mjs +21 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -140,6 +140,17 @@ declare function getPoolSqrtPrice(liqPool: Contract): Promise<bigint>;
|
|
|
140
140
|
declare function getPoolPrice(liqPool: Contract): Promise<number>;
|
|
141
141
|
declare function getCurrentTick(liqPool: Contract): Promise<number>;
|
|
142
142
|
|
|
143
|
+
declare function calculateTickFromPriceWithSpacing(price: number, tickSpacing?: number): number;
|
|
144
|
+
declare function calculateTickFromPrice(price: number): number;
|
|
145
|
+
declare function getSqrtPriceAtTick(tick: number): bigint;
|
|
146
|
+
declare function calculatePriceFromTick(tick: number): number;
|
|
147
|
+
declare function priceToSqrtPrice(price: number): bigint;
|
|
148
|
+
declare function liquidity0(amount: bigint, pa: bigint, pb: bigint): bigint;
|
|
149
|
+
declare function liquidity1(amount: bigint, pa: bigint, pb: bigint): bigint;
|
|
150
|
+
declare function amount0(liquidity0: bigint, pa: bigint, pb: bigint): bigint;
|
|
151
|
+
declare function amount1(liquidity1: bigint, pa: bigint, pb: bigint): bigint;
|
|
152
|
+
declare function calculateLiqDelta(ticklow: number, sqrt_cur: bigint, tickupp: number, amt0: bigint, amt1: bigint): [bigint, bigint, bigint];
|
|
153
|
+
|
|
143
154
|
declare const mutiVoucherABI: ({
|
|
144
155
|
anonymous: boolean;
|
|
145
156
|
inputs: {
|
|
@@ -179,4 +190,4 @@ declare function balanceOf(contractAddress: string, provider: SignerOrProvider,
|
|
|
179
190
|
declare function getAllVouchers(contractAddress: string, provider: SignerOrProvider): Promise<string[]>;
|
|
180
191
|
declare function BuildUseVoucherTx(tx: providers.TransactionRequest, voucherName: string): providers.TransactionRequest;
|
|
181
192
|
|
|
182
|
-
export { BuildUseVoucherTx, type ChallengeMatchResultParams, type CreateAuctionConfigParams, type CreateAuctionParams, type ModifyPositionParams, type PlaceBidParams, type PoolKey, type RevealBidParams, type RevealLockParams, type SetUnlockStrategyParams, type SignerOrProvider, type SubmitMatchResultsParams, type SwapParams, type UnlockTokensParams, type WithdrawMatchResultParams, addLiq, balanceOf, buyVoucher, buyVoucherWithEth, createAuction$1 as createAuction, createAuctionConfig, createAuction as createAuctionOnVault, createVoucher, getActiveAuctionsCount, getAllVouchers, getAuctionContract, getAuctionInfo, getAuctionLockInfo, getContract, getCurrentTick, getLiquidity, getLockInfo, getMatchResult, getPoolId, getPoolPrice, getPoolSqrtPrice, getProvider, getVoucherContract, getVoucherInfo, main, modifyPosition, mutiVoucherABI, placeBid, revealBid, revealLock, submitMatchResults, swap, toWei, unlockTokens, useVoucher, withdrawMatchResult };
|
|
193
|
+
export { BuildUseVoucherTx, type ChallengeMatchResultParams, type CreateAuctionConfigParams, type CreateAuctionParams, type ModifyPositionParams, type PlaceBidParams, type PoolKey, type RevealBidParams, type RevealLockParams, type SetUnlockStrategyParams, type SignerOrProvider, type SubmitMatchResultsParams, type SwapParams, type UnlockTokensParams, type WithdrawMatchResultParams, addLiq, amount0, amount1, balanceOf, buyVoucher, buyVoucherWithEth, calculateLiqDelta, calculatePriceFromTick, calculateTickFromPrice, calculateTickFromPriceWithSpacing, createAuction$1 as createAuction, createAuctionConfig, createAuction as createAuctionOnVault, createVoucher, getActiveAuctionsCount, getAllVouchers, getAuctionContract, getAuctionInfo, getAuctionLockInfo, getContract, getCurrentTick, getLiquidity, getLockInfo, getMatchResult, getPoolId, getPoolPrice, getPoolSqrtPrice, getProvider, getSqrtPriceAtTick, getVoucherContract, getVoucherInfo, liquidity0, liquidity1, main, modifyPosition, mutiVoucherABI, placeBid, priceToSqrtPrice, revealBid, revealLock, submitMatchResults, swap, toWei, unlockTokens, useVoucher, withdrawMatchResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -140,6 +140,17 @@ declare function getPoolSqrtPrice(liqPool: Contract): Promise<bigint>;
|
|
|
140
140
|
declare function getPoolPrice(liqPool: Contract): Promise<number>;
|
|
141
141
|
declare function getCurrentTick(liqPool: Contract): Promise<number>;
|
|
142
142
|
|
|
143
|
+
declare function calculateTickFromPriceWithSpacing(price: number, tickSpacing?: number): number;
|
|
144
|
+
declare function calculateTickFromPrice(price: number): number;
|
|
145
|
+
declare function getSqrtPriceAtTick(tick: number): bigint;
|
|
146
|
+
declare function calculatePriceFromTick(tick: number): number;
|
|
147
|
+
declare function priceToSqrtPrice(price: number): bigint;
|
|
148
|
+
declare function liquidity0(amount: bigint, pa: bigint, pb: bigint): bigint;
|
|
149
|
+
declare function liquidity1(amount: bigint, pa: bigint, pb: bigint): bigint;
|
|
150
|
+
declare function amount0(liquidity0: bigint, pa: bigint, pb: bigint): bigint;
|
|
151
|
+
declare function amount1(liquidity1: bigint, pa: bigint, pb: bigint): bigint;
|
|
152
|
+
declare function calculateLiqDelta(ticklow: number, sqrt_cur: bigint, tickupp: number, amt0: bigint, amt1: bigint): [bigint, bigint, bigint];
|
|
153
|
+
|
|
143
154
|
declare const mutiVoucherABI: ({
|
|
144
155
|
anonymous: boolean;
|
|
145
156
|
inputs: {
|
|
@@ -179,4 +190,4 @@ declare function balanceOf(contractAddress: string, provider: SignerOrProvider,
|
|
|
179
190
|
declare function getAllVouchers(contractAddress: string, provider: SignerOrProvider): Promise<string[]>;
|
|
180
191
|
declare function BuildUseVoucherTx(tx: providers.TransactionRequest, voucherName: string): providers.TransactionRequest;
|
|
181
192
|
|
|
182
|
-
export { BuildUseVoucherTx, type ChallengeMatchResultParams, type CreateAuctionConfigParams, type CreateAuctionParams, type ModifyPositionParams, type PlaceBidParams, type PoolKey, type RevealBidParams, type RevealLockParams, type SetUnlockStrategyParams, type SignerOrProvider, type SubmitMatchResultsParams, type SwapParams, type UnlockTokensParams, type WithdrawMatchResultParams, addLiq, balanceOf, buyVoucher, buyVoucherWithEth, createAuction$1 as createAuction, createAuctionConfig, createAuction as createAuctionOnVault, createVoucher, getActiveAuctionsCount, getAllVouchers, getAuctionContract, getAuctionInfo, getAuctionLockInfo, getContract, getCurrentTick, getLiquidity, getLockInfo, getMatchResult, getPoolId, getPoolPrice, getPoolSqrtPrice, getProvider, getVoucherContract, getVoucherInfo, main, modifyPosition, mutiVoucherABI, placeBid, revealBid, revealLock, submitMatchResults, swap, toWei, unlockTokens, useVoucher, withdrawMatchResult };
|
|
193
|
+
export { BuildUseVoucherTx, type ChallengeMatchResultParams, type CreateAuctionConfigParams, type CreateAuctionParams, type ModifyPositionParams, type PlaceBidParams, type PoolKey, type RevealBidParams, type RevealLockParams, type SetUnlockStrategyParams, type SignerOrProvider, type SubmitMatchResultsParams, type SwapParams, type UnlockTokensParams, type WithdrawMatchResultParams, addLiq, amount0, amount1, balanceOf, buyVoucher, buyVoucherWithEth, calculateLiqDelta, calculatePriceFromTick, calculateTickFromPrice, calculateTickFromPriceWithSpacing, createAuction$1 as createAuction, createAuctionConfig, createAuction as createAuctionOnVault, createVoucher, getActiveAuctionsCount, getAllVouchers, getAuctionContract, getAuctionInfo, getAuctionLockInfo, getContract, getCurrentTick, getLiquidity, getLockInfo, getMatchResult, getPoolId, getPoolPrice, getPoolSqrtPrice, getProvider, getSqrtPriceAtTick, getVoucherContract, getVoucherInfo, liquidity0, liquidity1, main, modifyPosition, mutiVoucherABI, placeBid, priceToSqrtPrice, revealBid, revealLock, submitMatchResults, swap, toWei, unlockTokens, useVoucher, withdrawMatchResult };
|
package/dist/index.js
CHANGED
|
@@ -35645,9 +35645,15 @@ var index_exports = {};
|
|
|
35645
35645
|
__export(index_exports, {
|
|
35646
35646
|
BuildUseVoucherTx: () => BuildUseVoucherTx,
|
|
35647
35647
|
addLiq: () => addLiq,
|
|
35648
|
+
amount0: () => amount0,
|
|
35649
|
+
amount1: () => amount1,
|
|
35648
35650
|
balanceOf: () => balanceOf,
|
|
35649
35651
|
buyVoucher: () => buyVoucher,
|
|
35650
35652
|
buyVoucherWithEth: () => buyVoucherWithEth,
|
|
35653
|
+
calculateLiqDelta: () => calculateLiqDelta,
|
|
35654
|
+
calculatePriceFromTick: () => calculatePriceFromTick,
|
|
35655
|
+
calculateTickFromPrice: () => calculateTickFromPrice,
|
|
35656
|
+
calculateTickFromPriceWithSpacing: () => calculateTickFromPriceWithSpacing,
|
|
35651
35657
|
createAuction: () => createAuction,
|
|
35652
35658
|
createAuctionConfig: () => createAuctionConfig,
|
|
35653
35659
|
createAuctionOnVault: () => createAuction2,
|
|
@@ -35666,12 +35672,16 @@ __export(index_exports, {
|
|
|
35666
35672
|
getPoolPrice: () => getPoolPrice,
|
|
35667
35673
|
getPoolSqrtPrice: () => getPoolSqrtPrice,
|
|
35668
35674
|
getProvider: () => getProvider,
|
|
35675
|
+
getSqrtPriceAtTick: () => getSqrtPriceAtTick,
|
|
35669
35676
|
getVoucherContract: () => getVoucherContract,
|
|
35670
35677
|
getVoucherInfo: () => getVoucherInfo,
|
|
35678
|
+
liquidity0: () => liquidity0,
|
|
35679
|
+
liquidity1: () => liquidity1,
|
|
35671
35680
|
main: () => main,
|
|
35672
35681
|
modifyPosition: () => modifyPosition,
|
|
35673
35682
|
mutiVoucherABI: () => mutiVoucherABI,
|
|
35674
35683
|
placeBid: () => placeBid,
|
|
35684
|
+
priceToSqrtPrice: () => priceToSqrtPrice,
|
|
35675
35685
|
revealBid: () => revealBid,
|
|
35676
35686
|
revealLock: () => revealLock,
|
|
35677
35687
|
submitMatchResults: () => submitMatchResults,
|
|
@@ -38055,6 +38065,7 @@ if (typeof require !== "undefined" && typeof module !== "undefined" && require.m
|
|
|
38055
38065
|
__reExport(index_exports, __toESM(require_place()), module.exports);
|
|
38056
38066
|
init_contract();
|
|
38057
38067
|
init_pool();
|
|
38068
|
+
init_liqCalculation();
|
|
38058
38069
|
|
|
38059
38070
|
// src/voucher.ts
|
|
38060
38071
|
init_lib49();
|
|
@@ -38312,9 +38323,15 @@ function BuildUseVoucherTx(tx, voucherName) {
|
|
|
38312
38323
|
0 && (module.exports = {
|
|
38313
38324
|
BuildUseVoucherTx,
|
|
38314
38325
|
addLiq,
|
|
38326
|
+
amount0,
|
|
38327
|
+
amount1,
|
|
38315
38328
|
balanceOf,
|
|
38316
38329
|
buyVoucher,
|
|
38317
38330
|
buyVoucherWithEth,
|
|
38331
|
+
calculateLiqDelta,
|
|
38332
|
+
calculatePriceFromTick,
|
|
38333
|
+
calculateTickFromPrice,
|
|
38334
|
+
calculateTickFromPriceWithSpacing,
|
|
38318
38335
|
createAuction,
|
|
38319
38336
|
createAuctionConfig,
|
|
38320
38337
|
createAuctionOnVault,
|
|
@@ -38333,12 +38350,16 @@ function BuildUseVoucherTx(tx, voucherName) {
|
|
|
38333
38350
|
getPoolPrice,
|
|
38334
38351
|
getPoolSqrtPrice,
|
|
38335
38352
|
getProvider,
|
|
38353
|
+
getSqrtPriceAtTick,
|
|
38336
38354
|
getVoucherContract,
|
|
38337
38355
|
getVoucherInfo,
|
|
38356
|
+
liquidity0,
|
|
38357
|
+
liquidity1,
|
|
38338
38358
|
main,
|
|
38339
38359
|
modifyPosition,
|
|
38340
38360
|
mutiVoucherABI,
|
|
38341
38361
|
placeBid,
|
|
38362
|
+
priceToSqrtPrice,
|
|
38342
38363
|
revealBid,
|
|
38343
38364
|
revealLock,
|
|
38344
38365
|
submitMatchResults,
|
package/dist/index.mjs
CHANGED
|
@@ -35649,9 +35649,15 @@ var index_exports = {};
|
|
|
35649
35649
|
__export(index_exports, {
|
|
35650
35650
|
BuildUseVoucherTx: () => BuildUseVoucherTx,
|
|
35651
35651
|
addLiq: () => addLiq,
|
|
35652
|
+
amount0: () => amount0,
|
|
35653
|
+
amount1: () => amount1,
|
|
35652
35654
|
balanceOf: () => balanceOf,
|
|
35653
35655
|
buyVoucher: () => buyVoucher,
|
|
35654
35656
|
buyVoucherWithEth: () => buyVoucherWithEth,
|
|
35657
|
+
calculateLiqDelta: () => calculateLiqDelta,
|
|
35658
|
+
calculatePriceFromTick: () => calculatePriceFromTick,
|
|
35659
|
+
calculateTickFromPrice: () => calculateTickFromPrice,
|
|
35660
|
+
calculateTickFromPriceWithSpacing: () => calculateTickFromPriceWithSpacing,
|
|
35655
35661
|
createAuction: () => createAuction,
|
|
35656
35662
|
createAuctionConfig: () => createAuctionConfig,
|
|
35657
35663
|
createAuctionOnVault: () => createAuction2,
|
|
@@ -35670,12 +35676,16 @@ __export(index_exports, {
|
|
|
35670
35676
|
getPoolPrice: () => getPoolPrice,
|
|
35671
35677
|
getPoolSqrtPrice: () => getPoolSqrtPrice,
|
|
35672
35678
|
getProvider: () => getProvider,
|
|
35679
|
+
getSqrtPriceAtTick: () => getSqrtPriceAtTick,
|
|
35673
35680
|
getVoucherContract: () => getVoucherContract,
|
|
35674
35681
|
getVoucherInfo: () => getVoucherInfo,
|
|
35682
|
+
liquidity0: () => liquidity0,
|
|
35683
|
+
liquidity1: () => liquidity1,
|
|
35675
35684
|
main: () => main,
|
|
35676
35685
|
modifyPosition: () => modifyPosition,
|
|
35677
35686
|
mutiVoucherABI: () => mutiVoucherABI,
|
|
35678
35687
|
placeBid: () => placeBid,
|
|
35688
|
+
priceToSqrtPrice: () => priceToSqrtPrice,
|
|
35679
35689
|
revealBid: () => revealBid,
|
|
35680
35690
|
revealLock: () => revealLock,
|
|
35681
35691
|
submitMatchResults: () => submitMatchResults,
|
|
@@ -38058,6 +38068,7 @@ if (typeof __require !== "undefined" && typeof module !== "undefined" && __requi
|
|
|
38058
38068
|
__reExport(index_exports, __toESM(require_place()));
|
|
38059
38069
|
init_contract();
|
|
38060
38070
|
init_pool();
|
|
38071
|
+
init_liqCalculation();
|
|
38061
38072
|
|
|
38062
38073
|
// src/voucher.ts
|
|
38063
38074
|
init_lib49();
|
|
@@ -38314,9 +38325,15 @@ function BuildUseVoucherTx(tx, voucherName) {
|
|
|
38314
38325
|
export {
|
|
38315
38326
|
BuildUseVoucherTx,
|
|
38316
38327
|
addLiq,
|
|
38328
|
+
amount0,
|
|
38329
|
+
amount1,
|
|
38317
38330
|
balanceOf,
|
|
38318
38331
|
buyVoucher,
|
|
38319
38332
|
buyVoucherWithEth,
|
|
38333
|
+
calculateLiqDelta,
|
|
38334
|
+
calculatePriceFromTick,
|
|
38335
|
+
calculateTickFromPrice,
|
|
38336
|
+
calculateTickFromPriceWithSpacing,
|
|
38320
38337
|
createAuction,
|
|
38321
38338
|
createAuctionConfig,
|
|
38322
38339
|
createAuction2 as createAuctionOnVault,
|
|
@@ -38335,12 +38352,16 @@ export {
|
|
|
38335
38352
|
getPoolPrice,
|
|
38336
38353
|
getPoolSqrtPrice,
|
|
38337
38354
|
getProvider,
|
|
38355
|
+
getSqrtPriceAtTick,
|
|
38338
38356
|
getVoucherContract,
|
|
38339
38357
|
getVoucherInfo,
|
|
38358
|
+
liquidity0,
|
|
38359
|
+
liquidity1,
|
|
38340
38360
|
main,
|
|
38341
38361
|
modifyPosition,
|
|
38342
38362
|
mutiVoucherABI,
|
|
38343
38363
|
placeBid,
|
|
38364
|
+
priceToSqrtPrice,
|
|
38344
38365
|
revealBid,
|
|
38345
38366
|
revealLock,
|
|
38346
38367
|
submitMatchResults,
|