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