@p2pdotme/sdk 1.1.8 → 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/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/orders.cjs +197 -82
- package/dist/orders.cjs.map +1 -1
- package/dist/orders.mjs +176 -61
- package/dist/orders.mjs.map +1 -1
- package/dist/prices.cjs +172 -57
- package/dist/prices.cjs.map +1 -1
- package/dist/prices.mjs +170 -55
- package/dist/prices.mjs.map +1 -1
- package/dist/profile.cjs +184 -69
- package/dist/profile.cjs.map +1 -1
- package/dist/profile.mjs +176 -61
- package/dist/profile.mjs.map +1 -1
- package/dist/react.cjs +545 -100
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +131 -1
- package/dist/react.d.ts +131 -1
- package/dist/react.mjs +511 -67
- package/dist/react.mjs.map +1 -1
- package/dist/stake.cjs +1212 -0
- package/dist/stake.cjs.map +1 -0
- package/dist/stake.d.cts +191 -0
- package/dist/stake.d.ts +191 -0
- package/dist/stake.mjs +1184 -0
- package/dist/stake.mjs.map +1 -0
- package/dist/zkkyc.cjs +95 -2
- package/dist/zkkyc.cjs.map +1 -1
- package/dist/zkkyc.mjs +95 -2
- package/dist/zkkyc.mjs.map +1 -1
- package/package.json +7 -1
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
|
|
1297
|
-
var ZodAnonAadharProofParamsSchema =
|
|
1298
|
-
nullifierSeed:
|
|
1299
|
-
nullifier:
|
|
1300
|
-
timestamp:
|
|
1301
|
-
signal:
|
|
1302
|
-
revealArray:
|
|
1303
|
-
packedGroth16Proof:
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
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 =
|
|
1315
|
-
_socialName:
|
|
1316
|
-
proofs:
|
|
1317
|
-
|
|
1318
|
-
claimInfo:
|
|
1319
|
-
provider:
|
|
1320
|
-
parameters:
|
|
1321
|
-
context:
|
|
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:
|
|
1324
|
-
claim:
|
|
1325
|
-
identifier:
|
|
1438
|
+
signedClaim: z5.object({
|
|
1439
|
+
claim: z5.object({
|
|
1440
|
+
identifier: z5.string(),
|
|
1326
1441
|
owner: ZodAddressSchema,
|
|
1327
|
-
timestampS:
|
|
1328
|
-
epoch:
|
|
1442
|
+
timestampS: z5.number(),
|
|
1443
|
+
epoch: z5.number()
|
|
1329
1444
|
}),
|
|
1330
|
-
signatures:
|
|
1445
|
+
signatures: z5.array(z5.string())
|
|
1331
1446
|
})
|
|
1332
1447
|
})
|
|
1333
1448
|
)
|
|
1334
1449
|
});
|
|
1335
|
-
var ZodSolidityVerifierParametersSchema =
|
|
1336
|
-
version:
|
|
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:
|
|
1340
|
-
vkeyHash:
|
|
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:
|
|
1458
|
+
proof: z5.string().refine((val) => val.startsWith("0x"), {
|
|
1344
1459
|
message: "Proof must be a hex string"
|
|
1345
1460
|
}),
|
|
1346
|
-
publicInputs:
|
|
1347
|
-
|
|
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:
|
|
1467
|
+
committedInputs: z5.string().refine((val) => val.startsWith("0x"), {
|
|
1353
1468
|
message: "Committed inputs must be a hex string"
|
|
1354
1469
|
}),
|
|
1355
|
-
serviceConfig:
|
|
1356
|
-
validityPeriodInSeconds:
|
|
1357
|
-
domain:
|
|
1358
|
-
scope:
|
|
1359
|
-
devMode:
|
|
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 =
|
|
1477
|
+
var ZodZkPassportRegisterParamsSchema = z5.object({
|
|
1363
1478
|
params: ZodSolidityVerifierParametersSchema,
|
|
1364
|
-
isIDCard:
|
|
1479
|
+
isIDCard: z5.boolean()
|
|
1365
1480
|
});
|
|
1366
1481
|
|
|
1367
1482
|
// src/contracts/tx-limits/index.ts
|
|
1368
|
-
import { ResultAsync as
|
|
1369
|
-
import { formatUnits, stringToHex as
|
|
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
|
|
1373
|
-
var ZodUsdcBalanceParamsSchema =
|
|
1487
|
+
import { z as z6 } from "zod";
|
|
1488
|
+
var ZodUsdcBalanceParamsSchema = z6.object({
|
|
1374
1489
|
address: ZodAddressSchema
|
|
1375
1490
|
});
|
|
1376
|
-
var ZodUsdcAllowanceParamsSchema =
|
|
1491
|
+
var ZodUsdcAllowanceParamsSchema = z6.object({
|
|
1377
1492
|
owner: ZodAddressSchema
|
|
1378
1493
|
});
|
|
1379
|
-
var ZodGetBalancesParamsSchema =
|
|
1494
|
+
var ZodGetBalancesParamsSchema = z6.object({
|
|
1380
1495
|
address: ZodAddressSchema,
|
|
1381
1496
|
currency: ZodCurrencySchema
|
|
1382
1497
|
});
|
|
1383
|
-
var ZodTxLimitsParamsSchema =
|
|
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
|
|
1504
|
+
import { ResultAsync as ResultAsync7 } from "neverthrow";
|
|
1390
1505
|
import { erc20Abi as erc20Abi2 } from "viem";
|
|
1391
1506
|
|
|
1392
1507
|
// src/prices/client.ts
|