@p2pdotme/sdk 1.1.9 → 1.2.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/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/orders.cjs +7 -0
- package/dist/orders.cjs.map +1 -1
- package/dist/orders.mjs +7 -0
- package/dist/orders.mjs.map +1 -1
- package/dist/prices.cjs +7 -0
- package/dist/prices.cjs.map +1 -1
- package/dist/prices.mjs +7 -0
- package/dist/prices.mjs.map +1 -1
- package/dist/profile.cjs +7 -0
- package/dist/profile.cjs.map +1 -1
- package/dist/profile.mjs +7 -0
- package/dist/profile.mjs.map +1 -1
- package/dist/react.cjs +44 -10
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +6 -0
- package/dist/react.d.ts +6 -0
- package/dist/react.mjs +44 -10
- package/dist/react.mjs.map +1 -1
- package/dist/stake.cjs +44 -10
- package/dist/stake.cjs.map +1 -1
- package/dist/stake.d.cts +6 -0
- package/dist/stake.d.ts +6 -0
- package/dist/stake.mjs +44 -10
- package/dist/stake.mjs.map +1 -1
- package/dist/zkkyc.cjs +7 -0
- package/dist/zkkyc.cjs.map +1 -1
- package/dist/zkkyc.mjs +7 -0
- package/dist/zkkyc.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react.cjs
CHANGED
|
@@ -1202,6 +1202,13 @@ var p2pStakeBoostFacetAbi = [
|
|
|
1202
1202
|
stateMutability: "nonpayable",
|
|
1203
1203
|
type: "function"
|
|
1204
1204
|
},
|
|
1205
|
+
{
|
|
1206
|
+
inputs: [],
|
|
1207
|
+
name: "p2pBoostCancelUnstake",
|
|
1208
|
+
outputs: [],
|
|
1209
|
+
stateMutability: "nonpayable",
|
|
1210
|
+
type: "function"
|
|
1211
|
+
},
|
|
1205
1212
|
{
|
|
1206
1213
|
inputs: [{ internalType: "address", name: "user", type: "address" }],
|
|
1207
1214
|
name: "getUserStake",
|
|
@@ -6684,7 +6691,7 @@ function createProfile(config) {
|
|
|
6684
6691
|
};
|
|
6685
6692
|
}
|
|
6686
6693
|
|
|
6687
|
-
// src/stake/actions/
|
|
6694
|
+
// src/stake/actions/cancel-unstake.ts
|
|
6688
6695
|
var import_neverthrow21 = require("neverthrow");
|
|
6689
6696
|
var import_viem20 = require("viem");
|
|
6690
6697
|
|
|
@@ -6737,14 +6744,14 @@ function submitPreparedTx2(input) {
|
|
|
6737
6744
|
});
|
|
6738
6745
|
}
|
|
6739
6746
|
|
|
6740
|
-
// src/stake/actions/
|
|
6741
|
-
function
|
|
6747
|
+
// src/stake/actions/cancel-unstake.ts
|
|
6748
|
+
function createCancelUnstakeAction(input) {
|
|
6742
6749
|
const { publicClient, diamondAddress } = input;
|
|
6743
6750
|
const prepareFn = () => (0, import_neverthrow21.okAsync)({
|
|
6744
6751
|
to: diamondAddress,
|
|
6745
6752
|
data: (0, import_viem20.encodeFunctionData)({
|
|
6746
6753
|
abi: ABIS.FACETS.STAKE,
|
|
6747
|
-
functionName: "
|
|
6754
|
+
functionName: "p2pBoostCancelUnstake",
|
|
6748
6755
|
args: []
|
|
6749
6756
|
}),
|
|
6750
6757
|
value: 0n
|
|
@@ -6761,14 +6768,40 @@ function createClaimUnstakeAction(input) {
|
|
|
6761
6768
|
};
|
|
6762
6769
|
}
|
|
6763
6770
|
|
|
6764
|
-
// src/stake/actions/
|
|
6771
|
+
// src/stake/actions/claim-unstake.ts
|
|
6765
6772
|
var import_neverthrow22 = require("neverthrow");
|
|
6766
6773
|
var import_viem21 = require("viem");
|
|
6767
|
-
function
|
|
6774
|
+
function createClaimUnstakeAction(input) {
|
|
6768
6775
|
const { publicClient, diamondAddress } = input;
|
|
6769
6776
|
const prepareFn = () => (0, import_neverthrow22.okAsync)({
|
|
6770
6777
|
to: diamondAddress,
|
|
6771
6778
|
data: (0, import_viem21.encodeFunctionData)({
|
|
6779
|
+
abi: ABIS.FACETS.STAKE,
|
|
6780
|
+
functionName: "p2pBoostClaimUnstake",
|
|
6781
|
+
args: []
|
|
6782
|
+
}),
|
|
6783
|
+
value: 0n
|
|
6784
|
+
});
|
|
6785
|
+
return {
|
|
6786
|
+
prepare() {
|
|
6787
|
+
return prepareFn();
|
|
6788
|
+
},
|
|
6789
|
+
execute({ walletClient, waitForReceipt }) {
|
|
6790
|
+
return prepareFn().andThen(
|
|
6791
|
+
(prepared) => submitPreparedTx2({ prepared, walletClient, publicClient, waitForReceipt })
|
|
6792
|
+
);
|
|
6793
|
+
}
|
|
6794
|
+
};
|
|
6795
|
+
}
|
|
6796
|
+
|
|
6797
|
+
// src/stake/actions/request-unstake.ts
|
|
6798
|
+
var import_neverthrow23 = require("neverthrow");
|
|
6799
|
+
var import_viem22 = require("viem");
|
|
6800
|
+
function createRequestUnstakeAction(input) {
|
|
6801
|
+
const { publicClient, diamondAddress } = input;
|
|
6802
|
+
const prepareFn = () => (0, import_neverthrow23.okAsync)({
|
|
6803
|
+
to: diamondAddress,
|
|
6804
|
+
data: (0, import_viem22.encodeFunctionData)({
|
|
6772
6805
|
abi: ABIS.FACETS.STAKE,
|
|
6773
6806
|
functionName: "p2pBoostRequestUnstake",
|
|
6774
6807
|
args: []
|
|
@@ -6788,7 +6821,7 @@ function createRequestUnstakeAction(input) {
|
|
|
6788
6821
|
}
|
|
6789
6822
|
|
|
6790
6823
|
// src/stake/actions/stake.ts
|
|
6791
|
-
var
|
|
6824
|
+
var import_viem23 = require("viem");
|
|
6792
6825
|
function createStakeAction(input) {
|
|
6793
6826
|
const { publicClient, diamondAddress } = input;
|
|
6794
6827
|
const prepareFn = (params) => validate(
|
|
@@ -6801,7 +6834,7 @@ function createStakeAction(input) {
|
|
|
6801
6834
|
})
|
|
6802
6835
|
).map(({ tokens }) => ({
|
|
6803
6836
|
to: diamondAddress,
|
|
6804
|
-
data: (0,
|
|
6837
|
+
data: (0, import_viem23.encodeFunctionData)({
|
|
6805
6838
|
abi: ABIS.FACETS.STAKE,
|
|
6806
6839
|
functionName: "p2pBoostStake",
|
|
6807
6840
|
args: [tokens]
|
|
@@ -6821,7 +6854,7 @@ function createStakeAction(input) {
|
|
|
6821
6854
|
}
|
|
6822
6855
|
|
|
6823
6856
|
// src/stake/actions/top-up.ts
|
|
6824
|
-
var
|
|
6857
|
+
var import_viem24 = require("viem");
|
|
6825
6858
|
function createTopUpAction(input) {
|
|
6826
6859
|
const { publicClient, diamondAddress } = input;
|
|
6827
6860
|
const prepareFn = (params) => validate(
|
|
@@ -6834,7 +6867,7 @@ function createTopUpAction(input) {
|
|
|
6834
6867
|
})
|
|
6835
6868
|
).map(({ tokens }) => ({
|
|
6836
6869
|
to: diamondAddress,
|
|
6837
|
-
data: (0,
|
|
6870
|
+
data: (0, import_viem24.encodeFunctionData)({
|
|
6838
6871
|
abi: ABIS.FACETS.STAKE,
|
|
6839
6872
|
functionName: "p2pBoostTopUp",
|
|
6840
6873
|
args: [tokens]
|
|
@@ -6899,6 +6932,7 @@ function createStake(config) {
|
|
|
6899
6932
|
stake: createStakeAction({ publicClient, diamondAddress }),
|
|
6900
6933
|
topUp: createTopUpAction({ publicClient, diamondAddress }),
|
|
6901
6934
|
requestUnstake: createRequestUnstakeAction({ publicClient, diamondAddress }),
|
|
6935
|
+
cancelUnstake: createCancelUnstakeAction({ publicClient, diamondAddress }),
|
|
6902
6936
|
claimUnstake: createClaimUnstakeAction({ publicClient, diamondAddress })
|
|
6903
6937
|
};
|
|
6904
6938
|
}
|