ppi-sdk 1.0.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/demo-ppi-system-fixed.js +76 -0
- package/examples/basic-usage.js +31 -0
- package/package.json +48 -0
- package/packages/ppi-sdk/compiler/ethereum-compiler.js +199 -0
- package/packages/ppi-sdk/core.js +69 -0
- package/packages/ppi-sdk/debug-primitive-methods.js +15 -0
- package/packages/ppi-sdk/fluent-api.js +367 -0
- package/packages/ppi-sdk/package.json +51 -0
- package/packages/ppi-sdk/src/index.js +95 -0
- package/packages/ppi-sdk/src/primitives/CONDITIONS.js +100 -0
- package/packages/ppi-sdk/src/primitives/ESCROW.js +143 -0
- package/packages/ppi-sdk/src/primitives/IF.js +67 -0
- package/packages/ppi-sdk/src/primitives/RECEIVE.js +62 -0
- package/packages/ppi-sdk/src/primitives/SCHEDULE.js +96 -0
- package/packages/ppi-sdk/src/primitives/SEND.js +65 -0
- package/packages/ppi-sdk/src/primitives/SPLIT.js +55 -0
- package/packages/ppi-sdk/src/primitives/STREAM.js +113 -0
- package/packages/ppi-sdk/src/primitives/VOTE.js +109 -0
- package/packages/ppi-sdk/src/types.js +26 -0
- package/packages/ppi-sdk/src/utils/index.js +30 -0
- package/packages/ppi-sdk/test-comprehensive.js +55 -0
- package/packages/ppi-sdk/test-debug.js +27 -0
- package/packages/ppi-sdk/test-final-launch.js +18 -0
- package/packages/ppi-sdk/test-final.js +62 -0
- package/packages/ppi-sdk/test-simple.js +43 -0
- package/packages/ppi-sdk/test-uppercase-fix.js +26 -0
- package/packages/ppi-sdk/utils/index.js +17 -0
- package/ppi-api/example-client.js +108 -0
- package/ppi-api/node_modules/.bin/mime +16 -0
- package/ppi-api/node_modules/.bin/mime.cmd +17 -0
- package/ppi-api/node_modules/.bin/mime.ps1 +28 -0
- package/ppi-api/node_modules/.package-lock.json +847 -0
- package/ppi-api/node_modules/accepts/HISTORY.md +243 -0
- package/ppi-api/node_modules/accepts/LICENSE +23 -0
- package/ppi-api/node_modules/accepts/README.md +140 -0
- package/ppi-api/node_modules/accepts/index.js +238 -0
- package/ppi-api/node_modules/accepts/package.json +47 -0
- package/ppi-api/node_modules/array-flatten/LICENSE +21 -0
- package/ppi-api/node_modules/array-flatten/README.md +43 -0
- package/ppi-api/node_modules/array-flatten/array-flatten.js +64 -0
- package/ppi-api/node_modules/array-flatten/package.json +39 -0
- package/ppi-api/node_modules/body-parser/HISTORY.md +672 -0
- package/ppi-api/node_modules/body-parser/LICENSE +23 -0
- package/ppi-api/node_modules/body-parser/README.md +476 -0
- package/ppi-api/node_modules/body-parser/SECURITY.md +25 -0
- package/ppi-api/node_modules/body-parser/index.js +156 -0
- package/ppi-api/node_modules/body-parser/lib/read.js +205 -0
- package/ppi-api/node_modules/body-parser/lib/types/json.js +247 -0
- package/ppi-api/node_modules/body-parser/lib/types/raw.js +101 -0
- package/ppi-api/node_modules/body-parser/lib/types/text.js +121 -0
- package/ppi-api/node_modules/body-parser/lib/types/urlencoded.js +307 -0
- package/ppi-api/node_modules/body-parser/package.json +56 -0
- package/ppi-api/node_modules/bytes/History.md +97 -0
- package/ppi-api/node_modules/bytes/LICENSE +23 -0
- package/ppi-api/node_modules/bytes/Readme.md +152 -0
- package/ppi-api/node_modules/bytes/index.js +170 -0
- package/ppi-api/node_modules/bytes/package.json +42 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/.nycrc +9 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/LICENSE +21 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/README.md +62 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/index.js +15 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/package.json +85 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/test/index.js +63 -0
- package/ppi-api/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
- package/ppi-api/node_modules/call-bound/.eslintrc +13 -0
- package/ppi-api/node_modules/call-bound/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/call-bound/.nycrc +9 -0
- package/ppi-api/node_modules/call-bound/CHANGELOG.md +42 -0
- package/ppi-api/node_modules/call-bound/LICENSE +21 -0
- package/ppi-api/node_modules/call-bound/README.md +53 -0
- package/ppi-api/node_modules/call-bound/index.d.ts +94 -0
- package/ppi-api/node_modules/call-bound/index.js +19 -0
- package/ppi-api/node_modules/call-bound/package.json +99 -0
- package/ppi-api/node_modules/call-bound/test/index.js +61 -0
- package/ppi-api/node_modules/call-bound/tsconfig.json +10 -0
- package/ppi-api/node_modules/content-disposition/HISTORY.md +60 -0
- package/ppi-api/node_modules/content-disposition/LICENSE +22 -0
- package/ppi-api/node_modules/content-disposition/README.md +142 -0
- package/ppi-api/node_modules/content-disposition/index.js +458 -0
- package/ppi-api/node_modules/content-disposition/package.json +44 -0
- package/ppi-api/node_modules/content-type/HISTORY.md +29 -0
- package/ppi-api/node_modules/content-type/LICENSE +22 -0
- package/ppi-api/node_modules/content-type/README.md +94 -0
- package/ppi-api/node_modules/content-type/index.js +225 -0
- package/ppi-api/node_modules/content-type/package.json +42 -0
- package/ppi-api/node_modules/cookie/LICENSE +24 -0
- package/ppi-api/node_modules/cookie/README.md +317 -0
- package/ppi-api/node_modules/cookie/SECURITY.md +25 -0
- package/ppi-api/node_modules/cookie/index.js +334 -0
- package/ppi-api/node_modules/cookie/package.json +44 -0
- package/ppi-api/node_modules/cookie-signature/History.md +38 -0
- package/ppi-api/node_modules/cookie-signature/Readme.md +42 -0
- package/ppi-api/node_modules/cookie-signature/index.js +51 -0
- package/ppi-api/node_modules/cookie-signature/package.json +18 -0
- package/ppi-api/node_modules/cors/CONTRIBUTING.md +33 -0
- package/ppi-api/node_modules/cors/HISTORY.md +58 -0
- package/ppi-api/node_modules/cors/LICENSE +22 -0
- package/ppi-api/node_modules/cors/README.md +243 -0
- package/ppi-api/node_modules/cors/lib/index.js +238 -0
- package/ppi-api/node_modules/cors/package.json +41 -0
- package/ppi-api/node_modules/debug/.coveralls.yml +1 -0
- package/ppi-api/node_modules/debug/.eslintrc +11 -0
- package/ppi-api/node_modules/debug/.travis.yml +14 -0
- package/ppi-api/node_modules/debug/CHANGELOG.md +362 -0
- package/ppi-api/node_modules/debug/LICENSE +19 -0
- package/ppi-api/node_modules/debug/Makefile +50 -0
- package/ppi-api/node_modules/debug/README.md +312 -0
- package/ppi-api/node_modules/debug/component.json +19 -0
- package/ppi-api/node_modules/debug/karma.conf.js +70 -0
- package/ppi-api/node_modules/debug/node.js +1 -0
- package/ppi-api/node_modules/debug/package.json +49 -0
- package/ppi-api/node_modules/debug/src/browser.js +185 -0
- package/ppi-api/node_modules/debug/src/debug.js +202 -0
- package/ppi-api/node_modules/debug/src/index.js +10 -0
- package/ppi-api/node_modules/debug/src/inspector-log.js +15 -0
- package/ppi-api/node_modules/debug/src/node.js +248 -0
- package/ppi-api/node_modules/depd/History.md +103 -0
- package/ppi-api/node_modules/depd/LICENSE +22 -0
- package/ppi-api/node_modules/depd/Readme.md +280 -0
- package/ppi-api/node_modules/depd/index.js +538 -0
- package/ppi-api/node_modules/depd/lib/browser/index.js +77 -0
- package/ppi-api/node_modules/depd/package.json +45 -0
- package/ppi-api/node_modules/destroy/LICENSE +23 -0
- package/ppi-api/node_modules/destroy/README.md +63 -0
- package/ppi-api/node_modules/destroy/index.js +209 -0
- package/ppi-api/node_modules/destroy/package.json +48 -0
- package/ppi-api/node_modules/dunder-proto/.eslintrc +5 -0
- package/ppi-api/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/dunder-proto/.nycrc +13 -0
- package/ppi-api/node_modules/dunder-proto/CHANGELOG.md +24 -0
- package/ppi-api/node_modules/dunder-proto/LICENSE +21 -0
- package/ppi-api/node_modules/dunder-proto/README.md +54 -0
- package/ppi-api/node_modules/dunder-proto/get.d.ts +5 -0
- package/ppi-api/node_modules/dunder-proto/get.js +30 -0
- package/ppi-api/node_modules/dunder-proto/package.json +76 -0
- package/ppi-api/node_modules/dunder-proto/set.d.ts +5 -0
- package/ppi-api/node_modules/dunder-proto/set.js +35 -0
- package/ppi-api/node_modules/dunder-proto/test/get.js +34 -0
- package/ppi-api/node_modules/dunder-proto/test/index.js +4 -0
- package/ppi-api/node_modules/dunder-proto/test/set.js +50 -0
- package/ppi-api/node_modules/dunder-proto/tsconfig.json +9 -0
- package/ppi-api/node_modules/ee-first/LICENSE +22 -0
- package/ppi-api/node_modules/ee-first/README.md +80 -0
- package/ppi-api/node_modules/ee-first/index.js +95 -0
- package/ppi-api/node_modules/ee-first/package.json +29 -0
- package/ppi-api/node_modules/encodeurl/LICENSE +22 -0
- package/ppi-api/node_modules/encodeurl/README.md +109 -0
- package/ppi-api/node_modules/encodeurl/index.js +60 -0
- package/ppi-api/node_modules/encodeurl/package.json +40 -0
- package/ppi-api/node_modules/es-define-property/.eslintrc +13 -0
- package/ppi-api/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/es-define-property/.nycrc +9 -0
- package/ppi-api/node_modules/es-define-property/CHANGELOG.md +29 -0
- package/ppi-api/node_modules/es-define-property/LICENSE +21 -0
- package/ppi-api/node_modules/es-define-property/README.md +49 -0
- package/ppi-api/node_modules/es-define-property/index.d.ts +3 -0
- package/ppi-api/node_modules/es-define-property/index.js +14 -0
- package/ppi-api/node_modules/es-define-property/package.json +81 -0
- package/ppi-api/node_modules/es-define-property/test/index.js +56 -0
- package/ppi-api/node_modules/es-define-property/tsconfig.json +10 -0
- package/ppi-api/node_modules/es-errors/.eslintrc +5 -0
- package/ppi-api/node_modules/es-errors/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/es-errors/CHANGELOG.md +40 -0
- package/ppi-api/node_modules/es-errors/LICENSE +21 -0
- package/ppi-api/node_modules/es-errors/README.md +55 -0
- package/ppi-api/node_modules/es-errors/eval.d.ts +3 -0
- package/ppi-api/node_modules/es-errors/eval.js +4 -0
- package/ppi-api/node_modules/es-errors/index.d.ts +3 -0
- package/ppi-api/node_modules/es-errors/index.js +4 -0
- package/ppi-api/node_modules/es-errors/package.json +80 -0
- package/ppi-api/node_modules/es-errors/range.d.ts +3 -0
- package/ppi-api/node_modules/es-errors/range.js +4 -0
- package/ppi-api/node_modules/es-errors/ref.d.ts +3 -0
- package/ppi-api/node_modules/es-errors/ref.js +4 -0
- package/ppi-api/node_modules/es-errors/syntax.d.ts +3 -0
- package/ppi-api/node_modules/es-errors/syntax.js +4 -0
- package/ppi-api/node_modules/es-errors/test/index.js +19 -0
- package/ppi-api/node_modules/es-errors/tsconfig.json +49 -0
- package/ppi-api/node_modules/es-errors/type.d.ts +3 -0
- package/ppi-api/node_modules/es-errors/type.js +4 -0
- package/ppi-api/node_modules/es-errors/uri.d.ts +3 -0
- package/ppi-api/node_modules/es-errors/uri.js +4 -0
- package/ppi-api/node_modules/es-object-atoms/.eslintrc +16 -0
- package/ppi-api/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/es-object-atoms/CHANGELOG.md +37 -0
- package/ppi-api/node_modules/es-object-atoms/LICENSE +21 -0
- package/ppi-api/node_modules/es-object-atoms/README.md +63 -0
- package/ppi-api/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
- package/ppi-api/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- package/ppi-api/node_modules/es-object-atoms/ToObject.d.ts +7 -0
- package/ppi-api/node_modules/es-object-atoms/ToObject.js +10 -0
- package/ppi-api/node_modules/es-object-atoms/index.d.ts +3 -0
- package/ppi-api/node_modules/es-object-atoms/index.js +4 -0
- package/ppi-api/node_modules/es-object-atoms/isObject.d.ts +3 -0
- package/ppi-api/node_modules/es-object-atoms/isObject.js +6 -0
- package/ppi-api/node_modules/es-object-atoms/package.json +80 -0
- package/ppi-api/node_modules/es-object-atoms/test/index.js +38 -0
- package/ppi-api/node_modules/es-object-atoms/tsconfig.json +6 -0
- package/ppi-api/node_modules/escape-html/LICENSE +24 -0
- package/ppi-api/node_modules/escape-html/Readme.md +43 -0
- package/ppi-api/node_modules/escape-html/index.js +78 -0
- package/ppi-api/node_modules/escape-html/package.json +24 -0
- package/ppi-api/node_modules/etag/HISTORY.md +83 -0
- package/ppi-api/node_modules/etag/LICENSE +22 -0
- package/ppi-api/node_modules/etag/README.md +159 -0
- package/ppi-api/node_modules/etag/index.js +131 -0
- package/ppi-api/node_modules/etag/package.json +47 -0
- package/ppi-api/node_modules/express/History.md +3656 -0
- package/ppi-api/node_modules/express/LICENSE +24 -0
- package/ppi-api/node_modules/express/Readme.md +260 -0
- package/ppi-api/node_modules/express/index.js +11 -0
- package/ppi-api/node_modules/express/lib/application.js +661 -0
- package/ppi-api/node_modules/express/lib/express.js +116 -0
- package/ppi-api/node_modules/express/lib/middleware/init.js +43 -0
- package/ppi-api/node_modules/express/lib/middleware/query.js +47 -0
- package/ppi-api/node_modules/express/lib/request.js +525 -0
- package/ppi-api/node_modules/express/lib/response.js +1179 -0
- package/ppi-api/node_modules/express/lib/router/index.js +673 -0
- package/ppi-api/node_modules/express/lib/router/layer.js +181 -0
- package/ppi-api/node_modules/express/lib/router/route.js +230 -0
- package/ppi-api/node_modules/express/lib/utils.js +303 -0
- package/ppi-api/node_modules/express/lib/view.js +182 -0
- package/ppi-api/node_modules/express/package.json +102 -0
- package/ppi-api/node_modules/finalhandler/HISTORY.md +210 -0
- package/ppi-api/node_modules/finalhandler/LICENSE +22 -0
- package/ppi-api/node_modules/finalhandler/README.md +147 -0
- package/ppi-api/node_modules/finalhandler/SECURITY.md +25 -0
- package/ppi-api/node_modules/finalhandler/index.js +341 -0
- package/ppi-api/node_modules/finalhandler/package.json +47 -0
- package/ppi-api/node_modules/forwarded/HISTORY.md +21 -0
- package/ppi-api/node_modules/forwarded/LICENSE +22 -0
- package/ppi-api/node_modules/forwarded/README.md +57 -0
- package/ppi-api/node_modules/forwarded/index.js +90 -0
- package/ppi-api/node_modules/forwarded/package.json +45 -0
- package/ppi-api/node_modules/fresh/HISTORY.md +70 -0
- package/ppi-api/node_modules/fresh/LICENSE +23 -0
- package/ppi-api/node_modules/fresh/README.md +119 -0
- package/ppi-api/node_modules/fresh/index.js +137 -0
- package/ppi-api/node_modules/fresh/package.json +46 -0
- package/ppi-api/node_modules/function-bind/.eslintrc +21 -0
- package/ppi-api/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/function-bind/.github/SECURITY.md +3 -0
- package/ppi-api/node_modules/function-bind/.nycrc +13 -0
- package/ppi-api/node_modules/function-bind/CHANGELOG.md +136 -0
- package/ppi-api/node_modules/function-bind/LICENSE +20 -0
- package/ppi-api/node_modules/function-bind/README.md +46 -0
- package/ppi-api/node_modules/function-bind/implementation.js +84 -0
- package/ppi-api/node_modules/function-bind/index.js +5 -0
- package/ppi-api/node_modules/function-bind/package.json +87 -0
- package/ppi-api/node_modules/function-bind/test/.eslintrc +9 -0
- package/ppi-api/node_modules/function-bind/test/index.js +252 -0
- package/ppi-api/node_modules/get-intrinsic/.eslintrc +42 -0
- package/ppi-api/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/get-intrinsic/.nycrc +9 -0
- package/ppi-api/node_modules/get-intrinsic/CHANGELOG.md +186 -0
- package/ppi-api/node_modules/get-intrinsic/LICENSE +21 -0
- package/ppi-api/node_modules/get-intrinsic/README.md +71 -0
- package/ppi-api/node_modules/get-intrinsic/index.js +378 -0
- package/ppi-api/node_modules/get-intrinsic/package.json +97 -0
- package/ppi-api/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
- package/ppi-api/node_modules/get-proto/.eslintrc +10 -0
- package/ppi-api/node_modules/get-proto/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/get-proto/.nycrc +9 -0
- package/ppi-api/node_modules/get-proto/CHANGELOG.md +21 -0
- package/ppi-api/node_modules/get-proto/LICENSE +21 -0
- package/ppi-api/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
- package/ppi-api/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/ppi-api/node_modules/get-proto/README.md +50 -0
- package/ppi-api/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
- package/ppi-api/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/ppi-api/node_modules/get-proto/index.d.ts +5 -0
- package/ppi-api/node_modules/get-proto/index.js +27 -0
- package/ppi-api/node_modules/get-proto/package.json +81 -0
- package/ppi-api/node_modules/get-proto/test/index.js +68 -0
- package/ppi-api/node_modules/get-proto/tsconfig.json +9 -0
- package/ppi-api/node_modules/gopd/.eslintrc +16 -0
- package/ppi-api/node_modules/gopd/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/gopd/CHANGELOG.md +45 -0
- package/ppi-api/node_modules/gopd/LICENSE +21 -0
- package/ppi-api/node_modules/gopd/README.md +40 -0
- package/ppi-api/node_modules/gopd/gOPD.d.ts +1 -0
- package/ppi-api/node_modules/gopd/gOPD.js +4 -0
- package/ppi-api/node_modules/gopd/index.d.ts +5 -0
- package/ppi-api/node_modules/gopd/index.js +15 -0
- package/ppi-api/node_modules/gopd/package.json +77 -0
- package/ppi-api/node_modules/gopd/test/index.js +36 -0
- package/ppi-api/node_modules/gopd/tsconfig.json +9 -0
- package/ppi-api/node_modules/has-symbols/.eslintrc +11 -0
- package/ppi-api/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/has-symbols/.nycrc +9 -0
- package/ppi-api/node_modules/has-symbols/CHANGELOG.md +91 -0
- package/ppi-api/node_modules/has-symbols/LICENSE +21 -0
- package/ppi-api/node_modules/has-symbols/README.md +46 -0
- package/ppi-api/node_modules/has-symbols/index.d.ts +3 -0
- package/ppi-api/node_modules/has-symbols/index.js +14 -0
- package/ppi-api/node_modules/has-symbols/package.json +111 -0
- package/ppi-api/node_modules/has-symbols/shams.d.ts +3 -0
- package/ppi-api/node_modules/has-symbols/shams.js +45 -0
- package/ppi-api/node_modules/has-symbols/test/index.js +22 -0
- package/ppi-api/node_modules/has-symbols/test/shams/core-js.js +29 -0
- package/ppi-api/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
- package/ppi-api/node_modules/has-symbols/test/tests.js +58 -0
- package/ppi-api/node_modules/has-symbols/tsconfig.json +10 -0
- package/ppi-api/node_modules/hasown/.eslintrc +5 -0
- package/ppi-api/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/hasown/.nycrc +13 -0
- package/ppi-api/node_modules/hasown/CHANGELOG.md +40 -0
- package/ppi-api/node_modules/hasown/LICENSE +21 -0
- package/ppi-api/node_modules/hasown/README.md +40 -0
- package/ppi-api/node_modules/hasown/index.d.ts +3 -0
- package/ppi-api/node_modules/hasown/index.js +8 -0
- package/ppi-api/node_modules/hasown/package.json +92 -0
- package/ppi-api/node_modules/hasown/tsconfig.json +6 -0
- package/ppi-api/node_modules/http-errors/HISTORY.md +180 -0
- package/ppi-api/node_modules/http-errors/LICENSE +23 -0
- package/ppi-api/node_modules/http-errors/README.md +169 -0
- package/ppi-api/node_modules/http-errors/index.js +289 -0
- package/ppi-api/node_modules/http-errors/package.json +50 -0
- package/ppi-api/node_modules/iconv-lite/Changelog.md +162 -0
- package/ppi-api/node_modules/iconv-lite/LICENSE +21 -0
- package/ppi-api/node_modules/iconv-lite/README.md +156 -0
- package/ppi-api/node_modules/iconv-lite/encodings/dbcs-codec.js +555 -0
- package/ppi-api/node_modules/iconv-lite/encodings/dbcs-data.js +176 -0
- package/ppi-api/node_modules/iconv-lite/encodings/index.js +22 -0
- package/ppi-api/node_modules/iconv-lite/encodings/internal.js +188 -0
- package/ppi-api/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- package/ppi-api/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/ppi-api/node_modules/iconv-lite/encodings/sbcs-data.js +174 -0
- package/ppi-api/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/ppi-api/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/ppi-api/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/ppi-api/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/ppi-api/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/ppi-api/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/ppi-api/node_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
- package/ppi-api/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/ppi-api/node_modules/iconv-lite/encodings/utf16.js +177 -0
- package/ppi-api/node_modules/iconv-lite/encodings/utf7.js +290 -0
- package/ppi-api/node_modules/iconv-lite/lib/bom-handling.js +52 -0
- package/ppi-api/node_modules/iconv-lite/lib/extend-node.js +217 -0
- package/ppi-api/node_modules/iconv-lite/lib/index.d.ts +24 -0
- package/ppi-api/node_modules/iconv-lite/lib/index.js +153 -0
- package/ppi-api/node_modules/iconv-lite/lib/streams.js +121 -0
- package/ppi-api/node_modules/iconv-lite/package.json +46 -0
- package/ppi-api/node_modules/inherits/LICENSE +16 -0
- package/ppi-api/node_modules/inherits/README.md +42 -0
- package/ppi-api/node_modules/inherits/inherits.js +9 -0
- package/ppi-api/node_modules/inherits/inherits_browser.js +27 -0
- package/ppi-api/node_modules/inherits/package.json +29 -0
- package/ppi-api/node_modules/ipaddr.js/LICENSE +19 -0
- package/ppi-api/node_modules/ipaddr.js/README.md +233 -0
- package/ppi-api/node_modules/ipaddr.js/ipaddr.min.js +1 -0
- package/ppi-api/node_modules/ipaddr.js/lib/ipaddr.js +673 -0
- package/ppi-api/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +68 -0
- package/ppi-api/node_modules/ipaddr.js/package.json +35 -0
- package/ppi-api/node_modules/math-intrinsics/.eslintrc +16 -0
- package/ppi-api/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/math-intrinsics/CHANGELOG.md +24 -0
- package/ppi-api/node_modules/math-intrinsics/LICENSE +21 -0
- package/ppi-api/node_modules/math-intrinsics/README.md +50 -0
- package/ppi-api/node_modules/math-intrinsics/abs.d.ts +1 -0
- package/ppi-api/node_modules/math-intrinsics/abs.js +4 -0
- package/ppi-api/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
- package/ppi-api/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
- package/ppi-api/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
- package/ppi-api/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
- package/ppi-api/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
- package/ppi-api/node_modules/math-intrinsics/constants/maxValue.js +5 -0
- package/ppi-api/node_modules/math-intrinsics/floor.d.ts +1 -0
- package/ppi-api/node_modules/math-intrinsics/floor.js +4 -0
- package/ppi-api/node_modules/math-intrinsics/isFinite.d.ts +3 -0
- package/ppi-api/node_modules/math-intrinsics/isFinite.js +12 -0
- package/ppi-api/node_modules/math-intrinsics/isInteger.d.ts +3 -0
- package/ppi-api/node_modules/math-intrinsics/isInteger.js +16 -0
- package/ppi-api/node_modules/math-intrinsics/isNaN.d.ts +1 -0
- package/ppi-api/node_modules/math-intrinsics/isNaN.js +6 -0
- package/ppi-api/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
- package/ppi-api/node_modules/math-intrinsics/isNegativeZero.js +6 -0
- package/ppi-api/node_modules/math-intrinsics/max.d.ts +1 -0
- package/ppi-api/node_modules/math-intrinsics/max.js +4 -0
- package/ppi-api/node_modules/math-intrinsics/min.d.ts +1 -0
- package/ppi-api/node_modules/math-intrinsics/min.js +4 -0
- package/ppi-api/node_modules/math-intrinsics/mod.d.ts +3 -0
- package/ppi-api/node_modules/math-intrinsics/mod.js +9 -0
- package/ppi-api/node_modules/math-intrinsics/package.json +86 -0
- package/ppi-api/node_modules/math-intrinsics/pow.d.ts +1 -0
- package/ppi-api/node_modules/math-intrinsics/pow.js +4 -0
- package/ppi-api/node_modules/math-intrinsics/round.d.ts +1 -0
- package/ppi-api/node_modules/math-intrinsics/round.js +4 -0
- package/ppi-api/node_modules/math-intrinsics/sign.d.ts +3 -0
- package/ppi-api/node_modules/math-intrinsics/sign.js +11 -0
- package/ppi-api/node_modules/math-intrinsics/test/index.js +192 -0
- package/ppi-api/node_modules/math-intrinsics/tsconfig.json +3 -0
- package/ppi-api/node_modules/media-typer/HISTORY.md +22 -0
- package/ppi-api/node_modules/media-typer/LICENSE +22 -0
- package/ppi-api/node_modules/media-typer/README.md +81 -0
- package/ppi-api/node_modules/media-typer/index.js +270 -0
- package/ppi-api/node_modules/media-typer/package.json +26 -0
- package/ppi-api/node_modules/merge-descriptors/HISTORY.md +21 -0
- package/ppi-api/node_modules/merge-descriptors/LICENSE +23 -0
- package/ppi-api/node_modules/merge-descriptors/README.md +49 -0
- package/ppi-api/node_modules/merge-descriptors/index.js +60 -0
- package/ppi-api/node_modules/merge-descriptors/package.json +39 -0
- package/ppi-api/node_modules/methods/HISTORY.md +29 -0
- package/ppi-api/node_modules/methods/LICENSE +24 -0
- package/ppi-api/node_modules/methods/README.md +51 -0
- package/ppi-api/node_modules/methods/index.js +69 -0
- package/ppi-api/node_modules/methods/package.json +36 -0
- package/ppi-api/node_modules/mime/CHANGELOG.md +164 -0
- package/ppi-api/node_modules/mime/LICENSE +21 -0
- package/ppi-api/node_modules/mime/README.md +90 -0
- package/ppi-api/node_modules/mime/cli.js +8 -0
- package/ppi-api/node_modules/mime/mime.js +108 -0
- package/ppi-api/node_modules/mime/package.json +44 -0
- package/ppi-api/node_modules/mime/src/build.js +53 -0
- package/ppi-api/node_modules/mime/src/test.js +60 -0
- package/ppi-api/node_modules/mime/types.json +1 -0
- package/ppi-api/node_modules/mime-db/HISTORY.md +507 -0
- package/ppi-api/node_modules/mime-db/LICENSE +23 -0
- package/ppi-api/node_modules/mime-db/README.md +100 -0
- package/ppi-api/node_modules/mime-db/db.json +8519 -0
- package/ppi-api/node_modules/mime-db/index.js +12 -0
- package/ppi-api/node_modules/mime-db/package.json +60 -0
- package/ppi-api/node_modules/mime-types/HISTORY.md +397 -0
- package/ppi-api/node_modules/mime-types/LICENSE +23 -0
- package/ppi-api/node_modules/mime-types/README.md +113 -0
- package/ppi-api/node_modules/mime-types/index.js +188 -0
- package/ppi-api/node_modules/mime-types/package.json +44 -0
- package/ppi-api/node_modules/ms/index.js +152 -0
- package/ppi-api/node_modules/ms/license.md +21 -0
- package/ppi-api/node_modules/ms/package.json +37 -0
- package/ppi-api/node_modules/ms/readme.md +51 -0
- package/ppi-api/node_modules/negotiator/HISTORY.md +108 -0
- package/ppi-api/node_modules/negotiator/LICENSE +24 -0
- package/ppi-api/node_modules/negotiator/README.md +203 -0
- package/ppi-api/node_modules/negotiator/index.js +82 -0
- package/ppi-api/node_modules/negotiator/lib/charset.js +169 -0
- package/ppi-api/node_modules/negotiator/lib/encoding.js +184 -0
- package/ppi-api/node_modules/negotiator/lib/language.js +179 -0
- package/ppi-api/node_modules/negotiator/lib/mediaType.js +294 -0
- package/ppi-api/node_modules/negotiator/package.json +42 -0
- package/ppi-api/node_modules/object-assign/index.js +90 -0
- package/ppi-api/node_modules/object-assign/license +21 -0
- package/ppi-api/node_modules/object-assign/package.json +42 -0
- package/ppi-api/node_modules/object-assign/readme.md +61 -0
- package/ppi-api/node_modules/object-inspect/.eslintrc +53 -0
- package/ppi-api/node_modules/object-inspect/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/object-inspect/.nycrc +13 -0
- package/ppi-api/node_modules/object-inspect/CHANGELOG.md +424 -0
- package/ppi-api/node_modules/object-inspect/LICENSE +21 -0
- package/ppi-api/node_modules/object-inspect/example/all.js +23 -0
- package/ppi-api/node_modules/object-inspect/example/circular.js +6 -0
- package/ppi-api/node_modules/object-inspect/example/fn.js +5 -0
- package/ppi-api/node_modules/object-inspect/example/inspect.js +10 -0
- package/ppi-api/node_modules/object-inspect/index.js +544 -0
- package/ppi-api/node_modules/object-inspect/package-support.json +20 -0
- package/ppi-api/node_modules/object-inspect/package.json +105 -0
- package/ppi-api/node_modules/object-inspect/readme.markdown +84 -0
- package/ppi-api/node_modules/object-inspect/test/bigint.js +58 -0
- package/ppi-api/node_modules/object-inspect/test/browser/dom.js +15 -0
- package/ppi-api/node_modules/object-inspect/test/circular.js +16 -0
- package/ppi-api/node_modules/object-inspect/test/deep.js +12 -0
- package/ppi-api/node_modules/object-inspect/test/element.js +53 -0
- package/ppi-api/node_modules/object-inspect/test/err.js +48 -0
- package/ppi-api/node_modules/object-inspect/test/fakes.js +29 -0
- package/ppi-api/node_modules/object-inspect/test/fn.js +76 -0
- package/ppi-api/node_modules/object-inspect/test/global.js +17 -0
- package/ppi-api/node_modules/object-inspect/test/has.js +15 -0
- package/ppi-api/node_modules/object-inspect/test/holes.js +15 -0
- package/ppi-api/node_modules/object-inspect/test/indent-option.js +271 -0
- package/ppi-api/node_modules/object-inspect/test/inspect.js +139 -0
- package/ppi-api/node_modules/object-inspect/test/lowbyte.js +12 -0
- package/ppi-api/node_modules/object-inspect/test/number.js +58 -0
- package/ppi-api/node_modules/object-inspect/test/quoteStyle.js +26 -0
- package/ppi-api/node_modules/object-inspect/test/toStringTag.js +40 -0
- package/ppi-api/node_modules/object-inspect/test/undef.js +12 -0
- package/ppi-api/node_modules/object-inspect/test/values.js +261 -0
- package/ppi-api/node_modules/object-inspect/test-core-js.js +26 -0
- package/ppi-api/node_modules/object-inspect/util.inspect.js +1 -0
- package/ppi-api/node_modules/on-finished/HISTORY.md +98 -0
- package/ppi-api/node_modules/on-finished/LICENSE +23 -0
- package/ppi-api/node_modules/on-finished/README.md +162 -0
- package/ppi-api/node_modules/on-finished/index.js +234 -0
- package/ppi-api/node_modules/on-finished/package.json +39 -0
- package/ppi-api/node_modules/parseurl/HISTORY.md +58 -0
- package/ppi-api/node_modules/parseurl/LICENSE +24 -0
- package/ppi-api/node_modules/parseurl/README.md +133 -0
- package/ppi-api/node_modules/parseurl/index.js +158 -0
- package/ppi-api/node_modules/parseurl/package.json +40 -0
- package/ppi-api/node_modules/path-to-regexp/LICENSE +21 -0
- package/ppi-api/node_modules/path-to-regexp/Readme.md +35 -0
- package/ppi-api/node_modules/path-to-regexp/index.js +156 -0
- package/ppi-api/node_modules/path-to-regexp/package.json +30 -0
- package/ppi-api/node_modules/proxy-addr/HISTORY.md +161 -0
- package/ppi-api/node_modules/proxy-addr/LICENSE +22 -0
- package/ppi-api/node_modules/proxy-addr/README.md +139 -0
- package/ppi-api/node_modules/proxy-addr/index.js +327 -0
- package/ppi-api/node_modules/proxy-addr/package.json +47 -0
- package/ppi-api/node_modules/qs/.editorconfig +46 -0
- package/ppi-api/node_modules/qs/.eslintrc +38 -0
- package/ppi-api/node_modules/qs/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/qs/.nycrc +13 -0
- package/ppi-api/node_modules/qs/CHANGELOG.md +600 -0
- package/ppi-api/node_modules/qs/LICENSE.md +29 -0
- package/ppi-api/node_modules/qs/README.md +709 -0
- package/ppi-api/node_modules/qs/dist/qs.js +90 -0
- package/ppi-api/node_modules/qs/lib/formats.js +23 -0
- package/ppi-api/node_modules/qs/lib/index.js +11 -0
- package/ppi-api/node_modules/qs/lib/parse.js +296 -0
- package/ppi-api/node_modules/qs/lib/stringify.js +351 -0
- package/ppi-api/node_modules/qs/lib/utils.js +265 -0
- package/ppi-api/node_modules/qs/package.json +91 -0
- package/ppi-api/node_modules/qs/test/empty-keys-cases.js +267 -0
- package/ppi-api/node_modules/qs/test/parse.js +1170 -0
- package/ppi-api/node_modules/qs/test/stringify.js +1298 -0
- package/ppi-api/node_modules/qs/test/utils.js +136 -0
- package/ppi-api/node_modules/range-parser/HISTORY.md +56 -0
- package/ppi-api/node_modules/range-parser/LICENSE +23 -0
- package/ppi-api/node_modules/range-parser/README.md +84 -0
- package/ppi-api/node_modules/range-parser/index.js +162 -0
- package/ppi-api/node_modules/range-parser/package.json +44 -0
- package/ppi-api/node_modules/raw-body/HISTORY.md +308 -0
- package/ppi-api/node_modules/raw-body/LICENSE +22 -0
- package/ppi-api/node_modules/raw-body/README.md +223 -0
- package/ppi-api/node_modules/raw-body/SECURITY.md +24 -0
- package/ppi-api/node_modules/raw-body/index.d.ts +87 -0
- package/ppi-api/node_modules/raw-body/index.js +336 -0
- package/ppi-api/node_modules/raw-body/package.json +49 -0
- package/ppi-api/node_modules/safe-buffer/LICENSE +21 -0
- package/ppi-api/node_modules/safe-buffer/README.md +584 -0
- package/ppi-api/node_modules/safe-buffer/index.d.ts +187 -0
- package/ppi-api/node_modules/safe-buffer/index.js +65 -0
- package/ppi-api/node_modules/safe-buffer/package.json +51 -0
- package/ppi-api/node_modules/safer-buffer/LICENSE +21 -0
- package/ppi-api/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- package/ppi-api/node_modules/safer-buffer/Readme.md +156 -0
- package/ppi-api/node_modules/safer-buffer/dangerous.js +58 -0
- package/ppi-api/node_modules/safer-buffer/package.json +34 -0
- package/ppi-api/node_modules/safer-buffer/safer.js +77 -0
- package/ppi-api/node_modules/safer-buffer/tests.js +406 -0
- package/ppi-api/node_modules/send/HISTORY.md +526 -0
- package/ppi-api/node_modules/send/LICENSE +23 -0
- package/ppi-api/node_modules/send/README.md +327 -0
- package/ppi-api/node_modules/send/SECURITY.md +24 -0
- package/ppi-api/node_modules/send/index.js +1142 -0
- package/ppi-api/node_modules/send/node_modules/encodeurl/HISTORY.md +14 -0
- package/ppi-api/node_modules/send/node_modules/encodeurl/LICENSE +22 -0
- package/ppi-api/node_modules/send/node_modules/encodeurl/README.md +128 -0
- package/ppi-api/node_modules/send/node_modules/encodeurl/index.js +60 -0
- package/ppi-api/node_modules/send/node_modules/encodeurl/package.json +40 -0
- package/ppi-api/node_modules/send/node_modules/ms/index.js +162 -0
- package/ppi-api/node_modules/send/node_modules/ms/license.md +21 -0
- package/ppi-api/node_modules/send/node_modules/ms/package.json +38 -0
- package/ppi-api/node_modules/send/node_modules/ms/readme.md +59 -0
- package/ppi-api/node_modules/send/package.json +62 -0
- package/ppi-api/node_modules/serve-static/HISTORY.md +487 -0
- package/ppi-api/node_modules/serve-static/LICENSE +25 -0
- package/ppi-api/node_modules/serve-static/README.md +257 -0
- package/ppi-api/node_modules/serve-static/index.js +209 -0
- package/ppi-api/node_modules/serve-static/package.json +42 -0
- package/ppi-api/node_modules/setprototypeof/LICENSE +13 -0
- package/ppi-api/node_modules/setprototypeof/README.md +31 -0
- package/ppi-api/node_modules/setprototypeof/index.d.ts +2 -0
- package/ppi-api/node_modules/setprototypeof/index.js +17 -0
- package/ppi-api/node_modules/setprototypeof/package.json +38 -0
- package/ppi-api/node_modules/setprototypeof/test/index.js +24 -0
- package/ppi-api/node_modules/side-channel/.editorconfig +9 -0
- package/ppi-api/node_modules/side-channel/.eslintrc +12 -0
- package/ppi-api/node_modules/side-channel/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/side-channel/.nycrc +13 -0
- package/ppi-api/node_modules/side-channel/CHANGELOG.md +110 -0
- package/ppi-api/node_modules/side-channel/LICENSE +21 -0
- package/ppi-api/node_modules/side-channel/README.md +61 -0
- package/ppi-api/node_modules/side-channel/index.d.ts +14 -0
- package/ppi-api/node_modules/side-channel/index.js +43 -0
- package/ppi-api/node_modules/side-channel/package.json +85 -0
- package/ppi-api/node_modules/side-channel/test/index.js +104 -0
- package/ppi-api/node_modules/side-channel/tsconfig.json +9 -0
- package/ppi-api/node_modules/side-channel-list/.editorconfig +9 -0
- package/ppi-api/node_modules/side-channel-list/.eslintrc +11 -0
- package/ppi-api/node_modules/side-channel-list/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/side-channel-list/.nycrc +13 -0
- package/ppi-api/node_modules/side-channel-list/CHANGELOG.md +15 -0
- package/ppi-api/node_modules/side-channel-list/LICENSE +21 -0
- package/ppi-api/node_modules/side-channel-list/README.md +62 -0
- package/ppi-api/node_modules/side-channel-list/index.d.ts +13 -0
- package/ppi-api/node_modules/side-channel-list/index.js +113 -0
- package/ppi-api/node_modules/side-channel-list/list.d.ts +14 -0
- package/ppi-api/node_modules/side-channel-list/package.json +77 -0
- package/ppi-api/node_modules/side-channel-list/test/index.js +104 -0
- package/ppi-api/node_modules/side-channel-list/tsconfig.json +9 -0
- package/ppi-api/node_modules/side-channel-map/.editorconfig +9 -0
- package/ppi-api/node_modules/side-channel-map/.eslintrc +11 -0
- package/ppi-api/node_modules/side-channel-map/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/side-channel-map/.nycrc +13 -0
- package/ppi-api/node_modules/side-channel-map/CHANGELOG.md +22 -0
- package/ppi-api/node_modules/side-channel-map/LICENSE +21 -0
- package/ppi-api/node_modules/side-channel-map/README.md +62 -0
- package/ppi-api/node_modules/side-channel-map/index.d.ts +15 -0
- package/ppi-api/node_modules/side-channel-map/index.js +68 -0
- package/ppi-api/node_modules/side-channel-map/package.json +80 -0
- package/ppi-api/node_modules/side-channel-map/test/index.js +114 -0
- package/ppi-api/node_modules/side-channel-map/tsconfig.json +9 -0
- package/ppi-api/node_modules/side-channel-weakmap/.editorconfig +9 -0
- package/ppi-api/node_modules/side-channel-weakmap/.eslintrc +12 -0
- package/ppi-api/node_modules/side-channel-weakmap/.github/FUNDING.yml +12 -0
- package/ppi-api/node_modules/side-channel-weakmap/.nycrc +13 -0
- package/ppi-api/node_modules/side-channel-weakmap/CHANGELOG.md +28 -0
- package/ppi-api/node_modules/side-channel-weakmap/LICENSE +21 -0
- package/ppi-api/node_modules/side-channel-weakmap/README.md +62 -0
- package/ppi-api/node_modules/side-channel-weakmap/index.d.ts +15 -0
- package/ppi-api/node_modules/side-channel-weakmap/index.js +84 -0
- package/ppi-api/node_modules/side-channel-weakmap/package.json +87 -0
- package/ppi-api/node_modules/side-channel-weakmap/test/index.js +114 -0
- package/ppi-api/node_modules/side-channel-weakmap/tsconfig.json +9 -0
- package/ppi-api/node_modules/statuses/HISTORY.md +82 -0
- package/ppi-api/node_modules/statuses/LICENSE +23 -0
- package/ppi-api/node_modules/statuses/README.md +136 -0
- package/ppi-api/node_modules/statuses/codes.json +65 -0
- package/ppi-api/node_modules/statuses/index.js +146 -0
- package/ppi-api/node_modules/statuses/package.json +49 -0
- package/ppi-api/node_modules/toidentifier/HISTORY.md +9 -0
- package/ppi-api/node_modules/toidentifier/LICENSE +21 -0
- package/ppi-api/node_modules/toidentifier/README.md +61 -0
- package/ppi-api/node_modules/toidentifier/index.js +32 -0
- package/ppi-api/node_modules/toidentifier/package.json +38 -0
- package/ppi-api/node_modules/type-is/HISTORY.md +259 -0
- package/ppi-api/node_modules/type-is/LICENSE +23 -0
- package/ppi-api/node_modules/type-is/README.md +170 -0
- package/ppi-api/node_modules/type-is/index.js +266 -0
- package/ppi-api/node_modules/type-is/package.json +45 -0
- package/ppi-api/node_modules/unpipe/HISTORY.md +4 -0
- package/ppi-api/node_modules/unpipe/LICENSE +22 -0
- package/ppi-api/node_modules/unpipe/README.md +43 -0
- package/ppi-api/node_modules/unpipe/index.js +69 -0
- package/ppi-api/node_modules/unpipe/package.json +27 -0
- package/ppi-api/node_modules/utils-merge/LICENSE +20 -0
- package/ppi-api/node_modules/utils-merge/README.md +34 -0
- package/ppi-api/node_modules/utils-merge/index.js +23 -0
- package/ppi-api/node_modules/utils-merge/package.json +40 -0
- package/ppi-api/node_modules/vary/HISTORY.md +39 -0
- package/ppi-api/node_modules/vary/LICENSE +22 -0
- package/ppi-api/node_modules/vary/README.md +101 -0
- package/ppi-api/node_modules/vary/index.js +149 -0
- package/ppi-api/node_modules/vary/package.json +43 -0
- package/ppi-api/package-lock.json +856 -0
- package/ppi-api/package.json +53 -0
- package/ppi-api/ppi-api-server.js +480 -0
- package/ppi-api/ppi-protocol-demo.js +83 -0
- package/ppi-api/ppi-protocol.js +114 -0
- package/ppi-api/ppi-url-client.js +97 -0
- package/ppi-api/test-ppi-api.js +72 -0
- package/ppi-api/test-ppi-protocol.js +44 -0
- package/ppi-api/test-protocol-api.js +81 -0
- package/src/compiler/compiler.js +832 -0
- package/src/index.js +112 -0
- package/src/integration/dag-integration.js +122 -0
- package/src/primitives/CONDITIONS.js +100 -0
- package/src/primitives/ESCROW.js +143 -0
- package/src/primitives/IF.js +67 -0
- package/src/primitives/RECEIVE.js +62 -0
- package/src/primitives/SCHEDULE.js +96 -0
- package/src/primitives/SEND.js +65 -0
- package/src/primitives/SPLIT.js +55 -0
- package/src/primitives/STREAM.js +113 -0
- package/src/primitives/VOTE.js +109 -0
- package/test/backend-diagnostic.js +48 -0
- package/test/check-balance.js +28 -0
- package/test/debug-flow.js +58 -0
- package/test/find-users.js +74 -0
- package/test/live-test.js +40 -0
- package/test/multi-chain-test.js +76 -0
- package/test/quick-test.js +15 -0
- package/test/real-users-test.js +67 -0
- package/test/synchronized-test.js +40 -0
- package/test/universal-trifecta.js +83 -0
- package/test-all-primitives-real-users.js +125 -0
- package/test-all-primitives.js +58 -0
- package/test-compiler-integration.js +60 -0
- package/test-individual.js +37 -0
- package/test-live-ppi-real-users.js +82 -0
- package/test-ppi-sdk.js +142 -0
- package/tools/emergency-fix.js +31 -0
- package/tools/package-manager-simple.js +98 -0
- package/tools/ppi-cli.js +165 -0
- package/tools/ppi-playground-web.js +35 -0
- package/tools/ppi-playground.js +236 -0
- package/tools/test-cli.js +2 -0
- package/tools/test-fix.js +52 -0
|
@@ -0,0 +1,832 @@
|
|
|
1
|
+
// C:\Casha\ppi-universe\src\compiler\compiler.js
|
|
2
|
+
// COMPLETE VERSION WITH PPI_RECEIVE ADDED
|
|
3
|
+
|
|
4
|
+
export class PPICompiler {
|
|
5
|
+
static compile(operation, target = 'casha-dag') {
|
|
6
|
+
const state = operation.getState ? operation.getState() : operation;
|
|
7
|
+
const operationType = state.operation || 'SEND';
|
|
8
|
+
|
|
9
|
+
console.log(`🔧 Compiling ${operationType} for target: ${target}`);
|
|
10
|
+
console.log(' Operation state:', JSON.stringify(state, null, 2));
|
|
11
|
+
|
|
12
|
+
switch(target) {
|
|
13
|
+
case 'casha-dag':
|
|
14
|
+
return this.compileForCasha(state, target, operationType);
|
|
15
|
+
case 'ethereum':
|
|
16
|
+
return this.compileForEthereum(state, target, operationType);
|
|
17
|
+
case 'solana':
|
|
18
|
+
return this.compileForSolana(state, target, operationType);
|
|
19
|
+
default:
|
|
20
|
+
throw new Error(`Unsupported target: ${target}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Enhanced compiler routing
|
|
25
|
+
static compileForCasha(state, target, operationType) {
|
|
26
|
+
switch(operationType) {
|
|
27
|
+
case 'SEND':
|
|
28
|
+
case 'PPI_SEND':
|
|
29
|
+
return this.compileSendCasha(state, target);
|
|
30
|
+
case 'PPI_RECEIVE': // ✅ ADDED: PPI_RECEIVE case
|
|
31
|
+
return this.compileReceiveCasha(state, target);
|
|
32
|
+
case 'PPI_ESCROW':
|
|
33
|
+
return this.compileEscrowCasha(state, target);
|
|
34
|
+
case 'PPI_SPLIT':
|
|
35
|
+
return this.compileSplitCasha(state, target);
|
|
36
|
+
case 'PPI_IF':
|
|
37
|
+
return this.compileIfCasha(state, target);
|
|
38
|
+
case 'PPI_CONDITION':
|
|
39
|
+
return this.compileConditionCasha(state, target);
|
|
40
|
+
case 'PPI_SCHEDULE':
|
|
41
|
+
return this.compileScheduleCasha(state, target);
|
|
42
|
+
case 'PPI_STREAM':
|
|
43
|
+
return this.compileStreamCasha(state, target);
|
|
44
|
+
case 'PPI_VOTE':
|
|
45
|
+
return this.compileVoteCasha(state, target);
|
|
46
|
+
default:
|
|
47
|
+
throw new Error(`Casha DAG: Unsupported operation: ${operationType}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
static compileForEthereum(state, target, operationType) {
|
|
52
|
+
switch(operationType) {
|
|
53
|
+
case 'SEND':
|
|
54
|
+
case 'PPI_SEND':
|
|
55
|
+
return this.compileSendEthereum(state, target);
|
|
56
|
+
case 'PPI_RECEIVE': // ✅ ADDED: PPI_RECEIVE case
|
|
57
|
+
return this.compileReceiveEthereum(state, target);
|
|
58
|
+
case 'PPI_ESCROW':
|
|
59
|
+
return this.compileEscrowEthereum(state, target);
|
|
60
|
+
case 'PPI_SPLIT':
|
|
61
|
+
return this.compileSplitEthereum(state, target);
|
|
62
|
+
case 'PPI_IF':
|
|
63
|
+
return this.compileIfEthereum(state, target);
|
|
64
|
+
case 'PPI_CONDITION':
|
|
65
|
+
return this.compileConditionEthereum(state, target);
|
|
66
|
+
case 'PPI_SCHEDULE':
|
|
67
|
+
return this.compileScheduleEthereum(state, target);
|
|
68
|
+
case 'PPI_STREAM':
|
|
69
|
+
return this.compileStreamEthereum(state, target);
|
|
70
|
+
case 'PPI_VOTE':
|
|
71
|
+
return this.compileVoteEthereum(state, target);
|
|
72
|
+
default:
|
|
73
|
+
throw new Error(`Ethereum: Unsupported operation: ${operationType}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
static compileForSolana(state, target, operationType) {
|
|
78
|
+
switch(operationType) {
|
|
79
|
+
case 'SEND':
|
|
80
|
+
case 'PPI_SEND':
|
|
81
|
+
return this.compileSendSolana(state, target);
|
|
82
|
+
case 'PPI_RECEIVE': // ✅ ADDED: PPI_RECEIVE case
|
|
83
|
+
return this.compileReceiveSolana(state, target);
|
|
84
|
+
case 'PPI_ESCROW':
|
|
85
|
+
return this.compileEscrowSolana(state, target);
|
|
86
|
+
case 'PPI_SPLIT':
|
|
87
|
+
return this.compileSplitSolana(state, target);
|
|
88
|
+
case 'PPI_IF':
|
|
89
|
+
return this.compileIfSolana(state, target);
|
|
90
|
+
case 'PPI_CONDITION':
|
|
91
|
+
return this.compileConditionSolana(state, target);
|
|
92
|
+
case 'PPI_SCHEDULE':
|
|
93
|
+
return this.compileScheduleSolana(state, target);
|
|
94
|
+
case 'PPI_STREAM':
|
|
95
|
+
return this.compileStreamSolana(state, target);
|
|
96
|
+
case 'PPI_VOTE':
|
|
97
|
+
return this.compileVoteSolana(state, target);
|
|
98
|
+
default:
|
|
99
|
+
throw new Error(`Solana: Unsupported operation: ${operationType}`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// ============================================================================
|
|
104
|
+
// CASH DAG COMPILATION METHODS
|
|
105
|
+
// ============================================================================
|
|
106
|
+
|
|
107
|
+
static compileSendCasha(state, target) {
|
|
108
|
+
const compiled = {
|
|
109
|
+
type: 'DAG_TRANSACTION',
|
|
110
|
+
version: '1.0',
|
|
111
|
+
operation: 'SEND',
|
|
112
|
+
target: 'casha-dag',
|
|
113
|
+
parameters: {
|
|
114
|
+
from_user: '{{current_user}}',
|
|
115
|
+
to_user: state.to_user,
|
|
116
|
+
amount: parseFloat(state.amount),
|
|
117
|
+
currency: state.currency || 'CASHA',
|
|
118
|
+
message: state.message || '',
|
|
119
|
+
fee: this.calculateFee(state),
|
|
120
|
+
confirmations: state.confirmations || 2,
|
|
121
|
+
priority: state.priority || 'standard',
|
|
122
|
+
instant_confirmation: (state.confirmations || 2) === 1,
|
|
123
|
+
use_fast_lane: (state.priority || 'standard') === 'instant'
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
console.log('📤 Compiled SEND for Casha DAG:', JSON.stringify(compiled, null, 2));
|
|
128
|
+
return compiled;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// ✅ ADDED: PPI_RECEIVE compilation method
|
|
132
|
+
static compileReceiveCasha(state, target) {
|
|
133
|
+
const compiled = {
|
|
134
|
+
type: 'DAG_PAYMENT_REQUEST',
|
|
135
|
+
version: '1.0',
|
|
136
|
+
operation: 'PAYMENT_REQUEST',
|
|
137
|
+
target: 'casha-dag',
|
|
138
|
+
parameters: {
|
|
139
|
+
from_user: state.from_user || '{{any_sender}}',
|
|
140
|
+
to_user: state.to_user || '{{current_user}}',
|
|
141
|
+
amount: parseFloat(state.amount),
|
|
142
|
+
currency: state.currency || 'CASHA',
|
|
143
|
+
message: state.message || '',
|
|
144
|
+
expires_in: state.expires_in || '7d',
|
|
145
|
+
status: 'pending',
|
|
146
|
+
request_id: this.generateRequestId()
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
console.log('📥 Compiled RECEIVE for Casha DAG:', JSON.stringify(compiled, null, 2));
|
|
151
|
+
return compiled;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
static compileEscrowCasha(state, target) {
|
|
155
|
+
const compiled = {
|
|
156
|
+
type: 'DAG_TRANSACTION',
|
|
157
|
+
version: '1.0',
|
|
158
|
+
operation: 'ESCROW_CREATE',
|
|
159
|
+
target: 'casha-dag',
|
|
160
|
+
parameters: {
|
|
161
|
+
from_user: state.from_user || '{{current_user}}',
|
|
162
|
+
to_user: state.to_user,
|
|
163
|
+
amount: parseFloat(state.amount),
|
|
164
|
+
arbitrator: state.arbitrator,
|
|
165
|
+
conditions: state.conditions || [],
|
|
166
|
+
message: state.message || '',
|
|
167
|
+
fee: this.calculateFee(state),
|
|
168
|
+
status: state.status || 'pending'
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
console.log('📤 Compiled ESCROW for Casha DAG:', JSON.stringify(compiled, null, 2));
|
|
173
|
+
return compiled;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
static compileSplitCasha(state, target) {
|
|
177
|
+
if (!state.recipients || state.recipients.length === 0) {
|
|
178
|
+
throw new Error('PPI_SPLIT requires recipients array');
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const share = state.amount / state.recipients.length;
|
|
182
|
+
const roundedShare = Math.round(share * 100) / 100;
|
|
183
|
+
|
|
184
|
+
const compiled = {
|
|
185
|
+
type: 'DAG_BATCH',
|
|
186
|
+
version: '1.0',
|
|
187
|
+
operation: 'BATCH_SEND',
|
|
188
|
+
target: 'casha-dag',
|
|
189
|
+
parameters: {
|
|
190
|
+
transactions: state.recipients.map(recipient => ({
|
|
191
|
+
from_user: '{{current_user}}',
|
|
192
|
+
to_user: recipient,
|
|
193
|
+
amount: roundedShare,
|
|
194
|
+
currency: state.currency || 'CASHA',
|
|
195
|
+
message: state.message || `Split payment: ${roundedShare} each`
|
|
196
|
+
}))
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
console.log('📤 Compiled SPLIT for Casha DAG:', JSON.stringify(compiled, null, 2));
|
|
201
|
+
return compiled;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
static compileIfCasha(state, target) {
|
|
205
|
+
const compiled = {
|
|
206
|
+
type: 'DAG_CONDITIONAL',
|
|
207
|
+
version: '1.0',
|
|
208
|
+
operation: 'CONDITIONAL_EXECUTE',
|
|
209
|
+
target: 'casha-dag',
|
|
210
|
+
parameters: {
|
|
211
|
+
condition: state.condition,
|
|
212
|
+
then_branch: state.then_action,
|
|
213
|
+
else_branch: state.else_action || null
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
console.log('📤 Compiled IF for Casha DAG:', JSON.stringify(compiled, null, 2));
|
|
218
|
+
return compiled;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
static compileConditionCasha(state, target) {
|
|
222
|
+
const compiled = {
|
|
223
|
+
type: 'DAG_CONDITION',
|
|
224
|
+
version: '1.0',
|
|
225
|
+
operation: 'CONDITION_CREATE',
|
|
226
|
+
target: 'casha-dag',
|
|
227
|
+
parameters: {
|
|
228
|
+
condition_type: state.condition_type,
|
|
229
|
+
params: state.params,
|
|
230
|
+
operator: state.chain_operator,
|
|
231
|
+
next_condition: state.next_condition
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
console.log('📤 Compiled CONDITION for Casha DAG:', JSON.stringify(compiled, null, 2));
|
|
236
|
+
return compiled;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
static compileScheduleCasha(state, target) {
|
|
240
|
+
const compiled = {
|
|
241
|
+
type: 'DAG_SCHEDULED',
|
|
242
|
+
version: '1.0',
|
|
243
|
+
operation: 'SCHEDULE_CREATE',
|
|
244
|
+
target: 'casha-dag',
|
|
245
|
+
parameters: {
|
|
246
|
+
from_user: '{{current_user}}',
|
|
247
|
+
to_user: state.to_user,
|
|
248
|
+
amount: parseFloat(state.amount),
|
|
249
|
+
schedule_type: state.schedule_type,
|
|
250
|
+
start_time: state.start_time,
|
|
251
|
+
end_time: state.end_time,
|
|
252
|
+
interval: state.interval,
|
|
253
|
+
cron_expression: state.cron_expression,
|
|
254
|
+
timezone: state.timezone,
|
|
255
|
+
message: state.message || '',
|
|
256
|
+
max_occurrences: state.max_occurrences,
|
|
257
|
+
fee: this.calculateFee(state)
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
console.log('📤 Compiled SCHEDULE for Casha DAG:', JSON.stringify(compiled, null, 2));
|
|
262
|
+
return compiled;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
static compileStreamCasha(state, target) {
|
|
266
|
+
const compiled = {
|
|
267
|
+
type: 'DAG_STREAM',
|
|
268
|
+
version: '1.0',
|
|
269
|
+
operation: 'STREAM_CREATE',
|
|
270
|
+
target: 'casha-dag',
|
|
271
|
+
parameters: {
|
|
272
|
+
from_user: '{{current_user}}',
|
|
273
|
+
to_user: state.to_user,
|
|
274
|
+
total_amount: parseFloat(state.amount),
|
|
275
|
+
stream_type: state.stream_type,
|
|
276
|
+
rate_per_interval: state.rate_per_interval || state.amount,
|
|
277
|
+
interval: state.interval,
|
|
278
|
+
start_time: state.start_time,
|
|
279
|
+
end_time: state.end_time,
|
|
280
|
+
duration: state.duration,
|
|
281
|
+
message: state.message || '',
|
|
282
|
+
auto_renew: state.auto_renew || false,
|
|
283
|
+
fee: this.calculateFee(state)
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
console.log('📤 Compiled STREAM for Casha DAG:', JSON.stringify(compiled, null, 2));
|
|
288
|
+
return compiled;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
static compileVoteCasha(state, target) {
|
|
292
|
+
const compiled = {
|
|
293
|
+
type: 'DAG_VOTE',
|
|
294
|
+
version: '1.0',
|
|
295
|
+
operation: 'VOTE_CREATE',
|
|
296
|
+
target: 'casha-dag',
|
|
297
|
+
parameters: {
|
|
298
|
+
proposal: state.proposal,
|
|
299
|
+
voters: state.voters,
|
|
300
|
+
vote_type: state.vote_type,
|
|
301
|
+
threshold: state.threshold,
|
|
302
|
+
options: state.options,
|
|
303
|
+
start_time: state.start_time,
|
|
304
|
+
end_time: state.end_time,
|
|
305
|
+
duration: state.duration,
|
|
306
|
+
message: state.message || '',
|
|
307
|
+
action_on_success: state.action_on_success,
|
|
308
|
+
action_on_failure: state.action_on_failure
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
console.log('📤 Compiled VOTE for Casha DAG:', JSON.stringify(compiled, null, 2));
|
|
313
|
+
return compiled;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// ============================================================================
|
|
317
|
+
// ETHEREUM COMPILATION METHODS
|
|
318
|
+
// ============================================================================
|
|
319
|
+
|
|
320
|
+
static compileSendEthereum(state, target) {
|
|
321
|
+
const compiled = {
|
|
322
|
+
type: 'ETHEREUM_TRANSACTION',
|
|
323
|
+
version: '1.0',
|
|
324
|
+
operation: 'ETH_TRANSFER',
|
|
325
|
+
target: 'ethereum',
|
|
326
|
+
chain: 'mainnet',
|
|
327
|
+
parameters: {
|
|
328
|
+
to: this.normalizeEthereumAddress(state.to_user),
|
|
329
|
+
value: this.etherToWei(state.amount),
|
|
330
|
+
gasLimit: 21000,
|
|
331
|
+
chainId: 1,
|
|
332
|
+
data: '0x'
|
|
333
|
+
},
|
|
334
|
+
metadata: {
|
|
335
|
+
message: state.message || '',
|
|
336
|
+
currency: 'ETH',
|
|
337
|
+
compiledAt: new Date().toISOString()
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
console.log('📤 Compiled SEND for Ethereum:', JSON.stringify(compiled, null, 2));
|
|
342
|
+
return compiled;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// ✅ ADDED: PPI_RECEIVE for Ethereum
|
|
346
|
+
static compileReceiveEthereum(state, target) {
|
|
347
|
+
const compiled = {
|
|
348
|
+
type: 'ETHEREUM_PAYMENT_REQUEST',
|
|
349
|
+
version: '1.0',
|
|
350
|
+
operation: 'PAYMENT_REQUEST',
|
|
351
|
+
target: 'ethereum',
|
|
352
|
+
chain: 'mainnet',
|
|
353
|
+
parameters: {
|
|
354
|
+
from: state.from_user ? this.normalizeEthereumAddress(state.from_user) : '0xANY_SENDER',
|
|
355
|
+
to: state.to_user ? this.normalizeEthereumAddress(state.to_user) : '{{current_wallet}}',
|
|
356
|
+
value: this.etherToWei(state.amount),
|
|
357
|
+
expiresAt: this.calculateExpiryTimestamp(state.expires_in || '7d')
|
|
358
|
+
},
|
|
359
|
+
metadata: {
|
|
360
|
+
message: state.message || '',
|
|
361
|
+
currency: 'ETH',
|
|
362
|
+
requestType: 'payment_request'
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
console.log('📥 Compiled RECEIVE for Ethereum:', JSON.stringify(compiled, null, 2));
|
|
367
|
+
return compiled;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
static compileEscrowEthereum(state, target) {
|
|
371
|
+
const compiled = {
|
|
372
|
+
type: 'ETHEREUM_SMART_CALL',
|
|
373
|
+
version: '1.0',
|
|
374
|
+
operation: 'ESCROW_CREATE',
|
|
375
|
+
target: 'ethereum',
|
|
376
|
+
chain: 'mainnet',
|
|
377
|
+
contract: '0xESCROW_CONTRACT_ADDRESS',
|
|
378
|
+
method: 'createEscrow',
|
|
379
|
+
parameters: {
|
|
380
|
+
from: this.normalizeEthereumAddress(state.from_user || '{{current_user}}'),
|
|
381
|
+
to: this.normalizeEthereumAddress(state.to_user),
|
|
382
|
+
amount: this.etherToWei(state.amount),
|
|
383
|
+
arbitrator: this.normalizeEthereumAddress(state.arbitrator || '0xARBITRATOR'),
|
|
384
|
+
conditions: state.conditions || []
|
|
385
|
+
},
|
|
386
|
+
value: this.etherToWei(state.amount),
|
|
387
|
+
gasLimit: 100000,
|
|
388
|
+
chainId: 1
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
console.log('📤 Compiled ESCROW for Ethereum:', JSON.stringify(compiled, null, 2));
|
|
392
|
+
return compiled;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
static compileSplitEthereum(state, target) {
|
|
396
|
+
if (!state.recipients || state.recipients.length === 0) {
|
|
397
|
+
throw new Error('PPI_SPLIT requires recipients array');
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
const share = state.amount / state.recipients.length;
|
|
401
|
+
const shareWei = this.etherToWei(share);
|
|
402
|
+
|
|
403
|
+
const compiled = {
|
|
404
|
+
type: 'ETHEREUM_BATCH',
|
|
405
|
+
version: '1.0',
|
|
406
|
+
operation: 'BATCH_TRANSFER',
|
|
407
|
+
target: 'ethereum',
|
|
408
|
+
chain: 'mainnet',
|
|
409
|
+
transactions: state.recipients.map(recipient => ({
|
|
410
|
+
to: this.normalizeEthereumAddress(recipient),
|
|
411
|
+
value: shareWei,
|
|
412
|
+
gasLimit: 21000,
|
|
413
|
+
data: '0x'
|
|
414
|
+
})),
|
|
415
|
+
gasLimit: 21000 * state.recipients.length,
|
|
416
|
+
chainId: 1
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
console.log('📤 Compiled SPLIT for Ethereum:', JSON.stringify(compiled, null, 2));
|
|
420
|
+
return compiled;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
static compileIfEthereum(state, target) {
|
|
424
|
+
const compiled = {
|
|
425
|
+
type: 'ETHEREUM_SMART_CALL',
|
|
426
|
+
version: '1.0',
|
|
427
|
+
operation: 'CONDITIONAL_EXECUTE',
|
|
428
|
+
target: 'ethereum',
|
|
429
|
+
chain: 'mainnet',
|
|
430
|
+
contract: '0xCONDITIONAL_CONTRACT_ADDRESS',
|
|
431
|
+
method: 'executeConditional',
|
|
432
|
+
parameters: {
|
|
433
|
+
condition: state.condition,
|
|
434
|
+
thenAction: state.then_action,
|
|
435
|
+
elseAction: state.else_action || '0x'
|
|
436
|
+
},
|
|
437
|
+
gasLimit: 150000,
|
|
438
|
+
chainId: 1
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
console.log('📤 Compiled IF for Ethereum:', JSON.stringify(compiled, null, 2));
|
|
442
|
+
return compiled;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
static compileConditionEthereum(state, target) {
|
|
446
|
+
const compiled = {
|
|
447
|
+
type: 'ETHEREUM_SMART_CALL',
|
|
448
|
+
version: '1.0',
|
|
449
|
+
operation: 'CONDITION_CREATE',
|
|
450
|
+
target: 'ethereum',
|
|
451
|
+
chain: 'mainnet',
|
|
452
|
+
contract: '0xCONDITION_CONTRACT_ADDRESS',
|
|
453
|
+
method: 'createCondition',
|
|
454
|
+
parameters: {
|
|
455
|
+
conditionType: state.condition_type,
|
|
456
|
+
params: state.params,
|
|
457
|
+
operator: state.chain_operator,
|
|
458
|
+
nextCondition: state.next_condition
|
|
459
|
+
},
|
|
460
|
+
gasLimit: 50000,
|
|
461
|
+
chainId: 1
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
console.log('📤 Compiled CONDITION for Ethereum:', JSON.stringify(compiled, null, 2));
|
|
465
|
+
return compiled;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// ============================================================================
|
|
469
|
+
// SOLANA COMPILATION METHODS
|
|
470
|
+
// ============================================================================
|
|
471
|
+
|
|
472
|
+
static compileSendSolana(state, target) {
|
|
473
|
+
const compiled = {
|
|
474
|
+
type: 'SOLANA_TRANSACTION',
|
|
475
|
+
version: '1.0',
|
|
476
|
+
operation: 'SOL_TRANSFER',
|
|
477
|
+
target: 'solana',
|
|
478
|
+
network: 'mainnet-beta',
|
|
479
|
+
instructions: [
|
|
480
|
+
{
|
|
481
|
+
programId: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',
|
|
482
|
+
accounts: [
|
|
483
|
+
{ pubkey: '{{from_wallet}}', isSigner: true, isWritable: true },
|
|
484
|
+
{ pubkey: this.normalizeSolanaAddress(state.to_user), isSigner: false, isWritable: true },
|
|
485
|
+
{ pubkey: '{{from_wallet}}', isSigner: true, isWritable: true }
|
|
486
|
+
],
|
|
487
|
+
data: this.encodeSolanaTransfer(state.amount)
|
|
488
|
+
}
|
|
489
|
+
],
|
|
490
|
+
recentBlockhash: '{{recent_blockhash}}',
|
|
491
|
+
feePayer: '{{from_wallet}}'
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
console.log('📤 Compiled SEND for Solana:', JSON.stringify(compiled, null, 2));
|
|
495
|
+
return compiled;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
// ✅ ADDED: PPI_RECEIVE for Solana
|
|
499
|
+
static compileReceiveSolana(state, target) {
|
|
500
|
+
const compiled = {
|
|
501
|
+
type: 'SOLANA_PAYMENT_REQUEST',
|
|
502
|
+
version: '1.0',
|
|
503
|
+
operation: 'PAYMENT_REQUEST',
|
|
504
|
+
target: 'solana',
|
|
505
|
+
network: 'mainnet-beta',
|
|
506
|
+
parameters: {
|
|
507
|
+
from: state.from_user ? this.normalizeSolanaAddress(state.from_user) : '{{any_sender}}',
|
|
508
|
+
to: state.to_user ? this.normalizeSolanaAddress(state.to_user) : '{{current_wallet}}',
|
|
509
|
+
amount: this.solToLamports(state.amount),
|
|
510
|
+
expiresAt: this.calculateExpiryTimestamp(state.expires_in || '7d')
|
|
511
|
+
},
|
|
512
|
+
metadata: {
|
|
513
|
+
message: state.message || '',
|
|
514
|
+
requestType: 'payment_request'
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
console.log('📥 Compiled RECEIVE for Solana:', JSON.stringify(compiled, null, 2));
|
|
519
|
+
return compiled;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
static compileEscrowSolana(state, target) {
|
|
523
|
+
const compiled = {
|
|
524
|
+
type: 'SOLANA_SMART_CALL',
|
|
525
|
+
version: '1.0',
|
|
526
|
+
operation: 'ESCROW_CREATE',
|
|
527
|
+
target: 'solana',
|
|
528
|
+
network: 'mainnet-beta',
|
|
529
|
+
programId: '{{escrow_program_id}}',
|
|
530
|
+
accounts: [
|
|
531
|
+
{ pubkey: this.normalizeSolanaAddress(state.from_user || '{{from_wallet}}'), isSigner: true, isWritable: true },
|
|
532
|
+
{ pubkey: this.normalizeSolanaAddress(state.to_user), isSigner: false, isWritable: true },
|
|
533
|
+
{ pubkey: this.normalizeSolanaAddress(state.arbitrator || '{{arbitrator}}'), isSigner: false, isWritable: false },
|
|
534
|
+
{ pubkey: '{{system_program}}', isSigner: false, isWritable: false }
|
|
535
|
+
],
|
|
536
|
+
data: this.encodeSolanaEscrow(state.amount, state.conditions || []),
|
|
537
|
+
recentBlockhash: '{{recent_blockhash}}',
|
|
538
|
+
feePayer: '{{from_wallet}}'
|
|
539
|
+
};
|
|
540
|
+
|
|
541
|
+
console.log('📤 Compiled ESCROW for Solana:', JSON.stringify(compiled, null, 2));
|
|
542
|
+
return compiled;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
static compileSplitSolana(state, target) {
|
|
546
|
+
if (!state.recipients || state.recipients.length === 0) {
|
|
547
|
+
throw new Error('PPI_SPLIT requires recipients array');
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
const share = state.amount / state.recipients.length;
|
|
551
|
+
const shareLamports = this.solToLamports(share);
|
|
552
|
+
|
|
553
|
+
const compiled = {
|
|
554
|
+
type: 'SOLANA_BATCH',
|
|
555
|
+
version: '1.0',
|
|
556
|
+
operation: 'BATCH_TRANSFER',
|
|
557
|
+
target: 'solana',
|
|
558
|
+
network: 'mainnet-beta',
|
|
559
|
+
instructions: state.recipients.map(recipient => ({
|
|
560
|
+
programId: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',
|
|
561
|
+
accounts: [
|
|
562
|
+
{ pubkey: '{{from_wallet}}', isSigner: true, isWritable: true },
|
|
563
|
+
{ pubkey: this.normalizeSolanaAddress(recipient), isSigner: false, isWritable: true },
|
|
564
|
+
{ pubkey: '{{from_wallet}}', isSigner: true, isWritable: true }
|
|
565
|
+
],
|
|
566
|
+
data: this.encodeSolanaTransfer(share)
|
|
567
|
+
})),
|
|
568
|
+
recentBlockhash: '{{recent_blockhash}}',
|
|
569
|
+
feePayer: '{{from_wallet}}'
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
console.log('📤 Compiled SPLIT for Solana:', JSON.stringify(compiled, null, 2));
|
|
573
|
+
return compiled;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
static compileIfSolana(state, target) {
|
|
577
|
+
const compiled = {
|
|
578
|
+
type: 'SOLANA_SMART_CALL',
|
|
579
|
+
version: '1.0',
|
|
580
|
+
operation: 'CONDITIONAL_EXECUTE',
|
|
581
|
+
target: 'solana',
|
|
582
|
+
network: 'mainnet-beta',
|
|
583
|
+
programId: '{{conditional_program_id}}',
|
|
584
|
+
accounts: [
|
|
585
|
+
{ pubkey: '{{from_wallet}}', isSigner: true, isWritable: true },
|
|
586
|
+
{ pubkey: '{{condition_account}}', isSigner: false, isWritable: false },
|
|
587
|
+
{ pubkey: '{{then_account}}', isSigner: false, isWritable: true },
|
|
588
|
+
{ pubkey: '{{else_account}}', isSigner: false, isWritable: true }
|
|
589
|
+
],
|
|
590
|
+
data: this.encodeSolanaConditional(state),
|
|
591
|
+
recentBlockhash: '{{recent_blockhash}}',
|
|
592
|
+
feePayer: '{{from_wallet}}'
|
|
593
|
+
};
|
|
594
|
+
|
|
595
|
+
console.log('📤 Compiled IF for Solana:', JSON.stringify(compiled, null, 2));
|
|
596
|
+
return compiled;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
static compileConditionSolana(state, target) {
|
|
600
|
+
const compiled = {
|
|
601
|
+
type: 'SOLANA_SMART_CALL',
|
|
602
|
+
version: '1.0',
|
|
603
|
+
operation: 'CONDITION_CREATE',
|
|
604
|
+
target: 'solana',
|
|
605
|
+
network: 'mainnet-beta',
|
|
606
|
+
programId: '{{condition_program_id}}',
|
|
607
|
+
accounts: [
|
|
608
|
+
{ pubkey: '{{from_wallet}}', isSigner: true, isWritable: true },
|
|
609
|
+
{ pubkey: '{{condition_account}}', isSigner: false, isWritable: true }
|
|
610
|
+
],
|
|
611
|
+
data: this.encodeSolanaCondition(state),
|
|
612
|
+
recentBlockhash: '{{recent_blockhash}}',
|
|
613
|
+
feePayer: '{{from_wallet}}'
|
|
614
|
+
};
|
|
615
|
+
|
|
616
|
+
console.log('📤 Compiled CONDITION for Solana:', JSON.stringify(compiled, null, 2));
|
|
617
|
+
return compiled;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
// ============================================================================
|
|
621
|
+
// UTILITY METHODS
|
|
622
|
+
// ============================================================================
|
|
623
|
+
|
|
624
|
+
static calculateFee(state) {
|
|
625
|
+
if (state.fee === 'auto') {
|
|
626
|
+
const baseFee = parseFloat(state.amount) * 0.01;
|
|
627
|
+
const calculatedFee = Math.max(0.1, Math.min(baseFee, 5.0));
|
|
628
|
+
console.log(` Calculated auto fee: ${calculatedFee} for amount: ${state.amount}`);
|
|
629
|
+
return calculatedFee;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
const fee = parseFloat(state.fee) || 0;
|
|
633
|
+
console.log(` Using fixed fee: ${fee}`);
|
|
634
|
+
return fee;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
// ✅ ADDED: Generate unique request ID for PPI_RECEIVE
|
|
638
|
+
static generateRequestId() {
|
|
639
|
+
return 'req_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
// ✅ ADDED: Calculate expiry timestamp
|
|
643
|
+
static calculateExpiryTimestamp(duration) {
|
|
644
|
+
const now = Date.now();
|
|
645
|
+
const match = duration.match(/(\d+)([dhms])/);
|
|
646
|
+
if (!match) return now + 7 * 24 * 60 * 60 * 1000; // Default 7 days
|
|
647
|
+
|
|
648
|
+
const value = parseInt(match[1]);
|
|
649
|
+
const unit = match[2];
|
|
650
|
+
|
|
651
|
+
const multipliers = {
|
|
652
|
+
's': 1000,
|
|
653
|
+
'm': 60 * 1000,
|
|
654
|
+
'h': 60 * 60 * 1000,
|
|
655
|
+
'd': 24 * 60 * 60 * 1000
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
return now + (value * (multipliers[unit] || multipliers['d']));
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
// ... (keep all your existing utility methods: etherToWei, normalizeEthereumAddress, solToLamports, etc.)
|
|
662
|
+
|
|
663
|
+
static etherToWei(etherAmount) {
|
|
664
|
+
if (etherAmount === undefined || etherAmount === null) {
|
|
665
|
+
throw new Error('Amount is required');
|
|
666
|
+
}
|
|
667
|
+
let amountStr = etherAmount.toString();
|
|
668
|
+
|
|
669
|
+
if (amountStr.includes('.')) {
|
|
670
|
+
const [integerPart, decimalPart] = amountStr.split('.');
|
|
671
|
+
const paddedDecimal = (decimalPart + '0'.repeat(18)).substring(0, 18);
|
|
672
|
+
amountStr = integerPart + paddedDecimal;
|
|
673
|
+
} else {
|
|
674
|
+
amountStr = amountStr + '0'.repeat(18);
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
amountStr = amountStr.replace(/^0+/, '') || '0';
|
|
678
|
+
return '0x' + BigInt(amountStr).toString(16);
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
static normalizeEthereumAddress(address) {
|
|
682
|
+
if (address.includes('@')) {
|
|
683
|
+
const mockHash = Array.from(address).reduce((acc, char) => {
|
|
684
|
+
return acc + char.charCodeAt(0).toString(16);
|
|
685
|
+
}, '').substring(0, 40);
|
|
686
|
+
return '0x' + mockHash.padEnd(40, '0');
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
if (address.startsWith('0x')) {
|
|
690
|
+
return address.toLowerCase();
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
return '0x' + address;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
static solToLamports(solAmount) {
|
|
697
|
+
return Math.floor(solAmount * 1e9).toString();
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
static normalizeSolanaAddress(address) {
|
|
701
|
+
if (address.startsWith('0x')) {
|
|
702
|
+
return 'So1' + address.substring(2, 44).padEnd(42, '0');
|
|
703
|
+
}
|
|
704
|
+
if (address.includes('@')) {
|
|
705
|
+
const mockBase58 = Array.from(address).reduce((acc, char) => {
|
|
706
|
+
const code = char.charCodeAt(0);
|
|
707
|
+
return acc + (code % 58).toString();
|
|
708
|
+
}, '').substring(0, 42);
|
|
709
|
+
return 'So1' + mockBase58.padEnd(42, '0');
|
|
710
|
+
}
|
|
711
|
+
return address;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
static encodeSolanaTransfer(amount) {
|
|
715
|
+
const lamports = this.solToLamports(amount);
|
|
716
|
+
return Buffer.from(`transfer_${lamports}`).toString('hex');
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
static encodeSolanaEscrow(amount, conditions) {
|
|
720
|
+
const lamports = this.solToLamports(amount);
|
|
721
|
+
return Buffer.from(`escrow_${lamports}_${conditions.join('_')}`).toString('hex');
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
static encodeSolanaCondition(state) {
|
|
725
|
+
const conditionData = {
|
|
726
|
+
type: state.condition_type,
|
|
727
|
+
params: state.params,
|
|
728
|
+
operator: state.chain_operator
|
|
729
|
+
};
|
|
730
|
+
return Buffer.from(JSON.stringify(conditionData)).toString('hex');
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
static encodeSolanaConditional(state) {
|
|
734
|
+
const conditionalData = {
|
|
735
|
+
condition: state.condition,
|
|
736
|
+
then_action: state.then_action ? 'defined' : 'undefined',
|
|
737
|
+
else_action: state.else_action ? 'defined' : 'undefined'
|
|
738
|
+
};
|
|
739
|
+
return Buffer.from(JSON.stringify(conditionalData)).toString('hex');
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
// ... (keep all your existing encoding utilities)
|
|
743
|
+
|
|
744
|
+
// Validation and utilities
|
|
745
|
+
static validate(operation) {
|
|
746
|
+
const state = operation.getState ? operation.getState() : operation;
|
|
747
|
+
const errors = [];
|
|
748
|
+
|
|
749
|
+
if (!state.amount || state.amount <= 0) {
|
|
750
|
+
errors.push('Amount must be positive');
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
if (state.operation === 'PPI_SEND' && !state.to_user) {
|
|
754
|
+
errors.push('PPI_SEND requires a recipient (to_user field)');
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
if (state.operation === 'PPI_ESCROW' && !state.to_user) {
|
|
758
|
+
errors.push('PPI_ESCROW requires a recipient (to_user field)');
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
if (state.operation === 'PPI_SPLIT' && (!state.recipients || state.recipients.length === 0)) {
|
|
762
|
+
errors.push('PPI_SPLIT requires recipients array');
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
return {
|
|
766
|
+
isValid: errors.length === 0,
|
|
767
|
+
errors: errors
|
|
768
|
+
};
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
static compileSafe(operation, target = 'casha-dag') {
|
|
772
|
+
const validation = this.validate(operation);
|
|
773
|
+
|
|
774
|
+
if (!validation.isValid) {
|
|
775
|
+
throw new Error(`Compilation failed: ${validation.errors.join(', ')}`);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
return this.compile(operation, target);
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
static getSupportedTargets() {
|
|
782
|
+
return ['casha-dag', 'ethereum', 'solana'];
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
static validateTarget(target) {
|
|
786
|
+
const supported = this.getSupportedTargets();
|
|
787
|
+
if (!supported.includes(target)) {
|
|
788
|
+
throw new Error(`Unsupported target: ${target}. Supported: ${supported.join(', ')}`);
|
|
789
|
+
}
|
|
790
|
+
return true;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
static recommendChain(useCase) {
|
|
794
|
+
const recommendations = {
|
|
795
|
+
'fast-payments': 'casha-dag',
|
|
796
|
+
'high-security': 'ethereum',
|
|
797
|
+
'high-throughput': 'solana',
|
|
798
|
+
'low-fees': 'casha-dag',
|
|
799
|
+
'smart-contracts': 'ethereum',
|
|
800
|
+
'defi': 'ethereum',
|
|
801
|
+
'nft': 'solana',
|
|
802
|
+
'gaming': 'solana'
|
|
803
|
+
};
|
|
804
|
+
|
|
805
|
+
return recommendations[useCase] || 'casha-dag';
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
// Export functions
|
|
810
|
+
export function compile(operation, target = 'casha-dag') {
|
|
811
|
+
return PPICompiler.compile(operation, target);
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
export function compileSafe(operation, target = 'casha-dag') {
|
|
815
|
+
return PPICompiler.compileSafe(operation, target);
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
export function validate(operation) {
|
|
819
|
+
return PPICompiler.validate(operation);
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
export function getSupportedTargets() {
|
|
823
|
+
return PPICompiler.getSupportedTargets();
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
export function validateTarget(target) {
|
|
827
|
+
return PPICompiler.validateTarget(target);
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
export function recommendChain(useCase) {
|
|
831
|
+
return PPICompiler.recommendChain(useCase);
|
|
832
|
+
}
|