@p2pdotme/sdk 1.1.0 → 1.1.2
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/README.md +32 -0
- package/dist/country.cjs +4 -4
- package/dist/country.cjs.map +1 -1
- package/dist/country.d.cts +2 -2
- package/dist/country.d.ts +2 -2
- package/dist/country.mjs +4 -4
- package/dist/country.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/orders.cjs +691 -2
- package/dist/orders.cjs.map +1 -1
- package/dist/orders.d.cts +222 -1
- package/dist/orders.d.ts +222 -1
- package/dist/orders.mjs +685 -1
- package/dist/orders.mjs.map +1 -1
- package/dist/prices.cjs +424 -0
- package/dist/prices.cjs.map +1 -1
- package/dist/prices.mjs +424 -0
- package/dist/prices.mjs.map +1 -1
- package/dist/profile.cjs +424 -0
- package/dist/profile.cjs.map +1 -1
- package/dist/profile.mjs +424 -0
- package/dist/profile.mjs.map +1 -1
- package/dist/qr-parsers.cjs +82 -1
- package/dist/qr-parsers.cjs.map +1 -1
- package/dist/qr-parsers.mjs +82 -1
- package/dist/qr-parsers.mjs.map +1 -1
- package/dist/react.cjs +424 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.mjs +424 -0
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/orders.mjs
CHANGED
|
@@ -4381,6 +4381,685 @@ function createSetSellOrderUpiAction(input) {
|
|
|
4381
4381
|
// src/orders/internal/routing/client.ts
|
|
4382
4382
|
import { stringToHex as stringToHex6 } from "viem";
|
|
4383
4383
|
|
|
4384
|
+
// src/contracts/error-messages.ts
|
|
4385
|
+
var contractErrorMessages = {
|
|
4386
|
+
// Access control
|
|
4387
|
+
NOT_ADMIN: "You are not an admin",
|
|
4388
|
+
NOT_SUPER_ADMIN: "You are not a super admin",
|
|
4389
|
+
NOT_AUTHORIZED: "Not authorized",
|
|
4390
|
+
NOT_SELF: "Action can only be performed by yourself",
|
|
4391
|
+
NOT_WHITELISTED: "Not whitelisted",
|
|
4392
|
+
NOT_CIRCLE_ADMIN: "You are not a circle admin",
|
|
4393
|
+
// Circle / community management
|
|
4394
|
+
INVALID_NAME: "Invalid name",
|
|
4395
|
+
INVALID_COMMUNITY_URL: "Invalid community URL",
|
|
4396
|
+
INVALID_ADMIN_COMMUNITY_URL: "Invalid admin community URL",
|
|
4397
|
+
ADMIN_ALREADY_HAS_CIRCLE: "Admin already has a circle",
|
|
4398
|
+
CIRCLE_NAME_ALREADY_TAKEN: "Circle name is already taken",
|
|
4399
|
+
P2P_STAKE_CONFIG_NOT_SET: "P2P stake config is not set",
|
|
4400
|
+
INSUFFICIENT_P2P_STAKE: "Insufficient P2P stake",
|
|
4401
|
+
P2P_TOKEN_NOT_SET: "P2P token is not set",
|
|
4402
|
+
P2P_UNSTAKE_REQUEST_PENDING: "A P2P unstake request is already pending",
|
|
4403
|
+
NO_P2P_UNSTAKE_REQUEST: "No P2P unstake request found",
|
|
4404
|
+
P2P_UNSTAKE_COOLDOWN_NOT_PASSED: "P2P unstake cooldown period has not passed",
|
|
4405
|
+
SLASH_AMOUNT_EXCEEDS_STAKE: "Slash amount exceeds stake",
|
|
4406
|
+
CIRCLE_NOT_ACTIVE: "Circle is not active",
|
|
4407
|
+
INVALID_CIRCLE_ID: "Invalid circle ID",
|
|
4408
|
+
CURRENCY_MISMATCH: "Currency mismatch",
|
|
4409
|
+
CIRCLE_FULL: "Circle is full",
|
|
4410
|
+
CIRCLE_ID_MISMATCH: "Circle ID mismatch",
|
|
4411
|
+
DUPLICATE_ACCOUNT_NAME: "Account name already exists",
|
|
4412
|
+
EMPTY_NAME: "Name cannot be empty",
|
|
4413
|
+
ACCOUNT_BOUND_TO_ANOTHER_CIRCLE: "Account is bound to another circle",
|
|
4414
|
+
EXIT_AMOUNT_EXCEEDED_CIRCLE_BALANCE: "Exit amount exceeded circle balance",
|
|
4415
|
+
UNDELEGATION_AMOUNT_TOO_HIGH: "Undelegation amount is too high",
|
|
4416
|
+
// Exchange / order lifecycle
|
|
4417
|
+
EXCHANGE_NOT_OPERATIONAL: "Exchange is not operational",
|
|
4418
|
+
ORDER_NOT_PLACED: "Order not placed",
|
|
4419
|
+
ORDER_NOT_PAID: "Order has not been paid",
|
|
4420
|
+
ORDER_STATUS_INVALID: "Order with placed status only can be re-assigned",
|
|
4421
|
+
ORDER_EXPIRED: "Order expired",
|
|
4422
|
+
ORDER_ALREADY_PAID: "Payment address already sent",
|
|
4423
|
+
ORDER_ALREADY_COMPLETED: "Order already marked completed",
|
|
4424
|
+
INVALID_ORDER_TYPE: "Invalid order type",
|
|
4425
|
+
ORDER_TYPE_INCORRECT: "Incorrect order type",
|
|
4426
|
+
ORDER_NOT_ACCEPTED: "Order not placed to be accepted",
|
|
4427
|
+
ORDER_NOT_ASSIGNED: "Order not assigned",
|
|
4428
|
+
ORDER_AMOUNT_EXCEEDS_LIMIT: "Order amount exceeds limit",
|
|
4429
|
+
INVALID_ORDER_AMOUNT: "Invalid order amount",
|
|
4430
|
+
INVALID_ORDER_AMOUNT_TO_COVER_FEE: "Order amount is not enough to cover fee",
|
|
4431
|
+
INVALID_ORDER_ID: "Invalid order ID",
|
|
4432
|
+
ORDER_TOO_EARLY_FOR_REASSIGNMENT: "Order is too early for reassignment",
|
|
4433
|
+
ORDER_TOO_LATE_FOR_REASSIGNMENT: "Order is too late for reassignment",
|
|
4434
|
+
REASSIGNMENT_NOT_REQUIRED: "Reassignment is not required",
|
|
4435
|
+
TIP_ALREADY_GIVEN: "Tip already given",
|
|
4436
|
+
CASHBACK_TRANSFER_FAILED: "Cashback transfer failed",
|
|
4437
|
+
// Order limits
|
|
4438
|
+
DAILY_BUY_ORDER_LIMIT_EXCEEDED: "Daily buy order count limit exceeded",
|
|
4439
|
+
MONTHLY_BUY_ORDER_LIMIT_EXCEEDED: "Monthly buy order count limit exceeded",
|
|
4440
|
+
SELL_ORDER_AMOUNT_LIMIT_EXCEEDED: "Sell order amount limit exceeded",
|
|
4441
|
+
BUY_ORDER_AMOUNT_EXCEEDS_LIMIT: "Buy order amount exceeds limit",
|
|
4442
|
+
SELL_ORDER_AMOUNT_EXCEEDS_LIMIT: "Sell order amount exceeds limit",
|
|
4443
|
+
BUY_AMOUNT_EXCEEDS_USDC_LIMIT: "Buy amount exceeds USDC limit",
|
|
4444
|
+
SELL_AMOUNT_EXCEEDS_FIAT_LIMIT: "Sell amount exceeds fiat limit",
|
|
4445
|
+
DAILY_VOLUME_LIMIT_EXCEEDED: "Daily volume limit exceeded",
|
|
4446
|
+
MONTHLY_VOLUME_LIMIT_EXCEEDED: "Monthly volume limit exceeded",
|
|
4447
|
+
USER_YEARLY_VOLUME_LIMIT_EXCEEDED: "Yearly volume limit exceeded",
|
|
4448
|
+
// Dispute
|
|
4449
|
+
DISPUTE_TIME_NOT_REACHED: "Dispute can only be raised after 30 minutes of order placement",
|
|
4450
|
+
DISPUTE_TIME_EXPIRED: "Dispute can only be raised after 24 hours of order placement",
|
|
4451
|
+
INVALID_ORDER_STATUS_TO_RAISE_DISPUTE: "Invalid order status to raise dispute",
|
|
4452
|
+
DISPUTE_NOT_RAISED: "Dispute not raised",
|
|
4453
|
+
CANNOT_RAISE_DISPUTE_TWICE: "Cannot raise dispute twice",
|
|
4454
|
+
DISPUTE_ALREADY_SETTLED: "Dispute already settled",
|
|
4455
|
+
TRANSACTION_ID_MISMATCH: "Transaction ID does not match",
|
|
4456
|
+
ACCOUNT_NUMBER_MISMATCH: "Account number does not match",
|
|
4457
|
+
NOT_PAID_BUY_ORDER: "Not a paid buy order",
|
|
4458
|
+
// Payment channels
|
|
4459
|
+
PAYMENT_CHANNEL_NOT_FOUND: "Payment channel not found",
|
|
4460
|
+
PAYMENT_CHANNEL_NOT_ACTIVE: "Payment channel not active",
|
|
4461
|
+
PAYMENT_CHANNEL_NOT_APPROVED: "Payment channel not approved",
|
|
4462
|
+
PAYMENT_CHANNEL_NOT_REJECTED: "Payment channel has not been rejected",
|
|
4463
|
+
INVALID_PAYMENT_CHANNEL_ID: "Invalid payment channel ID",
|
|
4464
|
+
DUPLICATE_PAYMENT_CHANNEL: "Duplicate payment channel",
|
|
4465
|
+
OLD_PAYMENT_CHANNEL_NOT_FOUND: "Old payment channel not found",
|
|
4466
|
+
NEW_PAYMENT_CHANNEL_NOT_FOUND: "New payment channel not found",
|
|
4467
|
+
SAME_PAYMENT_CHANNEL: "Old and new payment channels are the same",
|
|
4468
|
+
OLD_PAYMENT_CHANNEL_SHOULD_BE_INACTIVE: "Old payment channel should be inactive",
|
|
4469
|
+
NEW_PAYMENT_CHANNEL_SHOULD_BE_ACTIVE: "New payment channel should be active",
|
|
4470
|
+
ONGOING_ORDER_ON_PAYMENT_CHANNEL: "There is an ongoing order on this payment channel",
|
|
4471
|
+
UPI_ALREADY_SENT: "Payment address already sent",
|
|
4472
|
+
INVALID_ORDER_UPI: "Invalid order payment address",
|
|
4473
|
+
NO_FIAT_LIQUIDITY: "No fiat liquidity on exchange to complete order",
|
|
4474
|
+
// Merchant
|
|
4475
|
+
NOT_ENOUGH_ELIGIBLE_MERCHANTS: "Not enough eligible merchants",
|
|
4476
|
+
MERCHANT_NOT_REGISTERED: "Merchant is not registered",
|
|
4477
|
+
MERCHANT_NOT_APPROVED: "Merchant is not approved",
|
|
4478
|
+
MERCHANT_ALREADY_REGISTERED: "Merchant already registered",
|
|
4479
|
+
MERCHANT_ALREADY_REJECTED: "Merchant already rejected",
|
|
4480
|
+
MERCHANT_BLACKLISTED: "Merchant blacklisted",
|
|
4481
|
+
MERCHANT_NOT_BLACKLISTED: "Merchant not blacklisted",
|
|
4482
|
+
MERCHANT_ALREADY_BLACKLISTED: "Merchant already blacklisted",
|
|
4483
|
+
MERCHANT_HAS_ONGOING_ORDERS: "Merchant has ongoing orders",
|
|
4484
|
+
MERCHANT_NOT_FULLFILLED_ELIGIBILITY_THRESHOLD: "Merchant has not fulfilled eligibility threshold",
|
|
4485
|
+
INVALID_MERCHANT: "Invalid merchant",
|
|
4486
|
+
// Staking / unstaking
|
|
4487
|
+
STAKE_AMOUNT_TOO_LOW: "Stake amount is too low",
|
|
4488
|
+
ADDITIONAL_STAKE_NOT_ALLOWED: "Additional stake is not allowed",
|
|
4489
|
+
UNSTAKE_REQUEST_PENDING: "Unstake request is already pending",
|
|
4490
|
+
UNSTAKE_REQUEST_NOT_PENDING: "No pending unstake request",
|
|
4491
|
+
UNSTAKE_AMOUNT_EXCEEDED: "Unstake amount exceeded",
|
|
4492
|
+
ZERO_UNSTAKE_AMOUNT: "Unstake amount cannot be zero",
|
|
4493
|
+
NO_WITHDRAWABLE_AMOUNT: "No withdrawable amount",
|
|
4494
|
+
NO_STAKE: "No stake found",
|
|
4495
|
+
NO_STAKERS: "No stakers found",
|
|
4496
|
+
INSUFFICIENT_STAKED_AMOUNT: "Insufficient staked amount",
|
|
4497
|
+
COOLDOWN_NOT_PASSED: "Cooldown period has not passed",
|
|
4498
|
+
CLAIMABLE_REWARDS_NOT_AVAILABLE: "No rewards to claim",
|
|
4499
|
+
// Delegation
|
|
4500
|
+
EXIT_WOULD_BREACH_DELEGATION_INVARIANT: "Exit would breach delegation invariant",
|
|
4501
|
+
AGGREGATE_DELEGATION_EXCEEDS_TOTAL_STAKED: "Aggregate delegation exceeds total staked",
|
|
4502
|
+
INSUFFICIENT_MERCHANT_REWARDS: "Insufficient merchant rewards",
|
|
4503
|
+
// Migration
|
|
4504
|
+
INVALID_MIGRATION_STATUS: "Invalid migration status",
|
|
4505
|
+
MIGRATION_REQUEST_NOT_PENDING: "No pending migration request",
|
|
4506
|
+
MIGRATION_ALREADY_REQUESTED: "Migration already requested",
|
|
4507
|
+
// Token / currency
|
|
4508
|
+
TOKEN_ALREADY_EXISTS: "Token already exists",
|
|
4509
|
+
TOKEN_NOT_FOUND: "Token not found",
|
|
4510
|
+
TOKEN_EMPTY: "Token is empty",
|
|
4511
|
+
CURRENCY_NOT_SUPPORTED: "Currency not supported",
|
|
4512
|
+
INVALID_CURRENCY: "Invalid currency",
|
|
4513
|
+
// USDC / transfer
|
|
4514
|
+
USDC_TRANSFER_FAILED: "USDC transfer failed",
|
|
4515
|
+
USDC_TRANSFER_FAILED_WITH_ERROR_MESSAGE: "USDC transfer failed with error message",
|
|
4516
|
+
USDC_TRANSFER_FAILED_WITH_PANIC: "USDC transfer failed with panic",
|
|
4517
|
+
INSUFFICIENT_ALLOWANCE: "Insufficient USDC allowance",
|
|
4518
|
+
// ZK Passport
|
|
4519
|
+
ZK_PASSPORT_VERIFIER_NOT_SET: "ZK Passport verifier not set",
|
|
4520
|
+
ZK_PASSPORT_DOMAIN_EMPTY: "ZK Passport domain is empty",
|
|
4521
|
+
ZK_PASSPORT_SCOPE_EMPTY: "ZK Passport scope is empty",
|
|
4522
|
+
PASSPORT_ALREADY_VERIFIED: "Passport already verified",
|
|
4523
|
+
ZK_PASSPORT_PROOF_INVALID: "ZK Passport proof is invalid",
|
|
4524
|
+
ZK_PASSPORT_IDENTIFIER_ALREADY_VERIFIED: "ZK Passport identifier already verified",
|
|
4525
|
+
ZK_PASSPORT_INVALID_SCOPE: "ZK Passport invalid scope",
|
|
4526
|
+
ZK_PASSPORT_UNEXPECTED_SENDER: "ZK Passport unexpected sender",
|
|
4527
|
+
ZK_PASSPORT_AGE_BELOW_MINIMUM: "ZK Passport age below minimum",
|
|
4528
|
+
ZK_PASSPORT_MIN_AGE_TOO_HIGH: "ZK Passport minimum age too high",
|
|
4529
|
+
// Chainlink / oracle
|
|
4530
|
+
UNEXPECTED_REQUEST_ID: "Unexpected request ID",
|
|
4531
|
+
ONLY_ROUTER_CAN_FULFILL: "Only the router can fulfill this request",
|
|
4532
|
+
REQUEST_FAILED: "Request failed",
|
|
4533
|
+
SOURCE_CODE_MISMATCH: "Source code mismatch",
|
|
4534
|
+
ZERO_MARKET_PRICE: "Market price cannot be zero",
|
|
4535
|
+
INVALID_COMPUTED_PRICES: "Invalid computed prices",
|
|
4536
|
+
NOT_PRICE_UPDATER_FOR_CURRENCY: "Not the price updater for this currency",
|
|
4537
|
+
THRESHOLD_NOT_CONFIGURED: "Threshold not configured",
|
|
4538
|
+
SLIPPAGE_EXCEEDED: "Slippage exceeded",
|
|
4539
|
+
// Reputation / verification
|
|
4540
|
+
USER_HAS_NO_REPUTATION: "Kindly do ZK social verifications and increase your limits to place more orders",
|
|
4541
|
+
ZERO_REPUTATION_POINTS: "Cannot place buy orders with 0 reputation points",
|
|
4542
|
+
NO_REPUTATION: "No reputation points",
|
|
4543
|
+
INSUFFICIENT_RP: "Insufficient reputation points",
|
|
4544
|
+
NULLIFIER_ALREADY_VERIFIED: "Nullifier already verified",
|
|
4545
|
+
VERIFICATION_FAILED: "Verification failed",
|
|
4546
|
+
INVALID_SOCIAL_PLATFORM: "Invalid social media platform",
|
|
4547
|
+
SOCIAL_ALREADY_VERIFIED: "Social already verified",
|
|
4548
|
+
YEAR_FIELD_NOT_IN_PROOF: "Year field not found in proof",
|
|
4549
|
+
USER_ID_FIELD_NOT_IN_PROOF: "User ID field not found in proof",
|
|
4550
|
+
USER_ID_ALREADY_VERIFIED: "The social media account's user ID is already verified",
|
|
4551
|
+
USERNAME_ALREADY_VERIFIED: "The social media account's username is already verified",
|
|
4552
|
+
USERNAME_NOT_IN_PROOF: "Username field not found in proof",
|
|
4553
|
+
LINKEDIN_ONLY_RP_UPDATES: "LinkedIn only supports RP updates",
|
|
4554
|
+
FACEBOOK_ONLY_RP_UPDATES: "Facebook only supports RP updates",
|
|
4555
|
+
// Voting / referral
|
|
4556
|
+
ALREADY_REFERRED: "Already referred",
|
|
4557
|
+
SELF_REFERRAL_NOT_ALLOWED: "Self referral not allowed",
|
|
4558
|
+
NOT_ELIGIBLE_TO_REFER: "Not eligible to refer",
|
|
4559
|
+
MERCHANT_MONTHLY_REFERRAL_LIMIT_REACHED: "Merchant monthly referral limit reached",
|
|
4560
|
+
NO_RECOMMENDER: "No recommender found",
|
|
4561
|
+
RECOMMENDATION_ALREADY_CLAIMED: "Recommendation already claimed",
|
|
4562
|
+
CANNOT_VOTE_YOURSELF: "Cannot vote yourself",
|
|
4563
|
+
VOTES_PER_EPOCH_EXCEEDED: "Votes per epoch exceeded",
|
|
4564
|
+
ALREADY_VOTED: "Already voted",
|
|
4565
|
+
FUNCTION_NOT_FOUND: "Function not found",
|
|
4566
|
+
// Campaign
|
|
4567
|
+
CAMPAIGN_NOT_ACTIVE: "Campaign is not active",
|
|
4568
|
+
INVALID_MANAGER_DETAILS: "Invalid manager details",
|
|
4569
|
+
UNCLAIMED_REWARDS_EXIST: "Unclaimed rewards exist",
|
|
4570
|
+
REWARD_ALREADY_CLAIMED: "Reward already claimed",
|
|
4571
|
+
ONLY_NEW_USERS_ALLOWED: "Only new users allowed",
|
|
4572
|
+
MANAGER_NOT_FOUND: "Manager not found",
|
|
4573
|
+
MANAGER_INACTIVE: "Manager is inactive",
|
|
4574
|
+
NO_REWARDS: "No rewards",
|
|
4575
|
+
INVALID_CAMPAIGN_ID: "Invalid campaign ID",
|
|
4576
|
+
CANNOT_CLAIM_REVENUE_FOR_CURRENT_MONTH: "Cannot claim revenue for the current month",
|
|
4577
|
+
// Referral reward config
|
|
4578
|
+
REWARD_PERCENTAGE_TOO_HIGH: "Reward percentage is too high",
|
|
4579
|
+
// Signature / nonce
|
|
4580
|
+
NONCE_ALREADY_USED: "Nonce already used",
|
|
4581
|
+
SIGNATURE_VALIDATION_FAILED: "Signature validation failed",
|
|
4582
|
+
// Misc
|
|
4583
|
+
INVALID_ADDRESS: "Invalid address",
|
|
4584
|
+
INVALID_BLOCK_AMOUNT: "Invalid block amount",
|
|
4585
|
+
INVALID_AMOUNT: "Invalid amount",
|
|
4586
|
+
INVALID_INPUT: "Invalid input",
|
|
4587
|
+
INVALID_STATUS_TRANSITION: "Invalid status transition",
|
|
4588
|
+
ARRAY_LENGTH_MISMATCH: "Array length mismatch",
|
|
4589
|
+
USER_IS_BLACKLISTED: "User is blacklisted",
|
|
4590
|
+
ZERO_ADDRESS: "Zero address",
|
|
4591
|
+
REENTRANCY_GUARD: "Reentrancy detected",
|
|
4592
|
+
BATCH_TOO_LARGE: "Batch size too large",
|
|
4593
|
+
UNDERFLOW_SUBTRACTION: "Cannot subtract more than balance",
|
|
4594
|
+
TARGET_LONGER_THAN_DATA: "Target is longer than data"
|
|
4595
|
+
};
|
|
4596
|
+
function getContractErrorMessage(code, fallback = "Something went wrong. Please try again.") {
|
|
4597
|
+
if (!code) return fallback;
|
|
4598
|
+
return contractErrorMessages[code] ?? fallback;
|
|
4599
|
+
}
|
|
4600
|
+
|
|
4601
|
+
// src/contracts/errors.ts
|
|
4602
|
+
var contractErrors = {
|
|
4603
|
+
// Access control
|
|
4604
|
+
NotAdmin: "NOT_ADMIN",
|
|
4605
|
+
NotSuperAdmin: "NOT_SUPER_ADMIN",
|
|
4606
|
+
NotAuthorized: "NOT_AUTHORIZED",
|
|
4607
|
+
NotSelf: "NOT_SELF",
|
|
4608
|
+
NotWhitelisted: "NOT_WHITELISTED",
|
|
4609
|
+
NotCircleAdmin: "NOT_CIRCLE_ADMIN",
|
|
4610
|
+
// Circle / community management
|
|
4611
|
+
InvalidName: "INVALID_NAME",
|
|
4612
|
+
InvalidCommunityUrl: "INVALID_COMMUNITY_URL",
|
|
4613
|
+
InvalidAdminCommunityUrl: "INVALID_ADMIN_COMMUNITY_URL",
|
|
4614
|
+
AdminAlreadyHasCircle: "ADMIN_ALREADY_HAS_CIRCLE",
|
|
4615
|
+
CircleNameAlreadyTaken: "CIRCLE_NAME_ALREADY_TAKEN",
|
|
4616
|
+
P2PStakeConfigNotSet: "P2P_STAKE_CONFIG_NOT_SET",
|
|
4617
|
+
InsufficientP2PStake: "INSUFFICIENT_P2P_STAKE",
|
|
4618
|
+
P2PTokenNotSet: "P2P_TOKEN_NOT_SET",
|
|
4619
|
+
P2PUnstakeRequestPending: "P2P_UNSTAKE_REQUEST_PENDING",
|
|
4620
|
+
NoP2PUnstakeRequest: "NO_P2P_UNSTAKE_REQUEST",
|
|
4621
|
+
P2PUnstakeCooldownNotPassed: "P2P_UNSTAKE_COOLDOWN_NOT_PASSED",
|
|
4622
|
+
SlashAmountExceedsStake: "SLASH_AMOUNT_EXCEEDS_STAKE",
|
|
4623
|
+
CircleNotActive: "CIRCLE_NOT_ACTIVE",
|
|
4624
|
+
InvalidCircleId: "INVALID_CIRCLE_ID",
|
|
4625
|
+
CurrencyMismatch: "CURRENCY_MISMATCH",
|
|
4626
|
+
CircleFull: "CIRCLE_FULL",
|
|
4627
|
+
CircleIdMismatch: "CIRCLE_ID_MISMATCH",
|
|
4628
|
+
DuplicateAccountName: "DUPLICATE_ACCOUNT_NAME",
|
|
4629
|
+
EmptyName: "EMPTY_NAME",
|
|
4630
|
+
AccountBoundToAnotherCircle: "ACCOUNT_BOUND_TO_ANOTHER_CIRCLE",
|
|
4631
|
+
ExitAmountExceededCircleBalance: "EXIT_AMOUNT_EXCEEDED_CIRCLE_BALANCE",
|
|
4632
|
+
UndelegationAmountTooHigh: "UNDELEGATION_AMOUNT_TOO_HIGH",
|
|
4633
|
+
// Exchange / order lifecycle
|
|
4634
|
+
ExchangeNotOperational: "EXCHANGE_NOT_OPERATIONAL",
|
|
4635
|
+
OrderNotPlaced: "ORDER_NOT_PLACED",
|
|
4636
|
+
OrderNotPaid: "ORDER_NOT_PAID",
|
|
4637
|
+
OrderStatusInvalid: "ORDER_STATUS_INVALID",
|
|
4638
|
+
OrderExpired: "ORDER_EXPIRED",
|
|
4639
|
+
OrderAlreadyPaid: "ORDER_ALREADY_PAID",
|
|
4640
|
+
OrderAlreadyCompleted: "ORDER_ALREADY_COMPLETED",
|
|
4641
|
+
InvalidOrderType: "INVALID_ORDER_TYPE",
|
|
4642
|
+
OrderTypeIncorrect: "ORDER_TYPE_INCORRECT",
|
|
4643
|
+
OrderNotAccepted: "ORDER_NOT_ACCEPTED",
|
|
4644
|
+
OrderNotAssigned: "ORDER_NOT_ASSIGNED",
|
|
4645
|
+
OrderAmountExceedsLimit: "ORDER_AMOUNT_EXCEEDS_LIMIT",
|
|
4646
|
+
InvalidOrderAmount: "INVALID_ORDER_AMOUNT",
|
|
4647
|
+
InvalidOrderAmountToCoverFee: "INVALID_ORDER_AMOUNT_TO_COVER_FEE",
|
|
4648
|
+
InvalidOrderId: "INVALID_ORDER_ID",
|
|
4649
|
+
OrderTooEarlyForReassignment: "ORDER_TOO_EARLY_FOR_REASSIGNMENT",
|
|
4650
|
+
OrderTooLateForReassignment: "ORDER_TOO_LATE_FOR_REASSIGNMENT",
|
|
4651
|
+
ReAssignmentNotRequired: "REASSIGNMENT_NOT_REQUIRED",
|
|
4652
|
+
TipAlreadyGiven: "TIP_ALREADY_GIVEN",
|
|
4653
|
+
CashbackTransferFailed: "CASHBACK_TRANSFER_FAILED",
|
|
4654
|
+
// Order limits
|
|
4655
|
+
DailyBuyOrderLimitExceeded: "DAILY_BUY_ORDER_LIMIT_EXCEEDED",
|
|
4656
|
+
MonthlyBuyOrderLimitExceeded: "MONTHLY_BUY_ORDER_LIMIT_EXCEEDED",
|
|
4657
|
+
SellOrderAmountLimitExceeded: "SELL_ORDER_AMOUNT_LIMIT_EXCEEDED",
|
|
4658
|
+
BuyOrderAmountExceedsLimit: "BUY_ORDER_AMOUNT_EXCEEDS_LIMIT",
|
|
4659
|
+
SellOrderAmountExceedsLimit: "SELL_ORDER_AMOUNT_EXCEEDS_LIMIT",
|
|
4660
|
+
BuyAmountExceedsUsdcLimit: "BUY_AMOUNT_EXCEEDS_USDC_LIMIT",
|
|
4661
|
+
SellAmountExceedsFiatLimit: "SELL_AMOUNT_EXCEEDS_FIAT_LIMIT",
|
|
4662
|
+
DailyVolumeLimitExceeded: "DAILY_VOLUME_LIMIT_EXCEEDED",
|
|
4663
|
+
MonthlyVolumeLimitExceeded: "MONTHLY_VOLUME_LIMIT_EXCEEDED",
|
|
4664
|
+
UserYearlyVolumeLimitExceeded: "USER_YEARLY_VOLUME_LIMIT_EXCEEDED",
|
|
4665
|
+
// Dispute
|
|
4666
|
+
DisputeTimeNotReached: "DISPUTE_TIME_NOT_REACHED",
|
|
4667
|
+
DisputeTimeExpired: "DISPUTE_TIME_EXPIRED",
|
|
4668
|
+
InvalidOrderStatusToRaiseDispute: "INVALID_ORDER_STATUS_TO_RAISE_DISPUTE",
|
|
4669
|
+
DisputeNotRaised: "DISPUTE_NOT_RAISED",
|
|
4670
|
+
CannotRaiseDisputeTwice: "CANNOT_RAISE_DISPUTE_TWICE",
|
|
4671
|
+
DisputeAlreadySettled: "DISPUTE_ALREADY_SETTLED",
|
|
4672
|
+
TransactionIdMismatch: "TRANSACTION_ID_MISMATCH",
|
|
4673
|
+
AccountNumberMismatch: "ACCOUNT_NUMBER_MISMATCH",
|
|
4674
|
+
NotPaidBuyOrder: "NOT_PAID_BUY_ORDER",
|
|
4675
|
+
// Payment channels
|
|
4676
|
+
PaymentChannelNotFound: "PAYMENT_CHANNEL_NOT_FOUND",
|
|
4677
|
+
PaymentChannelNotActive: "PAYMENT_CHANNEL_NOT_ACTIVE",
|
|
4678
|
+
PaymentChannelNotApproved: "PAYMENT_CHANNEL_NOT_APPROVED",
|
|
4679
|
+
PaymentChannelNotRejected: "PAYMENT_CHANNEL_NOT_REJECTED",
|
|
4680
|
+
InvalidPaymentChannelId: "INVALID_PAYMENT_CHANNEL_ID",
|
|
4681
|
+
DuplicatePaymentChannel: "DUPLICATE_PAYMENT_CHANNEL",
|
|
4682
|
+
OldPaymentChannelNotFound: "OLD_PAYMENT_CHANNEL_NOT_FOUND",
|
|
4683
|
+
NewPaymentChannelNotFound: "NEW_PAYMENT_CHANNEL_NOT_FOUND",
|
|
4684
|
+
SamePaymentChannel: "SAME_PAYMENT_CHANNEL",
|
|
4685
|
+
OldPaymentChannelShouldBeInactive: "OLD_PAYMENT_CHANNEL_SHOULD_BE_INACTIVE",
|
|
4686
|
+
NewPaymentChannelShouldBeActive: "NEW_PAYMENT_CHANNEL_SHOULD_BE_ACTIVE",
|
|
4687
|
+
OngoingOrderOnPaymentChannel: "ONGOING_ORDER_ON_PAYMENT_CHANNEL",
|
|
4688
|
+
UpiAlreadySent: "UPI_ALREADY_SENT",
|
|
4689
|
+
InvalidOrderUpi: "INVALID_ORDER_UPI",
|
|
4690
|
+
NoFiatLiquidity: "NO_FIAT_LIQUIDITY",
|
|
4691
|
+
// Merchant
|
|
4692
|
+
NotEnoughEligibleMerchants: "NOT_ENOUGH_ELIGIBLE_MERCHANTS",
|
|
4693
|
+
MerchantNotRegistered: "MERCHANT_NOT_REGISTERED",
|
|
4694
|
+
MerchantNotApproved: "MERCHANT_NOT_APPROVED",
|
|
4695
|
+
MerchantAlreadyRegistered: "MERCHANT_ALREADY_REGISTERED",
|
|
4696
|
+
MerchantAlreadyRejected: "MERCHANT_ALREADY_REJECTED",
|
|
4697
|
+
MerchantBlacklisted: "MERCHANT_BLACKLISTED",
|
|
4698
|
+
MerchantNotBlacklisted: "MERCHANT_NOT_BLACKLISTED",
|
|
4699
|
+
MerchantAlreadyBlacklisted: "MERCHANT_ALREADY_BLACKLISTED",
|
|
4700
|
+
MerchantHasOngoingOrders: "MERCHANT_HAS_ONGOING_ORDERS",
|
|
4701
|
+
MerchantNotFullfilledEligibilityThreshold: "MERCHANT_NOT_FULLFILLED_ELIGIBILITY_THRESHOLD",
|
|
4702
|
+
InvalidMerchant: "INVALID_MERCHANT",
|
|
4703
|
+
// Staking / unstaking
|
|
4704
|
+
StakeAmountTooLow: "STAKE_AMOUNT_TOO_LOW",
|
|
4705
|
+
AdditionalStakeNotAllowed: "ADDITIONAL_STAKE_NOT_ALLOWED",
|
|
4706
|
+
UnstakeRequestPending: "UNSTAKE_REQUEST_PENDING",
|
|
4707
|
+
UnstakeRequestNotPending: "UNSTAKE_REQUEST_NOT_PENDING",
|
|
4708
|
+
UnstakeAmountExceeded: "UNSTAKE_AMOUNT_EXCEEDED",
|
|
4709
|
+
ZeroUnstakeAmount: "ZERO_UNSTAKE_AMOUNT",
|
|
4710
|
+
NoWithdrawableAmount: "NO_WITHDRAWABLE_AMOUNT",
|
|
4711
|
+
NoStake: "NO_STAKE",
|
|
4712
|
+
NoStakers: "NO_STAKERS",
|
|
4713
|
+
InsufficientStakedAmount: "INSUFFICIENT_STAKED_AMOUNT",
|
|
4714
|
+
CooldownNotPassed: "COOLDOWN_NOT_PASSED",
|
|
4715
|
+
ClaimableRewardsNotAvailable: "CLAIMABLE_REWARDS_NOT_AVAILABLE",
|
|
4716
|
+
// Delegation
|
|
4717
|
+
ExitWouldBreachDelegationInvariant: "EXIT_WOULD_BREACH_DELEGATION_INVARIANT",
|
|
4718
|
+
AggregateDelegationExceedsTotalStaked: "AGGREGATE_DELEGATION_EXCEEDS_TOTAL_STAKED",
|
|
4719
|
+
InsufficientMerchantRewards: "INSUFFICIENT_MERCHANT_REWARDS",
|
|
4720
|
+
// Migration
|
|
4721
|
+
InvalidMigrationStatus: "INVALID_MIGRATION_STATUS",
|
|
4722
|
+
MigrationRequestNotPending: "MIGRATION_REQUEST_NOT_PENDING",
|
|
4723
|
+
MigrationAlreadyRequested: "MIGRATION_ALREADY_REQUESTED",
|
|
4724
|
+
// Token / currency
|
|
4725
|
+
TokenAlreadyExists: "TOKEN_ALREADY_EXISTS",
|
|
4726
|
+
TokenNotFound: "TOKEN_NOT_FOUND",
|
|
4727
|
+
TokenEmpty: "TOKEN_EMPTY",
|
|
4728
|
+
CurrencyNotSupported: "CURRENCY_NOT_SUPPORTED",
|
|
4729
|
+
InvalidCurrency: "INVALID_CURRENCY",
|
|
4730
|
+
// USDC / transfer
|
|
4731
|
+
UsdtTransferFailed: "USDC_TRANSFER_FAILED",
|
|
4732
|
+
UsdtTransferFailedWithErrorMessage: "USDC_TRANSFER_FAILED_WITH_ERROR_MESSAGE",
|
|
4733
|
+
UsdtTransferFailedWithPanic: "USDC_TRANSFER_FAILED_WITH_PANIC",
|
|
4734
|
+
InsufficientAllowance: "INSUFFICIENT_ALLOWANCE",
|
|
4735
|
+
// ZK Passport
|
|
4736
|
+
ZKPassportVerifierNotSet: "ZK_PASSPORT_VERIFIER_NOT_SET",
|
|
4737
|
+
ZKPassportDomainEmpty: "ZK_PASSPORT_DOMAIN_EMPTY",
|
|
4738
|
+
ZKPassportScopeEmpty: "ZK_PASSPORT_SCOPE_EMPTY",
|
|
4739
|
+
PassportAlreadyVerified: "PASSPORT_ALREADY_VERIFIED",
|
|
4740
|
+
ZKPassportProofInvalid: "ZK_PASSPORT_PROOF_INVALID",
|
|
4741
|
+
ZKPassportIdentifierAlreadyVerified: "ZK_PASSPORT_IDENTIFIER_ALREADY_VERIFIED",
|
|
4742
|
+
ZKPassportInvalidScope: "ZK_PASSPORT_INVALID_SCOPE",
|
|
4743
|
+
ZKPassportUnexpectedSender: "ZK_PASSPORT_UNEXPECTED_SENDER",
|
|
4744
|
+
ZKPassportAgeBelowMinimum: "ZK_PASSPORT_AGE_BELOW_MINIMUM",
|
|
4745
|
+
ZKPassportMinAgeTooHigh: "ZK_PASSPORT_MIN_AGE_TOO_HIGH",
|
|
4746
|
+
// Chainlink / oracle
|
|
4747
|
+
UnexpectedRequestId: "UNEXPECTED_REQUEST_ID",
|
|
4748
|
+
OnlyRouterCanFulfill: "ONLY_ROUTER_CAN_FULFILL",
|
|
4749
|
+
RequestFailed: "REQUEST_FAILED",
|
|
4750
|
+
SourceCodeMismatch: "SOURCE_CODE_MISMATCH",
|
|
4751
|
+
ZeroMarketPrice: "ZERO_MARKET_PRICE",
|
|
4752
|
+
InvalidComputedPrices: "INVALID_COMPUTED_PRICES",
|
|
4753
|
+
NotPriceUpdaterForCurrency: "NOT_PRICE_UPDATER_FOR_CURRENCY",
|
|
4754
|
+
ThresholdNotConfigured: "THRESHOLD_NOT_CONFIGURED",
|
|
4755
|
+
SlippageExceeded: "SLIPPAGE_EXCEEDED",
|
|
4756
|
+
// Reputation / verification
|
|
4757
|
+
UserHasNoReputation: "USER_HAS_NO_REPUTATION",
|
|
4758
|
+
ZeroReputationPoints: "ZERO_REPUTATION_POINTS",
|
|
4759
|
+
NoReputation: "NO_REPUTATION",
|
|
4760
|
+
InsufficientRP: "INSUFFICIENT_RP",
|
|
4761
|
+
NullifierAlreadyVerified: "NULLIFIER_ALREADY_VERIFIED",
|
|
4762
|
+
VerificationFailed: "VERIFICATION_FAILED",
|
|
4763
|
+
InvalidSocialPlatform: "INVALID_SOCIAL_PLATFORM",
|
|
4764
|
+
SocialAlreadyVerified: "SOCIAL_ALREADY_VERIFIED",
|
|
4765
|
+
YearFieldNotInProof: "YEAR_FIELD_NOT_IN_PROOF",
|
|
4766
|
+
UserIdFieldNotInProof: "USER_ID_FIELD_NOT_IN_PROOF",
|
|
4767
|
+
UserIdAlreadyVerified: "USER_ID_ALREADY_VERIFIED",
|
|
4768
|
+
UsernameAlreadyVerified: "USERNAME_ALREADY_VERIFIED",
|
|
4769
|
+
UsernameNotInProof: "USERNAME_NOT_IN_PROOF",
|
|
4770
|
+
LinkedInOnlyRpUpdates: "LINKEDIN_ONLY_RP_UPDATES",
|
|
4771
|
+
FacebookOnlyRpUpdates: "FACEBOOK_ONLY_RP_UPDATES",
|
|
4772
|
+
// Voting / referral
|
|
4773
|
+
AlreadyReferred: "ALREADY_REFERRED",
|
|
4774
|
+
SelfReferralNotAllowed: "SELF_REFERRAL_NOT_ALLOWED",
|
|
4775
|
+
NotEligibleToRefer: "NOT_ELIGIBLE_TO_REFER",
|
|
4776
|
+
MerchantMonthlyReferralLimitReached: "MERCHANT_MONTHLY_REFERRAL_LIMIT_REACHED",
|
|
4777
|
+
NoRecommender: "NO_RECOMMENDER",
|
|
4778
|
+
RecommendationAlreadyClaimed: "RECOMMENDATION_ALREADY_CLAIMED",
|
|
4779
|
+
CannotVoteYourself: "CANNOT_VOTE_YOURSELF",
|
|
4780
|
+
VotesPerEpochExceeded: "VOTES_PER_EPOCH_EXCEEDED",
|
|
4781
|
+
AlreadyVoted: "ALREADY_VOTED",
|
|
4782
|
+
FunctionNotFound: "FUNCTION_NOT_FOUND",
|
|
4783
|
+
// Campaign
|
|
4784
|
+
CampaignNotActive: "CAMPAIGN_NOT_ACTIVE",
|
|
4785
|
+
InvalidManagerDetails: "INVALID_MANAGER_DETAILS",
|
|
4786
|
+
UnclaimedRewardsExist: "UNCLAIMED_REWARDS_EXIST",
|
|
4787
|
+
RewardAlreadyClaimed: "REWARD_ALREADY_CLAIMED",
|
|
4788
|
+
OnlyNewUsersAllowed: "ONLY_NEW_USERS_ALLOWED",
|
|
4789
|
+
ManagerNotFound: "MANAGER_NOT_FOUND",
|
|
4790
|
+
ManagerInactive: "MANAGER_INACTIVE",
|
|
4791
|
+
NoRewards: "NO_REWARDS",
|
|
4792
|
+
InvalidCampaignId: "INVALID_CAMPAIGN_ID",
|
|
4793
|
+
CannotClaimRevenueForCurrentMonth: "CANNOT_CLAIM_REVENUE_FOR_CURRENT_MONTH",
|
|
4794
|
+
// Referral reward config
|
|
4795
|
+
RewardPercentageTooHigh: "REWARD_PERCENTAGE_TOO_HIGH",
|
|
4796
|
+
// Signature / nonce
|
|
4797
|
+
NonceAlreadyUsed: "NONCE_ALREADY_USED",
|
|
4798
|
+
SignatureValidationFailed: "SIGNATURE_VALIDATION_FAILED",
|
|
4799
|
+
// Misc
|
|
4800
|
+
InvalidAddress: "INVALID_ADDRESS",
|
|
4801
|
+
InvalidBlockAmount: "INVALID_BLOCK_AMOUNT",
|
|
4802
|
+
InvalidAmount: "INVALID_AMOUNT",
|
|
4803
|
+
InvalidInput: "INVALID_INPUT",
|
|
4804
|
+
InvalidStatusTransition: "INVALID_STATUS_TRANSITION",
|
|
4805
|
+
ArrayLengthMismatch: "ARRAY_LENGTH_MISMATCH",
|
|
4806
|
+
UserIsBlacklisted: "USER_IS_BLACKLISTED",
|
|
4807
|
+
ZeroAddress: "ZERO_ADDRESS",
|
|
4808
|
+
ReentrancyGuard: "REENTRANCY_GUARD",
|
|
4809
|
+
BatchTooLarge: "BATCH_TOO_LARGE",
|
|
4810
|
+
UnderflowSubtraction: "UNDERFLOW_SUBTRACTION",
|
|
4811
|
+
TargetLongerThanData: "TARGET_LONGER_THAN_DATA"
|
|
4812
|
+
};
|
|
4813
|
+
var hexContractErrors = {
|
|
4814
|
+
// Access control
|
|
4815
|
+
"0x7bfa4b9f": contractErrors.NotAdmin,
|
|
4816
|
+
"0x16c726b1": contractErrors.NotSuperAdmin,
|
|
4817
|
+
"0xea8e4eb5": contractErrors.NotAuthorized,
|
|
4818
|
+
"0x29c3b7ee": contractErrors.NotSelf,
|
|
4819
|
+
"0x584a7938": contractErrors.NotWhitelisted,
|
|
4820
|
+
"0xa8143fbc": contractErrors.NotCircleAdmin,
|
|
4821
|
+
// Circle / community management
|
|
4822
|
+
"0x430f13b3": contractErrors.InvalidName,
|
|
4823
|
+
"0xe7cbf75a": contractErrors.InvalidCommunityUrl,
|
|
4824
|
+
"0x3762bfee": contractErrors.InvalidAdminCommunityUrl,
|
|
4825
|
+
"0x201c1ffc": contractErrors.AdminAlreadyHasCircle,
|
|
4826
|
+
"0x6540a51d": contractErrors.CircleNameAlreadyTaken,
|
|
4827
|
+
"0xcadc6786": contractErrors.P2PStakeConfigNotSet,
|
|
4828
|
+
"0x78317f44": contractErrors.InsufficientP2PStake,
|
|
4829
|
+
"0x18eda032": contractErrors.P2PTokenNotSet,
|
|
4830
|
+
"0xdab11ea6": contractErrors.P2PUnstakeRequestPending,
|
|
4831
|
+
"0xeb1ce40b": contractErrors.NoP2PUnstakeRequest,
|
|
4832
|
+
"0xbf2d0ba1": contractErrors.P2PUnstakeCooldownNotPassed,
|
|
4833
|
+
"0x06b663af": contractErrors.SlashAmountExceedsStake,
|
|
4834
|
+
"0xff9b022c": contractErrors.CircleNotActive,
|
|
4835
|
+
"0x3d90c0a6": contractErrors.InvalidCircleId,
|
|
4836
|
+
"0xfb42a67d": contractErrors.CurrencyMismatch,
|
|
4837
|
+
"0xf2775265": contractErrors.CircleFull,
|
|
4838
|
+
"0x784b6c3c": contractErrors.CircleIdMismatch,
|
|
4839
|
+
"0xee240e49": contractErrors.DuplicateAccountName,
|
|
4840
|
+
"0x2ef13105": contractErrors.EmptyName,
|
|
4841
|
+
"0x1b5433c8": contractErrors.AccountBoundToAnotherCircle,
|
|
4842
|
+
"0x549e2555": contractErrors.ExitAmountExceededCircleBalance,
|
|
4843
|
+
"0x865b21e1": contractErrors.UndelegationAmountTooHigh,
|
|
4844
|
+
// Exchange / order lifecycle
|
|
4845
|
+
"0x4bbac5de": contractErrors.ExchangeNotOperational,
|
|
4846
|
+
"0x58db8ed6": contractErrors.OrderNotPlaced,
|
|
4847
|
+
"0x1e3b9629": contractErrors.OrderNotPaid,
|
|
4848
|
+
"0x181b1b2e": contractErrors.OrderStatusInvalid,
|
|
4849
|
+
"0xc56873ba": contractErrors.OrderExpired,
|
|
4850
|
+
"0x7f61b868": contractErrors.OrderAlreadyPaid,
|
|
4851
|
+
"0x03683687": contractErrors.OrderAlreadyCompleted,
|
|
4852
|
+
"0x688c176f": contractErrors.InvalidOrderType,
|
|
4853
|
+
"0x2e757a60": contractErrors.OrderTypeIncorrect,
|
|
4854
|
+
"0x6b1b90b4": contractErrors.OrderNotAccepted,
|
|
4855
|
+
"0x1775c43e": contractErrors.OrderNotAssigned,
|
|
4856
|
+
"0xf42e41a1": contractErrors.OrderAmountExceedsLimit,
|
|
4857
|
+
"0x93845d68": contractErrors.InvalidOrderAmount,
|
|
4858
|
+
"0x138b9d5a": contractErrors.InvalidOrderAmountToCoverFee,
|
|
4859
|
+
"0x5d706033": contractErrors.InvalidOrderId,
|
|
4860
|
+
"0xbb776720": contractErrors.OrderTooEarlyForReassignment,
|
|
4861
|
+
"0x20d5910f": contractErrors.OrderTooLateForReassignment,
|
|
4862
|
+
"0xccd87bf0": contractErrors.ReAssignmentNotRequired,
|
|
4863
|
+
"0xb20277f8": contractErrors.TipAlreadyGiven,
|
|
4864
|
+
"0xdf9f707c": contractErrors.CashbackTransferFailed,
|
|
4865
|
+
// Order limits
|
|
4866
|
+
"0xe595a7bf": contractErrors.DailyBuyOrderLimitExceeded,
|
|
4867
|
+
"0x675dbc86": contractErrors.MonthlyBuyOrderLimitExceeded,
|
|
4868
|
+
"0x64301cb8": contractErrors.SellOrderAmountLimitExceeded,
|
|
4869
|
+
"0x91da284f": contractErrors.BuyOrderAmountExceedsLimit,
|
|
4870
|
+
"0xb407b9ec": contractErrors.SellOrderAmountExceedsLimit,
|
|
4871
|
+
"0x4b29cf0a": contractErrors.BuyAmountExceedsUsdcLimit,
|
|
4872
|
+
"0xbba2edf9": contractErrors.SellAmountExceedsFiatLimit,
|
|
4873
|
+
"0x7e2ee654": contractErrors.DailyVolumeLimitExceeded,
|
|
4874
|
+
"0x49de1789": contractErrors.MonthlyVolumeLimitExceeded,
|
|
4875
|
+
"0xb14a1ff3": contractErrors.UserYearlyVolumeLimitExceeded,
|
|
4876
|
+
// Dispute
|
|
4877
|
+
"0x07a2454f": contractErrors.DisputeTimeNotReached,
|
|
4878
|
+
"0xb28c3e29": contractErrors.DisputeTimeExpired,
|
|
4879
|
+
"0x2a829f07": contractErrors.InvalidOrderStatusToRaiseDispute,
|
|
4880
|
+
"0x88d039ce": contractErrors.DisputeNotRaised,
|
|
4881
|
+
"0x3764a75c": contractErrors.CannotRaiseDisputeTwice,
|
|
4882
|
+
"0x866e9f89": contractErrors.DisputeAlreadySettled,
|
|
4883
|
+
"0x6131d13d": contractErrors.TransactionIdMismatch,
|
|
4884
|
+
"0x8ec051b8": contractErrors.AccountNumberMismatch,
|
|
4885
|
+
"0xf8bfad32": contractErrors.NotPaidBuyOrder,
|
|
4886
|
+
// Payment channels
|
|
4887
|
+
"0x552ff5ec": contractErrors.PaymentChannelNotFound,
|
|
4888
|
+
"0xfccd93cf": contractErrors.PaymentChannelNotActive,
|
|
4889
|
+
"0x6764f4d6": contractErrors.PaymentChannelNotApproved,
|
|
4890
|
+
"0xab284291": contractErrors.PaymentChannelNotRejected,
|
|
4891
|
+
"0x99c8ef4d": contractErrors.InvalidPaymentChannelId,
|
|
4892
|
+
"0x0569ab3e": contractErrors.DuplicatePaymentChannel,
|
|
4893
|
+
"0xff4f83ca": contractErrors.OldPaymentChannelNotFound,
|
|
4894
|
+
"0xb1198199": contractErrors.NewPaymentChannelNotFound,
|
|
4895
|
+
"0xc905b99a": contractErrors.SamePaymentChannel,
|
|
4896
|
+
"0xcedb41f1": contractErrors.OldPaymentChannelShouldBeInactive,
|
|
4897
|
+
"0x487add97": contractErrors.NewPaymentChannelShouldBeActive,
|
|
4898
|
+
"0x6d4c3f9e": contractErrors.OngoingOrderOnPaymentChannel,
|
|
4899
|
+
"0xc1654697": contractErrors.UpiAlreadySent,
|
|
4900
|
+
"0xaa60ec26": contractErrors.InvalidOrderUpi,
|
|
4901
|
+
"0x81c2b982": contractErrors.NoFiatLiquidity,
|
|
4902
|
+
// Merchant
|
|
4903
|
+
"0x5d04ff4c": contractErrors.NotEnoughEligibleMerchants,
|
|
4904
|
+
"0xa6af7ebe": contractErrors.MerchantNotRegistered,
|
|
4905
|
+
"0x7290a612": contractErrors.MerchantNotApproved,
|
|
4906
|
+
"0xf4a1e014": contractErrors.MerchantAlreadyRegistered,
|
|
4907
|
+
"0x8713aaba": contractErrors.MerchantAlreadyRejected,
|
|
4908
|
+
"0x9ae55bc7": contractErrors.MerchantBlacklisted,
|
|
4909
|
+
"0x0ee0b659": contractErrors.MerchantNotBlacklisted,
|
|
4910
|
+
"0x5f765689": contractErrors.MerchantAlreadyBlacklisted,
|
|
4911
|
+
"0x9c54e5a8": contractErrors.MerchantHasOngoingOrders,
|
|
4912
|
+
"0x70d753bd": contractErrors.MerchantNotFullfilledEligibilityThreshold,
|
|
4913
|
+
"0xc0b6c919": contractErrors.InvalidMerchant,
|
|
4914
|
+
// Staking / unstaking
|
|
4915
|
+
"0x3fd2347e": contractErrors.StakeAmountTooLow,
|
|
4916
|
+
"0x703cde0a": contractErrors.AdditionalStakeNotAllowed,
|
|
4917
|
+
"0xa9de99ae": contractErrors.UnstakeRequestPending,
|
|
4918
|
+
"0x0b7c70f3": contractErrors.UnstakeRequestNotPending,
|
|
4919
|
+
"0xe665491f": contractErrors.UnstakeAmountExceeded,
|
|
4920
|
+
"0x2d3087f9": contractErrors.ZeroUnstakeAmount,
|
|
4921
|
+
"0x1b1d7861": contractErrors.NoWithdrawableAmount,
|
|
4922
|
+
"0xcacf989a": contractErrors.NoStake,
|
|
4923
|
+
"0x21311aa3": contractErrors.NoStakers,
|
|
4924
|
+
"0xd06ff88e": contractErrors.InsufficientStakedAmount,
|
|
4925
|
+
"0x9ab7872d": contractErrors.CooldownNotPassed,
|
|
4926
|
+
"0x73380d99": contractErrors.ClaimableRewardsNotAvailable,
|
|
4927
|
+
// Delegation
|
|
4928
|
+
"0xec4b3ce6": contractErrors.ExitWouldBreachDelegationInvariant,
|
|
4929
|
+
"0x8f90a426": contractErrors.AggregateDelegationExceedsTotalStaked,
|
|
4930
|
+
"0x2cc11576": contractErrors.InsufficientMerchantRewards,
|
|
4931
|
+
// Migration
|
|
4932
|
+
"0x92aa7d0f": contractErrors.InvalidMigrationStatus,
|
|
4933
|
+
"0x7ff47425": contractErrors.MigrationRequestNotPending,
|
|
4934
|
+
"0x88ddec46": contractErrors.MigrationAlreadyRequested,
|
|
4935
|
+
// Token / currency
|
|
4936
|
+
"0xc991cbb1": contractErrors.TokenAlreadyExists,
|
|
4937
|
+
"0xcbdb7b30": contractErrors.TokenNotFound,
|
|
4938
|
+
"0x9f11a53f": contractErrors.TokenEmpty,
|
|
4939
|
+
"0x02a6fdd2": contractErrors.CurrencyNotSupported,
|
|
4940
|
+
"0xf5993428": contractErrors.InvalidCurrency,
|
|
4941
|
+
// USDC / transfer
|
|
4942
|
+
"0x149f9fca": contractErrors.UsdtTransferFailed,
|
|
4943
|
+
"0x47bfece5": contractErrors.UsdtTransferFailedWithErrorMessage,
|
|
4944
|
+
"0x279bbc0c": contractErrors.UsdtTransferFailedWithPanic,
|
|
4945
|
+
"0xfb8f41b2": contractErrors.InsufficientAllowance,
|
|
4946
|
+
// ZK Passport
|
|
4947
|
+
"0xfd8d4a6d": contractErrors.ZKPassportVerifierNotSet,
|
|
4948
|
+
"0xb87078f9": contractErrors.ZKPassportDomainEmpty,
|
|
4949
|
+
"0x5eadc4c2": contractErrors.ZKPassportScopeEmpty,
|
|
4950
|
+
"0x7642fe15": contractErrors.PassportAlreadyVerified,
|
|
4951
|
+
"0x1fa24b35": contractErrors.ZKPassportProofInvalid,
|
|
4952
|
+
"0x36bdb7b6": contractErrors.ZKPassportIdentifierAlreadyVerified,
|
|
4953
|
+
"0xd13a7934": contractErrors.ZKPassportInvalidScope,
|
|
4954
|
+
"0x69f5bfe7": contractErrors.ZKPassportUnexpectedSender,
|
|
4955
|
+
"0x0464115c": contractErrors.ZKPassportAgeBelowMinimum,
|
|
4956
|
+
"0x48183836": contractErrors.ZKPassportMinAgeTooHigh,
|
|
4957
|
+
// Chainlink / oracle
|
|
4958
|
+
"0x7f73f237": contractErrors.UnexpectedRequestId,
|
|
4959
|
+
"0xab948796": contractErrors.OnlyRouterCanFulfill,
|
|
4960
|
+
"0x61982c98": contractErrors.RequestFailed,
|
|
4961
|
+
"0xab66be18": contractErrors.SourceCodeMismatch,
|
|
4962
|
+
"0xff2826ef": contractErrors.ZeroMarketPrice,
|
|
4963
|
+
"0xbb6c216c": contractErrors.InvalidComputedPrices,
|
|
4964
|
+
"0x3a8fbef4": contractErrors.NotPriceUpdaterForCurrency,
|
|
4965
|
+
"0x3e2c36f2": contractErrors.ThresholdNotConfigured,
|
|
4966
|
+
"0x71c4efed": contractErrors.SlippageExceeded,
|
|
4967
|
+
// Reputation / verification
|
|
4968
|
+
"0x071ea33c": contractErrors.UserHasNoReputation,
|
|
4969
|
+
"0xd2e1e6e0": contractErrors.ZeroReputationPoints,
|
|
4970
|
+
"0x3c0ca622": contractErrors.NoReputation,
|
|
4971
|
+
"0x412dd2b1": contractErrors.InsufficientRP,
|
|
4972
|
+
"0x0f165e7b": contractErrors.NullifierAlreadyVerified,
|
|
4973
|
+
"0x439cc0cd": contractErrors.VerificationFailed,
|
|
4974
|
+
"0x2366073b": contractErrors.InvalidSocialPlatform,
|
|
4975
|
+
"0x2f850b6b": contractErrors.SocialAlreadyVerified,
|
|
4976
|
+
"0x466f52a8": contractErrors.YearFieldNotInProof,
|
|
4977
|
+
"0x4d460588": contractErrors.UserIdFieldNotInProof,
|
|
4978
|
+
"0xa18ea4e8": contractErrors.UserIdAlreadyVerified,
|
|
4979
|
+
"0x69470b13": contractErrors.UsernameAlreadyVerified,
|
|
4980
|
+
"0x8390b2dd": contractErrors.UsernameNotInProof,
|
|
4981
|
+
"0xef053cf4": contractErrors.LinkedInOnlyRpUpdates,
|
|
4982
|
+
"0x355b0709": contractErrors.FacebookOnlyRpUpdates,
|
|
4983
|
+
// Voting / referral
|
|
4984
|
+
"0x7aabdfe3": contractErrors.AlreadyReferred,
|
|
4985
|
+
"0x83463f4a": contractErrors.SelfReferralNotAllowed,
|
|
4986
|
+
"0x69f6994a": contractErrors.NotEligibleToRefer,
|
|
4987
|
+
"0x1b19ad97": contractErrors.MerchantMonthlyReferralLimitReached,
|
|
4988
|
+
"0x944a2241": contractErrors.NoRecommender,
|
|
4989
|
+
"0x0ece93a6": contractErrors.RecommendationAlreadyClaimed,
|
|
4990
|
+
"0x74785d0f": contractErrors.CannotVoteYourself,
|
|
4991
|
+
"0xc26d5f75": contractErrors.VotesPerEpochExceeded,
|
|
4992
|
+
"0x7c9a1cf9": contractErrors.AlreadyVoted,
|
|
4993
|
+
"0x403e7fa6": contractErrors.FunctionNotFound,
|
|
4994
|
+
// Campaign
|
|
4995
|
+
"0x7a551e38": contractErrors.CampaignNotActive,
|
|
4996
|
+
"0x668ca75d": contractErrors.InvalidManagerDetails,
|
|
4997
|
+
"0x2f950361": contractErrors.UnclaimedRewardsExist,
|
|
4998
|
+
"0x626b7c00": contractErrors.RewardAlreadyClaimed,
|
|
4999
|
+
"0x902ade67": contractErrors.OnlyNewUsersAllowed,
|
|
5000
|
+
"0x22a5e34b": contractErrors.ManagerNotFound,
|
|
5001
|
+
"0xa1610e37": contractErrors.ManagerInactive,
|
|
5002
|
+
"0x3fb087f4": contractErrors.NoRewards,
|
|
5003
|
+
"0x3eedee0f": contractErrors.InvalidCampaignId,
|
|
5004
|
+
"0x302c5138": contractErrors.CannotClaimRevenueForCurrentMonth,
|
|
5005
|
+
// Referral reward config
|
|
5006
|
+
"0x074a6991": contractErrors.RewardPercentageTooHigh,
|
|
5007
|
+
// Signature / nonce
|
|
5008
|
+
"0x1fb09b80": contractErrors.NonceAlreadyUsed,
|
|
5009
|
+
"0x2fdec18b": contractErrors.SignatureValidationFailed,
|
|
5010
|
+
// Misc
|
|
5011
|
+
"0xe6c4247b": contractErrors.InvalidAddress,
|
|
5012
|
+
"0x3eb17c88": contractErrors.InvalidBlockAmount,
|
|
5013
|
+
"0x2c5211c6": contractErrors.InvalidAmount,
|
|
5014
|
+
"0xb4fa3fb3": contractErrors.InvalidInput,
|
|
5015
|
+
"0x1117a646": contractErrors.InvalidStatusTransition,
|
|
5016
|
+
"0xa24a13a6": contractErrors.ArrayLengthMismatch,
|
|
5017
|
+
"0xebb6f34b": contractErrors.UserIsBlacklisted,
|
|
5018
|
+
"0xd92e233d": contractErrors.ZeroAddress,
|
|
5019
|
+
"0x8beb9d16": contractErrors.ReentrancyGuard,
|
|
5020
|
+
"0xbb1cb70b": contractErrors.BatchTooLarge,
|
|
5021
|
+
"0xd97cf1ba": contractErrors.UnderflowSubtraction,
|
|
5022
|
+
"0xc9b16952": contractErrors.TargetLongerThanData
|
|
5023
|
+
};
|
|
5024
|
+
function parseContractError(error) {
|
|
5025
|
+
if (!error) return null;
|
|
5026
|
+
if (typeof error === "string") {
|
|
5027
|
+
const direct = hexContractErrors[error];
|
|
5028
|
+
if (direct) return direct;
|
|
5029
|
+
const hexMatch = error.match(/0x[a-fA-F0-9]{8}/);
|
|
5030
|
+
if (hexMatch) return hexContractErrors[hexMatch[0]] ?? null;
|
|
5031
|
+
return null;
|
|
5032
|
+
}
|
|
5033
|
+
if (typeof error === "object") {
|
|
5034
|
+
const e = error;
|
|
5035
|
+
if (e.data) {
|
|
5036
|
+
const hexCode = typeof e.data === "string" ? e.data : e.data.data;
|
|
5037
|
+
if (hexCode) {
|
|
5038
|
+
const match = hexContractErrors[hexCode];
|
|
5039
|
+
if (match) return match;
|
|
5040
|
+
}
|
|
5041
|
+
}
|
|
5042
|
+
if (typeof e.message === "string") {
|
|
5043
|
+
const hexMatch = e.message.match(/0x[a-fA-F0-9]{8}/);
|
|
5044
|
+
if (hexMatch) {
|
|
5045
|
+
const match = hexContractErrors[hexMatch[0]];
|
|
5046
|
+
if (match) return match;
|
|
5047
|
+
}
|
|
5048
|
+
const jsonMatch = e.message.match(/\{[\s\S]*\}/);
|
|
5049
|
+
if (jsonMatch) {
|
|
5050
|
+
try {
|
|
5051
|
+
const parsed = JSON.parse(jsonMatch[0]);
|
|
5052
|
+
const embedded = parseContractError(parsed);
|
|
5053
|
+
if (embedded) return embedded;
|
|
5054
|
+
} catch {
|
|
5055
|
+
}
|
|
5056
|
+
}
|
|
5057
|
+
}
|
|
5058
|
+
if (e.cause) return parseContractError(e.cause);
|
|
5059
|
+
}
|
|
5060
|
+
return null;
|
|
5061
|
+
}
|
|
5062
|
+
|
|
4384
5063
|
// src/contracts/order-flow/index.ts
|
|
4385
5064
|
import { ResultAsync as ResultAsync6 } from "neverthrow";
|
|
4386
5065
|
|
|
@@ -5201,12 +5880,17 @@ export {
|
|
|
5201
5880
|
OrdersError,
|
|
5202
5881
|
cipherParse,
|
|
5203
5882
|
cipherStringify,
|
|
5883
|
+
contractErrorMessages,
|
|
5884
|
+
contractErrors,
|
|
5204
5885
|
createInMemoryRelayStore,
|
|
5205
5886
|
createLocalStorageRelayStore,
|
|
5206
5887
|
createOrders,
|
|
5207
5888
|
createRelayIdentity,
|
|
5208
5889
|
decryptPaymentAddress,
|
|
5209
|
-
encryptPaymentAddress
|
|
5890
|
+
encryptPaymentAddress,
|
|
5891
|
+
getContractErrorMessage,
|
|
5892
|
+
hexContractErrors,
|
|
5893
|
+
parseContractError
|
|
5210
5894
|
};
|
|
5211
5895
|
/*! Bundled license information:
|
|
5212
5896
|
|