@t2000/sdk 5.16.0 → 5.17.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.cjs +126 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +47 -1
- package/dist/index.d.ts +47 -1
- package/dist/index.js +126 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -62,6 +62,49 @@ declare function listModels(opts?: {
|
|
|
62
62
|
apiBase?: string;
|
|
63
63
|
}): Promise<ApiModel[]>;
|
|
64
64
|
|
|
65
|
+
type CheckStatus = 'pass' | 'fail' | 'skip';
|
|
66
|
+
type TrustMode = 'trustless' | 'receipt-asserted' | 'roadmap';
|
|
67
|
+
interface VerifyCheck {
|
|
68
|
+
name: string;
|
|
69
|
+
status: CheckStatus;
|
|
70
|
+
detail: string;
|
|
71
|
+
trust: TrustMode;
|
|
72
|
+
}
|
|
73
|
+
interface VerifyAnchor {
|
|
74
|
+
txDigest: string;
|
|
75
|
+
anchoredAtMs?: string;
|
|
76
|
+
anchoredBy?: string;
|
|
77
|
+
explorer: string;
|
|
78
|
+
}
|
|
79
|
+
interface VerifyResult {
|
|
80
|
+
receiptId: string;
|
|
81
|
+
/** True iff the receipt resolved AND its on-chain Sui anchor matches. */
|
|
82
|
+
verified: boolean;
|
|
83
|
+
/** The trustless core: an on-chain ReceiptAnchored event matches the receipt. */
|
|
84
|
+
anchorVerified: boolean;
|
|
85
|
+
checks: VerifyCheck[];
|
|
86
|
+
wireHash?: string;
|
|
87
|
+
workloadId?: string;
|
|
88
|
+
upstream?: {
|
|
89
|
+
provider?: string;
|
|
90
|
+
result?: string;
|
|
91
|
+
tcbStatus?: string;
|
|
92
|
+
};
|
|
93
|
+
anchor?: VerifyAnchor;
|
|
94
|
+
}
|
|
95
|
+
interface VerifyOptions {
|
|
96
|
+
/** Override the API base (default `api.t2000.ai/v1`). */
|
|
97
|
+
apiBase?: string;
|
|
98
|
+
/** Sui network for the trustless anchor read (default `mainnet`). */
|
|
99
|
+
network?: 'mainnet' | 'testnet';
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Verify a confidential response by its receipt id. Reads the signed receipt
|
|
103
|
+
* (public), its on-chain Sui anchor (trustless), and reports a per-check result
|
|
104
|
+
* that FAILS CLOSED on any forgery or mismatch.
|
|
105
|
+
*/
|
|
106
|
+
declare function verifyReceipt(receiptId: string, opts?: VerifyOptions): Promise<VerifyResult>;
|
|
107
|
+
|
|
65
108
|
interface LimitsConfig {
|
|
66
109
|
/** Caps any single outbound write (send | swap | pay) by USD value. */
|
|
67
110
|
perTxUsd?: number;
|
|
@@ -225,6 +268,9 @@ declare class T2000 extends EventEmitter<T2000Events> {
|
|
|
225
268
|
apiKey?: string;
|
|
226
269
|
apiBase?: string;
|
|
227
270
|
}): Promise<ApiModel[]>;
|
|
271
|
+
/** Verify a confidential response by receipt id — checks the signed receipt
|
|
272
|
+
* + its trustless on-chain Sui anchor. Fails closed on any mismatch. */
|
|
273
|
+
verify(receiptId: string, opts?: VerifyOptions): Promise<VerifyResult>;
|
|
228
274
|
swap(params: {
|
|
229
275
|
from: string;
|
|
230
276
|
to: string;
|
|
@@ -1021,4 +1067,4 @@ declare function fullHandle(label: string, parentName?: string): string;
|
|
|
1021
1067
|
*/
|
|
1022
1068
|
declare function displayHandle(label: string, parentName?: string): string;
|
|
1023
1069
|
|
|
1024
|
-
export { AGENT_ID_PARENT, AGENT_ID_PARENT_NAME, AGENT_ID_PARENT_NFT_ID, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, type ApiModel, type AppenderContext, BalanceResponse, type BuildAddLeafParams, type BuildRevokeLeafParams, type ChatMessage, type ChatParams, type ChatResult, type ChatUsage, type ComposeTxOptions, type ComposeTxResult, DEFAULT_API_BASE, type DailySpend, DepositInfo, InvalidAddressError, type LabelValidationResult, type LimitAssertInput, LimitEnforcer, LimitExceededError, type LimitKind, type LimitOperation, type LimitsConfig, type LimitsFile, type NormalizedAddress, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SendResult, type SendTransferInput, SendableAsset, type StepPreview, SuinsNotRegisteredError, type SuinsParent, SuinsRpcError, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, WRITE_APPENDER_REGISTRY, type WriteStep, type WriteToolName, ZkLoginProof, approxUsdValue, assertLimitConfig, buildAddLeafTx, buildRevokeLeafTx, chatCompletion, chatCompletionStream, clearLimits, composeTx, dailySpentToday, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fullHandle, generateKeypair, getAddress, getLimits, getSponsoredSwapProviders, getSwapQuote, hasLimits, keypairFromPrivateKey, listModels, loadKey, looksLikeSuiNs, normalizeAddressInput, queryBalance, readLimitsFile, recordDailySpend, resolveAddressToSuinsViaRpc, resolveSuinsViaRpc, saveBech32, saveKey, setLimits, validateLabel, walletExists, writeLimitsFile };
|
|
1070
|
+
export { AGENT_ID_PARENT, AGENT_ID_PARENT_NAME, AGENT_ID_PARENT_NFT_ID, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, type ApiModel, type AppenderContext, BalanceResponse, type BuildAddLeafParams, type BuildRevokeLeafParams, type ChatMessage, type ChatParams, type ChatResult, type ChatUsage, type CheckStatus, type ComposeTxOptions, type ComposeTxResult, DEFAULT_API_BASE, type DailySpend, DepositInfo, InvalidAddressError, type LabelValidationResult, type LimitAssertInput, LimitEnforcer, LimitExceededError, type LimitKind, type LimitOperation, type LimitsConfig, type LimitsFile, type NormalizedAddress, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SendResult, type SendTransferInput, SendableAsset, type StepPreview, SuinsNotRegisteredError, type SuinsParent, SuinsRpcError, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, type TrustMode, type VerifyAnchor, type VerifyCheck, type VerifyOptions, type VerifyResult, WRITE_APPENDER_REGISTRY, type WriteStep, type WriteToolName, ZkLoginProof, approxUsdValue, assertLimitConfig, buildAddLeafTx, buildRevokeLeafTx, chatCompletion, chatCompletionStream, clearLimits, composeTx, dailySpentToday, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fullHandle, generateKeypair, getAddress, getLimits, getSponsoredSwapProviders, getSwapQuote, hasLimits, keypairFromPrivateKey, listModels, loadKey, looksLikeSuiNs, normalizeAddressInput, queryBalance, readLimitsFile, recordDailySpend, resolveAddressToSuinsViaRpc, resolveSuinsViaRpc, saveBech32, saveKey, setLimits, validateLabel, verifyReceipt, walletExists, writeLimitsFile };
|
package/dist/index.d.ts
CHANGED
|
@@ -62,6 +62,49 @@ declare function listModels(opts?: {
|
|
|
62
62
|
apiBase?: string;
|
|
63
63
|
}): Promise<ApiModel[]>;
|
|
64
64
|
|
|
65
|
+
type CheckStatus = 'pass' | 'fail' | 'skip';
|
|
66
|
+
type TrustMode = 'trustless' | 'receipt-asserted' | 'roadmap';
|
|
67
|
+
interface VerifyCheck {
|
|
68
|
+
name: string;
|
|
69
|
+
status: CheckStatus;
|
|
70
|
+
detail: string;
|
|
71
|
+
trust: TrustMode;
|
|
72
|
+
}
|
|
73
|
+
interface VerifyAnchor {
|
|
74
|
+
txDigest: string;
|
|
75
|
+
anchoredAtMs?: string;
|
|
76
|
+
anchoredBy?: string;
|
|
77
|
+
explorer: string;
|
|
78
|
+
}
|
|
79
|
+
interface VerifyResult {
|
|
80
|
+
receiptId: string;
|
|
81
|
+
/** True iff the receipt resolved AND its on-chain Sui anchor matches. */
|
|
82
|
+
verified: boolean;
|
|
83
|
+
/** The trustless core: an on-chain ReceiptAnchored event matches the receipt. */
|
|
84
|
+
anchorVerified: boolean;
|
|
85
|
+
checks: VerifyCheck[];
|
|
86
|
+
wireHash?: string;
|
|
87
|
+
workloadId?: string;
|
|
88
|
+
upstream?: {
|
|
89
|
+
provider?: string;
|
|
90
|
+
result?: string;
|
|
91
|
+
tcbStatus?: string;
|
|
92
|
+
};
|
|
93
|
+
anchor?: VerifyAnchor;
|
|
94
|
+
}
|
|
95
|
+
interface VerifyOptions {
|
|
96
|
+
/** Override the API base (default `api.t2000.ai/v1`). */
|
|
97
|
+
apiBase?: string;
|
|
98
|
+
/** Sui network for the trustless anchor read (default `mainnet`). */
|
|
99
|
+
network?: 'mainnet' | 'testnet';
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Verify a confidential response by its receipt id. Reads the signed receipt
|
|
103
|
+
* (public), its on-chain Sui anchor (trustless), and reports a per-check result
|
|
104
|
+
* that FAILS CLOSED on any forgery or mismatch.
|
|
105
|
+
*/
|
|
106
|
+
declare function verifyReceipt(receiptId: string, opts?: VerifyOptions): Promise<VerifyResult>;
|
|
107
|
+
|
|
65
108
|
interface LimitsConfig {
|
|
66
109
|
/** Caps any single outbound write (send | swap | pay) by USD value. */
|
|
67
110
|
perTxUsd?: number;
|
|
@@ -225,6 +268,9 @@ declare class T2000 extends EventEmitter<T2000Events> {
|
|
|
225
268
|
apiKey?: string;
|
|
226
269
|
apiBase?: string;
|
|
227
270
|
}): Promise<ApiModel[]>;
|
|
271
|
+
/** Verify a confidential response by receipt id — checks the signed receipt
|
|
272
|
+
* + its trustless on-chain Sui anchor. Fails closed on any mismatch. */
|
|
273
|
+
verify(receiptId: string, opts?: VerifyOptions): Promise<VerifyResult>;
|
|
228
274
|
swap(params: {
|
|
229
275
|
from: string;
|
|
230
276
|
to: string;
|
|
@@ -1021,4 +1067,4 @@ declare function fullHandle(label: string, parentName?: string): string;
|
|
|
1021
1067
|
*/
|
|
1022
1068
|
declare function displayHandle(label: string, parentName?: string): string;
|
|
1023
1069
|
|
|
1024
|
-
export { AGENT_ID_PARENT, AGENT_ID_PARENT_NAME, AGENT_ID_PARENT_NFT_ID, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, type ApiModel, type AppenderContext, BalanceResponse, type BuildAddLeafParams, type BuildRevokeLeafParams, type ChatMessage, type ChatParams, type ChatResult, type ChatUsage, type ComposeTxOptions, type ComposeTxResult, DEFAULT_API_BASE, type DailySpend, DepositInfo, InvalidAddressError, type LabelValidationResult, type LimitAssertInput, LimitEnforcer, LimitExceededError, type LimitKind, type LimitOperation, type LimitsConfig, type LimitsFile, type NormalizedAddress, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SendResult, type SendTransferInput, SendableAsset, type StepPreview, SuinsNotRegisteredError, type SuinsParent, SuinsRpcError, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, WRITE_APPENDER_REGISTRY, type WriteStep, type WriteToolName, ZkLoginProof, approxUsdValue, assertLimitConfig, buildAddLeafTx, buildRevokeLeafTx, chatCompletion, chatCompletionStream, clearLimits, composeTx, dailySpentToday, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fullHandle, generateKeypair, getAddress, getLimits, getSponsoredSwapProviders, getSwapQuote, hasLimits, keypairFromPrivateKey, listModels, loadKey, looksLikeSuiNs, normalizeAddressInput, queryBalance, readLimitsFile, recordDailySpend, resolveAddressToSuinsViaRpc, resolveSuinsViaRpc, saveBech32, saveKey, setLimits, validateLabel, walletExists, writeLimitsFile };
|
|
1070
|
+
export { AGENT_ID_PARENT, AGENT_ID_PARENT_NAME, AGENT_ID_PARENT_NFT_ID, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, type ApiModel, type AppenderContext, BalanceResponse, type BuildAddLeafParams, type BuildRevokeLeafParams, type ChatMessage, type ChatParams, type ChatResult, type ChatUsage, type CheckStatus, type ComposeTxOptions, type ComposeTxResult, DEFAULT_API_BASE, type DailySpend, DepositInfo, InvalidAddressError, type LabelValidationResult, type LimitAssertInput, LimitEnforcer, LimitExceededError, type LimitKind, type LimitOperation, type LimitsConfig, type LimitsFile, type NormalizedAddress, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SendResult, type SendTransferInput, SendableAsset, type StepPreview, SuinsNotRegisteredError, type SuinsParent, SuinsRpcError, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, type TrustMode, type VerifyAnchor, type VerifyCheck, type VerifyOptions, type VerifyResult, WRITE_APPENDER_REGISTRY, type WriteStep, type WriteToolName, ZkLoginProof, approxUsdValue, assertLimitConfig, buildAddLeafTx, buildRevokeLeafTx, chatCompletion, chatCompletionStream, clearLimits, composeTx, dailySpentToday, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fullHandle, generateKeypair, getAddress, getLimits, getSponsoredSwapProviders, getSwapQuote, hasLimits, keypairFromPrivateKey, listModels, loadKey, looksLikeSuiNs, normalizeAddressInput, queryBalance, readLimitsFile, recordDailySpend, resolveAddressToSuinsViaRpc, resolveSuinsViaRpc, saveBech32, saveKey, setLimits, validateLabel, verifyReceipt, walletExists, writeLimitsFile };
|
package/dist/index.js
CHANGED
|
@@ -1220,10 +1220,10 @@ async function finalize(response, opts) {
|
|
|
1220
1220
|
return { status: response.status, body: body2, paid: opts.paid };
|
|
1221
1221
|
}
|
|
1222
1222
|
async function makeGrpcBuildClient(client) {
|
|
1223
|
-
const { SuiGrpcClient:
|
|
1223
|
+
const { SuiGrpcClient: SuiGrpcClient3 } = await import('@mysten/sui/grpc');
|
|
1224
1224
|
const network = client.network === "testnet" ? "testnet" : "mainnet";
|
|
1225
1225
|
const baseUrl = network === "testnet" ? "https://fullnode.testnet.sui.io" : "https://fullnode.mainnet.sui.io";
|
|
1226
|
-
return new
|
|
1226
|
+
return new SuiGrpcClient3({ baseUrl, network });
|
|
1227
1227
|
}
|
|
1228
1228
|
function atomicToHuman(raw, decimals) {
|
|
1229
1229
|
return Number(raw) / 10 ** decimals;
|
|
@@ -2024,6 +2024,124 @@ async function listModels(opts) {
|
|
|
2024
2024
|
privacy: m.privacy ?? m.privacy_tier
|
|
2025
2025
|
}));
|
|
2026
2026
|
}
|
|
2027
|
+
var RECEIPT_ANCHORED_SUFFIX = "::anchor::ReceiptAnchored";
|
|
2028
|
+
function fullnodeUrl(network) {
|
|
2029
|
+
return network === "testnet" ? "https://fullnode.testnet.sui.io" : "https://fullnode.mainnet.sui.io";
|
|
2030
|
+
}
|
|
2031
|
+
async function verifyReceipt(receiptId, opts = {}) {
|
|
2032
|
+
const base = opts.apiBase ?? DEFAULT_API_BASE;
|
|
2033
|
+
const network = opts.network ?? "mainnet";
|
|
2034
|
+
const checks = [];
|
|
2035
|
+
let receipt = null;
|
|
2036
|
+
try {
|
|
2037
|
+
const res = await fetch(`${base}/aci/receipts/${encodeURIComponent(receiptId)}`);
|
|
2038
|
+
if (res.ok) {
|
|
2039
|
+
receipt = await res.json();
|
|
2040
|
+
}
|
|
2041
|
+
} catch {
|
|
2042
|
+
}
|
|
2043
|
+
if (!receipt?.event_log) {
|
|
2044
|
+
checks.push({
|
|
2045
|
+
name: "Receipt",
|
|
2046
|
+
status: "fail",
|
|
2047
|
+
detail: "receipt not found or malformed",
|
|
2048
|
+
trust: "receipt-asserted"
|
|
2049
|
+
});
|
|
2050
|
+
return { receiptId, verified: false, anchorVerified: false, checks };
|
|
2051
|
+
}
|
|
2052
|
+
const wireHash = receipt.event_log.find((e) => e.type === "response.returned")?.wire_hash;
|
|
2053
|
+
const workloadId = receipt.workload_id;
|
|
2054
|
+
checks.push({
|
|
2055
|
+
name: "Receipt",
|
|
2056
|
+
status: wireHash && workloadId ? "pass" : "fail",
|
|
2057
|
+
detail: wireHash ? `well-formed (${receipt.event_log.length} log entries, workload ${workloadId})` : "missing response wire_hash / workload_id",
|
|
2058
|
+
trust: "receipt-asserted"
|
|
2059
|
+
});
|
|
2060
|
+
const upstreamEv = receipt.event_log.find((e) => e.type === "upstream.verified");
|
|
2061
|
+
const upstreamOk = upstreamEv?.result === "verified";
|
|
2062
|
+
checks.push({
|
|
2063
|
+
name: "Confidential upstream",
|
|
2064
|
+
status: upstreamEv ? upstreamOk ? "pass" : "fail" : "skip",
|
|
2065
|
+
detail: upstreamEv ? `${upstreamEv.provider ?? upstreamEv.upstream_name ?? "upstream"}: ${upstreamEv.result ?? "unknown"}${upstreamEv.tcb_status ? ` (TCB ${upstreamEv.tcb_status})` : ""}` : "no upstream.verified event (routed/non-confidential?)",
|
|
2066
|
+
trust: "receipt-asserted"
|
|
2067
|
+
});
|
|
2068
|
+
let anchorVerified = false;
|
|
2069
|
+
let anchor;
|
|
2070
|
+
let digest;
|
|
2071
|
+
try {
|
|
2072
|
+
const res = await fetch(`${base}/aci/anchor/${encodeURIComponent(receiptId)}`);
|
|
2073
|
+
if (res.ok) {
|
|
2074
|
+
const j = await res.json();
|
|
2075
|
+
digest = j.txDigest;
|
|
2076
|
+
}
|
|
2077
|
+
} catch {
|
|
2078
|
+
}
|
|
2079
|
+
if (!digest) {
|
|
2080
|
+
checks.push({
|
|
2081
|
+
name: "Sui anchor",
|
|
2082
|
+
status: "fail",
|
|
2083
|
+
detail: `no anchor on record \u2014 POST ${base}/aci/anchor/${receiptId} to create one`,
|
|
2084
|
+
trust: "trustless"
|
|
2085
|
+
});
|
|
2086
|
+
} else {
|
|
2087
|
+
try {
|
|
2088
|
+
const client = new SuiGrpcClient({ baseUrl: fullnodeUrl(network), network });
|
|
2089
|
+
const tx = await client.core.getTransaction({
|
|
2090
|
+
digest,
|
|
2091
|
+
include: { events: true }
|
|
2092
|
+
});
|
|
2093
|
+
const txn = tx.$kind === "Transaction" ? tx.Transaction : tx.FailedTransaction;
|
|
2094
|
+
const ev = (txn.events ?? []).find(
|
|
2095
|
+
(e) => e.eventType.endsWith(RECEIPT_ANCHORED_SUFFIX)
|
|
2096
|
+
);
|
|
2097
|
+
const data = ev?.json ?? {};
|
|
2098
|
+
const onChainReceipt = String(data.receipt_id ?? "");
|
|
2099
|
+
const onChainWire = String(data.wire_hash ?? "");
|
|
2100
|
+
const onChainWorkload = String(data.workload_id ?? "");
|
|
2101
|
+
const matches = onChainReceipt === receiptId && onChainWire === wireHash && onChainWorkload === workloadId;
|
|
2102
|
+
anchorVerified = matches;
|
|
2103
|
+
anchor = {
|
|
2104
|
+
txDigest: digest,
|
|
2105
|
+
anchoredAtMs: data.anchored_at_ms ? String(data.anchored_at_ms) : void 0,
|
|
2106
|
+
anchoredBy: data.anchored_by ? String(data.anchored_by) : void 0,
|
|
2107
|
+
explorer: `https://suiscan.xyz/${network}/tx/${digest}`
|
|
2108
|
+
};
|
|
2109
|
+
checks.push({
|
|
2110
|
+
name: "Sui anchor",
|
|
2111
|
+
status: matches ? "pass" : "fail",
|
|
2112
|
+
detail: matches ? `on-chain ReceiptAnchored matches (wire_hash + workload_id), tx ${digest}` : `on-chain event does NOT match the receipt (wire ${onChainWire || "absent"})`,
|
|
2113
|
+
trust: "trustless"
|
|
2114
|
+
});
|
|
2115
|
+
} catch (e) {
|
|
2116
|
+
checks.push({
|
|
2117
|
+
name: "Sui anchor",
|
|
2118
|
+
status: "fail",
|
|
2119
|
+
detail: `could not read anchor tx ${digest}: ${e instanceof Error ? e.message : "error"}`,
|
|
2120
|
+
trust: "trustless"
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
checks.push({
|
|
2125
|
+
name: "Receipt signature",
|
|
2126
|
+
status: "skip",
|
|
2127
|
+
detail: receipt.signature ? "present (local recompute via RedPill keyset canonicalization = roadmap)" : "no signature on receipt",
|
|
2128
|
+
trust: "roadmap"
|
|
2129
|
+
});
|
|
2130
|
+
return {
|
|
2131
|
+
receiptId,
|
|
2132
|
+
verified: Boolean(wireHash && workloadId) && anchorVerified,
|
|
2133
|
+
anchorVerified,
|
|
2134
|
+
checks,
|
|
2135
|
+
wireHash,
|
|
2136
|
+
workloadId,
|
|
2137
|
+
upstream: upstreamEv ? {
|
|
2138
|
+
provider: upstreamEv.provider ?? upstreamEv.upstream_name,
|
|
2139
|
+
result: upstreamEv.result,
|
|
2140
|
+
tcbStatus: upstreamEv.tcb_status
|
|
2141
|
+
} : void 0,
|
|
2142
|
+
anchor
|
|
2143
|
+
};
|
|
2144
|
+
}
|
|
2027
2145
|
var DEFAULT_CONFIG_DIR = join(homedir(), ".t2000");
|
|
2028
2146
|
function resolveConfigPath(configDir) {
|
|
2029
2147
|
return join(configDir ?? DEFAULT_CONFIG_DIR, "config.json");
|
|
@@ -2309,6 +2427,11 @@ var T2000 = class _T2000 extends EventEmitter {
|
|
|
2309
2427
|
async models(opts) {
|
|
2310
2428
|
return listModels(opts);
|
|
2311
2429
|
}
|
|
2430
|
+
/** Verify a confidential response by receipt id — checks the signed receipt
|
|
2431
|
+
* + its trustless on-chain Sui anchor. Fails closed on any mismatch. */
|
|
2432
|
+
async verify(receiptId, opts) {
|
|
2433
|
+
return verifyReceipt(receiptId, opts);
|
|
2434
|
+
}
|
|
2312
2435
|
// -- Swap --
|
|
2313
2436
|
async swap(params) {
|
|
2314
2437
|
this.limits.assert({
|
|
@@ -3067,6 +3190,6 @@ function displayHandle(label, parentName = AUDRIC_PARENT_NAME) {
|
|
|
3067
3190
|
// src/index.ts
|
|
3068
3191
|
init_preflight();
|
|
3069
3192
|
|
|
3070
|
-
export { AGENT_ID_PARENT, AGENT_ID_PARENT_NAME, AGENT_ID_PARENT_NFT_ID, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, CETUS_USDC_SUI_POOL, CLOCK_ID, COIN_REGISTRY, DEFAULT_API_BASE, DEFAULT_GRPC_URL, DEFAULT_NETWORK, ETH_TYPE, GASLESS_MIN_STABLE_AMOUNT, GASLESS_STABLE_TYPES, GAS_RESERVE_MIN, IKA_TYPE, InvalidAddressError, KNOWN_TARGETS, KeypairSigner, LABEL_PATTERNS, LOFI_TYPE, LimitEnforcer, LimitExceededError, MANIFEST_TYPE, MIST_PER_SUI, NAVX_TYPE, OPERATION_ASSETS, OVERLAY_FEE_RATE, PREFLIGHT_MAX_AMOUNT, PREFLIGHT_OK, SENDABLE_ASSETS, SPONSORED_PYTH_DEPENDENT_PROVIDERS, STABLE_ASSETS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SUI_DECIMALS, SUI_TYPE, SUPPORTED_ASSETS, SuinsNotRegisteredError, SuinsRpcError, T2000, T2000Error, T2000_OVERLAY_FEE_WALLET, TOKEN_MAP, USDC_DECIMALS, USDC_TYPE, USDE_TYPE, USDSUI_TYPE, USDT_TYPE, WAL_TYPE, WBTC_TYPE, WRITE_APPENDER_REGISTRY, ZkLoginSigner, addSendToTx, addSwapToTx, approxUsdValue, assertAllowedAsset, assertLimitConfig, buildAddLeafTx, buildRevokeLeafTx, buildSendTx, buildSwapTx, chatCompletion, chatCompletionStream, checkPositiveAmount, checkSuiAddress, classifyAction, classifyLabel, classifyTransaction, clearLimits, composeTx, dailySpentToday, deriveAllowedAddressesFromPtb, deserializeCetusRoute, displayHandle, executeTx, exportPrivateKey, extractAllUserLegs, extractTransferDetails, extractTxCommands, extractTxSender, fallbackLabel, fetchAllCoins, findSwapRoute, formatAssetAmount, formatSui, formatUsd, fullHandle, generateKeypair, getAddress, getCoinMeta, getDecimals, getDecimalsForCoinType, getLimits, getSponsoredSwapProviders, getSuiClient, getSuiGrpcClient, getSwapQuote, hasLimits, isAllowedAsset, isCetusRouteFresh, isInRegistry, keypairFromPrivateKey, listModels, loadKey, looksLikeSuiNs, mapMoveAbortCode, mapWalletError, mistToSui, normalizeAddressInput, normalizeAsset, normalizeCoinType, parseSuiRpcTx, payWithMpp, preflightFail, preflightPay, preflightSend, preflightSwap, queryBalance, queryHistory, queryTransaction, rawToStable, rawToUsdc, readLimitsFile, recordDailySpend, refineLendingLabel, resolveAddressToSuinsViaRpc, resolveSuinsViaRpc, resolveSymbol, resolveTokenType, saveBech32, saveKey, selectAndSplitCoin, selectSuiCoin, serializeCetusRoute, setLimits, simulateTransaction, stableToRaw, suiToMist, throwIfSimulationFailed, truncateAddress, usdcToRaw, validateAddress, validateLabel, verifyCetusRouteCoinMatch, walletExists, writeLimitsFile };
|
|
3193
|
+
export { AGENT_ID_PARENT, AGENT_ID_PARENT_NAME, AGENT_ID_PARENT_NFT_ID, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, CETUS_USDC_SUI_POOL, CLOCK_ID, COIN_REGISTRY, DEFAULT_API_BASE, DEFAULT_GRPC_URL, DEFAULT_NETWORK, ETH_TYPE, GASLESS_MIN_STABLE_AMOUNT, GASLESS_STABLE_TYPES, GAS_RESERVE_MIN, IKA_TYPE, InvalidAddressError, KNOWN_TARGETS, KeypairSigner, LABEL_PATTERNS, LOFI_TYPE, LimitEnforcer, LimitExceededError, MANIFEST_TYPE, MIST_PER_SUI, NAVX_TYPE, OPERATION_ASSETS, OVERLAY_FEE_RATE, PREFLIGHT_MAX_AMOUNT, PREFLIGHT_OK, SENDABLE_ASSETS, SPONSORED_PYTH_DEPENDENT_PROVIDERS, STABLE_ASSETS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SUI_DECIMALS, SUI_TYPE, SUPPORTED_ASSETS, SuinsNotRegisteredError, SuinsRpcError, T2000, T2000Error, T2000_OVERLAY_FEE_WALLET, TOKEN_MAP, USDC_DECIMALS, USDC_TYPE, USDE_TYPE, USDSUI_TYPE, USDT_TYPE, WAL_TYPE, WBTC_TYPE, WRITE_APPENDER_REGISTRY, ZkLoginSigner, addSendToTx, addSwapToTx, approxUsdValue, assertAllowedAsset, assertLimitConfig, buildAddLeafTx, buildRevokeLeafTx, buildSendTx, buildSwapTx, chatCompletion, chatCompletionStream, checkPositiveAmount, checkSuiAddress, classifyAction, classifyLabel, classifyTransaction, clearLimits, composeTx, dailySpentToday, deriveAllowedAddressesFromPtb, deserializeCetusRoute, displayHandle, executeTx, exportPrivateKey, extractAllUserLegs, extractTransferDetails, extractTxCommands, extractTxSender, fallbackLabel, fetchAllCoins, findSwapRoute, formatAssetAmount, formatSui, formatUsd, fullHandle, generateKeypair, getAddress, getCoinMeta, getDecimals, getDecimalsForCoinType, getLimits, getSponsoredSwapProviders, getSuiClient, getSuiGrpcClient, getSwapQuote, hasLimits, isAllowedAsset, isCetusRouteFresh, isInRegistry, keypairFromPrivateKey, listModels, loadKey, looksLikeSuiNs, mapMoveAbortCode, mapWalletError, mistToSui, normalizeAddressInput, normalizeAsset, normalizeCoinType, parseSuiRpcTx, payWithMpp, preflightFail, preflightPay, preflightSend, preflightSwap, queryBalance, queryHistory, queryTransaction, rawToStable, rawToUsdc, readLimitsFile, recordDailySpend, refineLendingLabel, resolveAddressToSuinsViaRpc, resolveSuinsViaRpc, resolveSymbol, resolveTokenType, saveBech32, saveKey, selectAndSplitCoin, selectSuiCoin, serializeCetusRoute, setLimits, simulateTransaction, stableToRaw, suiToMist, throwIfSimulationFailed, truncateAddress, usdcToRaw, validateAddress, validateLabel, verifyCetusRouteCoinMatch, verifyReceipt, walletExists, writeLimitsFile };
|
|
3071
3194
|
//# sourceMappingURL=index.js.map
|
|
3072
3195
|
//# sourceMappingURL=index.js.map
|