@p2pdotme/sdk 1.1.7 → 1.1.9

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/prices.mjs CHANGED
@@ -478,6 +478,97 @@ var p2pConfigFacetAbi = [
478
478
  }
479
479
  ];
480
480
 
481
+ // src/contracts/abis/p2p-stake-boost-facet.ts
482
+ var p2pStakeBoostFacetAbi = [
483
+ {
484
+ inputs: [{ internalType: "uint256", name: "tokens", type: "uint256" }],
485
+ name: "p2pBoostStake",
486
+ outputs: [],
487
+ stateMutability: "nonpayable",
488
+ type: "function"
489
+ },
490
+ {
491
+ inputs: [{ internalType: "uint256", name: "tokens", type: "uint256" }],
492
+ name: "p2pBoostTopUp",
493
+ outputs: [],
494
+ stateMutability: "nonpayable",
495
+ type: "function"
496
+ },
497
+ {
498
+ inputs: [],
499
+ name: "p2pBoostRequestUnstake",
500
+ outputs: [],
501
+ stateMutability: "nonpayable",
502
+ type: "function"
503
+ },
504
+ {
505
+ inputs: [],
506
+ name: "p2pBoostClaimUnstake",
507
+ outputs: [],
508
+ stateMutability: "nonpayable",
509
+ type: "function"
510
+ },
511
+ {
512
+ inputs: [{ internalType: "address", name: "user", type: "address" }],
513
+ name: "getUserStake",
514
+ outputs: [
515
+ {
516
+ components: [
517
+ { internalType: "uint128", name: "stakedAmount", type: "uint128" },
518
+ { internalType: "uint64", name: "cooldownEnd", type: "uint64" },
519
+ { internalType: "uint8", name: "status", type: "uint8" }
520
+ ],
521
+ internalType: "struct P2PStakeBoostStorage.UserStake",
522
+ name: "",
523
+ type: "tuple"
524
+ }
525
+ ],
526
+ stateMutability: "view",
527
+ type: "function"
528
+ },
529
+ {
530
+ inputs: [{ internalType: "bytes32", name: "currency", type: "bytes32" }],
531
+ name: "getStakeBoostConfig",
532
+ outputs: [
533
+ {
534
+ components: [
535
+ {
536
+ internalType: "uint256",
537
+ name: "tokensPerUsdNumerator",
538
+ type: "uint256"
539
+ },
540
+ {
541
+ internalType: "uint256",
542
+ name: "tokensPerUsdDenominator",
543
+ type: "uint256"
544
+ },
545
+ { internalType: "uint256", name: "maxBoostUsd", type: "uint256" }
546
+ ],
547
+ internalType: "struct P2PStakeBoostStorage.BoostConfig",
548
+ name: "",
549
+ type: "tuple"
550
+ }
551
+ ],
552
+ stateMutability: "view",
553
+ type: "function"
554
+ },
555
+ {
556
+ inputs: [],
557
+ name: "getStakeBoostGlobals",
558
+ outputs: [
559
+ { internalType: "address", name: "p2pToken", type: "address" },
560
+ { internalType: "address", name: "fraudReserve", type: "address" },
561
+ { internalType: "uint256", name: "maxStakeTokens", type: "uint256" },
562
+ { internalType: "uint256", name: "normalCooldown", type: "uint256" },
563
+ { internalType: "uint256", name: "blacklistCooldown", type: "uint256" },
564
+ { internalType: "uint8", name: "tokenDecimals", type: "uint8" },
565
+ { internalType: "uint256", name: "totalStaked", type: "uint256" }
566
+ ],
567
+ stateMutability: "view",
568
+ type: "function"
569
+ }
570
+ ];
571
+
481
572
  // src/contracts/abis/reputation-manager.ts
482
573
  var reputationManagerAbi = [
483
574
  {
@@ -684,14 +775,16 @@ var reputationManagerAbi = [
684
775
  var DIAMOND_ABI = [
685
776
  ...orderFlowFacetAbi,
686
777
  ...orderProcessorFacetAbi,
687
- ...p2pConfigFacetAbi
778
+ ...p2pConfigFacetAbi,
779
+ ...p2pStakeBoostFacetAbi
688
780
  ];
689
781
  var ABIS = {
690
782
  DIAMOND: DIAMOND_ABI,
691
783
  FACETS: {
692
784
  ORDER_FLOW: orderFlowFacetAbi,
693
785
  ORDER_PROCESSOR: orderProcessorFacetAbi,
694
- CONFIG: p2pConfigFacetAbi
786
+ CONFIG: p2pConfigFacetAbi,
787
+ STAKE: p2pStakeBoostFacetAbi
695
788
  },
696
789
  EXTERNAL: {
697
790
  USDC: erc20Abi,
@@ -1288,105 +1381,127 @@ function getReputationPerUsdcLimit(publicClient, diamondAddress, params) {
1288
1381
  );
1289
1382
  }
1290
1383
 
1384
+ // src/contracts/p2p-stake/index.ts
1385
+ import { ResultAsync as ResultAsync5 } from "neverthrow";
1386
+ import { stringToHex as stringToHex3 } from "viem";
1387
+
1388
+ // src/stake/validation.ts
1389
+ import { z as z4 } from "zod";
1390
+ var ZodGetUserStakeParamsSchema = z4.object({
1391
+ user: ZodAddressSchema
1392
+ });
1393
+ var ZodGetStakeBoostConfigParamsSchema = z4.object({
1394
+ currency: ZodCurrencySchema
1395
+ });
1396
+ var ZodGetP2pTokenBalanceParamsSchema = z4.object({
1397
+ address: ZodAddressSchema
1398
+ });
1399
+ var ZodStakeParamsSchema = z4.object({
1400
+ tokens: z4.bigint().positive()
1401
+ });
1402
+ var ZodTopUpParamsSchema = z4.object({
1403
+ tokens: z4.bigint().positive()
1404
+ });
1405
+
1291
1406
  // src/contracts/reputation-manager/writes.ts
1292
1407
  import { Result } from "neverthrow";
1293
1408
  import { encodeFunctionData } from "viem";
1294
1409
 
1295
1410
  // src/zkkyc/validation.ts
1296
- import { z as z4 } from "zod";
1297
- var ZodAnonAadharProofParamsSchema = z4.object({
1298
- nullifierSeed: z4.bigint(),
1299
- nullifier: z4.bigint(),
1300
- timestamp: z4.bigint(),
1301
- signal: z4.bigint(),
1302
- revealArray: z4.tuple([z4.bigint(), z4.bigint(), z4.bigint(), z4.bigint()]),
1303
- packedGroth16Proof: z4.tuple([
1304
- z4.bigint(),
1305
- z4.bigint(),
1306
- z4.bigint(),
1307
- z4.bigint(),
1308
- z4.bigint(),
1309
- z4.bigint(),
1310
- z4.bigint(),
1311
- z4.bigint()
1411
+ import { z as z5 } from "zod";
1412
+ var ZodAnonAadharProofParamsSchema = z5.object({
1413
+ nullifierSeed: z5.bigint(),
1414
+ nullifier: z5.bigint(),
1415
+ timestamp: z5.bigint(),
1416
+ signal: z5.bigint(),
1417
+ revealArray: z5.tuple([z5.bigint(), z5.bigint(), z5.bigint(), z5.bigint()]),
1418
+ packedGroth16Proof: z5.tuple([
1419
+ z5.bigint(),
1420
+ z5.bigint(),
1421
+ z5.bigint(),
1422
+ z5.bigint(),
1423
+ z5.bigint(),
1424
+ z5.bigint(),
1425
+ z5.bigint(),
1426
+ z5.bigint()
1312
1427
  ])
1313
1428
  });
1314
- var ZodSocialVerifyParamsSchema = z4.object({
1315
- _socialName: z4.string(),
1316
- proofs: z4.array(
1317
- z4.object({
1318
- claimInfo: z4.object({
1319
- provider: z4.string(),
1320
- parameters: z4.string(),
1321
- context: z4.string()
1429
+ var ZodSocialVerifyParamsSchema = z5.object({
1430
+ _socialName: z5.string(),
1431
+ proofs: z5.array(
1432
+ z5.object({
1433
+ claimInfo: z5.object({
1434
+ provider: z5.string(),
1435
+ parameters: z5.string(),
1436
+ context: z5.string()
1322
1437
  }),
1323
- signedClaim: z4.object({
1324
- claim: z4.object({
1325
- identifier: z4.string(),
1438
+ signedClaim: z5.object({
1439
+ claim: z5.object({
1440
+ identifier: z5.string(),
1326
1441
  owner: ZodAddressSchema,
1327
- timestampS: z4.number(),
1328
- epoch: z4.number()
1442
+ timestampS: z5.number(),
1443
+ epoch: z5.number()
1329
1444
  }),
1330
- signatures: z4.array(z4.string())
1445
+ signatures: z5.array(z5.string())
1331
1446
  })
1332
1447
  })
1333
1448
  )
1334
1449
  });
1335
- var ZodSolidityVerifierParametersSchema = z4.object({
1336
- version: z4.string().refine((val) => val.startsWith("0x"), {
1450
+ var ZodSolidityVerifierParametersSchema = z5.object({
1451
+ version: z5.string().refine((val) => val.startsWith("0x"), {
1337
1452
  message: "Version must be a hex string"
1338
1453
  }),
1339
- proofVerificationData: z4.object({
1340
- vkeyHash: z4.string().refine((val) => /^0x[a-fA-F0-9]{64}$/.test(val), {
1454
+ proofVerificationData: z5.object({
1455
+ vkeyHash: z5.string().refine((val) => /^0x[a-fA-F0-9]{64}$/.test(val), {
1341
1456
  message: "Invalid bytes32 hex string"
1342
1457
  }),
1343
- proof: z4.string().refine((val) => val.startsWith("0x"), {
1458
+ proof: z5.string().refine((val) => val.startsWith("0x"), {
1344
1459
  message: "Proof must be a hex string"
1345
1460
  }),
1346
- publicInputs: z4.array(
1347
- z4.string().refine((val) => /^0x[a-fA-F0-9]{64}$/.test(val), {
1461
+ publicInputs: z5.array(
1462
+ z5.string().refine((val) => /^0x[a-fA-F0-9]{64}$/.test(val), {
1348
1463
  message: "Each public input must be a valid bytes32 hex string"
1349
1464
  })
1350
1465
  )
1351
1466
  }),
1352
- committedInputs: z4.string().refine((val) => val.startsWith("0x"), {
1467
+ committedInputs: z5.string().refine((val) => val.startsWith("0x"), {
1353
1468
  message: "Committed inputs must be a hex string"
1354
1469
  }),
1355
- serviceConfig: z4.object({
1356
- validityPeriodInSeconds: z4.number().int().nonnegative(),
1357
- domain: z4.string(),
1358
- scope: z4.string(),
1359
- devMode: z4.boolean()
1470
+ serviceConfig: z5.object({
1471
+ validityPeriodInSeconds: z5.number().int().nonnegative(),
1472
+ domain: z5.string(),
1473
+ scope: z5.string(),
1474
+ devMode: z5.boolean()
1360
1475
  })
1361
1476
  });
1362
- var ZodZkPassportRegisterParamsSchema = z4.object({
1477
+ var ZodZkPassportRegisterParamsSchema = z5.object({
1363
1478
  params: ZodSolidityVerifierParametersSchema,
1364
- isIDCard: z4.boolean()
1479
+ isIDCard: z5.boolean()
1365
1480
  });
1366
1481
 
1367
1482
  // src/contracts/tx-limits/index.ts
1368
- import { ResultAsync as ResultAsync5 } from "neverthrow";
1369
- import { formatUnits, stringToHex as stringToHex3 } from "viem";
1483
+ import { ResultAsync as ResultAsync6 } from "neverthrow";
1484
+ import { formatUnits, stringToHex as stringToHex4 } from "viem";
1370
1485
 
1371
1486
  // src/profile/validation.ts
1372
- import { z as z5 } from "zod";
1373
- var ZodUsdcBalanceParamsSchema = z5.object({
1487
+ import { z as z6 } from "zod";
1488
+ var ZodUsdcBalanceParamsSchema = z6.object({
1374
1489
  address: ZodAddressSchema
1375
1490
  });
1376
- var ZodUsdcAllowanceParamsSchema = z5.object({
1491
+ var ZodUsdcAllowanceParamsSchema = z6.object({
1377
1492
  owner: ZodAddressSchema
1378
1493
  });
1379
- var ZodGetBalancesParamsSchema = z5.object({
1494
+ var ZodGetBalancesParamsSchema = z6.object({
1380
1495
  address: ZodAddressSchema,
1381
1496
  currency: ZodCurrencySchema
1382
1497
  });
1383
- var ZodTxLimitsParamsSchema = z5.object({
1498
+ var ZodTxLimitsParamsSchema = z6.object({
1384
1499
  address: ZodAddressSchema,
1385
1500
  currency: ZodCurrencySchema
1386
1501
  });
1387
1502
 
1388
1503
  // src/contracts/usdc/index.ts
1389
- import { ResultAsync as ResultAsync6 } from "neverthrow";
1504
+ import { ResultAsync as ResultAsync7 } from "neverthrow";
1390
1505
  import { erc20Abi as erc20Abi2 } from "viem";
1391
1506
 
1392
1507
  // src/prices/client.ts