canton-amm-ledger-core 0.0.7 → 0.0.9
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/src/main.d.ts +72 -0
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/main.js +397 -46
- package/dist/src/main.js.map +1 -1
- package/generated/daml.js/{type7labs-amm-allocation-request-v0-v1-0.0.1 → type7labs-amm-allocation-request-v0-v2-0.0.1}/lib/Type7Labs/Amm/AmmAllocationRequestV0/module.d.ts +5 -5
- package/generated/daml.js/{type7labs-amm-allocation-request-v0-v1-0.0.1 → type7labs-amm-allocation-request-v0-v2-0.0.1}/lib/Type7Labs/Amm/AmmAllocationRequestV0/module.js +7 -7
- package/generated/daml.js/type7labs-amm-allocation-request-v0-v2-0.0.1/lib/index.d.ts +3 -0
- package/generated/daml.js/{type7labs-amm-ammv0-tests-v1-0.0.1 → type7labs-amm-allocation-request-v0-v2-0.0.1}/lib/index.js +1 -1
- package/generated/daml.js/{type7labs-amm-allocation-request-v0-v1-0.0.1 → type7labs-amm-allocation-request-v0-v2-0.0.1}/package.json +2 -2
- package/generated/daml.js/type7labs-amm-ammv0-tests-v2-0.0.1/lib/index.d.ts +3 -0
- package/generated/daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-ammv0-tests-v2-0.0.1}/lib/index.js +1 -1
- package/generated/daml.js/{type7labs-amm-ammv0-tests-v1-0.0.1 → type7labs-amm-ammv0-tests-v2-0.0.1}/package.json +1 -1
- package/generated/daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/lib/Type7Labs/Amm/AmmV0/module.d.ts +9 -9
- package/generated/daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/lib/Type7Labs/Amm/AmmV0/module.js +11 -11
- package/generated/daml.js/type7labs-amm-v0-v2-0.0.1/lib/index.d.ts +3 -0
- package/generated/daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/lib/index.js +1 -1
- package/{node_modules/@daml.js/type7labs-amm-v0-v1-0.0.1 → generated/daml.js/type7labs-amm-v0-v2-0.0.1}/package.json +2 -2
- package/{node_modules/@daml.js/type7labs-api-amm-v1-0.0.1 → generated/daml.js/type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/IAmm/module.d.ts +3 -3
- package/{node_modules/@daml.js/type7labs-api-amm-v1-0.0.1 → generated/daml.js/type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/IAmm/module.js +9 -9
- package/{node_modules/@daml.js/type7labs-api-amm-v1-0.0.1 → generated/daml.js/type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/IAmmAllocationRequest/module.d.ts +2 -2
- package/generated/daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/IAmmAllocationRequest/module.js +1 -1
- package/generated/daml.js/type7labs-api-amm-v2-0.0.1/lib/index.d.ts +3 -0
- package/generated/daml.js/{type7labs-amm-allocation-request-v0-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/index.js +1 -1
- package/{node_modules/@daml.js/type7labs-api-amm-v1-0.0.1 → generated/daml.js/type7labs-api-amm-v2-0.0.1}/package.json +1 -1
- package/generated/daml.js/{type7labs-scripts-amm-v0-v1-v0-0.0.1 → type7labs-scripts-amm-v0-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/AmmV0/SetupData/module.d.ts +5 -5
- package/generated/daml.js/{type7labs-scripts-amm-v0-v1-v0-0.0.1 → type7labs-scripts-amm-v0-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/AmmV0/SetupData/module.js +6 -6
- package/generated/daml.js/type7labs-scripts-amm-v0-v2-v0-0.0.1/lib/index.d.ts +3 -0
- package/generated/daml.js/type7labs-scripts-amm-v0-v2-v0-0.0.1/lib/index.js +10 -0
- package/generated/daml.js/{type7labs-scripts-amm-v0-v1-v0-0.0.1 → type7labs-scripts-amm-v0-v2-v0-0.0.1}/package.json +2 -2
- package/generated/daml.js/{type7labs-scripts-api-amm-v1-v0-0.0.1 → type7labs-scripts-api-amm-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/IAmmAllocationRequestInteract/module.d.ts +2 -2
- package/generated/daml.js/{type7labs-scripts-api-amm-v1-v0-0.0.1 → type7labs-scripts-api-amm-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/IAmmAllocationRequestInteract/module.js +3 -3
- package/generated/daml.js/{type7labs-scripts-api-amm-v1-v0-0.0.1 → type7labs-scripts-api-amm-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/IAmmInteract/module.d.ts +25 -25
- package/generated/daml.js/{type7labs-scripts-api-amm-v1-v0-0.0.1 → type7labs-scripts-api-amm-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/IAmmInteract/module.js +44 -44
- package/generated/daml.js/type7labs-scripts-api-amm-v2-v0-0.0.1/lib/index.d.ts +3 -0
- package/generated/daml.js/type7labs-scripts-api-amm-v2-v0-0.0.1/lib/index.js +10 -0
- package/generated/daml.js/{type7labs-scripts-api-amm-v1-v0-0.0.1 → type7labs-scripts-api-amm-v2-v0-0.0.1}/package.json +2 -2
- package/node_modules/@daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/lib/Type7Labs/Amm/AmmV0/module.d.ts +9 -9
- package/node_modules/@daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/lib/Type7Labs/Amm/AmmV0/module.js +11 -11
- package/node_modules/@daml.js/type7labs-amm-v0-v2-0.0.1/lib/index.d.ts +3 -0
- package/node_modules/@daml.js/type7labs-amm-v0-v2-0.0.1/lib/index.js +10 -0
- package/{generated/daml.js/type7labs-amm-v0-v1-0.0.1 → node_modules/@daml.js/type7labs-amm-v0-v2-0.0.1}/package.json +2 -2
- package/{generated/daml.js/type7labs-api-amm-v1-0.0.1 → node_modules/@daml.js/type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/IAmm/module.d.ts +3 -3
- package/{generated/daml.js/type7labs-api-amm-v1-0.0.1 → node_modules/@daml.js/type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/IAmm/module.js +9 -9
- package/{generated/daml.js/type7labs-api-amm-v1-0.0.1 → node_modules/@daml.js/type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/IAmmAllocationRequest/module.d.ts +2 -2
- package/node_modules/@daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/IAmmAllocationRequest/module.js +1 -1
- package/node_modules/@daml.js/type7labs-api-amm-v2-0.0.1/lib/index.d.ts +3 -0
- package/node_modules/@daml.js/type7labs-api-amm-v2-0.0.1/lib/index.js +10 -0
- package/{generated/daml.js/type7labs-api-amm-v1-0.0.1 → node_modules/@daml.js/type7labs-api-amm-v2-0.0.1}/package.json +1 -1
- package/package.json +5 -5
- package/generated/daml.js/type7labs-amm-allocation-request-v0-v1-0.0.1/lib/index.d.ts +0 -3
- package/generated/daml.js/type7labs-amm-ammv0-tests-v1-0.0.1/lib/index.d.ts +0 -3
- package/generated/daml.js/type7labs-amm-v0-v1-0.0.1/lib/index.d.ts +0 -3
- package/generated/daml.js/type7labs-api-amm-v1-0.0.1/lib/index.d.ts +0 -3
- package/generated/daml.js/type7labs-scripts-amm-v0-v1-v0-0.0.1/lib/index.d.ts +0 -3
- package/generated/daml.js/type7labs-scripts-amm-v0-v1-v0-0.0.1/lib/index.js +0 -10
- package/generated/daml.js/type7labs-scripts-api-amm-v1-v0-0.0.1/lib/index.d.ts +0 -3
- package/generated/daml.js/type7labs-scripts-api-amm-v1-v0-0.0.1/lib/index.js +0 -10
- package/node_modules/@daml.js/type7labs-amm-v0-v1-0.0.1/lib/index.d.ts +0 -3
- package/node_modules/@daml.js/type7labs-amm-v0-v1-0.0.1/lib/index.js +0 -10
- package/node_modules/@daml.js/type7labs-api-amm-v1-0.0.1/lib/index.d.ts +0 -3
- package/node_modules/@daml.js/type7labs-api-amm-v1-0.0.1/lib/index.js +0 -10
- /package/generated/daml.js/{type7labs-amm-allocation-request-v0-v1-0.0.1 → type7labs-amm-allocation-request-v0-v2-0.0.1}/lib/Type7Labs/Amm/AmmAllocationRequestV0/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-amm-allocation-request-v0-v1-0.0.1 → type7labs-amm-allocation-request-v0-v2-0.0.1}/lib/Type7Labs/Amm/AmmAllocationRequestV0/index.js +0 -0
- /package/generated/daml.js/{type7labs-amm-allocation-request-v0-v1-0.0.1 → type7labs-amm-allocation-request-v0-v2-0.0.1}/lib/Type7Labs/Amm/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-amm-allocation-request-v0-v1-0.0.1 → type7labs-amm-allocation-request-v0-v2-0.0.1}/lib/Type7Labs/Amm/index.js +0 -0
- /package/generated/daml.js/{type7labs-amm-allocation-request-v0-v1-0.0.1 → type7labs-amm-allocation-request-v0-v2-0.0.1}/lib/Type7Labs/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-amm-allocation-request-v0-v1-0.0.1 → type7labs-amm-allocation-request-v0-v2-0.0.1}/lib/Type7Labs/index.js +0 -0
- /package/generated/daml.js/{type7labs-amm-allocation-request-v0-v1-0.0.1 → type7labs-amm-allocation-request-v0-v2-0.0.1}/tsconfig.json +0 -0
- /package/generated/daml.js/{type7labs-amm-ammv0-tests-v1-0.0.1 → type7labs-amm-ammv0-tests-v2-0.0.1}/lib/Type7Labs/Tests/Amm/AmmV0/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-amm-ammv0-tests-v1-0.0.1 → type7labs-amm-ammv0-tests-v2-0.0.1}/lib/Type7Labs/Tests/Amm/AmmV0/index.js +0 -0
- /package/generated/daml.js/{type7labs-amm-ammv0-tests-v1-0.0.1 → type7labs-amm-ammv0-tests-v2-0.0.1}/lib/Type7Labs/Tests/Amm/AmmV0/module.d.ts +0 -0
- /package/generated/daml.js/{type7labs-amm-ammv0-tests-v1-0.0.1 → type7labs-amm-ammv0-tests-v2-0.0.1}/lib/Type7Labs/Tests/Amm/AmmV0/module.js +0 -0
- /package/generated/daml.js/{type7labs-amm-ammv0-tests-v1-0.0.1 → type7labs-amm-ammv0-tests-v2-0.0.1}/lib/Type7Labs/Tests/Amm/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-amm-ammv0-tests-v1-0.0.1 → type7labs-amm-ammv0-tests-v2-0.0.1}/lib/Type7Labs/Tests/Amm/index.js +0 -0
- /package/generated/daml.js/{type7labs-amm-ammv0-tests-v1-0.0.1 → type7labs-amm-ammv0-tests-v2-0.0.1}/lib/Type7Labs/Tests/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-amm-ammv0-tests-v1-0.0.1 → type7labs-amm-ammv0-tests-v2-0.0.1}/lib/Type7Labs/Tests/index.js +0 -0
- /package/generated/daml.js/{type7labs-amm-ammv0-tests-v1-0.0.1 → type7labs-amm-ammv0-tests-v2-0.0.1}/lib/Type7Labs/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-amm-ammv0-tests-v1-0.0.1 → type7labs-amm-ammv0-tests-v2-0.0.1}/lib/Type7Labs/index.js +0 -0
- /package/generated/daml.js/{type7labs-amm-ammv0-tests-v1-0.0.1 → type7labs-amm-ammv0-tests-v2-0.0.1}/tsconfig.json +0 -0
- /package/generated/daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/lib/Type7Labs/Amm/AmmV0/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/lib/Type7Labs/Amm/AmmV0/index.js +0 -0
- /package/generated/daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/lib/Type7Labs/Amm/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/lib/Type7Labs/Amm/index.js +0 -0
- /package/generated/daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/lib/Type7Labs/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/lib/Type7Labs/index.js +0 -0
- /package/generated/daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/tsconfig.json +0 -0
- /package/generated/daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/IAmm/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/IAmm/index.js +0 -0
- /package/generated/daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/IAmmAllocationRequest/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/IAmmAllocationRequest/index.js +0 -0
- /package/generated/daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/index.js +0 -0
- /package/generated/daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/index.js +0 -0
- /package/generated/daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/index.js +0 -0
- /package/generated/daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/tsconfig.json +0 -0
- /package/generated/daml.js/{type7labs-scripts-amm-v0-v1-v0-0.0.1 → type7labs-scripts-amm-v0-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/AmmV0/SetupData/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-scripts-amm-v0-v1-v0-0.0.1 → type7labs-scripts-amm-v0-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/AmmV0/SetupData/index.js +0 -0
- /package/generated/daml.js/{type7labs-scripts-amm-v0-v1-v0-0.0.1 → type7labs-scripts-amm-v0-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/AmmV0/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-scripts-amm-v0-v1-v0-0.0.1 → type7labs-scripts-amm-v0-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/AmmV0/index.js +0 -0
- /package/generated/daml.js/{type7labs-scripts-amm-v0-v1-v0-0.0.1 → type7labs-scripts-amm-v0-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-scripts-amm-v0-v1-v0-0.0.1 → type7labs-scripts-amm-v0-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/index.js +0 -0
- /package/generated/daml.js/{type7labs-scripts-amm-v0-v1-v0-0.0.1 → type7labs-scripts-amm-v0-v2-v0-0.0.1}/lib/Type7Labs/Scripts/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-scripts-amm-v0-v1-v0-0.0.1 → type7labs-scripts-amm-v0-v2-v0-0.0.1}/lib/Type7Labs/Scripts/index.js +0 -0
- /package/generated/daml.js/{type7labs-scripts-amm-v0-v1-v0-0.0.1 → type7labs-scripts-amm-v0-v2-v0-0.0.1}/lib/Type7Labs/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-scripts-amm-v0-v1-v0-0.0.1 → type7labs-scripts-amm-v0-v2-v0-0.0.1}/lib/Type7Labs/index.js +0 -0
- /package/generated/daml.js/{type7labs-scripts-amm-v0-v1-v0-0.0.1 → type7labs-scripts-amm-v0-v2-v0-0.0.1}/tsconfig.json +0 -0
- /package/generated/daml.js/{type7labs-scripts-api-amm-v1-v0-0.0.1 → type7labs-scripts-api-amm-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/IAmmAllocationRequestInteract/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-scripts-api-amm-v1-v0-0.0.1 → type7labs-scripts-api-amm-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/IAmmAllocationRequestInteract/index.js +0 -0
- /package/generated/daml.js/{type7labs-scripts-api-amm-v1-v0-0.0.1 → type7labs-scripts-api-amm-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/IAmmInteract/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-scripts-api-amm-v1-v0-0.0.1 → type7labs-scripts-api-amm-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/IAmmInteract/index.js +0 -0
- /package/generated/daml.js/{type7labs-scripts-api-amm-v1-v0-0.0.1 → type7labs-scripts-api-amm-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-scripts-api-amm-v1-v0-0.0.1 → type7labs-scripts-api-amm-v2-v0-0.0.1}/lib/Type7Labs/Scripts/Amm/index.js +0 -0
- /package/generated/daml.js/{type7labs-scripts-api-amm-v1-v0-0.0.1 → type7labs-scripts-api-amm-v2-v0-0.0.1}/lib/Type7Labs/Scripts/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-scripts-api-amm-v1-v0-0.0.1 → type7labs-scripts-api-amm-v2-v0-0.0.1}/lib/Type7Labs/Scripts/index.js +0 -0
- /package/generated/daml.js/{type7labs-scripts-api-amm-v1-v0-0.0.1 → type7labs-scripts-api-amm-v2-v0-0.0.1}/lib/Type7Labs/index.d.ts +0 -0
- /package/generated/daml.js/{type7labs-scripts-api-amm-v1-v0-0.0.1 → type7labs-scripts-api-amm-v2-v0-0.0.1}/lib/Type7Labs/index.js +0 -0
- /package/generated/daml.js/{type7labs-scripts-api-amm-v1-v0-0.0.1 → type7labs-scripts-api-amm-v2-v0-0.0.1}/tsconfig.json +0 -0
- /package/node_modules/@daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/lib/Type7Labs/Amm/AmmV0/index.d.ts +0 -0
- /package/node_modules/@daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/lib/Type7Labs/Amm/AmmV0/index.js +0 -0
- /package/node_modules/@daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/lib/Type7Labs/Amm/index.d.ts +0 -0
- /package/node_modules/@daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/lib/Type7Labs/Amm/index.js +0 -0
- /package/node_modules/@daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/lib/Type7Labs/index.d.ts +0 -0
- /package/node_modules/@daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/lib/Type7Labs/index.js +0 -0
- /package/node_modules/@daml.js/{type7labs-amm-v0-v1-0.0.1 → type7labs-amm-v0-v2-0.0.1}/tsconfig.json +0 -0
- /package/node_modules/@daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/IAmm/index.d.ts +0 -0
- /package/node_modules/@daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/IAmm/index.js +0 -0
- /package/node_modules/@daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/IAmmAllocationRequest/index.d.ts +0 -0
- /package/node_modules/@daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/IAmmAllocationRequest/index.js +0 -0
- /package/node_modules/@daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/index.d.ts +0 -0
- /package/node_modules/@daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/Amm/index.js +0 -0
- /package/node_modules/@daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/index.d.ts +0 -0
- /package/node_modules/@daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/Api/index.js +0 -0
- /package/node_modules/@daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/index.d.ts +0 -0
- /package/node_modules/@daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/lib/Type7Labs/index.js +0 -0
- /package/node_modules/@daml.js/{type7labs-api-amm-v1-0.0.1 → type7labs-api-amm-v2-0.0.1}/tsconfig.json +0 -0
package/dist/src/main.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { LedgerError, } from "./lib/ledger_json_api/client.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { AmmSchema, UserRole, AmmState, AddLpProviderResultSchema, RemoveLpProviderResultSchema, AddSwapUserResultSchema, RemoveSwapUserResultSchema, CreateLiquidityAdditionAllocationRequestResultSchema, CreateLiquidityRemovalAllocationRequestResultSchema, CreateSwapAllocationRequestResultSchema, AddLpProviderArgsSchema, RemoveLpProviderArgsSchema, RemoveSwapUserArgsSchema, AddSwapUserArgsSchema, CreateLiquidityAdditionAllocationRequestArgsSchema, CancelProcessingArgsSchema, CancelProcessingResultSchema, CompleteProcessingArgsSchema, CompleteProcessingResultSchema, UpdateFeeRateResultSchema, UpdateFeeRateArgsSchema, UpdateSettlementExecutorArgsSchema, UpdateSettlementExecutorResultSchema, UpdateLpAdditionTimeInMicrosecondsArgsSchema, UpdateLpAdditionTimeInMicrosecondsResultSchema, UpdateLpRemovalTimeInMicrosecondsArgsSchema, UpdateLpRemovalTimeInMicrosecondsResultSchema, UpdateSwapTimeInMicrosecondsArgsSchema, UpdateSwapTimeInMicrosecondsResultSchema, AddAllocationToCurrentRequestResultSchema, AddAllocationToCurrentRequestArgsSchema, WithdrawAllocationFromCurrentRequestResultSchema, WithdrawAllocationFromCurrentRequestArgsSchema, CreateLiquidityRemovalAllocationRequestArgsSchema, CreateSwapAllocationRequestArgsSchema, AllocationViewSchema, AmmAllocationRequestViewSchema, AllocateRequiredOperatorFundsForCurrentRequestArgsSchema, AllocateRequiredOperatorFundsForCurrentRequestResultSchema, AddAmmManagerArgsSchema, AddAmmManagerResultSchema, RemoveAmmManagerResultSchema, RemoveAmmManagerArgsSchema, HoldingViewSchema, TransferInstructionSchema, TransferPreapprovalSchema, MergeDelegationProposalSchema, MergeDelegationSchema, ExerciseTransferInstructionChoiceResultSchema, ExecuteMergeDelegationProposalChoiceResultSchema, TransferInstructionResultSchema, FeaturedAppRightViewSchema, FeaturedAppActivityMarkerViewSchema, UpdateOperatorFeeRateArgsSchema, UpdateOperatorFeeRateResultSchema, } from "./schema.js";
|
|
3
|
+
import { AmmSchema, UserRole, AmmState, AddLpProviderResultSchema, RemoveLpProviderResultSchema, AddSwapUserResultSchema, RemoveSwapUserResultSchema, CreateLiquidityAdditionAllocationRequestResultSchema, CreateLiquidityRemovalAllocationRequestResultSchema, CreateSwapAllocationRequestResultSchema, AddLpProviderArgsSchema, RemoveLpProviderArgsSchema, RemoveSwapUserArgsSchema, AddSwapUserArgsSchema, CreateLiquidityAdditionAllocationRequestArgsSchema, CancelProcessingArgsSchema, CancelProcessingResultSchema, CompleteProcessingArgsSchema, CompleteProcessingResultSchema, UpdateFeeRateResultSchema, UpdateFeeRateArgsSchema, UpdateSettlementExecutorArgsSchema, UpdateSettlementExecutorResultSchema, UpdateLpAdditionTimeInMicrosecondsArgsSchema, UpdateLpAdditionTimeInMicrosecondsResultSchema, UpdateLpRemovalTimeInMicrosecondsArgsSchema, UpdateLpRemovalTimeInMicrosecondsResultSchema, UpdateSwapTimeInMicrosecondsArgsSchema, UpdateSwapTimeInMicrosecondsResultSchema, AddAllocationToCurrentRequestResultSchema, AddAllocationToCurrentRequestArgsSchema, WithdrawAllocationFromCurrentRequestResultSchema, WithdrawAllocationFromCurrentRequestArgsSchema, CreateLiquidityRemovalAllocationRequestArgsSchema, CreateSwapAllocationRequestArgsSchema, AllocationViewSchema, AmmAllocationRequestViewSchema, AllocateRequiredOperatorFundsForCurrentRequestArgsSchema, AllocateRequiredOperatorFundsForCurrentRequestResultSchema, AddAmmManagerArgsSchema, AddAmmManagerResultSchema, RemoveAmmManagerResultSchema, RemoveAmmManagerArgsSchema, HoldingViewSchema, TransferInstructionSchema, TransferPreapprovalSchema, MergeDelegationProposalSchema, MergeDelegationSchema, ExerciseTransferInstructionChoiceResultSchema, ExecuteMergeDelegationProposalChoiceResultSchema, TransferInstructionResultSchema, TransferSchema, FeaturedAppRightViewSchema, FeaturedAppActivityMarkerViewSchema, UpdateOperatorFeeRateArgsSchema, UpdateOperatorFeeRateResultSchema, } from "./schema.js";
|
|
4
4
|
import { Allocation, AllocationView as DtAllocationView, } from "@daml.js/splice-api-token-allocation-v1-1.0.0/lib/Splice/Api/Token/AllocationV1/module.js";
|
|
5
5
|
import { Holding, HoldingView as DHoldingView, } from "@daml.js/splice-api-token-holding-v1-1.0.0/lib/Splice/Api/Token/HoldingV1/module.js";
|
|
6
|
-
import { IAmmAllocationRequest } from "@daml.js/type7labs-api-amm-
|
|
7
|
-
import { AmmView, IAmm, } from "@daml.js/type7labs-api-amm-
|
|
8
|
-
import { AmmV0 } from "@daml.js/type7labs-amm-v0-
|
|
6
|
+
import { IAmmAllocationRequest } from "@daml.js/type7labs-api-amm-v2-0.0.1/lib/Type7Labs/Api/Amm/IAmmAllocationRequest/module.js";
|
|
7
|
+
import { AmmView, IAmm, } from "@daml.js/type7labs-api-amm-v2-0.0.1/lib/Type7Labs/Api/Amm/IAmm/module.js";
|
|
8
|
+
import { AmmV0 } from "@daml.js/type7labs-amm-v0-v2-0.0.1/lib/Type7Labs/Amm/AmmV0/module.js";
|
|
9
9
|
import { emptyMap } from "@daml/types";
|
|
10
10
|
import { DAML_DECIMAL_PRECISION, EXTERNAL_PARTY_COMMAND_COMPLETION_FETCH_RETRIES_COUNT, EXTERNAL_PARTY_TRANSACTION_UPDATE_FETCH_RETRIES_COUNT, } from "./constant.js";
|
|
11
11
|
import { FeaturedAppActivityMarker, FeaturedAppRight, } from "@daml.js/splice-api-featured-app-v1-1.0.0/lib/Splice/Api/FeaturedAppRightV1/module.js";
|
|
12
|
+
import BigNumber from "bignumber.js";
|
|
12
13
|
export class LedgerCoreError extends Error {
|
|
13
14
|
partyId;
|
|
14
15
|
contractId;
|
|
@@ -1422,11 +1423,11 @@ async function executeExternalPartyExerciseCommand(user, client, logger, command
|
|
|
1422
1423
|
throw await errorHandler(error);
|
|
1423
1424
|
}
|
|
1424
1425
|
await externalSigner.statusUpdates?.("submitted");
|
|
1425
|
-
let
|
|
1426
|
+
let applicableUpdateId = null;
|
|
1426
1427
|
try {
|
|
1427
1428
|
for (let i = 0; i < EXTERNAL_PARTY_COMMAND_COMPLETION_FETCH_RETRIES_COUNT; i++) {
|
|
1428
1429
|
try {
|
|
1429
|
-
completionResult = await client
|
|
1430
|
+
const completionResult = await client
|
|
1430
1431
|
.path("/v2/commands/completions")
|
|
1431
1432
|
.method("post")
|
|
1432
1433
|
.create()({
|
|
@@ -1438,9 +1439,36 @@ async function executeExternalPartyExerciseCommand(user, client, logger, command
|
|
|
1438
1439
|
message: "Completion result",
|
|
1439
1440
|
completionResult: completionResult,
|
|
1440
1441
|
});
|
|
1441
|
-
if (completionResult
|
|
1442
|
+
if (!completionResult) {
|
|
1443
|
+
if (i < EXTERNAL_PARTY_COMMAND_COMPLETION_FETCH_RETRIES_COUNT - 1) {
|
|
1444
|
+
await new Promise((resolve) => setTimeout(resolve, 100 * Math.pow(2, i)));
|
|
1445
|
+
}
|
|
1446
|
+
continue;
|
|
1447
|
+
}
|
|
1448
|
+
// Find the applicable completion with all validations
|
|
1449
|
+
const foundCompletion = completionResult.data.find((completion) => {
|
|
1450
|
+
if (!("Completion" in completion.completionResponse))
|
|
1451
|
+
return false;
|
|
1452
|
+
if (!(completion.completionResponse.Completion.value.actAs || []).includes(user.partyId))
|
|
1453
|
+
return false;
|
|
1454
|
+
if (completion.completionResponse.Completion.value.commandId !==
|
|
1455
|
+
commandId)
|
|
1456
|
+
return false;
|
|
1457
|
+
if (completion.completionResponse.Completion.value.submissionId !==
|
|
1458
|
+
submissionId)
|
|
1459
|
+
return false;
|
|
1460
|
+
return true;
|
|
1461
|
+
});
|
|
1462
|
+
if (foundCompletion) {
|
|
1463
|
+
// for type safety, check if Completion is present
|
|
1464
|
+
if (!("Completion" in foundCompletion.completionResponse)) {
|
|
1465
|
+
throw await getLedgerCoreApiError("response_parsing", "Completion is not present", null, user.partyId, null, null);
|
|
1466
|
+
}
|
|
1467
|
+
applicableUpdateId =
|
|
1468
|
+
foundCompletion.completionResponse.Completion.value.updateId;
|
|
1442
1469
|
break;
|
|
1443
1470
|
}
|
|
1471
|
+
// If we didn't find the applicable completion, retry
|
|
1444
1472
|
if (i < EXTERNAL_PARTY_COMMAND_COMPLETION_FETCH_RETRIES_COUNT - 1) {
|
|
1445
1473
|
await new Promise((resolve) => setTimeout(resolve, 100 * Math.pow(2, i)));
|
|
1446
1474
|
}
|
|
@@ -1456,32 +1484,9 @@ async function executeExternalPartyExerciseCommand(user, client, logger, command
|
|
|
1456
1484
|
catch (error) {
|
|
1457
1485
|
throw await errorHandler(error);
|
|
1458
1486
|
}
|
|
1459
|
-
if (!
|
|
1460
|
-
throw await getLedgerCoreApiError("offchain_validation", "No
|
|
1461
|
-
}
|
|
1462
|
-
const applicableCompletion = completionResult.data.find((completion) => {
|
|
1463
|
-
if (!("Completion" in completion.completionResponse))
|
|
1464
|
-
return false;
|
|
1465
|
-
if (!(completion.completionResponse.Completion.value.actAs || []).includes(user.partyId))
|
|
1466
|
-
return false;
|
|
1467
|
-
if (completion.completionResponse.Completion.value.commandId !== commandId)
|
|
1468
|
-
return false;
|
|
1469
|
-
if (completion.completionResponse.Completion.value.submissionId !==
|
|
1470
|
-
submissionId)
|
|
1471
|
-
return false;
|
|
1472
|
-
return true;
|
|
1473
|
-
})?.completionResponse || null;
|
|
1474
|
-
if (!applicableCompletion) {
|
|
1475
|
-
throw await getLedgerCoreApiError("offchain_validation", "No applicable completion found", null, user.partyId, null, null);
|
|
1476
|
-
}
|
|
1477
|
-
if (!("Completion" in applicableCompletion)) {
|
|
1478
|
-
throw await getLedgerCoreApiError("response_parsing", "Completion is not present", null, user.partyId, null, null);
|
|
1487
|
+
if (!applicableUpdateId) {
|
|
1488
|
+
throw await getLedgerCoreApiError("offchain_validation", "No applicable update ID found", null, user.partyId, null, null);
|
|
1479
1489
|
}
|
|
1480
|
-
const applicableUpdateId = applicableCompletion.Completion.value.updateId;
|
|
1481
|
-
logger.debug({
|
|
1482
|
-
message: "Applicable update ID",
|
|
1483
|
-
applicableUpdateId: applicableUpdateId,
|
|
1484
|
-
});
|
|
1485
1490
|
let transactionByUpdateIdResponse = null;
|
|
1486
1491
|
try {
|
|
1487
1492
|
for (let i = 0; i < EXTERNAL_PARTY_TRANSACTION_UPDATE_FETCH_RETRIES_COUNT; i++) {
|
|
@@ -1506,7 +1511,6 @@ async function executeExternalPartyExerciseCommand(user, client, logger, command
|
|
|
1506
1511
|
},
|
|
1507
1512
|
verbose: false,
|
|
1508
1513
|
},
|
|
1509
|
-
// todo check this
|
|
1510
1514
|
transactionShape: "TRANSACTION_SHAPE_LEDGER_EFFECTS",
|
|
1511
1515
|
},
|
|
1512
1516
|
});
|
|
@@ -1515,15 +1519,6 @@ async function executeExternalPartyExerciseCommand(user, client, logger, command
|
|
|
1515
1519
|
transactionByUpdateIdResponse: transactionByUpdateIdResponse,
|
|
1516
1520
|
attempt: i + 1,
|
|
1517
1521
|
});
|
|
1518
|
-
if (transactionByUpdateIdResponse?.data?.transaction !== null &&
|
|
1519
|
-
transactionByUpdateIdResponse?.data?.transaction !== undefined) {
|
|
1520
|
-
break;
|
|
1521
|
-
}
|
|
1522
|
-
// If transaction is null/undefined, wait before retrying
|
|
1523
|
-
if (i < EXTERNAL_PARTY_TRANSACTION_UPDATE_FETCH_RETRIES_COUNT - 1) {
|
|
1524
|
-
// Wait with exponential backoff: 100ms, 200ms, 400ms, 800ms
|
|
1525
|
-
await new Promise((resolve) => setTimeout(resolve, 100 * Math.pow(2, i)));
|
|
1526
|
-
}
|
|
1527
1522
|
}
|
|
1528
1523
|
catch (error) {
|
|
1529
1524
|
logger.debug({
|
|
@@ -1546,10 +1541,6 @@ async function executeExternalPartyExerciseCommand(user, client, logger, command
|
|
|
1546
1541
|
if (!transactionByUpdateIdResponse) {
|
|
1547
1542
|
throw await getLedgerCoreApiError("query", "Failed to get transaction by update ID", null, user.partyId, null, null);
|
|
1548
1543
|
}
|
|
1549
|
-
if (!transactionByUpdateIdResponse.data ||
|
|
1550
|
-
!transactionByUpdateIdResponse.data.transaction) {
|
|
1551
|
-
throw await getLedgerCoreApiError("query", `Transaction not found for update ID ${applicableUpdateId} after retries. Response: ${JSON.stringify(transactionByUpdateIdResponse)}`, null, user.partyId, null, null);
|
|
1552
|
-
}
|
|
1553
1544
|
return transactionByUpdateIdResponse.data.transaction;
|
|
1554
1545
|
}
|
|
1555
1546
|
export async function exerciseAmmChoice(user, client, logger, choiceName, args, externalSigner) {
|
|
@@ -2553,4 +2544,364 @@ export async function getFeaturedAppActivityMarkersVisibleToParty(user, client,
|
|
|
2553
2544
|
featuredAppActivityMarker: featuredAppActivityMarker,
|
|
2554
2545
|
}));
|
|
2555
2546
|
}
|
|
2547
|
+
export async function getLatestPrunedOffsets(client) {
|
|
2548
|
+
try {
|
|
2549
|
+
return (await client
|
|
2550
|
+
.path("/v2/state/latest-pruned-offsets")
|
|
2551
|
+
.method("get")
|
|
2552
|
+
.create()({})).data.participantPrunedUpToInclusive;
|
|
2553
|
+
}
|
|
2554
|
+
catch (error) {
|
|
2555
|
+
throw await getLedgerCoreApiError("query", "An unexpected error occurred in query error handler for get latest pruned offsets", error, null, null, null);
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
const InterfaceViewSchema = z.object({
|
|
2559
|
+
interfaceId: z.string(),
|
|
2560
|
+
viewStatus: z.unknown(),
|
|
2561
|
+
viewValue: z.unknown().optional(),
|
|
2562
|
+
});
|
|
2563
|
+
const CreatedEventSchema = z.object({
|
|
2564
|
+
contractId: z.string(),
|
|
2565
|
+
templateId: z.string().optional(),
|
|
2566
|
+
interfaceViews: z.array(InterfaceViewSchema).optional(),
|
|
2567
|
+
effectiveAt: z.string().optional(),
|
|
2568
|
+
offset: z.number().optional(),
|
|
2569
|
+
nodeId: z.number().optional(),
|
|
2570
|
+
});
|
|
2571
|
+
const ExercisedEventSchema = z.object({
|
|
2572
|
+
contractId: z.string(),
|
|
2573
|
+
choice: z.string(),
|
|
2574
|
+
choiceArgument: z.unknown().optional(),
|
|
2575
|
+
exerciseResult: TransferInstructionResultSchema.optional(),
|
|
2576
|
+
effectiveAt: z.string().optional(),
|
|
2577
|
+
offset: z.number().optional(),
|
|
2578
|
+
nodeId: z.number().optional(),
|
|
2579
|
+
});
|
|
2580
|
+
const ArchivedEventSchema = z.object({
|
|
2581
|
+
contractId: z.string(),
|
|
2582
|
+
templateId: z.string().optional(),
|
|
2583
|
+
offset: z.number().optional(),
|
|
2584
|
+
nodeId: z.number().optional(),
|
|
2585
|
+
});
|
|
2586
|
+
const EventSchema = z.union([
|
|
2587
|
+
z.object({ CreatedEvent: CreatedEventSchema }),
|
|
2588
|
+
z.object({ ExercisedEvent: ExercisedEventSchema }),
|
|
2589
|
+
z.object({ ArchivedEvent: ArchivedEventSchema }),
|
|
2590
|
+
]);
|
|
2591
|
+
const JsTransactionSchema = z.object({
|
|
2592
|
+
updateId: z.string(),
|
|
2593
|
+
commandId: z.string().optional(),
|
|
2594
|
+
workflowId: z.string().optional(),
|
|
2595
|
+
effectiveAt: z.string(),
|
|
2596
|
+
events: z.array(EventSchema).optional(),
|
|
2597
|
+
offset: z.number(),
|
|
2598
|
+
synchronizerId: z.string().optional(),
|
|
2599
|
+
recordTime: z.string().optional(),
|
|
2600
|
+
});
|
|
2601
|
+
const TransactionSchema = z.object({
|
|
2602
|
+
value: JsTransactionSchema,
|
|
2603
|
+
});
|
|
2604
|
+
const UpdateResponseSchema = z.object({
|
|
2605
|
+
update: z.union([
|
|
2606
|
+
z.object({ Transaction: TransactionSchema }),
|
|
2607
|
+
z.object({ OffsetCheckpoint: z.unknown() }),
|
|
2608
|
+
z.object({ Reassignment: z.unknown() }),
|
|
2609
|
+
z.object({ TopologyTransaction: z.unknown() }),
|
|
2610
|
+
]),
|
|
2611
|
+
});
|
|
2612
|
+
const UpdatesResponseSchema = z.array(UpdateResponseSchema);
|
|
2613
|
+
const TransferChoiceArgumentSchema = z.object({
|
|
2614
|
+
transfer: TransferSchema,
|
|
2615
|
+
});
|
|
2616
|
+
export async function getHistoryForParty(user, client, logger, beginExclusive) {
|
|
2617
|
+
let startOffset = beginExclusive;
|
|
2618
|
+
if (startOffset === undefined) {
|
|
2619
|
+
try {
|
|
2620
|
+
startOffset = await getLatestPrunedOffsets(client);
|
|
2621
|
+
}
|
|
2622
|
+
catch (error) {
|
|
2623
|
+
if (error instanceof LedgerCoreError) {
|
|
2624
|
+
throw error;
|
|
2625
|
+
}
|
|
2626
|
+
throw await getLedgerCoreApiError("query", "An unexpected error occurred in query error handler for get latest pruned offsets", error, user.partyId, null, null);
|
|
2627
|
+
}
|
|
2628
|
+
}
|
|
2629
|
+
const TOKEN_STANDARD_INTERFACES = [
|
|
2630
|
+
SPLICE_API_TOKEN_TRANSFER_INSTRUCTION_V1_TRANSFER_INSTRUCTION_INTERFACE_ID,
|
|
2631
|
+
SPLICE_API_TOKEN_TRANSFER_INSTRUCTION_V1_TRANSFER_FACTORY_INTERFACE_ID,
|
|
2632
|
+
];
|
|
2633
|
+
let updates = null;
|
|
2634
|
+
try {
|
|
2635
|
+
updates = (await client.path("/v2/updates/flats").method("post").create()({
|
|
2636
|
+
updateFormat: {
|
|
2637
|
+
includeTransactions: {
|
|
2638
|
+
eventFormat: {
|
|
2639
|
+
filtersByParty: {
|
|
2640
|
+
[user.partyId]: {
|
|
2641
|
+
cumulative: TOKEN_STANDARD_INTERFACES.map((i) => ({
|
|
2642
|
+
identifierFilter: {
|
|
2643
|
+
InterfaceFilter: {
|
|
2644
|
+
value: {
|
|
2645
|
+
interfaceId: i,
|
|
2646
|
+
includeInterfaceView: true,
|
|
2647
|
+
includeCreatedEventBlob: false,
|
|
2648
|
+
},
|
|
2649
|
+
},
|
|
2650
|
+
},
|
|
2651
|
+
})),
|
|
2652
|
+
},
|
|
2653
|
+
},
|
|
2654
|
+
verbose: false,
|
|
2655
|
+
},
|
|
2656
|
+
transactionShape: "TRANSACTION_SHAPE_LEDGER_EFFECTS",
|
|
2657
|
+
},
|
|
2658
|
+
},
|
|
2659
|
+
verbose: false,
|
|
2660
|
+
beginExclusive: startOffset,
|
|
2661
|
+
})).data;
|
|
2662
|
+
}
|
|
2663
|
+
catch (error) {
|
|
2664
|
+
throw await getLedgerCoreApiError("query", "An unexpected error occurred in query error handler for get updates for party", error, user.partyId, null, null);
|
|
2665
|
+
}
|
|
2666
|
+
const activities = [];
|
|
2667
|
+
let endExclusive = startOffset;
|
|
2668
|
+
// Parse updates response with zod
|
|
2669
|
+
const parsedUpdates = UpdatesResponseSchema.safeParse(updates);
|
|
2670
|
+
if (!parsedUpdates.success) {
|
|
2671
|
+
logger.debug({
|
|
2672
|
+
message: "Failed to parse updates response",
|
|
2673
|
+
error: parsedUpdates.error,
|
|
2674
|
+
});
|
|
2675
|
+
return {
|
|
2676
|
+
activities,
|
|
2677
|
+
beginExclusive: startOffset,
|
|
2678
|
+
endExclusive,
|
|
2679
|
+
};
|
|
2680
|
+
}
|
|
2681
|
+
// Helper to match interface IDs (handles both # prefix and package ID formats)
|
|
2682
|
+
const matchesTransferInstructionInterface = (interfaceId) => interfaceId.endsWith(":Splice.Api.Token.TransferInstructionV1:TransferInstruction");
|
|
2683
|
+
const transferInstructions = new Map();
|
|
2684
|
+
// First pass: collect all events
|
|
2685
|
+
for (const updateResponse of parsedUpdates.data) {
|
|
2686
|
+
if (!("Transaction" in updateResponse.update))
|
|
2687
|
+
continue;
|
|
2688
|
+
const transaction = updateResponse.update.Transaction.value;
|
|
2689
|
+
const timestamp = transaction.effectiveAt
|
|
2690
|
+
? new Date(transaction.effectiveAt)
|
|
2691
|
+
: new Date();
|
|
2692
|
+
const transactionId = transaction.updateId || transaction.offset?.toString() || "";
|
|
2693
|
+
if (transaction.offset !== undefined) {
|
|
2694
|
+
endExclusive = Math.max(endExclusive, transaction.offset);
|
|
2695
|
+
}
|
|
2696
|
+
if (!transaction.events)
|
|
2697
|
+
continue;
|
|
2698
|
+
for (const event of transaction.events) {
|
|
2699
|
+
// Handle TransferInstruction CreatedEvent
|
|
2700
|
+
if ("CreatedEvent" in event) {
|
|
2701
|
+
const created = event.CreatedEvent;
|
|
2702
|
+
const interfaceViews = created.interfaceViews || [];
|
|
2703
|
+
const transferInstructionView = interfaceViews.find((view) => matchesTransferInstructionInterface(view.interfaceId));
|
|
2704
|
+
if (transferInstructionView?.viewValue) {
|
|
2705
|
+
const parsedViewValue = TransferInstructionSchema.safeParse(transferInstructionView.viewValue);
|
|
2706
|
+
if (parsedViewValue.success) {
|
|
2707
|
+
const transfer = parsedViewValue.data.transfer;
|
|
2708
|
+
const isSender = transfer.sender === user.partyId;
|
|
2709
|
+
const isReceiver = transfer.receiver === user.partyId;
|
|
2710
|
+
if (isSender || isReceiver) {
|
|
2711
|
+
transferInstructions.set(created.contractId, {
|
|
2712
|
+
contractId: created.contractId,
|
|
2713
|
+
sender: transfer.sender,
|
|
2714
|
+
receiver: transfer.receiver,
|
|
2715
|
+
amount: transfer.amount,
|
|
2716
|
+
instrumentId: transfer.instrumentId,
|
|
2717
|
+
createTimestamp: timestamp,
|
|
2718
|
+
createTransactionId: transactionId,
|
|
2719
|
+
});
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
else {
|
|
2723
|
+
logger.debug({
|
|
2724
|
+
message: "Failed to parse TransferInstruction view value",
|
|
2725
|
+
error: parsedViewValue.error,
|
|
2726
|
+
contractId: created.contractId,
|
|
2727
|
+
});
|
|
2728
|
+
}
|
|
2729
|
+
}
|
|
2730
|
+
}
|
|
2731
|
+
// Handle ExercisedEvent
|
|
2732
|
+
if ("ExercisedEvent" in event) {
|
|
2733
|
+
const exercised = event.ExercisedEvent;
|
|
2734
|
+
// Update transfer instruction final state
|
|
2735
|
+
if (exercised.choice === "TransferInstruction_Accept") {
|
|
2736
|
+
const instruction = transferInstructions.get(exercised.contractId);
|
|
2737
|
+
if (instruction) {
|
|
2738
|
+
instruction.finalState = "accepted";
|
|
2739
|
+
instruction.finalTimestamp = timestamp;
|
|
2740
|
+
instruction.finalTransactionId = transactionId;
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
else if (exercised.choice === "TransferInstruction_Reject") {
|
|
2744
|
+
const instruction = transferInstructions.get(exercised.contractId);
|
|
2745
|
+
if (instruction) {
|
|
2746
|
+
instruction.finalState = "rejected";
|
|
2747
|
+
instruction.finalTimestamp = timestamp;
|
|
2748
|
+
instruction.finalTransactionId = transactionId;
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
else if (exercised.choice === "TransferInstruction_Withdraw") {
|
|
2752
|
+
const instruction = transferInstructions.get(exercised.contractId);
|
|
2753
|
+
if (instruction) {
|
|
2754
|
+
instruction.finalState = "withdrawn";
|
|
2755
|
+
instruction.finalTimestamp = timestamp;
|
|
2756
|
+
instruction.finalTransactionId = transactionId;
|
|
2757
|
+
}
|
|
2758
|
+
}
|
|
2759
|
+
// TransferFactory_Transfer - check exercise result
|
|
2760
|
+
if (exercised.choice === "TransferFactory_Transfer") {
|
|
2761
|
+
if (exercised.choiceArgument && exercised.exerciseResult) {
|
|
2762
|
+
const parsedChoiceArgument = TransferChoiceArgumentSchema.safeParse(exercised.choiceArgument);
|
|
2763
|
+
if (parsedChoiceArgument.success) {
|
|
2764
|
+
const transfer = parsedChoiceArgument.data.transfer;
|
|
2765
|
+
const isSender = transfer.sender === user.partyId;
|
|
2766
|
+
const isReceiver = transfer.receiver === user.partyId;
|
|
2767
|
+
const result = exercised.exerciseResult.output;
|
|
2768
|
+
// Completed → sent/received
|
|
2769
|
+
if ("TransferInstructionResult_Completed" in result) {
|
|
2770
|
+
if (isSender) {
|
|
2771
|
+
activities.push({
|
|
2772
|
+
type: "sent",
|
|
2773
|
+
id: transactionId,
|
|
2774
|
+
timestamp,
|
|
2775
|
+
instrumentId: transfer.instrumentId,
|
|
2776
|
+
amount: transfer.amount,
|
|
2777
|
+
receiver: transfer.receiver,
|
|
2778
|
+
contractId: exercised.contractId,
|
|
2779
|
+
});
|
|
2780
|
+
}
|
|
2781
|
+
if (isReceiver) {
|
|
2782
|
+
activities.push({
|
|
2783
|
+
type: "received",
|
|
2784
|
+
id: transactionId,
|
|
2785
|
+
timestamp,
|
|
2786
|
+
instrumentId: transfer.instrumentId,
|
|
2787
|
+
amount: transfer.amount,
|
|
2788
|
+
sender: transfer.sender,
|
|
2789
|
+
contractId: exercised.contractId,
|
|
2790
|
+
});
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
// Pending → handled by CreatedEvent (TransferInstruction created)
|
|
2794
|
+
// No action needed here as the pending transfer instruction will
|
|
2795
|
+
// appear in transferInstructions map from its CreatedEvent
|
|
2796
|
+
// Failed → failed activity
|
|
2797
|
+
if ("TransferInstructionResult_Failed" in result) {
|
|
2798
|
+
if (isSender || isReceiver) {
|
|
2799
|
+
activities.push({
|
|
2800
|
+
type: "failed",
|
|
2801
|
+
id: transactionId,
|
|
2802
|
+
timestamp,
|
|
2803
|
+
instrumentId: transfer.instrumentId,
|
|
2804
|
+
amount: transfer.amount,
|
|
2805
|
+
otherParty: isSender ? transfer.receiver : transfer.sender,
|
|
2806
|
+
contractId: exercised.contractId,
|
|
2807
|
+
});
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2811
|
+
else {
|
|
2812
|
+
logger.debug({
|
|
2813
|
+
message: "Failed to parse TransferFactory_Transfer choice argument",
|
|
2814
|
+
error: parsedChoiceArgument.error,
|
|
2815
|
+
contractId: exercised.contractId,
|
|
2816
|
+
});
|
|
2817
|
+
}
|
|
2818
|
+
}
|
|
2819
|
+
}
|
|
2820
|
+
}
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
// Second pass: build activities from transfer instructions
|
|
2824
|
+
for (const instruction of transferInstructions.values()) {
|
|
2825
|
+
const isSender = instruction.sender === user.partyId;
|
|
2826
|
+
const isReceiver = instruction.receiver === user.partyId;
|
|
2827
|
+
if (instruction.finalState === "accepted") {
|
|
2828
|
+
// Accepted → sent/received (hide the Create, show as completed transfer)
|
|
2829
|
+
if (isSender) {
|
|
2830
|
+
activities.push({
|
|
2831
|
+
type: "sent",
|
|
2832
|
+
id: instruction.finalTransactionId || instruction.createTransactionId,
|
|
2833
|
+
timestamp: instruction.finalTimestamp || instruction.createTimestamp,
|
|
2834
|
+
instrumentId: instruction.instrumentId,
|
|
2835
|
+
amount: instruction.amount,
|
|
2836
|
+
receiver: instruction.receiver,
|
|
2837
|
+
contractId: instruction.contractId,
|
|
2838
|
+
});
|
|
2839
|
+
}
|
|
2840
|
+
if (isReceiver) {
|
|
2841
|
+
activities.push({
|
|
2842
|
+
type: "received",
|
|
2843
|
+
id: instruction.finalTransactionId || instruction.createTransactionId,
|
|
2844
|
+
timestamp: instruction.finalTimestamp || instruction.createTimestamp,
|
|
2845
|
+
instrumentId: instruction.instrumentId,
|
|
2846
|
+
amount: instruction.amount,
|
|
2847
|
+
sender: instruction.sender,
|
|
2848
|
+
contractId: instruction.contractId,
|
|
2849
|
+
});
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
else if (instruction.finalState === "rejected") {
|
|
2853
|
+
activities.push({
|
|
2854
|
+
type: "rejected",
|
|
2855
|
+
id: instruction.finalTransactionId || instruction.createTransactionId,
|
|
2856
|
+
timestamp: instruction.finalTimestamp || instruction.createTimestamp,
|
|
2857
|
+
instrumentId: instruction.instrumentId,
|
|
2858
|
+
amount: instruction.amount,
|
|
2859
|
+
otherParty: isSender ? instruction.receiver : instruction.sender,
|
|
2860
|
+
contractId: instruction.contractId,
|
|
2861
|
+
});
|
|
2862
|
+
}
|
|
2863
|
+
else if (instruction.finalState === "withdrawn") {
|
|
2864
|
+
activities.push({
|
|
2865
|
+
type: "withdrawn",
|
|
2866
|
+
id: instruction.finalTransactionId || instruction.createTransactionId,
|
|
2867
|
+
timestamp: instruction.finalTimestamp || instruction.createTimestamp,
|
|
2868
|
+
instrumentId: instruction.instrumentId,
|
|
2869
|
+
amount: instruction.amount,
|
|
2870
|
+
otherParty: isSender ? instruction.receiver : instruction.sender,
|
|
2871
|
+
contractId: instruction.contractId,
|
|
2872
|
+
});
|
|
2873
|
+
}
|
|
2874
|
+
else {
|
|
2875
|
+
// No final state → pending
|
|
2876
|
+
if (isSender) {
|
|
2877
|
+
activities.push({
|
|
2878
|
+
type: "pending_outgoing",
|
|
2879
|
+
id: instruction.createTransactionId,
|
|
2880
|
+
timestamp: instruction.createTimestamp,
|
|
2881
|
+
instrumentId: instruction.instrumentId,
|
|
2882
|
+
amount: instruction.amount,
|
|
2883
|
+
receiver: instruction.receiver,
|
|
2884
|
+
contractId: instruction.contractId,
|
|
2885
|
+
});
|
|
2886
|
+
}
|
|
2887
|
+
else if (isReceiver) {
|
|
2888
|
+
activities.push({
|
|
2889
|
+
type: "pending_incoming",
|
|
2890
|
+
id: instruction.createTransactionId,
|
|
2891
|
+
timestamp: instruction.createTimestamp,
|
|
2892
|
+
instrumentId: instruction.instrumentId,
|
|
2893
|
+
amount: instruction.amount,
|
|
2894
|
+
sender: instruction.sender,
|
|
2895
|
+
contractId: instruction.contractId,
|
|
2896
|
+
});
|
|
2897
|
+
}
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
activities.sort((a, b) => b.timestamp.getTime() - a.timestamp.getTime());
|
|
2901
|
+
return {
|
|
2902
|
+
activities,
|
|
2903
|
+
beginExclusive: startOffset,
|
|
2904
|
+
endExclusive,
|
|
2905
|
+
};
|
|
2906
|
+
}
|
|
2556
2907
|
//# sourceMappingURL=main.js.map
|