@aura-payments/sdk 2.1.0 → 2.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/index.d.mts +471 -2
- package/dist/index.d.ts +471 -2
- package/dist/index.js +181 -21
- package/dist/index.mjs +177 -20
- package/package.json +14 -2
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -558,6 +558,217 @@ declare class Escrows {
|
|
|
558
558
|
getDispute(escrowId: string, disputeId: string): Promise<Dispute>;
|
|
559
559
|
}
|
|
560
560
|
|
|
561
|
+
/**
|
|
562
|
+
* Insights types for the Aura Payments SDK
|
|
563
|
+
*
|
|
564
|
+
* Mirrors the platform routes under `app/api/v1/insights/`:
|
|
565
|
+
* GET /v1/insights/overview KPIs for a period, with change vs the prior one
|
|
566
|
+
* GET /v1/insights/forecast ML forecast for a metric (Growth+ gated)
|
|
567
|
+
* GET /v1/insights/audit paginated audit log
|
|
568
|
+
*
|
|
569
|
+
* All three wrap their payload in `{data, meta}`, which the client unwraps, so
|
|
570
|
+
* these types describe the inner payload.
|
|
571
|
+
*
|
|
572
|
+
* `POST /v1/insights/audit/export` is not modelled: it returns an async job id
|
|
573
|
+
* that must be polled and then downloaded — a multi-step flow of its own.
|
|
574
|
+
*/
|
|
575
|
+
/** Period selector shared by the overview and audit routes. */
|
|
576
|
+
type InsightsPeriod = 'today' | '7d' | '30d' | '90d' | 'custom';
|
|
577
|
+
/** A KPI with its change against the previous period. */
|
|
578
|
+
interface MetricValue {
|
|
579
|
+
value: number;
|
|
580
|
+
/** Percentage change vs the previous period. */
|
|
581
|
+
change: number;
|
|
582
|
+
previousValue: number;
|
|
583
|
+
}
|
|
584
|
+
interface SparklinePoint {
|
|
585
|
+
/** ISO 8601 datetime. */
|
|
586
|
+
timestamp: string;
|
|
587
|
+
value: number;
|
|
588
|
+
}
|
|
589
|
+
interface VolumeBarPoint {
|
|
590
|
+
label: string;
|
|
591
|
+
value: number;
|
|
592
|
+
count: number;
|
|
593
|
+
}
|
|
594
|
+
interface InsightsOverview {
|
|
595
|
+
/** Resolved window for the requested period; both ISO 8601 datetimes. */
|
|
596
|
+
period: {
|
|
597
|
+
start: string;
|
|
598
|
+
end: string;
|
|
599
|
+
};
|
|
600
|
+
metrics: {
|
|
601
|
+
revenue: MetricValue;
|
|
602
|
+
transactions: MetricValue;
|
|
603
|
+
activeEscrows: MetricValue;
|
|
604
|
+
commissions: MetricValue;
|
|
605
|
+
};
|
|
606
|
+
charts: {
|
|
607
|
+
revenueSparkline: SparklinePoint[];
|
|
608
|
+
volumeBar: VolumeBarPoint[];
|
|
609
|
+
/** Fraction between 0 and 1 (e.g. 0.982). */
|
|
610
|
+
successRate: number;
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
/** Metrics the forecast route can project. */
|
|
614
|
+
type ForecastMetric = 'revenue' | 'transaction_count' | 'escrow_count' | 'commission' | 'avg_transaction_value';
|
|
615
|
+
/** Forecasting algorithms accepted by the route (it validates an enum). */
|
|
616
|
+
type ForecastAlgorithm = 'linear_regression' | 'moving_average' | 'exponential_smoothing' | 'arima' | 'prophet' | 'ensemble';
|
|
617
|
+
type ForecastPeriod = 'daily' | 'weekly' | 'monthly';
|
|
618
|
+
interface ForecastParams {
|
|
619
|
+
metric: ForecastMetric;
|
|
620
|
+
algorithm?: ForecastAlgorithm;
|
|
621
|
+
period?: ForecastPeriod;
|
|
622
|
+
/** Number of periods to project (1–365). */
|
|
623
|
+
horizon?: number;
|
|
624
|
+
includeHistory?: boolean;
|
|
625
|
+
/** Historical periods to include (1–365). */
|
|
626
|
+
historyPeriods?: number;
|
|
627
|
+
}
|
|
628
|
+
interface TimeSeriesPoint {
|
|
629
|
+
/** ISO 8601 datetime. */
|
|
630
|
+
timestamp: string;
|
|
631
|
+
value: number;
|
|
632
|
+
label?: string;
|
|
633
|
+
}
|
|
634
|
+
interface ForecastPoint {
|
|
635
|
+
/** ISO 8601 date (YYYY-MM-DD). */
|
|
636
|
+
date: string;
|
|
637
|
+
predicted: number;
|
|
638
|
+
/** 5th percentile. */
|
|
639
|
+
lowerBound: number;
|
|
640
|
+
/** 95th percentile. */
|
|
641
|
+
upperBound: number;
|
|
642
|
+
/** Present when the date is in the past, for accuracy tracking. */
|
|
643
|
+
actual?: number;
|
|
644
|
+
}
|
|
645
|
+
interface ForecastSeries {
|
|
646
|
+
metric: ForecastMetric;
|
|
647
|
+
algorithm: ForecastAlgorithm;
|
|
648
|
+
period: ForecastPeriod;
|
|
649
|
+
/** e.g. 0.95 for a 95% confidence interval. */
|
|
650
|
+
confidenceLevel: number;
|
|
651
|
+
historical: TimeSeriesPoint[];
|
|
652
|
+
forecast: ForecastPoint[];
|
|
653
|
+
accuracy: {
|
|
654
|
+
mape: number;
|
|
655
|
+
r2: number;
|
|
656
|
+
trainingPoints: number;
|
|
657
|
+
};
|
|
658
|
+
/** ISO 8601 datetime. */
|
|
659
|
+
generatedAt: string;
|
|
660
|
+
}
|
|
661
|
+
interface ForecastProjection {
|
|
662
|
+
predicted: number;
|
|
663
|
+
lowerBound: number;
|
|
664
|
+
upperBound: number;
|
|
665
|
+
}
|
|
666
|
+
interface ForecastSummary {
|
|
667
|
+
currentPeriod: {
|
|
668
|
+
value: number;
|
|
669
|
+
isActual: boolean;
|
|
670
|
+
changeFromPrevious: number;
|
|
671
|
+
};
|
|
672
|
+
nextPeriod: ForecastProjection;
|
|
673
|
+
next30Days: ForecastProjection;
|
|
674
|
+
next90Days: ForecastProjection;
|
|
675
|
+
/** A qualitative band, not a number. */
|
|
676
|
+
modelConfidence: 'high' | 'medium' | 'low';
|
|
677
|
+
trend: 'up' | 'down' | 'stable';
|
|
678
|
+
}
|
|
679
|
+
interface ForecastResult {
|
|
680
|
+
forecast: ForecastSeries;
|
|
681
|
+
summary: ForecastSummary;
|
|
682
|
+
}
|
|
683
|
+
/** Who or what performed an audited action. */
|
|
684
|
+
type AuditActor = 'user' | 'system' | 'api' | 'cron' | 'webhook';
|
|
685
|
+
interface AuditParams {
|
|
686
|
+
action?: string;
|
|
687
|
+
actor?: AuditActor;
|
|
688
|
+
resourceType?: string;
|
|
689
|
+
resourceId?: string;
|
|
690
|
+
/** Defaults to `30d` server-side. */
|
|
691
|
+
range?: InsightsPeriod;
|
|
692
|
+
/** ISO 8601 datetime; required together with `end` when `range` is `custom`. */
|
|
693
|
+
start?: string;
|
|
694
|
+
/** ISO 8601 datetime; required together with `start` when `range` is `custom`. */
|
|
695
|
+
end?: string;
|
|
696
|
+
/** 1-based page number. */
|
|
697
|
+
page?: number;
|
|
698
|
+
/** Page size, 1–100 (default 50). */
|
|
699
|
+
limit?: number;
|
|
700
|
+
}
|
|
701
|
+
interface AuditEntry {
|
|
702
|
+
id: string;
|
|
703
|
+
action: string;
|
|
704
|
+
actor: AuditActor;
|
|
705
|
+
actorId?: string;
|
|
706
|
+
actorName?: string;
|
|
707
|
+
resourceType: string;
|
|
708
|
+
resourceId: string;
|
|
709
|
+
description: string;
|
|
710
|
+
amountUsdc?: string;
|
|
711
|
+
ipAddress?: string;
|
|
712
|
+
userAgent?: string;
|
|
713
|
+
/** ISO 8601 datetime. */
|
|
714
|
+
timestamp: string;
|
|
715
|
+
/** Checksum linking this entry to the previous one. */
|
|
716
|
+
checksum: string;
|
|
717
|
+
previousChecksum?: string;
|
|
718
|
+
/** Monotonic per-account sequence number; absent on pre-backfill rows. */
|
|
719
|
+
sequenceNo?: number;
|
|
720
|
+
}
|
|
721
|
+
interface AuditSummary {
|
|
722
|
+
totalEntries: number;
|
|
723
|
+
byAction: Record<string, number>;
|
|
724
|
+
byActor: Record<AuditActor, number>;
|
|
725
|
+
last24Hours: number;
|
|
726
|
+
chainIntegrityIssues: number;
|
|
727
|
+
/** ISO 8601 datetime. */
|
|
728
|
+
lastVerified?: string;
|
|
729
|
+
}
|
|
730
|
+
interface AuditResult {
|
|
731
|
+
items: AuditEntry[];
|
|
732
|
+
total: number;
|
|
733
|
+
page: number;
|
|
734
|
+
limit: number;
|
|
735
|
+
hasMore: boolean;
|
|
736
|
+
cursor?: string;
|
|
737
|
+
summary: AuditSummary;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Insights resource for Aura Payments SDK
|
|
742
|
+
*
|
|
743
|
+
* Read-only analytics. `POST /v1/insights/audit/export` is intentionally absent:
|
|
744
|
+
* it returns an async job id that must be polled and then downloaded, which is a
|
|
745
|
+
* multi-step flow rather than a single call.
|
|
746
|
+
*/
|
|
747
|
+
|
|
748
|
+
declare class Insights {
|
|
749
|
+
private client;
|
|
750
|
+
constructor(client: AuraClient);
|
|
751
|
+
/**
|
|
752
|
+
* Revenue, transactions, active escrows and commissions for a period, each
|
|
753
|
+
* with its change against the prior period.
|
|
754
|
+
*
|
|
755
|
+
* The route defaults to `7d`. `start` and `end` are ISO 8601 datetimes and are
|
|
756
|
+
* both required when `period` is `'custom'`.
|
|
757
|
+
*/
|
|
758
|
+
overview(period?: InsightsPeriod, start?: string, end?: string): Promise<InsightsOverview>;
|
|
759
|
+
/**
|
|
760
|
+
* Forecast a metric over a horizon. Gated to Growth+ plans; lower tiers
|
|
761
|
+
* surface a 403 `AuraAPIError`.
|
|
762
|
+
*/
|
|
763
|
+
forecast(params: ForecastParams): Promise<ForecastResult>;
|
|
764
|
+
/**
|
|
765
|
+
* Query the account audit log by action, actor, resource and date range.
|
|
766
|
+
*
|
|
767
|
+
* The route defaults to `range: '30d'`, `page: 1`, `limit: 50`.
|
|
768
|
+
*/
|
|
769
|
+
audit(params?: AuditParams): Promise<AuditResult>;
|
|
770
|
+
}
|
|
771
|
+
|
|
561
772
|
/**
|
|
562
773
|
* Mandate types for Aura Payments SDK.
|
|
563
774
|
*
|
|
@@ -807,6 +1018,64 @@ declare class Policies {
|
|
|
807
1018
|
create(params: CreatePolicyParams, idempotencyKey?: string): Promise<AgentPolicy>;
|
|
808
1019
|
}
|
|
809
1020
|
|
|
1021
|
+
/**
|
|
1022
|
+
* Treasury types for the Aura Payments SDK
|
|
1023
|
+
*
|
|
1024
|
+
* Mirrors `POST /v1/treasury/optimize`, which returns an AI recommendation over
|
|
1025
|
+
* the account's wallet balances and escrow exposure. The route is snake_case and
|
|
1026
|
+
* — unlike the rest of the API — reports balances as JSON **numbers**, not
|
|
1027
|
+
* decimal strings, because it sums Circle balances with `parseFloat` and returns
|
|
1028
|
+
* the raw values. Treat them as display figures, never as settlement amounts.
|
|
1029
|
+
*
|
|
1030
|
+
* `POST /v1/treasury/batch` is deliberately not modelled: it executes 1–10 real
|
|
1031
|
+
* transfers and needs a dedicated confirm/preview flow, not a bare method call.
|
|
1032
|
+
*/
|
|
1033
|
+
interface TreasuryWallet {
|
|
1034
|
+
id: string;
|
|
1035
|
+
address: string;
|
|
1036
|
+
chain: string;
|
|
1037
|
+
/** USDC balance as a number (see the module note on precision). */
|
|
1038
|
+
balance: number;
|
|
1039
|
+
}
|
|
1040
|
+
interface TreasuryRecommendation {
|
|
1041
|
+
action: string;
|
|
1042
|
+
reasoning: string;
|
|
1043
|
+
confidence: number;
|
|
1044
|
+
}
|
|
1045
|
+
interface TreasuryOptimization {
|
|
1046
|
+
/** Total USDC across all non-escrow wallets. */
|
|
1047
|
+
treasury_balance: number;
|
|
1048
|
+
/** USDC locked in funded/locked escrows. */
|
|
1049
|
+
pending_payouts: number;
|
|
1050
|
+
/** `treasury_balance` minus `pending_payouts`. */
|
|
1051
|
+
available: number;
|
|
1052
|
+
active_escrows: number;
|
|
1053
|
+
wallets: TreasuryWallet[];
|
|
1054
|
+
recommendation: TreasuryRecommendation;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* Treasury resource for Aura Payments SDK
|
|
1059
|
+
*
|
|
1060
|
+
* Read-only analysis surface. `POST /v1/treasury/batch` (bulk transfers) is
|
|
1061
|
+
* intentionally absent — it moves real money across 1–10 recipients and needs a
|
|
1062
|
+
* dedicated confirm/preview flow rather than a single method call.
|
|
1063
|
+
*/
|
|
1064
|
+
|
|
1065
|
+
declare class Treasury {
|
|
1066
|
+
private client;
|
|
1067
|
+
constructor(client: AuraClient);
|
|
1068
|
+
/**
|
|
1069
|
+
* Analyze treasury balances, escrow exposure and pending payouts, and return
|
|
1070
|
+
* an AI recommendation. Moves no funds.
|
|
1071
|
+
*
|
|
1072
|
+
* A POST with no body — the platform derives everything from the authenticated
|
|
1073
|
+
* account. Gated to Growth+ plans; lower tiers surface a 403 `AuraAPIError`
|
|
1074
|
+
* with code `feature_not_available`.
|
|
1075
|
+
*/
|
|
1076
|
+
optimize(): Promise<TreasuryOptimization>;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
810
1079
|
/**
|
|
811
1080
|
* Wallet types for Aura Payments SDK
|
|
812
1081
|
* Public API types for external developers
|
|
@@ -1093,11 +1362,208 @@ declare class Webhooks {
|
|
|
1093
1362
|
*/
|
|
1094
1363
|
private static computeHmacSignature;
|
|
1095
1364
|
/**
|
|
1096
|
-
* Constant-time
|
|
1365
|
+
* Constant-time comparison of two hex signatures.
|
|
1366
|
+
*
|
|
1367
|
+
* Length is compared first because `timingSafeEqual` throws on mismatched
|
|
1368
|
+
* buffers; that only reveals the length of an attacker-supplied signature,
|
|
1369
|
+
* never the contents of the expected one.
|
|
1097
1370
|
*/
|
|
1098
1371
|
private static secureCompare;
|
|
1099
1372
|
}
|
|
1100
1373
|
|
|
1374
|
+
/**
|
|
1375
|
+
* Withdrawal types for the Aura Payments SDK
|
|
1376
|
+
*
|
|
1377
|
+
* Mirrors the platform routes under `app/api/v1/withdrawals/`:
|
|
1378
|
+
* GET /v1/withdrawals list (returns the whole {withdrawals,pagination} wrapper)
|
|
1379
|
+
* GET /v1/withdrawals/:id get
|
|
1380
|
+
* POST /v1/withdrawals/estimate fee/net-amount preview (no money moves)
|
|
1381
|
+
* GET /v1/withdrawals/limits KYC-tier limits ({success,data} — SDK returns `data`)
|
|
1382
|
+
* POST /v1/withdrawals/validate destination address validation (no money moves)
|
|
1383
|
+
*
|
|
1384
|
+
* `POST /v1/withdrawals` (create) is deliberately NOT modelled here: the route is
|
|
1385
|
+
* behind `stepUpGuard({maxAge:'5m'})`, which an API-key client cannot satisfy.
|
|
1386
|
+
*/
|
|
1387
|
+
/** Blockchain networks accepted by the withdrawal routes. */
|
|
1388
|
+
type WithdrawalChain = 'ARC' | 'ETH' | 'BASE' | 'ARB' | 'MATIC';
|
|
1389
|
+
/** Where the funds land: a CEX deposit address or a self-custody wallet. */
|
|
1390
|
+
type WithdrawalDestinationType = 'exchange' | 'wallet';
|
|
1391
|
+
/** Platform fee configuration applied to the withdrawal. */
|
|
1392
|
+
type WithdrawalFeeConfig = 'FREE' | 'GAS_ONLY' | 'STANDARD';
|
|
1393
|
+
/** Exchange hint used for deposit-address heuristics and warnings. */
|
|
1394
|
+
type WithdrawalExchange = 'binance' | 'coinbase' | 'kraken' | 'other';
|
|
1395
|
+
/** Withdrawal lifecycle: pending → submitted → confirmed | failed (or cancelled). */
|
|
1396
|
+
type WithdrawalStatus = 'pending' | 'submitted' | 'confirmed' | 'failed' | 'cancelled';
|
|
1397
|
+
/** Classification of a destination address. */
|
|
1398
|
+
type WithdrawalAddressType = 'eoa' | 'contract' | 'unknown';
|
|
1399
|
+
/** Split of the platform fee into its gas-coverage and margin components. */
|
|
1400
|
+
interface WithdrawalFeeBreakdown {
|
|
1401
|
+
gasComponent: string;
|
|
1402
|
+
platformComponent: string;
|
|
1403
|
+
}
|
|
1404
|
+
interface Withdrawal {
|
|
1405
|
+
id: string;
|
|
1406
|
+
status: WithdrawalStatus;
|
|
1407
|
+
amount: string;
|
|
1408
|
+
netAmount: string;
|
|
1409
|
+
platformFee: string;
|
|
1410
|
+
destinationAddress: string;
|
|
1411
|
+
chain: WithdrawalChain;
|
|
1412
|
+
exchange?: WithdrawalExchange;
|
|
1413
|
+
circleTransferId?: string;
|
|
1414
|
+
txHash?: string;
|
|
1415
|
+
estimatedConfirmation?: string;
|
|
1416
|
+
confirmedAt?: string;
|
|
1417
|
+
failureReason?: string;
|
|
1418
|
+
feeBreakdown?: WithdrawalFeeBreakdown;
|
|
1419
|
+
createdAt: string;
|
|
1420
|
+
}
|
|
1421
|
+
interface ListWithdrawalsParams {
|
|
1422
|
+
/** Page size. The route clamps this to a maximum of 100 (default 50). */
|
|
1423
|
+
limit?: number;
|
|
1424
|
+
offset?: number;
|
|
1425
|
+
status?: WithdrawalStatus;
|
|
1426
|
+
chain?: WithdrawalChain;
|
|
1427
|
+
/** ISO 8601 datetime. */
|
|
1428
|
+
fromDate?: string;
|
|
1429
|
+
/** ISO 8601 datetime. */
|
|
1430
|
+
toDate?: string;
|
|
1431
|
+
}
|
|
1432
|
+
interface ListWithdrawalsResponse {
|
|
1433
|
+
withdrawals: Withdrawal[];
|
|
1434
|
+
pagination: {
|
|
1435
|
+
limit: number;
|
|
1436
|
+
offset: number;
|
|
1437
|
+
count: number;
|
|
1438
|
+
hasMore: boolean;
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
/**
|
|
1442
|
+
* Estimate request.
|
|
1443
|
+
*
|
|
1444
|
+
* `exchange` is REQUIRED by the route whenever `destinationType` is `'exchange'`
|
|
1445
|
+
* (the route validates a discriminated union), and is ignored for `'wallet'`.
|
|
1446
|
+
* `sourceChain` defaults to `ARC`; a source ≠ destination pair is bridged via CCTP
|
|
1447
|
+
* and only the supported routes (ARC → BASE/ETH/SOL) are accepted.
|
|
1448
|
+
*/
|
|
1449
|
+
interface EstimateWithdrawalParams {
|
|
1450
|
+
walletId: string;
|
|
1451
|
+
/** USDC amount, up to 6 decimals (e.g. "100.00"). */
|
|
1452
|
+
amount: string;
|
|
1453
|
+
destinationType: WithdrawalDestinationType;
|
|
1454
|
+
/** EVM address: 0x + 40 hex chars. */
|
|
1455
|
+
destinationAddress: string;
|
|
1456
|
+
chain: WithdrawalChain;
|
|
1457
|
+
exchange?: WithdrawalExchange;
|
|
1458
|
+
sourceChain?: WithdrawalChain;
|
|
1459
|
+
feeConfig?: WithdrawalFeeConfig;
|
|
1460
|
+
}
|
|
1461
|
+
interface WithdrawalEstimate {
|
|
1462
|
+
requestedAmount: string;
|
|
1463
|
+
platformFee: string;
|
|
1464
|
+
/** Only set for cross-chain (CCTP) transfers. */
|
|
1465
|
+
bridgeFee: string | null;
|
|
1466
|
+
networkFee: string;
|
|
1467
|
+
totalFees: string;
|
|
1468
|
+
netAmount: string;
|
|
1469
|
+
/** ISO 8601 datetime. */
|
|
1470
|
+
estimatedConfirmationTime: string;
|
|
1471
|
+
estimatedMinutes: number;
|
|
1472
|
+
chain: WithdrawalChain;
|
|
1473
|
+
sourceChain: WithdrawalChain;
|
|
1474
|
+
needsBridge: boolean;
|
|
1475
|
+
destinationType: WithdrawalDestinationType;
|
|
1476
|
+
feeBreakdown: WithdrawalFeeBreakdown & {
|
|
1477
|
+
bridgeComponent: string | null;
|
|
1478
|
+
};
|
|
1479
|
+
}
|
|
1480
|
+
interface WithdrawalLimits {
|
|
1481
|
+
kycTier: string;
|
|
1482
|
+
limits: {
|
|
1483
|
+
daily: string;
|
|
1484
|
+
monthly: string;
|
|
1485
|
+
perTransaction: string;
|
|
1486
|
+
minimum: string;
|
|
1487
|
+
};
|
|
1488
|
+
used: {
|
|
1489
|
+
daily: string;
|
|
1490
|
+
monthly: string;
|
|
1491
|
+
};
|
|
1492
|
+
remaining: {
|
|
1493
|
+
daily: string;
|
|
1494
|
+
monthly: string;
|
|
1495
|
+
};
|
|
1496
|
+
}
|
|
1497
|
+
interface ValidateWithdrawalParams {
|
|
1498
|
+
/** EVM address: 0x + 40 hex chars. */
|
|
1499
|
+
address: string;
|
|
1500
|
+
chain: WithdrawalChain;
|
|
1501
|
+
/** When provided, the response includes a `feePreview`. */
|
|
1502
|
+
amount?: string;
|
|
1503
|
+
feeConfig?: WithdrawalFeeConfig;
|
|
1504
|
+
}
|
|
1505
|
+
/** Fee preview returned by `validate` when an `amount` was supplied. */
|
|
1506
|
+
interface WithdrawalFeePreview {
|
|
1507
|
+
requestedAmount: string;
|
|
1508
|
+
fixedFee: string;
|
|
1509
|
+
percentageFee: string;
|
|
1510
|
+
totalFee: string;
|
|
1511
|
+
netAmount: string;
|
|
1512
|
+
breakdown: WithdrawalFeeBreakdown;
|
|
1513
|
+
}
|
|
1514
|
+
interface WithdrawalValidation {
|
|
1515
|
+
isValid: boolean;
|
|
1516
|
+
chain: WithdrawalChain;
|
|
1517
|
+
addressType: WithdrawalAddressType;
|
|
1518
|
+
detectedExchange?: WithdrawalExchange;
|
|
1519
|
+
warnings: string[];
|
|
1520
|
+
checksumAddress?: string;
|
|
1521
|
+
/** `null` unless `amount` was passed to `validate`. */
|
|
1522
|
+
feePreview?: WithdrawalFeePreview | null;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
/**
|
|
1526
|
+
* Withdrawals resource for Aura Payments SDK
|
|
1527
|
+
*
|
|
1528
|
+
* Read + estimate surface only. `POST /v1/withdrawals` (create) is intentionally
|
|
1529
|
+
* absent: the platform route is guarded by `stepUpGuard({maxAge:'5m'})`, which
|
|
1530
|
+
* requires a session younger than five minutes. An API-key client can never
|
|
1531
|
+
* satisfy that, so exposing create here would ship a method that always 401s.
|
|
1532
|
+
*/
|
|
1533
|
+
|
|
1534
|
+
declare class Withdrawals {
|
|
1535
|
+
private client;
|
|
1536
|
+
constructor(client: AuraClient);
|
|
1537
|
+
/**
|
|
1538
|
+
* Get a single withdrawal, including status, fees, destination and tx hash.
|
|
1539
|
+
*/
|
|
1540
|
+
get(withdrawalId: string): Promise<Withdrawal>;
|
|
1541
|
+
/**
|
|
1542
|
+
* List withdrawals for the account, most recent first.
|
|
1543
|
+
*
|
|
1544
|
+
* Returns the whole `{withdrawals, pagination}` envelope — this route does not
|
|
1545
|
+
* use the `{success,data}` wrapper, so pagination metadata is preserved.
|
|
1546
|
+
*/
|
|
1547
|
+
list(params?: ListWithdrawalsParams): Promise<ListWithdrawalsResponse>;
|
|
1548
|
+
/**
|
|
1549
|
+
* Preview fees and net amount for a withdrawal WITHOUT creating it.
|
|
1550
|
+
*
|
|
1551
|
+
* `params.exchange` is required by the route when `destinationType` is
|
|
1552
|
+
* `'exchange'`; cross-chain estimates (source ≠ destination) add a CCTP
|
|
1553
|
+
* bridge fee and only the supported routes are accepted.
|
|
1554
|
+
*/
|
|
1555
|
+
estimate(params: EstimateWithdrawalParams): Promise<WithdrawalEstimate>;
|
|
1556
|
+
/**
|
|
1557
|
+
* Get the account's KYC-tier withdrawal limits and remaining allowance.
|
|
1558
|
+
*/
|
|
1559
|
+
limits(): Promise<WithdrawalLimits>;
|
|
1560
|
+
/**
|
|
1561
|
+
* Validate a destination address for a chain. Moves no funds; when `amount` is
|
|
1562
|
+
* supplied the response also carries a fee preview.
|
|
1563
|
+
*/
|
|
1564
|
+
validate(params: ValidateWithdrawalParams): Promise<WithdrawalValidation>;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1101
1567
|
/**
|
|
1102
1568
|
* Aura Payments SDK Client
|
|
1103
1569
|
* Main entry point for interacting with the Aura Payments Platform API
|
|
@@ -1151,6 +1617,9 @@ declare class AuraClient {
|
|
|
1151
1617
|
readonly agents: Agents;
|
|
1152
1618
|
readonly policies: Policies;
|
|
1153
1619
|
readonly mandates: Mandates;
|
|
1620
|
+
readonly withdrawals: Withdrawals;
|
|
1621
|
+
readonly treasury: Treasury;
|
|
1622
|
+
readonly insights: Insights;
|
|
1154
1623
|
constructor(config: AuraClientConfig);
|
|
1155
1624
|
/**
|
|
1156
1625
|
* Normalize the base URL so resource paths like `/v1/escrow` reach the
|
|
@@ -1289,4 +1758,4 @@ declare function retryWithBackoff<T>(fn: () => Promise<T>, maxRetries?: number,
|
|
|
1289
1758
|
*/
|
|
1290
1759
|
declare function withTimeout<T>(promise: Promise<T>, timeoutMs: number, timeoutMessage?: string): Promise<T>;
|
|
1291
1760
|
|
|
1292
|
-
export { type Agent, type AgentBalance, type AgentPolicy, type AgentRiskTier, type AgentStatus, type AgentStatusResponse, type AgentType, Agents, type ApproveMandateParams, AuraAPIError, AuraAuthenticationError, AuraClient, type AuraClientConfig, AuraError, AuraFaucetUnavailableError, AuraNetworkError, AuraNotFoundError, AuraRateLimitError, AuraTimeoutError, AuraValidationError, type Chain, type ConfigureWebhookParams, type CreateAgentParams, type CreateAgentResponse, type CreateDisputeParams, type CreateEscrowParams, type CreateEscrowResponse, type CreatePolicyParams, type CreateWalletParams, type Dispute, type DisputeStatus, type Escrow, type EscrowListItem, type EscrowSortBy, type EscrowSplitInput, type EscrowSplitResponse, type EscrowState, Escrows, type EvaluatePolicyParams, type EvaluatePolicyResponse, type FreezeAgentParams, type FundEscrowParams, type InitialPolicyInput, type ListAgentsParams, type ListAgentsResponse, type ListEscrowsParams, type ListEscrowsResponse, type ListMandatesParams, type ListMandatesResponse, type ListPoliciesResponse, type ListWalletsParams, type ListWalletsResponse, type Mandate, type MandateDecisionMethod, type MandateIntent, type MandateIntentKind, MandateSignature, type MandateStatus, Mandates, type MerchantDestinationType, type MerchantRule, type MerchantRuleInput, type MerchantRuleType, type OwnerType, Policies, type PolicyDecision, type ReceiveAndSplitFundingRequired, type ReceiveAndSplitParams, type ReceiveAndSplitResult, type ReceiveAndSplitStage, type RefundEscrowParams, type RejectMandateParams, type ReleaseEscrowParams, type RequestTestnetFundsParams, type RequestTestnetFundsResponse, type SpendingLimit, type SpendingLimitInput, type SpendingLimitType, type SplitRole, type TokenBalance, type Transfer, type TransferParams, type UnfreezeAgentParams, type UnlockType, type UpdateAgentParams, type ValidateWebhookSignatureOptions, type Wallet, type WalletBalance, type WalletOwnerType, Wallets, type WebhookConfig, type WebhookEvent, type WebhookEventType, type WebhookValidationResult, Webhooks, calculateBackoff, generateIdempotencyKey, isAuraAPIError, isAuraError, isAuraFaucetUnavailableError, isAuraNetworkError, isAuraTimeoutError, isRetryableError, retryWithBackoff, withTimeout };
|
|
1761
|
+
export { type Agent, type AgentBalance, type AgentPolicy, type AgentRiskTier, type AgentStatus, type AgentStatusResponse, type AgentType, Agents, type ApproveMandateParams, type AuditActor, type AuditEntry, type AuditParams, type AuditResult, type AuditSummary, AuraAPIError, AuraAuthenticationError, AuraClient, type AuraClientConfig, AuraError, AuraFaucetUnavailableError, AuraNetworkError, AuraNotFoundError, AuraRateLimitError, AuraTimeoutError, AuraValidationError, type Chain, type ConfigureWebhookParams, type CreateAgentParams, type CreateAgentResponse, type CreateDisputeParams, type CreateEscrowParams, type CreateEscrowResponse, type CreatePolicyParams, type CreateWalletParams, type Dispute, type DisputeStatus, type Escrow, type EscrowListItem, type EscrowSortBy, type EscrowSplitInput, type EscrowSplitResponse, type EscrowState, Escrows, type EstimateWithdrawalParams, type EvaluatePolicyParams, type EvaluatePolicyResponse, type ForecastAlgorithm, type ForecastMetric, type ForecastParams, type ForecastPeriod, type ForecastPoint, type ForecastProjection, type ForecastResult, type ForecastSeries, type ForecastSummary, type FreezeAgentParams, type FundEscrowParams, type InitialPolicyInput, Insights, type InsightsOverview, type InsightsPeriod, type ListAgentsParams, type ListAgentsResponse, type ListEscrowsParams, type ListEscrowsResponse, type ListMandatesParams, type ListMandatesResponse, type ListPoliciesResponse, type ListWalletsParams, type ListWalletsResponse, type ListWithdrawalsParams, type ListWithdrawalsResponse, type Mandate, type MandateDecisionMethod, type MandateIntent, type MandateIntentKind, MandateSignature, type MandateStatus, Mandates, type MerchantDestinationType, type MerchantRule, type MerchantRuleInput, type MerchantRuleType, type MetricValue, type OwnerType, Policies, type PolicyDecision, type ReceiveAndSplitFundingRequired, type ReceiveAndSplitParams, type ReceiveAndSplitResult, type ReceiveAndSplitStage, type RefundEscrowParams, type RejectMandateParams, type ReleaseEscrowParams, type RequestTestnetFundsParams, type RequestTestnetFundsResponse, type SparklinePoint, type SpendingLimit, type SpendingLimitInput, type SpendingLimitType, type SplitRole, type TimeSeriesPoint, type TokenBalance, type Transfer, type TransferParams, Treasury, type TreasuryOptimization, type TreasuryRecommendation, type TreasuryWallet, type UnfreezeAgentParams, type UnlockType, type UpdateAgentParams, type ValidateWebhookSignatureOptions, type ValidateWithdrawalParams, type VolumeBarPoint, type Wallet, type WalletBalance, type WalletOwnerType, Wallets, type WebhookConfig, type WebhookEvent, type WebhookEventType, type WebhookValidationResult, Webhooks, type Withdrawal, type WithdrawalAddressType, type WithdrawalChain, type WithdrawalDestinationType, type WithdrawalEstimate, type WithdrawalExchange, type WithdrawalFeeBreakdown, type WithdrawalFeeConfig, type WithdrawalFeePreview, type WithdrawalLimits, type WithdrawalStatus, type WithdrawalValidation, Withdrawals, calculateBackoff, generateIdempotencyKey, isAuraAPIError, isAuraError, isAuraFaucetUnavailableError, isAuraNetworkError, isAuraTimeoutError, isRetryableError, retryWithBackoff, withTimeout };
|