@usdctofiat/offramp 1.1.4 → 1.3.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/{chunk-OJY6DE3I.js → chunk-JQBKGGI2.js} +555 -213
- package/dist/chunk-JQBKGGI2.js.map +1 -0
- package/dist/{errors-Dtzrl98J.d.cts → errors-CfZrDly0.d.cts} +42 -2
- package/dist/{errors-Dtzrl98J.d.ts → errors-CfZrDly0.d.ts} +42 -2
- package/dist/index.cjs +556 -213
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -4
- package/dist/index.d.ts +37 -4
- package/dist/index.js +26 -18
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +591 -240
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +5 -2
- package/dist/react.d.ts +5 -2
- package/dist/react.js +33 -14
- package/dist/react.js.map +1 -1
- package/package.json +16 -6
- package/dist/chunk-OJY6DE3I.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,46 +1,54 @@
|
|
|
1
1
|
import {
|
|
2
|
+
CURRENCIES,
|
|
2
3
|
ESCROW_ADDRESS,
|
|
4
|
+
Offramp,
|
|
3
5
|
OfframpError,
|
|
4
6
|
PLATFORMS,
|
|
5
7
|
close,
|
|
8
|
+
createOfframp,
|
|
9
|
+
createTelemetryContext,
|
|
6
10
|
delegate,
|
|
7
11
|
deposits,
|
|
8
12
|
disableOtc,
|
|
13
|
+
emitEvent,
|
|
9
14
|
enableOtc,
|
|
10
15
|
getOtcLink,
|
|
11
16
|
offramp,
|
|
17
|
+
sanitizeAttributionId,
|
|
18
|
+
sendTelemetryEvent,
|
|
12
19
|
undelegate
|
|
13
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-JQBKGGI2.js";
|
|
14
21
|
|
|
15
|
-
// src/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
countryCode: info.countryCode ?? ""
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
return entries;
|
|
30
|
-
}
|
|
31
|
-
var CURRENCIES = buildCurrencies();
|
|
22
|
+
// src/types.ts
|
|
23
|
+
var OFFRAMP_ERROR_CODES = {
|
|
24
|
+
VALIDATION: "VALIDATION",
|
|
25
|
+
APPROVAL_FAILED: "APPROVAL_FAILED",
|
|
26
|
+
REGISTRATION_FAILED: "REGISTRATION_FAILED",
|
|
27
|
+
DEPOSIT_FAILED: "DEPOSIT_FAILED",
|
|
28
|
+
CONFIRMATION_FAILED: "CONFIRMATION_FAILED",
|
|
29
|
+
DELEGATION_FAILED: "DELEGATION_FAILED",
|
|
30
|
+
USER_CANCELLED: "USER_CANCELLED",
|
|
31
|
+
UNSUPPORTED: "UNSUPPORTED"
|
|
32
|
+
};
|
|
32
33
|
export {
|
|
33
34
|
CURRENCIES,
|
|
34
35
|
ESCROW_ADDRESS,
|
|
36
|
+
OFFRAMP_ERROR_CODES,
|
|
37
|
+
Offramp,
|
|
35
38
|
OfframpError,
|
|
36
39
|
PLATFORMS,
|
|
37
40
|
close,
|
|
41
|
+
createOfframp,
|
|
42
|
+
createTelemetryContext,
|
|
38
43
|
delegate,
|
|
39
44
|
deposits,
|
|
40
45
|
disableOtc,
|
|
46
|
+
emitEvent,
|
|
41
47
|
enableOtc,
|
|
42
48
|
getOtcLink,
|
|
43
49
|
offramp,
|
|
50
|
+
sanitizeAttributionId,
|
|
51
|
+
sendTelemetryEvent,
|
|
44
52
|
undelegate
|
|
45
53
|
};
|
|
46
54
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { PlatformEntry } from \"./platforms\";\nimport type { CurrencyEntry } from \"./currencies\";\n\nexport const OFFRAMP_ERROR_CODES = {\n VALIDATION: \"VALIDATION\",\n APPROVAL_FAILED: \"APPROVAL_FAILED\",\n REGISTRATION_FAILED: \"REGISTRATION_FAILED\",\n DEPOSIT_FAILED: \"DEPOSIT_FAILED\",\n CONFIRMATION_FAILED: \"CONFIRMATION_FAILED\",\n DELEGATION_FAILED: \"DELEGATION_FAILED\",\n USER_CANCELLED: \"USER_CANCELLED\",\n UNSUPPORTED: \"UNSUPPORTED\",\n} as const;\n\nexport type OfframpErrorCode = (typeof OFFRAMP_ERROR_CODES)[keyof typeof OFFRAMP_ERROR_CODES];\n\nexport interface OfframpParams {\n /** USDC amount as decimal string, min 1. */\n amount: string;\n /** Payment platform — use `PLATFORMS.REVOLUT` etc. */\n platform: PlatformEntry;\n /** Fiat currency — use `CURRENCIES.EUR` etc. */\n currency: CurrencyEntry;\n /** Platform-specific identifier (username, email, IBAN). */\n identifier: string;\n /** Optional: restrict the deposit to this taker wallet (OTC private order). */\n otcTaker?: string;\n /** Optional SDK-only referral metadata for telemetry attribution. */\n referralId?: string;\n /** Optional SDK-only integrator metadata for telemetry attribution. */\n integratorId?: string;\n /** Optional per-wallet key to replay the first successful result for 10 minutes. */\n idempotencyKey?: string;\n}\n\nexport interface OfframpResult {\n depositId: string;\n txHash: string;\n /** Whether an existing undelegated deposit was resumed. */\n resumed: boolean;\n /** OTC link for the taker, present when `otcTaker` was provided. */\n otcLink?: string;\n}\n\nexport type OfframpStep =\n | \"approving\"\n | \"registering\"\n | \"depositing\"\n | \"confirming\"\n | \"delegating\"\n | \"restricting\"\n | \"resuming\"\n | \"done\";\n\nexport type OfframpState =\n | \"idle\"\n | \"approving\"\n | \"registering\"\n | \"depositing\"\n | \"confirming\"\n | \"delegating\"\n | \"done\"\n | \"error\";\n\nexport interface OfframpProgress {\n step: OfframpStep;\n txHash?: string;\n depositId?: string;\n}\n\nexport type OnProgress = (progress: OfframpProgress) => void;\n\nexport type DepositStatus = \"active\" | \"empty\" | \"closed\";\n\nexport interface OfframpQuoteInput {\n amount: string;\n currency: CurrencyEntry;\n platform: PlatformEntry;\n}\n\nexport interface OfframpQuote {\n amountUsdc: number;\n expectedFiat: number;\n effectiveRate: number;\n vaultSpreadBps: number;\n}\n\nexport interface OfframpVaultStatus {\n rateManagerId: string;\n rateManagerAddress: string;\n feeRateBps: number;\n escrow: string;\n isActive: boolean;\n}\n\nexport interface OfframpCreateOptions {\n integratorId?: string;\n referralId?: string;\n telemetry?: boolean;\n}\n\nexport interface DepositInfo {\n /** Numeric deposit ID. Pass this to `close()`. */\n depositId: string;\n /** Composite ID (escrowAddress_depositId). */\n compositeId: string;\n /** Creation transaction hash. */\n txHash?: string;\n status: DepositStatus;\n remainingUsdc: number;\n outstandingUsdc: number;\n totalTakenUsdc: number;\n fulfilledIntents: number;\n paymentMethods: string[];\n currencies: string[];\n rateSource: string;\n delegated: boolean;\n escrowAddress: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAGO,IAAM,sBAAsB;AAAA,EACjC,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,aAAa;AACf;","names":[]}
|