@p2pdotme/sdk 1.1.8 → 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/prices.cjs CHANGED
@@ -505,6 +505,104 @@ var p2pConfigFacetAbi = [
505
505
  }
506
506
  ];
507
507
 
508
+ // src/contracts/abis/p2p-stake-boost-facet.ts
509
+ var p2pStakeBoostFacetAbi = [
510
+ {
511
+ inputs: [{ internalType: "uint256", name: "tokens", type: "uint256" }],
512
+ name: "p2pBoostStake",
513
+ outputs: [],
514
+ stateMutability: "nonpayable",
515
+ type: "function"
516
+ },
517
+ {
518
+ inputs: [{ internalType: "uint256", name: "tokens", type: "uint256" }],
519
+ name: "p2pBoostTopUp",
520
+ outputs: [],
521
+ stateMutability: "nonpayable",
522
+ type: "function"
523
+ },
524
+ {
525
+ inputs: [],
526
+ name: "p2pBoostRequestUnstake",
527
+ outputs: [],
528
+ stateMutability: "nonpayable",
529
+ type: "function"
530
+ },
531
+ {
532
+ inputs: [],
533
+ name: "p2pBoostClaimUnstake",
534
+ outputs: [],
535
+ stateMutability: "nonpayable",
536
+ type: "function"
537
+ },
538
+ {
539
+ inputs: [],
540
+ name: "p2pBoostCancelUnstake",
541
+ outputs: [],
542
+ stateMutability: "nonpayable",
543
+ type: "function"
544
+ },
545
+ {
546
+ inputs: [{ internalType: "address", name: "user", type: "address" }],
547
+ name: "getUserStake",
548
+ outputs: [
549
+ {
550
+ components: [
551
+ { internalType: "uint128", name: "stakedAmount", type: "uint128" },
552
+ { internalType: "uint64", name: "cooldownEnd", type: "uint64" },
553
+ { internalType: "uint8", name: "status", type: "uint8" }
554
+ ],
555
+ internalType: "struct P2PStakeBoostStorage.UserStake",
556
+ name: "",
557
+ type: "tuple"
558
+ }
559
+ ],
560
+ stateMutability: "view",
561
+ type: "function"
562
+ },
563
+ {
564
+ inputs: [{ internalType: "bytes32", name: "currency", type: "bytes32" }],
565
+ name: "getStakeBoostConfig",
566
+ outputs: [
567
+ {
568
+ components: [
569
+ {
570
+ internalType: "uint256",
571
+ name: "tokensPerUsdNumerator",
572
+ type: "uint256"
573
+ },
574
+ {
575
+ internalType: "uint256",
576
+ name: "tokensPerUsdDenominator",
577
+ type: "uint256"
578
+ },
579
+ { internalType: "uint256", name: "maxBoostUsd", type: "uint256" }
580
+ ],
581
+ internalType: "struct P2PStakeBoostStorage.BoostConfig",
582
+ name: "",
583
+ type: "tuple"
584
+ }
585
+ ],
586
+ stateMutability: "view",
587
+ type: "function"
588
+ },
589
+ {
590
+ inputs: [],
591
+ name: "getStakeBoostGlobals",
592
+ outputs: [
593
+ { internalType: "address", name: "p2pToken", type: "address" },
594
+ { internalType: "address", name: "fraudReserve", type: "address" },
595
+ { internalType: "uint256", name: "maxStakeTokens", type: "uint256" },
596
+ { internalType: "uint256", name: "normalCooldown", type: "uint256" },
597
+ { internalType: "uint256", name: "blacklistCooldown", type: "uint256" },
598
+ { internalType: "uint8", name: "tokenDecimals", type: "uint8" },
599
+ { internalType: "uint256", name: "totalStaked", type: "uint256" }
600
+ ],
601
+ stateMutability: "view",
602
+ type: "function"
603
+ }
604
+ ];
605
+
508
606
  // src/contracts/abis/reputation-manager.ts
509
607
  var reputationManagerAbi = [
510
608
  {
@@ -711,14 +809,16 @@ var reputationManagerAbi = [
711
809
  var DIAMOND_ABI = [
712
810
  ...orderFlowFacetAbi,
713
811
  ...orderProcessorFacetAbi,
714
- ...p2pConfigFacetAbi
812
+ ...p2pConfigFacetAbi,
813
+ ...p2pStakeBoostFacetAbi
715
814
  ];
716
815
  var ABIS = {
717
816
  DIAMOND: DIAMOND_ABI,
718
817
  FACETS: {
719
818
  ORDER_FLOW: orderFlowFacetAbi,
720
819
  ORDER_PROCESSOR: orderProcessorFacetAbi,
721
- CONFIG: p2pConfigFacetAbi
820
+ CONFIG: p2pConfigFacetAbi,
821
+ STAKE: p2pStakeBoostFacetAbi
722
822
  },
723
823
  EXTERNAL: {
724
824
  USDC: import_viem.erc20Abi,
@@ -1315,106 +1415,128 @@ function getReputationPerUsdcLimit(publicClient, diamondAddress, params) {
1315
1415
  );
1316
1416
  }
1317
1417
 
1318
- // src/contracts/reputation-manager/writes.ts
1418
+ // src/contracts/p2p-stake/index.ts
1319
1419
  var import_neverthrow6 = require("neverthrow");
1320
1420
  var import_viem5 = require("viem");
1321
1421
 
1322
- // src/zkkyc/validation.ts
1422
+ // src/stake/validation.ts
1323
1423
  var import_zod4 = require("zod");
1324
- var ZodAnonAadharProofParamsSchema = import_zod4.z.object({
1325
- nullifierSeed: import_zod4.z.bigint(),
1326
- nullifier: import_zod4.z.bigint(),
1327
- timestamp: import_zod4.z.bigint(),
1328
- signal: import_zod4.z.bigint(),
1329
- revealArray: import_zod4.z.tuple([import_zod4.z.bigint(), import_zod4.z.bigint(), import_zod4.z.bigint(), import_zod4.z.bigint()]),
1330
- packedGroth16Proof: import_zod4.z.tuple([
1331
- import_zod4.z.bigint(),
1332
- import_zod4.z.bigint(),
1333
- import_zod4.z.bigint(),
1334
- import_zod4.z.bigint(),
1335
- import_zod4.z.bigint(),
1336
- import_zod4.z.bigint(),
1337
- import_zod4.z.bigint(),
1338
- import_zod4.z.bigint()
1424
+ var ZodGetUserStakeParamsSchema = import_zod4.z.object({
1425
+ user: ZodAddressSchema
1426
+ });
1427
+ var ZodGetStakeBoostConfigParamsSchema = import_zod4.z.object({
1428
+ currency: ZodCurrencySchema
1429
+ });
1430
+ var ZodGetP2pTokenBalanceParamsSchema = import_zod4.z.object({
1431
+ address: ZodAddressSchema
1432
+ });
1433
+ var ZodStakeParamsSchema = import_zod4.z.object({
1434
+ tokens: import_zod4.z.bigint().positive()
1435
+ });
1436
+ var ZodTopUpParamsSchema = import_zod4.z.object({
1437
+ tokens: import_zod4.z.bigint().positive()
1438
+ });
1439
+
1440
+ // src/contracts/reputation-manager/writes.ts
1441
+ var import_neverthrow7 = require("neverthrow");
1442
+ var import_viem6 = require("viem");
1443
+
1444
+ // src/zkkyc/validation.ts
1445
+ var import_zod5 = require("zod");
1446
+ var ZodAnonAadharProofParamsSchema = import_zod5.z.object({
1447
+ nullifierSeed: import_zod5.z.bigint(),
1448
+ nullifier: import_zod5.z.bigint(),
1449
+ timestamp: import_zod5.z.bigint(),
1450
+ signal: import_zod5.z.bigint(),
1451
+ revealArray: import_zod5.z.tuple([import_zod5.z.bigint(), import_zod5.z.bigint(), import_zod5.z.bigint(), import_zod5.z.bigint()]),
1452
+ packedGroth16Proof: import_zod5.z.tuple([
1453
+ import_zod5.z.bigint(),
1454
+ import_zod5.z.bigint(),
1455
+ import_zod5.z.bigint(),
1456
+ import_zod5.z.bigint(),
1457
+ import_zod5.z.bigint(),
1458
+ import_zod5.z.bigint(),
1459
+ import_zod5.z.bigint(),
1460
+ import_zod5.z.bigint()
1339
1461
  ])
1340
1462
  });
1341
- var ZodSocialVerifyParamsSchema = import_zod4.z.object({
1342
- _socialName: import_zod4.z.string(),
1343
- proofs: import_zod4.z.array(
1344
- import_zod4.z.object({
1345
- claimInfo: import_zod4.z.object({
1346
- provider: import_zod4.z.string(),
1347
- parameters: import_zod4.z.string(),
1348
- context: import_zod4.z.string()
1463
+ var ZodSocialVerifyParamsSchema = import_zod5.z.object({
1464
+ _socialName: import_zod5.z.string(),
1465
+ proofs: import_zod5.z.array(
1466
+ import_zod5.z.object({
1467
+ claimInfo: import_zod5.z.object({
1468
+ provider: import_zod5.z.string(),
1469
+ parameters: import_zod5.z.string(),
1470
+ context: import_zod5.z.string()
1349
1471
  }),
1350
- signedClaim: import_zod4.z.object({
1351
- claim: import_zod4.z.object({
1352
- identifier: import_zod4.z.string(),
1472
+ signedClaim: import_zod5.z.object({
1473
+ claim: import_zod5.z.object({
1474
+ identifier: import_zod5.z.string(),
1353
1475
  owner: ZodAddressSchema,
1354
- timestampS: import_zod4.z.number(),
1355
- epoch: import_zod4.z.number()
1476
+ timestampS: import_zod5.z.number(),
1477
+ epoch: import_zod5.z.number()
1356
1478
  }),
1357
- signatures: import_zod4.z.array(import_zod4.z.string())
1479
+ signatures: import_zod5.z.array(import_zod5.z.string())
1358
1480
  })
1359
1481
  })
1360
1482
  )
1361
1483
  });
1362
- var ZodSolidityVerifierParametersSchema = import_zod4.z.object({
1363
- version: import_zod4.z.string().refine((val) => val.startsWith("0x"), {
1484
+ var ZodSolidityVerifierParametersSchema = import_zod5.z.object({
1485
+ version: import_zod5.z.string().refine((val) => val.startsWith("0x"), {
1364
1486
  message: "Version must be a hex string"
1365
1487
  }),
1366
- proofVerificationData: import_zod4.z.object({
1367
- vkeyHash: import_zod4.z.string().refine((val) => /^0x[a-fA-F0-9]{64}$/.test(val), {
1488
+ proofVerificationData: import_zod5.z.object({
1489
+ vkeyHash: import_zod5.z.string().refine((val) => /^0x[a-fA-F0-9]{64}$/.test(val), {
1368
1490
  message: "Invalid bytes32 hex string"
1369
1491
  }),
1370
- proof: import_zod4.z.string().refine((val) => val.startsWith("0x"), {
1492
+ proof: import_zod5.z.string().refine((val) => val.startsWith("0x"), {
1371
1493
  message: "Proof must be a hex string"
1372
1494
  }),
1373
- publicInputs: import_zod4.z.array(
1374
- import_zod4.z.string().refine((val) => /^0x[a-fA-F0-9]{64}$/.test(val), {
1495
+ publicInputs: import_zod5.z.array(
1496
+ import_zod5.z.string().refine((val) => /^0x[a-fA-F0-9]{64}$/.test(val), {
1375
1497
  message: "Each public input must be a valid bytes32 hex string"
1376
1498
  })
1377
1499
  )
1378
1500
  }),
1379
- committedInputs: import_zod4.z.string().refine((val) => val.startsWith("0x"), {
1501
+ committedInputs: import_zod5.z.string().refine((val) => val.startsWith("0x"), {
1380
1502
  message: "Committed inputs must be a hex string"
1381
1503
  }),
1382
- serviceConfig: import_zod4.z.object({
1383
- validityPeriodInSeconds: import_zod4.z.number().int().nonnegative(),
1384
- domain: import_zod4.z.string(),
1385
- scope: import_zod4.z.string(),
1386
- devMode: import_zod4.z.boolean()
1504
+ serviceConfig: import_zod5.z.object({
1505
+ validityPeriodInSeconds: import_zod5.z.number().int().nonnegative(),
1506
+ domain: import_zod5.z.string(),
1507
+ scope: import_zod5.z.string(),
1508
+ devMode: import_zod5.z.boolean()
1387
1509
  })
1388
1510
  });
1389
- var ZodZkPassportRegisterParamsSchema = import_zod4.z.object({
1511
+ var ZodZkPassportRegisterParamsSchema = import_zod5.z.object({
1390
1512
  params: ZodSolidityVerifierParametersSchema,
1391
- isIDCard: import_zod4.z.boolean()
1513
+ isIDCard: import_zod5.z.boolean()
1392
1514
  });
1393
1515
 
1394
1516
  // src/contracts/tx-limits/index.ts
1395
- var import_neverthrow7 = require("neverthrow");
1396
- var import_viem6 = require("viem");
1517
+ var import_neverthrow8 = require("neverthrow");
1518
+ var import_viem7 = require("viem");
1397
1519
 
1398
1520
  // src/profile/validation.ts
1399
- var import_zod5 = require("zod");
1400
- var ZodUsdcBalanceParamsSchema = import_zod5.z.object({
1521
+ var import_zod6 = require("zod");
1522
+ var ZodUsdcBalanceParamsSchema = import_zod6.z.object({
1401
1523
  address: ZodAddressSchema
1402
1524
  });
1403
- var ZodUsdcAllowanceParamsSchema = import_zod5.z.object({
1525
+ var ZodUsdcAllowanceParamsSchema = import_zod6.z.object({
1404
1526
  owner: ZodAddressSchema
1405
1527
  });
1406
- var ZodGetBalancesParamsSchema = import_zod5.z.object({
1528
+ var ZodGetBalancesParamsSchema = import_zod6.z.object({
1407
1529
  address: ZodAddressSchema,
1408
1530
  currency: ZodCurrencySchema
1409
1531
  });
1410
- var ZodTxLimitsParamsSchema = import_zod5.z.object({
1532
+ var ZodTxLimitsParamsSchema = import_zod6.z.object({
1411
1533
  address: ZodAddressSchema,
1412
1534
  currency: ZodCurrencySchema
1413
1535
  });
1414
1536
 
1415
1537
  // src/contracts/usdc/index.ts
1416
- var import_neverthrow8 = require("neverthrow");
1417
- var import_viem7 = require("viem");
1538
+ var import_neverthrow9 = require("neverthrow");
1539
+ var import_viem8 = require("viem");
1418
1540
 
1419
1541
  // src/prices/client.ts
1420
1542
  function createPrices(config) {