@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/react.d.cts CHANGED
@@ -203,6 +203,11 @@ interface ExecuteBase$1 {
203
203
  readonly waitForReceipt?: boolean;
204
204
  }
205
205
 
206
+ interface CancelUnstakeAction {
207
+ prepare(): ResultAsync<PreparedTx$1, StakeError>;
208
+ execute(params: ExecuteBase$1): ResultAsync<TxResult$1, StakeError>;
209
+ }
210
+
206
211
  interface ClaimUnstakeAction {
207
212
  prepare(): ResultAsync<PreparedTx$1, StakeError>;
208
213
  execute(params: ExecuteBase$1): ResultAsync<TxResult$1, StakeError>;
@@ -235,6 +240,7 @@ interface StakeClient {
235
240
  readonly stake: StakeAction;
236
241
  readonly topUp: TopUpAction;
237
242
  readonly requestUnstake: RequestUnstakeAction;
243
+ readonly cancelUnstake: CancelUnstakeAction;
238
244
  readonly claimUnstake: ClaimUnstakeAction;
239
245
  }
240
246
 
package/dist/react.d.ts CHANGED
@@ -203,6 +203,11 @@ interface ExecuteBase$1 {
203
203
  readonly waitForReceipt?: boolean;
204
204
  }
205
205
 
206
+ interface CancelUnstakeAction {
207
+ prepare(): ResultAsync<PreparedTx$1, StakeError>;
208
+ execute(params: ExecuteBase$1): ResultAsync<TxResult$1, StakeError>;
209
+ }
210
+
206
211
  interface ClaimUnstakeAction {
207
212
  prepare(): ResultAsync<PreparedTx$1, StakeError>;
208
213
  execute(params: ExecuteBase$1): ResultAsync<TxResult$1, StakeError>;
@@ -235,6 +240,7 @@ interface StakeClient {
235
240
  readonly stake: StakeAction;
236
241
  readonly topUp: TopUpAction;
237
242
  readonly requestUnstake: RequestUnstakeAction;
243
+ readonly cancelUnstake: CancelUnstakeAction;
238
244
  readonly claimUnstake: ClaimUnstakeAction;
239
245
  }
240
246
 
package/dist/react.mjs CHANGED
@@ -1157,6 +1157,13 @@ var p2pStakeBoostFacetAbi = [
1157
1157
  stateMutability: "nonpayable",
1158
1158
  type: "function"
1159
1159
  },
1160
+ {
1161
+ inputs: [],
1162
+ name: "p2pBoostCancelUnstake",
1163
+ outputs: [],
1164
+ stateMutability: "nonpayable",
1165
+ type: "function"
1166
+ },
1160
1167
  {
1161
1168
  inputs: [{ internalType: "address", name: "user", type: "address" }],
1162
1169
  name: "getUserStake",
@@ -6639,7 +6646,7 @@ function createProfile(config) {
6639
6646
  };
6640
6647
  }
6641
6648
 
6642
- // src/stake/actions/claim-unstake.ts
6649
+ // src/stake/actions/cancel-unstake.ts
6643
6650
  import { okAsync as okAsync6 } from "neverthrow";
6644
6651
  import { encodeFunctionData as encodeFunctionData8 } from "viem";
6645
6652
 
@@ -6692,14 +6699,14 @@ function submitPreparedTx2(input) {
6692
6699
  });
6693
6700
  }
6694
6701
 
6695
- // src/stake/actions/claim-unstake.ts
6696
- function createClaimUnstakeAction(input) {
6702
+ // src/stake/actions/cancel-unstake.ts
6703
+ function createCancelUnstakeAction(input) {
6697
6704
  const { publicClient, diamondAddress } = input;
6698
6705
  const prepareFn = () => okAsync6({
6699
6706
  to: diamondAddress,
6700
6707
  data: encodeFunctionData8({
6701
6708
  abi: ABIS.FACETS.STAKE,
6702
- functionName: "p2pBoostClaimUnstake",
6709
+ functionName: "p2pBoostCancelUnstake",
6703
6710
  args: []
6704
6711
  }),
6705
6712
  value: 0n
@@ -6716,14 +6723,40 @@ function createClaimUnstakeAction(input) {
6716
6723
  };
6717
6724
  }
6718
6725
 
6719
- // src/stake/actions/request-unstake.ts
6726
+ // src/stake/actions/claim-unstake.ts
6720
6727
  import { okAsync as okAsync7 } from "neverthrow";
6721
6728
  import { encodeFunctionData as encodeFunctionData9 } from "viem";
6722
- function createRequestUnstakeAction(input) {
6729
+ function createClaimUnstakeAction(input) {
6723
6730
  const { publicClient, diamondAddress } = input;
6724
6731
  const prepareFn = () => okAsync7({
6725
6732
  to: diamondAddress,
6726
6733
  data: encodeFunctionData9({
6734
+ abi: ABIS.FACETS.STAKE,
6735
+ functionName: "p2pBoostClaimUnstake",
6736
+ args: []
6737
+ }),
6738
+ value: 0n
6739
+ });
6740
+ return {
6741
+ prepare() {
6742
+ return prepareFn();
6743
+ },
6744
+ execute({ walletClient, waitForReceipt }) {
6745
+ return prepareFn().andThen(
6746
+ (prepared) => submitPreparedTx2({ prepared, walletClient, publicClient, waitForReceipt })
6747
+ );
6748
+ }
6749
+ };
6750
+ }
6751
+
6752
+ // src/stake/actions/request-unstake.ts
6753
+ import { okAsync as okAsync8 } from "neverthrow";
6754
+ import { encodeFunctionData as encodeFunctionData10 } from "viem";
6755
+ function createRequestUnstakeAction(input) {
6756
+ const { publicClient, diamondAddress } = input;
6757
+ const prepareFn = () => okAsync8({
6758
+ to: diamondAddress,
6759
+ data: encodeFunctionData10({
6727
6760
  abi: ABIS.FACETS.STAKE,
6728
6761
  functionName: "p2pBoostRequestUnstake",
6729
6762
  args: []
@@ -6743,7 +6776,7 @@ function createRequestUnstakeAction(input) {
6743
6776
  }
6744
6777
 
6745
6778
  // src/stake/actions/stake.ts
6746
- import { encodeFunctionData as encodeFunctionData10 } from "viem";
6779
+ import { encodeFunctionData as encodeFunctionData11 } from "viem";
6747
6780
  function createStakeAction(input) {
6748
6781
  const { publicClient, diamondAddress } = input;
6749
6782
  const prepareFn = (params) => validate(
@@ -6756,7 +6789,7 @@ function createStakeAction(input) {
6756
6789
  })
6757
6790
  ).map(({ tokens }) => ({
6758
6791
  to: diamondAddress,
6759
- data: encodeFunctionData10({
6792
+ data: encodeFunctionData11({
6760
6793
  abi: ABIS.FACETS.STAKE,
6761
6794
  functionName: "p2pBoostStake",
6762
6795
  args: [tokens]
@@ -6776,7 +6809,7 @@ function createStakeAction(input) {
6776
6809
  }
6777
6810
 
6778
6811
  // src/stake/actions/top-up.ts
6779
- import { encodeFunctionData as encodeFunctionData11 } from "viem";
6812
+ import { encodeFunctionData as encodeFunctionData12 } from "viem";
6780
6813
  function createTopUpAction(input) {
6781
6814
  const { publicClient, diamondAddress } = input;
6782
6815
  const prepareFn = (params) => validate(
@@ -6789,7 +6822,7 @@ function createTopUpAction(input) {
6789
6822
  })
6790
6823
  ).map(({ tokens }) => ({
6791
6824
  to: diamondAddress,
6792
- data: encodeFunctionData11({
6825
+ data: encodeFunctionData12({
6793
6826
  abi: ABIS.FACETS.STAKE,
6794
6827
  functionName: "p2pBoostTopUp",
6795
6828
  args: [tokens]
@@ -6854,6 +6887,7 @@ function createStake(config) {
6854
6887
  stake: createStakeAction({ publicClient, diamondAddress }),
6855
6888
  topUp: createTopUpAction({ publicClient, diamondAddress }),
6856
6889
  requestUnstake: createRequestUnstakeAction({ publicClient, diamondAddress }),
6890
+ cancelUnstake: createCancelUnstakeAction({ publicClient, diamondAddress }),
6857
6891
  claimUnstake: createClaimUnstakeAction({ publicClient, diamondAddress })
6858
6892
  };
6859
6893
  }