@routedock/routedock 0.3.0 → 0.3.1
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/{ProviderRegistry-D-0rqK0N.d.cts → ProviderRegistry-CyZ5eryO.d.cts} +1 -1
- package/dist/{ProviderRegistry-CA_TdREG.d.ts → ProviderRegistry-w4_hkI_1.d.ts} +1 -1
- package/dist/{RouteDockClient-go9aopfF.d.cts → RouteDockClient-CXvWXix5.d.cts} +2 -0
- package/dist/{RouteDockClient-Bh86bVly.d.ts → RouteDockClient-CjM2VyOd.d.ts} +2 -0
- package/dist/client.cjs +4 -9
- package/dist/client.d.cts +3 -3
- package/dist/client.d.ts +3 -3
- package/dist/client.js +4 -9
- package/dist/index.cjs +4 -9
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -9
- package/dist/react.cjs +4 -9
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +4 -9
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { usdcToStroops } from '@routedock/nulth-sdk';
|
|
2
|
-
import { l as SpendStore, a as DailySpend, R as RetryPolicy } from './RouteDockClient-
|
|
2
|
+
import { l as SpendStore, a as DailySpend, R as RetryPolicy } from './RouteDockClient-CXvWXix5.cjs';
|
|
3
3
|
import { ClientStellarSigner } from '@x402/stellar';
|
|
4
4
|
import { h as RouteDockManifest, c as PaymentResult } from './logger-D8_Q2ytp.cjs';
|
|
5
5
|
import { Keypair } from '@stellar/stellar-sdk';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { usdcToStroops } from '@routedock/nulth-sdk';
|
|
2
|
-
import { l as SpendStore, a as DailySpend, R as RetryPolicy } from './RouteDockClient-
|
|
2
|
+
import { l as SpendStore, a as DailySpend, R as RetryPolicy } from './RouteDockClient-CjM2VyOd.js';
|
|
3
3
|
import { ClientStellarSigner } from '@x402/stellar';
|
|
4
4
|
import { h as RouteDockManifest, c as PaymentResult } from './logger-D8_Q2ytp.js';
|
|
5
5
|
import { Keypair } from '@stellar/stellar-sdk';
|
|
@@ -183,9 +183,11 @@ declare function paymentContextFromManifest(manifest: {
|
|
|
183
183
|
pricing: {
|
|
184
184
|
x402?: {
|
|
185
185
|
amount: string;
|
|
186
|
+
payee?: string;
|
|
186
187
|
};
|
|
187
188
|
'mpp-charge'?: {
|
|
188
189
|
amount: string;
|
|
190
|
+
payee?: string;
|
|
189
191
|
};
|
|
190
192
|
};
|
|
191
193
|
}, mode: 'x402' | 'mpp-charge', ledgerSequence: number): Omit<PaymentAuthContext, 'authEntry'>;
|
|
@@ -183,9 +183,11 @@ declare function paymentContextFromManifest(manifest: {
|
|
|
183
183
|
pricing: {
|
|
184
184
|
x402?: {
|
|
185
185
|
amount: string;
|
|
186
|
+
payee?: string;
|
|
186
187
|
};
|
|
187
188
|
'mpp-charge'?: {
|
|
188
189
|
amount: string;
|
|
190
|
+
payee?: string;
|
|
189
191
|
};
|
|
190
192
|
};
|
|
191
193
|
}, mode: 'x402' | 'mpp-charge', ledgerSequence: number): Omit<PaymentAuthContext, 'authEntry'>;
|
package/dist/client.cjs
CHANGED
|
@@ -718,7 +718,7 @@ var routedock_schema_default = {
|
|
|
718
718
|
|
|
719
719
|
// package.json
|
|
720
720
|
var package_default = {
|
|
721
|
-
version: "0.3.
|
|
721
|
+
version: "0.3.1"};
|
|
722
722
|
var MANIFEST_SIGNATURE_VERSION = "2";
|
|
723
723
|
function canonicalize(value) {
|
|
724
724
|
if (Array.isArray(value)) {
|
|
@@ -2183,11 +2183,6 @@ function encodeAuthSignature(proof) {
|
|
|
2183
2183
|
const payload = { nulth: "zk-v1", proof };
|
|
2184
2184
|
return Buffer.from(JSON.stringify(payload), "utf8").toString("base64");
|
|
2185
2185
|
}
|
|
2186
|
-
function usdcToStroops2(amount) {
|
|
2187
|
-
const [whole = "0", frac = ""] = amount.split(".");
|
|
2188
|
-
const padded = (frac + "0000000").slice(0, 7);
|
|
2189
|
-
return BigInt(whole) * 10000000n + BigInt(padded);
|
|
2190
|
-
}
|
|
2191
2186
|
var NulthClient = class {
|
|
2192
2187
|
constructor(config) {
|
|
2193
2188
|
this.config = config;
|
|
@@ -2298,14 +2293,14 @@ function paymentContextFromManifest(manifest, mode, ledgerSequence) {
|
|
|
2298
2293
|
const pricing = manifest.pricing[mode];
|
|
2299
2294
|
if (!pricing) throw new Error(`manifest.pricing.${mode} missing`);
|
|
2300
2295
|
return {
|
|
2301
|
-
payee: manifest.payee,
|
|
2302
|
-
amountStroops:
|
|
2296
|
+
payee: pricing.payee ?? manifest.payee,
|
|
2297
|
+
amountStroops: nulthSdk.usdcToStroops(pricing.amount),
|
|
2303
2298
|
assetContract: manifest.asset_contract,
|
|
2304
2299
|
ledgerSequence
|
|
2305
2300
|
};
|
|
2306
2301
|
}
|
|
2307
2302
|
function createPolicyState(input) {
|
|
2308
|
-
const dailyCapStroops =
|
|
2303
|
+
const dailyCapStroops = nulthSdk.usdcToStroops(input.dailyCapUsdc);
|
|
2309
2304
|
return {
|
|
2310
2305
|
dailyCapStroops,
|
|
2311
2306
|
allowlistCommitment: commitAllowlist(input.allowedPayees, input.witnessSecret),
|
package/dist/client.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { g as RouteDockLogger, h as RouteDockManifest, n as SessionOptions, m as SessionHandle } from './logger-D8_Q2ytp.cjs';
|
|
2
2
|
export { A as AssetConfig, D as DEFAULT_MAX_SESSION_DURATION_MS, a as DisputeStatus, E as EndpointDescriptor, b as EstimateCostResult, P as PaymentMode, c as PaymentResult, d as PreflightResult, e as PricingConfig, R as RouteDockLogFields, f as RouteDockLogLevel, S as SLAConfig, i as SessionCloseFailedPayload, j as SessionCloseResult, k as SessionEvent, l as SessionEventPayloadMap, o as SessionPricingConfig, p as SessionState, q as SessionStats, r as SessionTimeoutPayload, s as StreamOptions, V as VaultMode, t as consoleLogger, u as createConsoleLogger, v as noopLogger, w as resolveLogger } from './logger-D8_Q2ytp.cjs';
|
|
3
3
|
export { R as RouteDockChannelStateError, a as RouteDockClientVersionError, b as RouteDockDisputeError, c as RouteDockError, d as RouteDockErrorCode, e as RouteDockErrorOptions, f as RouteDockFacilitatorError, g as RouteDockManifestError, h as RouteDockManifestSunsetError, i as RouteDockManifestTimeoutError, j as RouteDockNetworkError, k as RouteDockNoSupportedModeError, l as RouteDockPolicyRejectError, m as RouteDockPolicyRejectedError, n as RouteDockRefundWindowError, o as RouteDockSessionError, p as RouteDockSignatureError, q as RouteDockTrustlineError, r as RouteDockVoucherMonotonicityError, S as SessionStore, s as SupabaseSessionStore, t as getEligibleAssets, u as httpStatusToError, v as isAssetEligible, w as normalizeManifestAssets, x as parseRetryAfterMs, y as resolveAssetContract, z as selectAsset, A as wrapFetchError, B as wrapMppError } from './SessionStore-B4-Hi4H8.cjs';
|
|
4
|
-
import { R as RetryPolicy } from './RouteDockClient-
|
|
5
|
-
export { D as DEFAULT_RETRY_POLICY, a as DailySpend, I as InMemorySpendStore, b as InMemorySpendStoreOptions, M as ModeSelectOptions, N as NulthAuthSignature, c as NulthClientConfig, d as NulthPolicyError, e as NulthPolicyState, f as NulthProof, g as NulthSignerConfig, h as NulthStellarSigner, i as NulthVaultConfig, P as PaymentAuthContext, j as RouteDockClient, k as RouteDockClientConfig, S as SpendCap, l as SpendStore, V as VaultConfig, m as assertEndpointActive, n as assertManifestValid, o as assertNulthVaultManifest, p as backoffDelayMs, q as configureManifestCache, r as createNulthSigner, s as createPolicyState, t as decodeAuthSignature, u as fetchLedgerSequence, v as fetchManifest, w as invalidateManifest, x as paymentContextFromManifest, y as prepareNulthSigner, z as rankProvidersByLatency, A as selectMode, B as setNulthPaymentContext, C as usdcToMicros, E as withRetry } from './RouteDockClient-
|
|
6
|
-
export { F as FileSpendStore, M as MppChargeClient, O as OnChainProviderInfo, a as OnChainRegistry, P as ProviderRecord, b as ProviderRegistry, c as ProviderRegistryConfig, X as X402Client, u as usdcToUnits } from './ProviderRegistry-
|
|
4
|
+
import { R as RetryPolicy } from './RouteDockClient-CXvWXix5.cjs';
|
|
5
|
+
export { D as DEFAULT_RETRY_POLICY, a as DailySpend, I as InMemorySpendStore, b as InMemorySpendStoreOptions, M as ModeSelectOptions, N as NulthAuthSignature, c as NulthClientConfig, d as NulthPolicyError, e as NulthPolicyState, f as NulthProof, g as NulthSignerConfig, h as NulthStellarSigner, i as NulthVaultConfig, P as PaymentAuthContext, j as RouteDockClient, k as RouteDockClientConfig, S as SpendCap, l as SpendStore, V as VaultConfig, m as assertEndpointActive, n as assertManifestValid, o as assertNulthVaultManifest, p as backoffDelayMs, q as configureManifestCache, r as createNulthSigner, s as createPolicyState, t as decodeAuthSignature, u as fetchLedgerSequence, v as fetchManifest, w as invalidateManifest, x as paymentContextFromManifest, y as prepareNulthSigner, z as rankProvidersByLatency, A as selectMode, B as setNulthPaymentContext, C as usdcToMicros, E as withRetry } from './RouteDockClient-CXvWXix5.cjs';
|
|
6
|
+
export { F as FileSpendStore, M as MppChargeClient, O as OnChainProviderInfo, a as OnChainRegistry, P as ProviderRecord, b as ProviderRegistry, c as ProviderRegistryConfig, X as X402Client, u as usdcToUnits } from './ProviderRegistry-CyZ5eryO.cjs';
|
|
7
7
|
import { Keypair } from '@stellar/stellar-sdk';
|
|
8
8
|
export { USDC_DECIMALS, usdcToStroops } from '@routedock/nulth-sdk';
|
|
9
9
|
import 'mppx';
|
package/dist/client.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { g as RouteDockLogger, h as RouteDockManifest, n as SessionOptions, m as SessionHandle } from './logger-D8_Q2ytp.js';
|
|
2
2
|
export { A as AssetConfig, D as DEFAULT_MAX_SESSION_DURATION_MS, a as DisputeStatus, E as EndpointDescriptor, b as EstimateCostResult, P as PaymentMode, c as PaymentResult, d as PreflightResult, e as PricingConfig, R as RouteDockLogFields, f as RouteDockLogLevel, S as SLAConfig, i as SessionCloseFailedPayload, j as SessionCloseResult, k as SessionEvent, l as SessionEventPayloadMap, o as SessionPricingConfig, p as SessionState, q as SessionStats, r as SessionTimeoutPayload, s as StreamOptions, V as VaultMode, t as consoleLogger, u as createConsoleLogger, v as noopLogger, w as resolveLogger } from './logger-D8_Q2ytp.js';
|
|
3
3
|
export { R as RouteDockChannelStateError, a as RouteDockClientVersionError, b as RouteDockDisputeError, c as RouteDockError, d as RouteDockErrorCode, e as RouteDockErrorOptions, f as RouteDockFacilitatorError, g as RouteDockManifestError, h as RouteDockManifestSunsetError, i as RouteDockManifestTimeoutError, j as RouteDockNetworkError, k as RouteDockNoSupportedModeError, l as RouteDockPolicyRejectError, m as RouteDockPolicyRejectedError, n as RouteDockRefundWindowError, o as RouteDockSessionError, p as RouteDockSignatureError, q as RouteDockTrustlineError, r as RouteDockVoucherMonotonicityError, S as SessionStore, s as SupabaseSessionStore, t as getEligibleAssets, u as httpStatusToError, v as isAssetEligible, w as normalizeManifestAssets, x as parseRetryAfterMs, y as resolveAssetContract, z as selectAsset, A as wrapFetchError, B as wrapMppError } from './SessionStore-BaYiegP0.js';
|
|
4
|
-
import { R as RetryPolicy } from './RouteDockClient-
|
|
5
|
-
export { D as DEFAULT_RETRY_POLICY, a as DailySpend, I as InMemorySpendStore, b as InMemorySpendStoreOptions, M as ModeSelectOptions, N as NulthAuthSignature, c as NulthClientConfig, d as NulthPolicyError, e as NulthPolicyState, f as NulthProof, g as NulthSignerConfig, h as NulthStellarSigner, i as NulthVaultConfig, P as PaymentAuthContext, j as RouteDockClient, k as RouteDockClientConfig, S as SpendCap, l as SpendStore, V as VaultConfig, m as assertEndpointActive, n as assertManifestValid, o as assertNulthVaultManifest, p as backoffDelayMs, q as configureManifestCache, r as createNulthSigner, s as createPolicyState, t as decodeAuthSignature, u as fetchLedgerSequence, v as fetchManifest, w as invalidateManifest, x as paymentContextFromManifest, y as prepareNulthSigner, z as rankProvidersByLatency, A as selectMode, B as setNulthPaymentContext, C as usdcToMicros, E as withRetry } from './RouteDockClient-
|
|
6
|
-
export { F as FileSpendStore, M as MppChargeClient, O as OnChainProviderInfo, a as OnChainRegistry, P as ProviderRecord, b as ProviderRegistry, c as ProviderRegistryConfig, X as X402Client, u as usdcToUnits } from './ProviderRegistry-
|
|
4
|
+
import { R as RetryPolicy } from './RouteDockClient-CjM2VyOd.js';
|
|
5
|
+
export { D as DEFAULT_RETRY_POLICY, a as DailySpend, I as InMemorySpendStore, b as InMemorySpendStoreOptions, M as ModeSelectOptions, N as NulthAuthSignature, c as NulthClientConfig, d as NulthPolicyError, e as NulthPolicyState, f as NulthProof, g as NulthSignerConfig, h as NulthStellarSigner, i as NulthVaultConfig, P as PaymentAuthContext, j as RouteDockClient, k as RouteDockClientConfig, S as SpendCap, l as SpendStore, V as VaultConfig, m as assertEndpointActive, n as assertManifestValid, o as assertNulthVaultManifest, p as backoffDelayMs, q as configureManifestCache, r as createNulthSigner, s as createPolicyState, t as decodeAuthSignature, u as fetchLedgerSequence, v as fetchManifest, w as invalidateManifest, x as paymentContextFromManifest, y as prepareNulthSigner, z as rankProvidersByLatency, A as selectMode, B as setNulthPaymentContext, C as usdcToMicros, E as withRetry } from './RouteDockClient-CjM2VyOd.js';
|
|
6
|
+
export { F as FileSpendStore, M as MppChargeClient, O as OnChainProviderInfo, a as OnChainRegistry, P as ProviderRecord, b as ProviderRegistry, c as ProviderRegistryConfig, X as X402Client, u as usdcToUnits } from './ProviderRegistry-w4_hkI_1.js';
|
|
7
7
|
import { Keypair } from '@stellar/stellar-sdk';
|
|
8
8
|
export { USDC_DECIMALS, usdcToStroops } from '@routedock/nulth-sdk';
|
|
9
9
|
import 'mppx';
|
package/dist/client.js
CHANGED
|
@@ -712,7 +712,7 @@ var routedock_schema_default = {
|
|
|
712
712
|
|
|
713
713
|
// package.json
|
|
714
714
|
var package_default = {
|
|
715
|
-
version: "0.3.
|
|
715
|
+
version: "0.3.1"};
|
|
716
716
|
var MANIFEST_SIGNATURE_VERSION = "2";
|
|
717
717
|
function canonicalize(value) {
|
|
718
718
|
if (Array.isArray(value)) {
|
|
@@ -2177,11 +2177,6 @@ function encodeAuthSignature(proof) {
|
|
|
2177
2177
|
const payload = { nulth: "zk-v1", proof };
|
|
2178
2178
|
return Buffer.from(JSON.stringify(payload), "utf8").toString("base64");
|
|
2179
2179
|
}
|
|
2180
|
-
function usdcToStroops2(amount) {
|
|
2181
|
-
const [whole = "0", frac = ""] = amount.split(".");
|
|
2182
|
-
const padded = (frac + "0000000").slice(0, 7);
|
|
2183
|
-
return BigInt(whole) * 10000000n + BigInt(padded);
|
|
2184
|
-
}
|
|
2185
2180
|
var NulthClient = class {
|
|
2186
2181
|
constructor(config) {
|
|
2187
2182
|
this.config = config;
|
|
@@ -2292,14 +2287,14 @@ function paymentContextFromManifest(manifest, mode, ledgerSequence) {
|
|
|
2292
2287
|
const pricing = manifest.pricing[mode];
|
|
2293
2288
|
if (!pricing) throw new Error(`manifest.pricing.${mode} missing`);
|
|
2294
2289
|
return {
|
|
2295
|
-
payee: manifest.payee,
|
|
2296
|
-
amountStroops:
|
|
2290
|
+
payee: pricing.payee ?? manifest.payee,
|
|
2291
|
+
amountStroops: usdcToStroops(pricing.amount),
|
|
2297
2292
|
assetContract: manifest.asset_contract,
|
|
2298
2293
|
ledgerSequence
|
|
2299
2294
|
};
|
|
2300
2295
|
}
|
|
2301
2296
|
function createPolicyState(input) {
|
|
2302
|
-
const dailyCapStroops =
|
|
2297
|
+
const dailyCapStroops = usdcToStroops(input.dailyCapUsdc);
|
|
2303
2298
|
return {
|
|
2304
2299
|
dailyCapStroops,
|
|
2305
2300
|
allowlistCommitment: commitAllowlist(input.allowedPayees, input.witnessSecret),
|
package/dist/index.cjs
CHANGED
|
@@ -724,7 +724,7 @@ var routedock_schema_default = {
|
|
|
724
724
|
|
|
725
725
|
// package.json
|
|
726
726
|
var package_default = {
|
|
727
|
-
version: "0.3.
|
|
727
|
+
version: "0.3.1"};
|
|
728
728
|
var MANIFEST_SIGNATURE_VERSION = "2";
|
|
729
729
|
function canonicalize(value) {
|
|
730
730
|
if (Array.isArray(value)) {
|
|
@@ -2199,11 +2199,6 @@ function encodeAuthSignature(proof) {
|
|
|
2199
2199
|
const payload = { nulth: "zk-v1", proof };
|
|
2200
2200
|
return Buffer.from(JSON.stringify(payload), "utf8").toString("base64");
|
|
2201
2201
|
}
|
|
2202
|
-
function usdcToStroops2(amount) {
|
|
2203
|
-
const [whole = "0", frac = ""] = amount.split(".");
|
|
2204
|
-
const padded = (frac + "0000000").slice(0, 7);
|
|
2205
|
-
return BigInt(whole) * 10000000n + BigInt(padded);
|
|
2206
|
-
}
|
|
2207
2202
|
var NulthClient = class {
|
|
2208
2203
|
constructor(config) {
|
|
2209
2204
|
this.config = config;
|
|
@@ -2314,14 +2309,14 @@ function paymentContextFromManifest(manifest, mode, ledgerSequence) {
|
|
|
2314
2309
|
const pricing = manifest.pricing[mode];
|
|
2315
2310
|
if (!pricing) throw new Error(`manifest.pricing.${mode} missing`);
|
|
2316
2311
|
return {
|
|
2317
|
-
payee: manifest.payee,
|
|
2318
|
-
amountStroops:
|
|
2312
|
+
payee: pricing.payee ?? manifest.payee,
|
|
2313
|
+
amountStroops: nulthSdk.usdcToStroops(pricing.amount),
|
|
2319
2314
|
assetContract: manifest.asset_contract,
|
|
2320
2315
|
ledgerSequence
|
|
2321
2316
|
};
|
|
2322
2317
|
}
|
|
2323
2318
|
function createPolicyState(input) {
|
|
2324
|
-
const dailyCapStroops =
|
|
2319
|
+
const dailyCapStroops = nulthSdk.usdcToStroops(input.dailyCapUsdc);
|
|
2325
2320
|
return {
|
|
2326
2321
|
dailyCapStroops,
|
|
2327
2322
|
allowlistCommitment: commitAllowlist(input.allowedPayees, input.witnessSecret),
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { A as AssetConfig, D as DEFAULT_MAX_SESSION_DURATION_MS, a as DisputeStatus, E as EndpointDescriptor, b as EstimateCostResult, P as PaymentMode, c as PaymentResult, d as PreflightResult, e as PricingConfig, R as RouteDockLogFields, f as RouteDockLogLevel, g as RouteDockLogger, h as RouteDockManifest, S as SLAConfig, i as SessionCloseFailedPayload, j as SessionCloseResult, k as SessionEvent, l as SessionEventPayloadMap, m as SessionHandle, n as SessionOptions, o as SessionPricingConfig, p as SessionState, q as SessionStats, r as SessionTimeoutPayload, s as StreamOptions, V as VaultMode, t as consoleLogger, u as createConsoleLogger, v as noopLogger, w as resolveLogger } from './logger-D8_Q2ytp.cjs';
|
|
2
2
|
export { R as RouteDockChannelStateError, a as RouteDockClientVersionError, b as RouteDockDisputeError, c as RouteDockError, d as RouteDockErrorCode, e as RouteDockErrorOptions, f as RouteDockFacilitatorError, g as RouteDockManifestError, h as RouteDockManifestSunsetError, i as RouteDockManifestTimeoutError, j as RouteDockNetworkError, k as RouteDockNoSupportedModeError, l as RouteDockPolicyRejectError, m as RouteDockPolicyRejectedError, n as RouteDockRefundWindowError, o as RouteDockSessionError, p as RouteDockSignatureError, q as RouteDockTrustlineError, r as RouteDockVoucherMonotonicityError, S as SessionStore, s as SupabaseSessionStore, t as getEligibleAssets, u as httpStatusToError, v as isAssetEligible, w as normalizeManifestAssets, x as parseRetryAfterMs, y as resolveAssetContract, z as selectAsset, A as wrapFetchError, B as wrapMppError } from './SessionStore-B4-Hi4H8.cjs';
|
|
3
|
-
export { D as DEFAULT_RETRY_POLICY, a as DailySpend, I as InMemorySpendStore, b as InMemorySpendStoreOptions, M as ModeSelectOptions, N as NulthAuthSignature, c as NulthClientConfig, d as NulthPolicyError, e as NulthPolicyState, f as NulthProof, g as NulthSignerConfig, h as NulthStellarSigner, i as NulthVaultConfig, P as PaymentAuthContext, R as RetryPolicy, j as RouteDockClient, k as RouteDockClientConfig, S as SpendCap, l as SpendStore, V as VaultConfig, m as assertEndpointActive, n as assertManifestValid, o as assertNulthVaultManifest, p as backoffDelayMs, q as configureManifestCache, r as createNulthSigner, s as createPolicyState, t as decodeAuthSignature, u as fetchLedgerSequence, v as fetchManifest, w as invalidateManifest, x as paymentContextFromManifest, y as prepareNulthSigner, z as rankProvidersByLatency, A as selectMode, B as setNulthPaymentContext, C as usdcToMicros, E as withRetry } from './RouteDockClient-
|
|
4
|
-
export { F as FileSpendStore, M as MppChargeClient, O as OnChainProviderInfo, a as OnChainRegistry, P as ProviderRecord, b as ProviderRegistry, c as ProviderRegistryConfig, X as X402Client, u as usdcToUnits } from './ProviderRegistry-
|
|
3
|
+
export { D as DEFAULT_RETRY_POLICY, a as DailySpend, I as InMemorySpendStore, b as InMemorySpendStoreOptions, M as ModeSelectOptions, N as NulthAuthSignature, c as NulthClientConfig, d as NulthPolicyError, e as NulthPolicyState, f as NulthProof, g as NulthSignerConfig, h as NulthStellarSigner, i as NulthVaultConfig, P as PaymentAuthContext, R as RetryPolicy, j as RouteDockClient, k as RouteDockClientConfig, S as SpendCap, l as SpendStore, V as VaultConfig, m as assertEndpointActive, n as assertManifestValid, o as assertNulthVaultManifest, p as backoffDelayMs, q as configureManifestCache, r as createNulthSigner, s as createPolicyState, t as decodeAuthSignature, u as fetchLedgerSequence, v as fetchManifest, w as invalidateManifest, x as paymentContextFromManifest, y as prepareNulthSigner, z as rankProvidersByLatency, A as selectMode, B as setNulthPaymentContext, C as usdcToMicros, E as withRetry } from './RouteDockClient-CXvWXix5.cjs';
|
|
4
|
+
export { F as FileSpendStore, M as MppChargeClient, O as OnChainProviderInfo, a as OnChainRegistry, P as ProviderRecord, b as ProviderRegistry, c as ProviderRegistryConfig, X as X402Client, u as usdcToUnits } from './ProviderRegistry-CyZ5eryO.cjs';
|
|
5
5
|
export { R as ReconciliationStats, a as RegisterProviderOptions, S as SessionReconcilerOptions, b as SupabaseSeenTxStore, d as decimalToStroops, r as reconcileAbandonedSessions, c as registerProvider, e as runStartupReconciliation } from './SessionReconciler-Cz2nuOlJ.cjs';
|
|
6
6
|
export { R as RouteDockMiddlewareOptions, r as routedock } from './routedockMiddleware-DlyLrxp7.cjs';
|
|
7
7
|
export { m as manifestDigest, s as signManifest, v as verifyManifestSignature } from './sign-AKH67sft.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { A as AssetConfig, D as DEFAULT_MAX_SESSION_DURATION_MS, a as DisputeStatus, E as EndpointDescriptor, b as EstimateCostResult, P as PaymentMode, c as PaymentResult, d as PreflightResult, e as PricingConfig, R as RouteDockLogFields, f as RouteDockLogLevel, g as RouteDockLogger, h as RouteDockManifest, S as SLAConfig, i as SessionCloseFailedPayload, j as SessionCloseResult, k as SessionEvent, l as SessionEventPayloadMap, m as SessionHandle, n as SessionOptions, o as SessionPricingConfig, p as SessionState, q as SessionStats, r as SessionTimeoutPayload, s as StreamOptions, V as VaultMode, t as consoleLogger, u as createConsoleLogger, v as noopLogger, w as resolveLogger } from './logger-D8_Q2ytp.js';
|
|
2
2
|
export { R as RouteDockChannelStateError, a as RouteDockClientVersionError, b as RouteDockDisputeError, c as RouteDockError, d as RouteDockErrorCode, e as RouteDockErrorOptions, f as RouteDockFacilitatorError, g as RouteDockManifestError, h as RouteDockManifestSunsetError, i as RouteDockManifestTimeoutError, j as RouteDockNetworkError, k as RouteDockNoSupportedModeError, l as RouteDockPolicyRejectError, m as RouteDockPolicyRejectedError, n as RouteDockRefundWindowError, o as RouteDockSessionError, p as RouteDockSignatureError, q as RouteDockTrustlineError, r as RouteDockVoucherMonotonicityError, S as SessionStore, s as SupabaseSessionStore, t as getEligibleAssets, u as httpStatusToError, v as isAssetEligible, w as normalizeManifestAssets, x as parseRetryAfterMs, y as resolveAssetContract, z as selectAsset, A as wrapFetchError, B as wrapMppError } from './SessionStore-BaYiegP0.js';
|
|
3
|
-
export { D as DEFAULT_RETRY_POLICY, a as DailySpend, I as InMemorySpendStore, b as InMemorySpendStoreOptions, M as ModeSelectOptions, N as NulthAuthSignature, c as NulthClientConfig, d as NulthPolicyError, e as NulthPolicyState, f as NulthProof, g as NulthSignerConfig, h as NulthStellarSigner, i as NulthVaultConfig, P as PaymentAuthContext, R as RetryPolicy, j as RouteDockClient, k as RouteDockClientConfig, S as SpendCap, l as SpendStore, V as VaultConfig, m as assertEndpointActive, n as assertManifestValid, o as assertNulthVaultManifest, p as backoffDelayMs, q as configureManifestCache, r as createNulthSigner, s as createPolicyState, t as decodeAuthSignature, u as fetchLedgerSequence, v as fetchManifest, w as invalidateManifest, x as paymentContextFromManifest, y as prepareNulthSigner, z as rankProvidersByLatency, A as selectMode, B as setNulthPaymentContext, C as usdcToMicros, E as withRetry } from './RouteDockClient-
|
|
4
|
-
export { F as FileSpendStore, M as MppChargeClient, O as OnChainProviderInfo, a as OnChainRegistry, P as ProviderRecord, b as ProviderRegistry, c as ProviderRegistryConfig, X as X402Client, u as usdcToUnits } from './ProviderRegistry-
|
|
3
|
+
export { D as DEFAULT_RETRY_POLICY, a as DailySpend, I as InMemorySpendStore, b as InMemorySpendStoreOptions, M as ModeSelectOptions, N as NulthAuthSignature, c as NulthClientConfig, d as NulthPolicyError, e as NulthPolicyState, f as NulthProof, g as NulthSignerConfig, h as NulthStellarSigner, i as NulthVaultConfig, P as PaymentAuthContext, R as RetryPolicy, j as RouteDockClient, k as RouteDockClientConfig, S as SpendCap, l as SpendStore, V as VaultConfig, m as assertEndpointActive, n as assertManifestValid, o as assertNulthVaultManifest, p as backoffDelayMs, q as configureManifestCache, r as createNulthSigner, s as createPolicyState, t as decodeAuthSignature, u as fetchLedgerSequence, v as fetchManifest, w as invalidateManifest, x as paymentContextFromManifest, y as prepareNulthSigner, z as rankProvidersByLatency, A as selectMode, B as setNulthPaymentContext, C as usdcToMicros, E as withRetry } from './RouteDockClient-CjM2VyOd.js';
|
|
4
|
+
export { F as FileSpendStore, M as MppChargeClient, O as OnChainProviderInfo, a as OnChainRegistry, P as ProviderRecord, b as ProviderRegistry, c as ProviderRegistryConfig, X as X402Client, u as usdcToUnits } from './ProviderRegistry-w4_hkI_1.js';
|
|
5
5
|
export { R as ReconciliationStats, a as RegisterProviderOptions, S as SessionReconcilerOptions, b as SupabaseSeenTxStore, d as decimalToStroops, r as reconcileAbandonedSessions, c as registerProvider, e as runStartupReconciliation } from './SessionReconciler-Bw-PoBVl.js';
|
|
6
6
|
export { R as RouteDockMiddlewareOptions, r as routedock } from './routedockMiddleware-57gUaEMf.js';
|
|
7
7
|
export { m as manifestDigest, s as signManifest, v as verifyManifestSignature } from './sign-BEq-OsSq.js';
|
package/dist/index.js
CHANGED
|
@@ -718,7 +718,7 @@ var routedock_schema_default = {
|
|
|
718
718
|
|
|
719
719
|
// package.json
|
|
720
720
|
var package_default = {
|
|
721
|
-
version: "0.3.
|
|
721
|
+
version: "0.3.1"};
|
|
722
722
|
var MANIFEST_SIGNATURE_VERSION = "2";
|
|
723
723
|
function canonicalize(value) {
|
|
724
724
|
if (Array.isArray(value)) {
|
|
@@ -2193,11 +2193,6 @@ function encodeAuthSignature(proof) {
|
|
|
2193
2193
|
const payload = { nulth: "zk-v1", proof };
|
|
2194
2194
|
return Buffer.from(JSON.stringify(payload), "utf8").toString("base64");
|
|
2195
2195
|
}
|
|
2196
|
-
function usdcToStroops2(amount) {
|
|
2197
|
-
const [whole = "0", frac = ""] = amount.split(".");
|
|
2198
|
-
const padded = (frac + "0000000").slice(0, 7);
|
|
2199
|
-
return BigInt(whole) * 10000000n + BigInt(padded);
|
|
2200
|
-
}
|
|
2201
2196
|
var NulthClient = class {
|
|
2202
2197
|
constructor(config) {
|
|
2203
2198
|
this.config = config;
|
|
@@ -2308,14 +2303,14 @@ function paymentContextFromManifest(manifest, mode, ledgerSequence) {
|
|
|
2308
2303
|
const pricing = manifest.pricing[mode];
|
|
2309
2304
|
if (!pricing) throw new Error(`manifest.pricing.${mode} missing`);
|
|
2310
2305
|
return {
|
|
2311
|
-
payee: manifest.payee,
|
|
2312
|
-
amountStroops:
|
|
2306
|
+
payee: pricing.payee ?? manifest.payee,
|
|
2307
|
+
amountStroops: usdcToStroops(pricing.amount),
|
|
2313
2308
|
assetContract: manifest.asset_contract,
|
|
2314
2309
|
ledgerSequence
|
|
2315
2310
|
};
|
|
2316
2311
|
}
|
|
2317
2312
|
function createPolicyState(input) {
|
|
2318
|
-
const dailyCapStroops =
|
|
2313
|
+
const dailyCapStroops = usdcToStroops(input.dailyCapUsdc);
|
|
2319
2314
|
return {
|
|
2320
2315
|
dailyCapStroops,
|
|
2321
2316
|
allowlistCommitment: commitAllowlist(input.allowedPayees, input.witnessSecret),
|
package/dist/react.cjs
CHANGED
|
@@ -634,7 +634,7 @@ var routedock_schema_default = {
|
|
|
634
634
|
|
|
635
635
|
// package.json
|
|
636
636
|
var package_default = {
|
|
637
|
-
version: "0.3.
|
|
637
|
+
version: "0.3.1"};
|
|
638
638
|
var MANIFEST_SIGNATURE_VERSION = "2";
|
|
639
639
|
function canonicalize(value) {
|
|
640
640
|
if (Array.isArray(value)) {
|
|
@@ -2082,11 +2082,6 @@ function encodeAuthSignature(proof) {
|
|
|
2082
2082
|
const payload = { nulth: "zk-v1", proof };
|
|
2083
2083
|
return Buffer.from(JSON.stringify(payload), "utf8").toString("base64");
|
|
2084
2084
|
}
|
|
2085
|
-
function usdcToStroops2(amount) {
|
|
2086
|
-
const [whole = "0", frac = ""] = amount.split(".");
|
|
2087
|
-
const padded = (frac + "0000000").slice(0, 7);
|
|
2088
|
-
return BigInt(whole) * 10000000n + BigInt(padded);
|
|
2089
|
-
}
|
|
2090
2085
|
var NulthClient = class {
|
|
2091
2086
|
constructor(config) {
|
|
2092
2087
|
this.config = config;
|
|
@@ -2197,14 +2192,14 @@ function paymentContextFromManifest(manifest, mode, ledgerSequence) {
|
|
|
2197
2192
|
const pricing = manifest.pricing[mode];
|
|
2198
2193
|
if (!pricing) throw new Error(`manifest.pricing.${mode} missing`);
|
|
2199
2194
|
return {
|
|
2200
|
-
payee: manifest.payee,
|
|
2201
|
-
amountStroops:
|
|
2195
|
+
payee: pricing.payee ?? manifest.payee,
|
|
2196
|
+
amountStroops: nulthSdk.usdcToStroops(pricing.amount),
|
|
2202
2197
|
assetContract: manifest.asset_contract,
|
|
2203
2198
|
ledgerSequence
|
|
2204
2199
|
};
|
|
2205
2200
|
}
|
|
2206
2201
|
function createPolicyState(input) {
|
|
2207
|
-
const dailyCapStroops =
|
|
2202
|
+
const dailyCapStroops = nulthSdk.usdcToStroops(input.dailyCapUsdc);
|
|
2208
2203
|
return {
|
|
2209
2204
|
dailyCapStroops,
|
|
2210
2205
|
allowlistCommitment: commitAllowlist(input.allowedPayees, input.witnessSecret),
|
package/dist/react.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { SupabaseClient } from '@supabase/supabase-js';
|
|
4
|
-
import { j as RouteDockClient, k as RouteDockClientConfig, M as ModeSelectOptions } from './RouteDockClient-
|
|
4
|
+
import { j as RouteDockClient, k as RouteDockClientConfig, M as ModeSelectOptions } from './RouteDockClient-CXvWXix5.cjs';
|
|
5
5
|
import { c as PaymentResult, m as SessionHandle, j as SessionCloseResult } from './logger-D8_Q2ytp.cjs';
|
|
6
6
|
import '@stellar/stellar-sdk';
|
|
7
7
|
import '@x402/stellar';
|
package/dist/react.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { SupabaseClient } from '@supabase/supabase-js';
|
|
4
|
-
import { j as RouteDockClient, k as RouteDockClientConfig, M as ModeSelectOptions } from './RouteDockClient-
|
|
4
|
+
import { j as RouteDockClient, k as RouteDockClientConfig, M as ModeSelectOptions } from './RouteDockClient-CjM2VyOd.js';
|
|
5
5
|
import { c as PaymentResult, m as SessionHandle, j as SessionCloseResult } from './logger-D8_Q2ytp.js';
|
|
6
6
|
import '@stellar/stellar-sdk';
|
|
7
7
|
import '@x402/stellar';
|
package/dist/react.js
CHANGED
|
@@ -632,7 +632,7 @@ var routedock_schema_default = {
|
|
|
632
632
|
|
|
633
633
|
// package.json
|
|
634
634
|
var package_default = {
|
|
635
|
-
version: "0.3.
|
|
635
|
+
version: "0.3.1"};
|
|
636
636
|
var MANIFEST_SIGNATURE_VERSION = "2";
|
|
637
637
|
function canonicalize(value) {
|
|
638
638
|
if (Array.isArray(value)) {
|
|
@@ -2080,11 +2080,6 @@ function encodeAuthSignature(proof) {
|
|
|
2080
2080
|
const payload = { nulth: "zk-v1", proof };
|
|
2081
2081
|
return Buffer.from(JSON.stringify(payload), "utf8").toString("base64");
|
|
2082
2082
|
}
|
|
2083
|
-
function usdcToStroops2(amount) {
|
|
2084
|
-
const [whole = "0", frac = ""] = amount.split(".");
|
|
2085
|
-
const padded = (frac + "0000000").slice(0, 7);
|
|
2086
|
-
return BigInt(whole) * 10000000n + BigInt(padded);
|
|
2087
|
-
}
|
|
2088
2083
|
var NulthClient = class {
|
|
2089
2084
|
constructor(config) {
|
|
2090
2085
|
this.config = config;
|
|
@@ -2195,14 +2190,14 @@ function paymentContextFromManifest(manifest, mode, ledgerSequence) {
|
|
|
2195
2190
|
const pricing = manifest.pricing[mode];
|
|
2196
2191
|
if (!pricing) throw new Error(`manifest.pricing.${mode} missing`);
|
|
2197
2192
|
return {
|
|
2198
|
-
payee: manifest.payee,
|
|
2199
|
-
amountStroops:
|
|
2193
|
+
payee: pricing.payee ?? manifest.payee,
|
|
2194
|
+
amountStroops: usdcToStroops(pricing.amount),
|
|
2200
2195
|
assetContract: manifest.asset_contract,
|
|
2201
2196
|
ledgerSequence
|
|
2202
2197
|
};
|
|
2203
2198
|
}
|
|
2204
2199
|
function createPolicyState(input) {
|
|
2205
|
-
const dailyCapStroops =
|
|
2200
|
+
const dailyCapStroops = usdcToStroops(input.dailyCapUsdc);
|
|
2206
2201
|
return {
|
|
2207
2202
|
dailyCapStroops,
|
|
2208
2203
|
allowlistCommitment: commitAllowlist(input.allowedPayees, input.witnessSecret),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routedock/routedock",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Unified payment execution layer for autonomous agents on Stellar",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"@x402/core": "^2.9.0",
|
|
132
132
|
"@x402/stellar": "^2.9.0",
|
|
133
133
|
"mppx": "^0.5.7",
|
|
134
|
-
"@routedock/nulth-sdk": "0.2.
|
|
134
|
+
"@routedock/nulth-sdk": "0.2.2"
|
|
135
135
|
},
|
|
136
136
|
"peerDependencies": {
|
|
137
137
|
"express": "^4.18.0",
|