SPB Git

Repository Public

execution-vectors.mts 20.7 KB 183 lines typescript

1// Generates the canonical vectors of the Execution domain of SPWalletCore from the backend's OWN TypeScript.2// Run: cd ~/Desktop/Cluster/projets/sp-wallet && npx tsx /tmp/spw-vectors-exec.mts <output dir of Vectors> <output dir of Fixtures>3// Pure functions only: no database query, no network, no server is started.4import { createHash } from 'node:crypto';5import { mkdirSync, writeFileSync } from 'node:fs';6import { join } from 'node:path';78const ROOT = '/Users/simon-pierreboucher/Desktop/Cluster/projets/sp-wallet';9const trading = await import(`${ROOT}/packages/trading/src/index.ts`);10const live = await import(`${ROOT}/packages/derivatives/src/live/index.ts`);11const keyModel = await import(`${ROOT}/services/api/src/trading-api/key-model.ts`);12const exec = await import(`${ROOT}/services/api/src/derivatives/exec.ts`);1314const hex = (b: Uint8Array | Buffer): string => Buffer.from(b).toString('hex');15const sha = (b: Uint8Array | Buffer | string): string => createHash('sha256').update(b).digest('hex');16const b64u = (h: string): string => Buffer.from(h, 'hex').toString('base64url');1718interface Vector { name: string; domain: string; source: string; object: unknown; canonicalHex: string; hashHex: string }1920// `stableJson` of services/api/src/derivatives/exec.ts is not exported. The string below is rebuilt with the same rule and is21// ACCEPTED ONLY when its SHA-256 equals what the backend's exported `canonicalIntentHash(domain, object)` returns.22const stableJson = (v: unknown): string => (v === null || typeof v !== 'object' ? JSON.stringify(v ?? null) : Array.isArray(v) ? `[${v.map(stableJson).join(',')}]`23  : `{${Object.keys(v as object).sort().map((k) => `${JSON.stringify(k)}:${stableJson((v as Record<string, unknown>)[k])}`).join(',')}}`);24function intentVector(name: string, domain: string, source: string, object: unknown): Vector {25  const canonical = Buffer.from(`${domain}\n${stableJson(object)}`, 'utf8');26  const backend = hex(exec.canonicalIntentHash(domain, object));27  if (sha(canonical) !== backend) throw new Error(`${name}: the rebuilt canonical string does not hash to the backend's canonicalIntentHash`);28  return { name, domain, source, object, canonicalHex: hex(canonical), hashHex: backend };29}3031const STAMP = { createdAt: 1794000000000, expiresAt: 1794000300000 };32const SRC_RISK = (fn: string) => `services/api/src/risk/service.ts ${fn} → risk/passkey.ts prepareIntent → services/api/src/derivatives/exec.ts canonicalIntentHash`;3334// ---------------------------------------------------------------------------------------------------------------- risk limits35const limitsFull = trading.RiskLimitsSchema.parse({36  allowedVenues: ['hyperliquid', 'gmx'], allowedInstruments: ['hyperliquid:ETH', 'hyperliquid:BTC', 'gmx:BTC/USD [BTC-USDC]'],37  maxPositionNotional: { per: { 'hyperliquid:BTC': '20000', 'hyperliquid:ETH': '10000.50' }, default: '5000' },38  maxOrderLeverage: '5', maxAccountLeverage: '3.5', maxDailyLoss: '500', maxTotalLoss: '2000', maxDrawdownBps: '1500', maxGrossExposure: '40000', maxNetExposure: '25000',39  maxAssetExposure: { per: { BTC: '15000', ETH: '9000' } }, maxVenueExposure: { per: {}, default: '30000' }, maxVenueCollateralShareBps: '8000',40  minLiquidationDistanceBps: '1200', maxSlippageBps: '80', maxPriceAgeMs: { per: { coingecko: 900000, hyperliquid: 5000 }, default: 10000 }, maxBookAgeMs: 8000,41  minPriceSources: 2, maxSourceDeviationBps: '150', maxOrdersPerMinute: 10, maxOrdersPerHour: 100, maxOrdersPerDay: 500, maxOrderNotional: '5000', maxDailyNotional: '50000',42  minLiquidity: { withinBps: '100', multiple: '2' },43});44const limitsVectors: Vector[] = [45  intentVector('limits-live-every-field', 'SPW-RISK-LIMITS-INTENT-v1', SRC_RISK('prepareLimits'),46    { v: 1, kind: 'limits', mode: 'live', limits: limitsFull, loosened: ['allowedInstruments', 'maxDailyLoss', 'maxGrossExposure', 'maxPositionNotional'], nonce: '0d5a7b52-6f1e-4d0a-9a51-000000000001', ...STAMP }),47  intentVector('limits-paper-two-fields', 'SPW-RISK-LIMITS-INTENT-v1', SRC_RISK('prepareLimits'),48    { v: 1, kind: 'limits', mode: 'paper', limits: trading.RiskLimitsSchema.parse({ maxOrderNotional: '20000000', maxOrdersPerMinute: 120 }), loosened: ['maxOrdersPerMinute', 'maxOrderNotional'], nonce: '0d5a7b52-6f1e-4d0a-9a51-000000000002', ...STAMP }),49  intentVector('limits-live-empty-lists-and-zero', 'SPW-RISK-LIMITS-INTENT-v1', SRC_RISK('prepareLimits'),50    { v: 1, kind: 'limits', mode: 'live', limits: trading.RiskLimitsSchema.parse({ allowedVenues: [], allowedInstruments: ['hyperliquid:BTC'], maxDailyLoss: '0', maxPositionNotional: { per: {} }, maxOrdersPerDay: 0 }), loosened: ['allowedInstruments'], nonce: '0d5a7b52-6f1e-4d0a-9a51-000000000003', ...STAMP }),51];5253// ---------------------------------------------------------------------------------------------------------------- switches, automatic stops54const switchVectors: Vector[] = [55  intentVector('release-kill-switch-owner', 'SPW-RISK-SWITCH-INTENT-v1', SRC_RISK('prepareRelease'),56    { v: 1, kind: 'kill_switch', engagedAt: 1793999940000, engagedBy: 'owner:owner', reason: 'arrêt d\'urgence / "test" — \\ fin', nonce: '0d5a7b52-6f1e-4d0a-9a51-000000000011', ...STAMP }),57  intentVector('release-read-only-nulls', 'SPW-RISK-SWITCH-INTENT-v1', SRC_RISK('prepareRelease'),58    { v: 1, kind: 'read_only', engagedAt: null, engagedBy: null, reason: null, nonce: '0d5a7b52-6f1e-4d0a-9a51-000000000012', ...STAMP }),59  intentVector('release-kill-switch-system-control-characters', 'SPW-RISK-SWITCH-INTENT-v1', SRC_RISK('prepareRelease'),60    { v: 1, kind: 'kill_switch', engagedAt: 1793999940001, engagedBy: 'system:supervisor', reason: 'tab\there\nline\r\u0001\u001f\u007f\b\f 

 😀 é/</script>', nonce: '0d5a7b52-6f1e-4d0a-9a51-000000000013', ...STAMP }),61  intentVector('release-kill-switch-api-key', 'SPW-RISK-SWITCH-INTENT-v1', SRC_RISK('prepareRelease'),62    { v: 1, kind: 'kill_switch', engagedAt: 1793999000000, engagedBy: 'api_key:spk_0123456789ab', reason: 'max loss', nonce: '0d5a7b52-6f1e-4d0a-9a51-000000000014', ...STAMP }),63];64const autoVectors: Vector[] = [65  intentVector('auto-total-loss-off', 'SPW-RISK-AUTO-INTENT-v1', SRC_RISK('prepareAutoKill'),66    { v: 1, kind: 'auto', auto: { totalLoss: false, drawdown: true, dailyLoss: false }, loosened: ['totalLoss'], nonce: '0d5a7b52-6f1e-4d0a-9a51-000000000021', ...STAMP }),67  intentVector('auto-all-off', 'SPW-RISK-AUTO-INTENT-v1', SRC_RISK('prepareAutoKill'),68    { v: 1, kind: 'auto', auto: { totalLoss: false, drawdown: false, dailyLoss: false }, loosened: ['totalLoss', 'drawdown', 'dailyLoss'], nonce: '0d5a7b52-6f1e-4d0a-9a51-000000000022', ...STAMP }),69];7071// ---------------------------------------------------------------------------------------------------------------- trading mandates72const SRC_TM = 'packages/trading/src/mandate/trading-mandate.ts tradingMandateBytes / tradingMandateHash';73const tm = (name: string, object: unknown): Vector => ({ name, domain: trading.TRADING_MANDATE_DOMAIN, source: SRC_TM, object, canonicalHex: hex(trading.tradingMandateBytes(object)), hashHex: hex(trading.tradingMandateHash(object)) });74const ACCOUNT = '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', AGENT_KEY = '0x90f79bf6eb2c4f870365e785982e1f101e93b906';75const liveMandate = {76  v: 1, mandateId: '4b9d1c2e-3f40-4a5b-8c6d-000000000101', principal: { kind: 'agent', id: '9f8e7d6c-5b4a-4c3d-8e2f-000000000201' },77  accounts: [{ kind: 'venue_account', venue: 'hyperliquid', network: 'mainnet', account: ACCOUNT }], venues: ['hyperliquid'], networks: ['mainnet'],78  instruments: ['hyperliquid:ETH', 'hyperliquid:BTC'], marketKinds: ['perp'], orderTypes: ['market', 'limit', 'stop', 'take_profit'],79  maxCapitalUsd: '5000.50', maxOrderNotionalUsd: '2000.00', maxPositionNotionalUsd: '8000', maxLeverage: '3', maxDailyLossUsd: '250.50', floorEquityUsd: '2500.0',80  createdAt: 1794000000, notBefore: 1794000000, notAfter: 1794000000 + 14 * 86400, frequency: { perMinute: 5, perHour: 30, perDay: 120 }, maxSlippageBps: 150, maxFeeUsd: '5.0',81  stopConditions: [{ kind: 'signer_unreachable_gte', ms: 120000 }, { kind: 'loss_gte', usd: '1000.0' }, { kind: 'drawdown_gte', bps: 1500 }, { kind: 'data_stale_gte', ms: 30000 }, { kind: 'consecutive_rejects_gte', count: 5 }],82  mode: 'live', strategySha256: 'a1'.repeat(32), label: 'Tendance BTC/ETH — été',83};84const paperMandate = {85  v: 1, mandateId: '4b9d1c2e-3f40-4a5b-8c6d-000000000102', principal: { kind: 'api_key', id: 'spk_0123456789ab' },86  accounts: [{ kind: 'venue_account', venue: 'hyperliquid', network: 'paper', account: '6e0f8a44-1b7c-4f1e-9d55-0000000000a2' }, { kind: 'venue_account', venue: 'gmx', network: 'paper', account: '6e0f8a44-1b7c-4f1e-9d55-0000000000a1' }],87  venues: ['hyperliquid', 'gmx'], networks: ['paper'], instruments: ['hyperliquid:*', 'gmx:BTC/USD'], marketKinds: ['perp'], orderTypes: ['limit', 'market'],88  maxCapitalUsd: '100000', maxOrderNotionalUsd: '0.50', maxPositionNotionalUsd: '250000.000', maxLeverage: '2.50', maxDailyLossUsd: '1', floorEquityUsd: '0',89  createdAt: 1794000000, notBefore: 1794003600, notAfter: 1794000000 + 365 * 86400, frequency: { perMinute: 1, perHour: 1, perDay: 1 }, maxSlippageBps: 1, maxFeeUsd: '0',90  stopConditions: [], mode: 'paper', strategySha256: null, label: 'clé de test',91};92const vaultMandate = {93  v: 1, mandateId: '4b9d1c2e-3f40-4a5b-8c6d-000000000103', principal: { kind: 'agent', id: 'agent:dca.01' },94  accounts: [{ kind: 'vault', vaultIndex: 3, address: '0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65', network: 'base' }, { kind: 'venue_account', venue: 'hyperliquid', network: 'testnet', account: ACCOUNT }],95  venues: ['spot', 'hyperliquid'], networks: ['testnet', 'base'], instruments: ['spot:ETH-USDC', 'hyperliquid:BTC', 'spot:ETH'], marketKinds: ['spot', 'perp'], orderTypes: ['take_profit', 'market'],96  maxCapitalUsd: '0.000001', maxOrderNotionalUsd: '0.000001', maxPositionNotionalUsd: '0.000001', maxLeverage: '1', maxDailyLossUsd: '0.000001', floorEquityUsd: '0.0000001',97  createdAt: 1794000000, notBefore: 1794000000, notAfter: 1794086400, frequency: { perMinute: 600, perHour: 10000, perDay: 500 }, maxSlippageBps: 2000, maxFeeUsd: '12.340',98  stopConditions: [{ kind: 'loss_gte', usd: '0.10' }], mode: 'live', strategySha256: 'b2'.repeat(32), label: 'x',99};100const mandateVectors: Vector[] = [tm('live-agent-perp-all-stop-conditions', liveMandate), tm('paper-api-key-wildcard-null-strategy', paperMandate), tm('live-vault-and-venue-account-spot-perp', vaultMandate)];101102// the derivative mandate the isolated signer stores, COMPILED by the backend from the live trading mandate above103const authorization = { v: 1, authorizationId: '7c2a9e10-4d3b-4e8f-9a6c-000000000301', keyId: 'spw-0123456789abcdef', venue: 'hyperliquid', network: 'mainnet', account: ACCOUNT, agentAddress: AGENT_KEY, agentName: 'spw-main',104  mode: 'MANUAL_LIVE', policy: { allowedInstruments: ['hyperliquid:BTC', 'hyperliquid:ETH', 'hyperliquid:SOL'], maxLeverage: 5, maxOrderNotional: '5000', maxPositionNotional: '20000', maxGrossExposure: '40000', maxOrdersPerDay: 200, maxPriceDeviationBps: 300 },105  createdAt: 1793990000, expiresAt: 1794000000 + 60 * 86400 };106const ACK_SHA = 'c3'.repeat(32);107const compiled = trading.compileToVenueMandate(liveMandate, { authorization, ackSha256: ACK_SHA });108const SRC_VM = 'packages/derivatives/src/live/mandate.ts venueMandateBytes / venueMandateHash';109const vm = (name: string, object: unknown, source = SRC_VM): Vector => ({ name, domain: 'SPW-VENUE-MANDATE-v1', source, object, canonicalHex: hex(live.venueMandateBytes(object)), hashHex: hex(live.venueMandateHash(object)) });110const venueVectors: Vector[] = [111  vm('compiled-from-live-agent-perp-all-stop-conditions', compiled.mandate, `packages/trading/src/mandate/trading-mandate.ts compileToVenueMandate → ${SRC_VM}`),112  vm('hand-built-unsorted-instruments-decimals', { v: 1, mandateId: '4b9d1c2e-3f40-4a5b-8c6d-000000000110', authorizationId: authorization.authorizationId, keyId: authorization.keyId, venue: 'hyperliquid', network: 'testnet', account: ACCOUNT, agentAddress: AGENT_KEY,113    strategySha256: 'd4'.repeat(32), agentId: 'spk_0123456789ab', instruments: [{ instrument: 'hyperliquid:SOL', maxLeverage: 20, maxPositionNotional: '100.10' }, { instrument: 'hyperliquid:BTC', maxLeverage: 1, maxPositionNotional: '0.5' }, { instrument: 'hyperliquid:ETH', maxLeverage: 3, maxPositionNotional: '4000.0' }],114    maxOrderNotional: '2000.000', maxGrossExposure: '12000.00', maxOrdersPerDay: 500, maxOrdersPerHour: 60, maxDailyTurnover: '50000', floorEquity: '2500.5', maxPriceDeviationBps: 10, createdAt: 1794000000, expiresAt: 1794000000 + 30 * 86400, ackSha256: ACK_SHA }),115];116117// ---------------------------------------------------------------------------------------------------------------- the approval intent of a live mandate118const SRC_AP = 'services/api/src/mandates/service.ts MANDATE_APPROVAL_DOMAIN (prepareApproval → risk/passkey.ts prepareIntent → services/api/src/derivatives/exec.ts canonicalIntentHash)';119const tmHash = hex(trading.tradingMandateHash(liveMandate)), vmHash = hex(live.venueMandateHash(compiled.mandate));120const approvalIntent = { v: 1, kind: 'trading_mandate_approval', mandateId: liveMandate.mandateId, tradingMandateHash: tmHash, principal: `agent:${liveMandate.principal.id}`, mode: 'live', signer: { shape: 'SPW-VENUE-MANDATE-v1', mandateHash: vmHash },121  nonce: '0d5a7b52-6f1e-4d0a-9a51-000000000031', ...STAMP };122const approvalVectors: Vector[] = [123  intentVector('approval-directional', 'SPW-TRADING-MANDATE-APPROVAL-v1', SRC_AP, approvalIntent),124  intentVector('approval-quoting-with-section-hash', 'SPW-TRADING-MANDATE-APPROVAL-v1', SRC_AP, { v: 1, kind: 'trading_mandate_approval', mandateId: liveMandate.mandateId, tradingMandateHash: tmHash, principal: `agent:${liveMandate.principal.id}`, mode: 'live',125    signer: { shape: 'SPW-VENUE-QUOTING-MANDATE-v1', mandateHash: 'e5'.repeat(32) }, quotingSectionHash: 'f6'.repeat(32), nonce: '0d5a7b52-6f1e-4d0a-9a51-000000000032', ...STAMP }),126];127128// ---------------------------------------------------------------------------------------------------------------- API key intents129const SRC_KEY = 'services/api/src/trading-api/key-model.ts canonicalJson + intentChallenge (services/api/src/trading-api/keys.ts storeIntent)';130function keyVector(name: string, object: unknown): Vector {131  const canonical: string = keyModel.canonicalJson(object);132  return { name, domain: 'SPW-APIKEY-INTENT-v1', source: SRC_KEY, object: JSON.parse(JSON.stringify(object)), canonicalHex: hex(Buffer.from(`SPW-APIKEY-INTENT-v1\n${canonical}`, 'utf8')), hashHex: hex(keyModel.intentChallenge(canonical)) };133}134const KB = { v: 1, origin: 'https://wallet.example.test', preparedAt: '2026-11-18T12:34:56.789Z' };135const createIntent = { ...KB, action: 'create', intentId: '0d5a7b52-6f1e-4d0a-9a51-000000000041', key: { id: 'spk_0123456789ab', name: 'Tableau de bord (lecture)', scopes: ['markets:read', 'orders:read', 'wallet:read'], expiresAt: '2027-02-16T12:34:56.789Z',136  limits: { maxOrderNotionalUsd: null, maxDailyNotionalUsd: null }, restrictions: { networks: [], venues: [], instruments: [], ipAllow: [] }, rateLimitPerMin: 120, mandateId: null } };137const keyVectors: Vector[] = [138  keyVector('create-read-only-defaults', createIntent),139  keyVector('create-trading-fractional-limits-restrictions-mandate', { ...KB, action: 'create', intentId: '0d5a7b52-6f1e-4d0a-9a51-000000000042', key: { id: 'spk_a1b2c3d4e5f6', name: 'bot-1', scopes: ['orders:cancel', 'orders:execute', 'orders:prepare', 'orders:read', 'positions:manage'],140    expiresAt: '2026-12-18T12:34:56.789Z', limits: { maxOrderNotionalUsd: 1500.5, maxDailyNotionalUsd: 100000000 }, restrictions: { networks: ['mainnet'], venues: ['hyperliquid'], instruments: ['hyperliquid:BTC', 'hyperliquid:ETH'], ipAllow: ['2001:db8::1', '203.0.113.0/24'] },141    rateLimitPerMin: 600, mandateId: liveMandate.mandateId } }),142  keyVector('create-number-forms', { ...KB, action: 'create', intentId: '0d5a7b52-6f1e-4d0a-9a51-000000000043', key: { id: 'spk_ffffffffffff', name: 'n', scopes: ['markets:read'], expiresAt: '2026-11-19T12:34:56.789Z',143    limits: { maxOrderNotionalUsd: 0.0000001, maxDailyNotionalUsd: 0.1 }, restrictions: { networks: [], venues: [], instruments: [], ipAllow: [] }, rateLimitPerMin: 1, mandateId: null } }),144  keyVector('create-number-forms-2', { ...KB, action: 'create', intentId: '0d5a7b52-6f1e-4d0a-9a51-000000000044', key: { id: 'spk_eeeeeeeeeeee', name: 'n2', scopes: ['markets:read'], expiresAt: '2026-11-19T12:34:56.789Z',145    limits: { maxOrderNotionalUsd: 0.000001, maxDailyNotionalUsd: 99999999.99 }, restrictions: { networks: [], venues: [], instruments: [], ipAllow: [] }, rateLimitPerMin: 1, mandateId: null } }),146  keyVector('create-number-forms-3', { ...KB, action: 'create', intentId: '0d5a7b52-6f1e-4d0a-9a51-000000000045', key: { id: 'spk_dddddddddddd', name: 'n3', scopes: ['markets:read'], expiresAt: '2026-11-19T12:34:56.789Z',147    limits: { maxOrderNotionalUsd: 123456.789, maxDailyNotionalUsd: 1.5e-7 }, restrictions: { networks: [], venues: [], instruments: [], ipAllow: [] }, rateLimitPerMin: 1, mandateId: null } }),148  keyVector('rotate', { ...KB, action: 'rotate', intentId: '0d5a7b52-6f1e-4d0a-9a51-000000000046', keyId: 'spk_0123456789ab', newKeyId: 'spk_ba9876543210' }),149  keyVector('update-widening-scopes-limits-expiry', { ...KB, action: 'update', intentId: '0d5a7b52-6f1e-4d0a-9a51-000000000047', keyId: 'spk_0123456789ab',150    changes: { scopes: ['markets:read', 'orders:prepare', 'orders:read'], expiresAt: '2027-03-01T00:00:00.000Z', limits: { maxOrderNotionalUsd: 2500, maxDailyNotionalUsd: null }, rateLimitPerMin: 240 }, widening: ['scopes', 'expiresAt', 'limits', 'rateLimitPerMin'] }),151  keyVector('update-bind-mandate', { ...KB, action: 'update', intentId: '0d5a7b52-6f1e-4d0a-9a51-000000000048', keyId: 'spk_a1b2c3d4e5f6', changes: { mandateId: liveMandate.mandateId }, widening: ['mandateId'] }),152  keyVector('update-unbind-mandate-rename-restrictions', { ...KB, action: 'update', intentId: '0d5a7b52-6f1e-4d0a-9a51-000000000049', keyId: 'spk_a1b2c3d4e5f6',153    changes: { name: 'bot-1 (étroit)', mandateId: null, restrictions: { networks: [], venues: ['gmx', 'hyperliquid'], instruments: [], ipAllow: [] } }, widening: ['restrictions.venues'] }),154];155156// ---------------------------------------------------------------------------------------------------------------- output157const [vectorsDir, fixturesDir] = process.argv.slice(2);158if (!vectorsDir || !fixturesDir) throw new Error('usage: npx tsx /tmp/spw-vectors-exec.mts <Vectors dir> <Fixtures dir>');159mkdirSync(vectorsDir, { recursive: true }); mkdirSync(fixturesDir, { recursive: true });160const files: Record<string, Vector[]> = {161  'execution-risk-limits-intent.json': limitsVectors, 'execution-risk-switch-intent.json': switchVectors, 'execution-risk-auto-intent.json': autoVectors,162  'execution-trading-mandate.json': mandateVectors, 'execution-venue-mandate.json': venueVectors, 'execution-mandate-approval-intent.json': approvalVectors, 'execution-apikey-intent.json': keyVectors,163};164for (const [f, v] of Object.entries(files)) writeFileSync(join(vectorsDir, f), `${JSON.stringify(v, null, 2)}\n`);165166// The answer of POST /mandates/:id/approve/prepare for the live mandate above, in the shape of mandates/service.ts `prepareApproval`167// (directional branch) and derivatives/exec.ts `storePrepared`. Every hash and both challenges come from the backend functions above;168// the texts are placeholders of this fixture.169const options = (hashHex: string) => ({ challenge: b64u(hashHex), rpId: 'wallet.example.test', timeout: 120000, userVerification: 'required', allowCredentials: [{ id: 'Y3JlZC0x', type: 'public-key', transports: ['internal', 'hybrid'] }] });170const bindingHash = hex(exec.canonicalIntentHash('SPW-TRADING-MANDATE-APPROVAL-v1', approvalIntent));171const sheet = {172  mandateId: liveMandate.mandateId, mandate: liveMandate, hash: tmHash, mode: 'live', enforcement: compiled.enforcement, derived: compiled.derived, principalDescriptor: null, kind: 'directional', passkey: true,173  signer: { shape: 'SPW-VENUE-MANDATE-v1', accountId: '6e0f8a44-1b7c-4f1e-9d55-0000000000b1', mandate: compiled.mandate, hash: vmHash,174    acknowledgement: { locale: 'en', sha256: ACK_SHA, version: 'fixture', title: 'Jurisdiction acknowledgement (fixture)', text: 'fixture text of the acknowledgement' },175    warning: 'fixture warning', enforcedBySigner: ['fixture'], trustedBySigner: ['fixture'], notEnforced: ['fixture'], windDown: { seconds: live.VENUE_MANDATE_WIND_DOWN_S, text: 'fixture' }, options: options(vmHash) },176  binding: { domain: 'SPW-TRADING-MANDATE-APPROVAL-v1', intent: approvalIntent, hash: bindingHash, options: options(bindingHash), expiresAt: approvalIntent.expiresAt },177  note: 'two passkey prompts (fixture)',178};179writeFileSync(join(fixturesDir, 'execution-mandate-approval-sheet.json'), `${JSON.stringify(sheet, null, 2)}\n`);180console.log(Object.entries(files).map(([f, v]) => `${f}: ${v.length}`).join('\n'));181console.log('execution-mandate-approval-sheet.json: 1 (generated fixture)');182process.exit(0);183
Files main
Menu

Theme