zkcloudworker 0.18.2 → 0.18.5
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +201 -0
- package/README.md +2 -4
- package/dist/ts/cloud/config.js.map +1 -0
- package/dist/ts/cloud/index.js.map +1 -0
- package/dist/ts/cloud/networks.js.map +1 -0
- package/dist/ts/cloud/utils/base64.js.map +1 -0
- package/dist/ts/cloud/utils/graphql.js.map +1 -0
- package/dist/ts/cloud/utils/index.js.map +1 -0
- package/dist/ts/cloud/utils/utils.js.map +1 -0
- package/dist/ts/cloud/worker/cloud.js.map +1 -0
- package/dist/ts/cloud/worker/index.js.map +1 -0
- package/{lib → dist}/ts/cloud/worker/job.js.map +1 -1
- package/{lib → dist}/ts/cloud/worker/task.js.map +1 -1
- package/dist/ts/cloud/worker/transaction.js.map +1 -0
- package/dist/ts/cloud/worker/worker.js.map +1 -0
- package/dist/ts/index.js.map +1 -0
- package/dist/ts/mina/api/api.js.map +1 -0
- package/dist/ts/mina/index.js.map +1 -0
- package/dist/ts/mina/local/local.js.map +1 -0
- package/dist/ts/mina/storage/index.js.map +1 -0
- package/dist/ts/mina/storage/ipfs.js.map +1 -0
- package/dist/ts/mina/storage/pinata.js.map +1 -0
- package/dist/ts/mina/storage/storage.js.map +1 -0
- package/dist/ts/mina/token/FungibleToken.js.map +1 -0
- package/dist/ts/mina/token/FungibleTokenAdmin.js.map +1 -0
- package/dist/ts/mina/token/api.js.map +1 -0
- package/dist/ts/mina/token/index.js.map +1 -0
- package/dist/ts/mina/token/vk.js.map +1 -0
- package/{lib → dist}/ts/mina/token/whitelist.d.ts +1 -1
- package/{lib/web → dist/ts}/mina/token/whitelist.js +5 -1
- package/dist/ts/mina/token/whitelist.js.map +1 -0
- package/dist/ts/mina/transactions/account.js.map +1 -0
- package/dist/ts/mina/transactions/blockberry.js.map +1 -0
- package/dist/ts/mina/transactions/chain.js.map +1 -0
- package/dist/ts/mina/transactions/index.js.map +1 -0
- package/dist/ts/mina/transactions/nonce.js.map +1 -0
- package/dist/ts/mina/transactions/send.js.map +1 -0
- package/dist/ts/mina/transactions/tiny-contract.js.map +1 -0
- package/dist/ts/mina/transactions/transaction.js.map +1 -0
- package/dist/ts/mina/transactions/txstatus.js.map +1 -0
- package/dist/ts/mina/utils/base64.js.map +1 -0
- package/dist/ts/mina/utils/fee.js.map +1 -0
- package/dist/ts/mina/utils/fetch.js.map +1 -0
- package/dist/ts/mina/utils/fields.js.map +1 -0
- package/dist/ts/mina/utils/index.js.map +1 -0
- package/dist/ts/mina/utils/indexed-map.js.map +1 -0
- package/dist/ts/mina/utils/mina.js.map +1 -0
- package/dist/ts/mina/verification/index.js.map +1 -0
- package/dist/ts/mina/verification/verification.js.map +1 -0
- package/dist/tsconfig.web.tsbuildinfo +1 -0
- package/dist/web/cloud/config.js.map +1 -0
- package/dist/web/cloud/index.js.map +1 -0
- package/dist/web/cloud/networks.js.map +1 -0
- package/dist/web/cloud/utils/base64.js.map +1 -0
- package/dist/web/cloud/utils/graphql.js.map +1 -0
- package/dist/web/cloud/utils/index.js.map +1 -0
- package/dist/web/cloud/utils/utils.js.map +1 -0
- package/dist/web/cloud/worker/cloud.js.map +1 -0
- package/dist/web/cloud/worker/index.js.map +1 -0
- package/{lib → dist}/web/cloud/worker/job.js.map +1 -1
- package/{lib → dist}/web/cloud/worker/task.js.map +1 -1
- package/dist/web/cloud/worker/transaction.js.map +1 -0
- package/dist/web/cloud/worker/worker.js.map +1 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/mina/api/api.js.map +1 -0
- package/dist/web/mina/index.js.map +1 -0
- package/dist/web/mina/local/local.js.map +1 -0
- package/dist/web/mina/storage/index.js.map +1 -0
- package/dist/web/mina/storage/ipfs.js.map +1 -0
- package/dist/web/mina/storage/pinata.js.map +1 -0
- package/dist/web/mina/storage/storage.js.map +1 -0
- package/dist/web/mina/token/FungibleToken.js.map +1 -0
- package/dist/web/mina/token/FungibleTokenAdmin.js.map +1 -0
- package/dist/web/mina/token/api.js.map +1 -0
- package/dist/web/mina/token/index.js.map +1 -0
- package/dist/web/mina/token/vk.js.map +1 -0
- package/{lib → dist}/web/mina/token/whitelist.d.ts +1 -1
- package/{lib/ts → dist/web}/mina/token/whitelist.js +5 -1
- package/dist/web/mina/token/whitelist.js.map +1 -0
- package/dist/web/mina/transactions/account.js.map +1 -0
- package/dist/web/mina/transactions/blockberry.js.map +1 -0
- package/dist/web/mina/transactions/chain.js.map +1 -0
- package/dist/web/mina/transactions/index.js.map +1 -0
- package/dist/web/mina/transactions/nonce.js.map +1 -0
- package/dist/web/mina/transactions/send.js.map +1 -0
- package/dist/web/mina/transactions/tiny-contract.js.map +1 -0
- package/dist/web/mina/transactions/transaction.js.map +1 -0
- package/dist/web/mina/transactions/txstatus.js.map +1 -0
- package/dist/web/mina/utils/base64.js.map +1 -0
- package/dist/web/mina/utils/fee.js.map +1 -0
- package/dist/web/mina/utils/fetch.js.map +1 -0
- package/dist/web/mina/utils/fields.js.map +1 -0
- package/dist/web/mina/utils/index.js.map +1 -0
- package/dist/web/mina/utils/indexed-map.js.map +1 -0
- package/dist/web/mina/utils/mina.js.map +1 -0
- package/dist/web/mina/verification/index.js.map +1 -0
- package/dist/web/mina/verification/verification.js.map +1 -0
- package/package.json +32 -20
- package/src/cloud/config.ts +10 -0
- package/src/cloud/index.ts +4 -0
- package/src/cloud/networks.ts +130 -0
- package/src/cloud/utils/base64.ts +87 -0
- package/src/cloud/utils/graphql.ts +252 -0
- package/src/cloud/utils/index.ts +3 -0
- package/src/cloud/utils/utils.ts +79 -0
- package/src/cloud/worker/cloud.ts +326 -0
- package/src/cloud/worker/index.ts +5 -0
- package/src/cloud/worker/job.ts +123 -0
- package/src/cloud/worker/task.ts +45 -0
- package/src/cloud/worker/transaction.ts +12 -0
- package/src/cloud/worker/worker.ts +62 -0
- package/src/index.ts +2 -0
- package/src/mina/api/api.ts +597 -0
- package/src/mina/index.ts +8 -0
- package/src/mina/local/local.ts +651 -0
- package/src/mina/storage/index.ts +3 -0
- package/src/mina/storage/ipfs.ts +20 -0
- package/src/mina/storage/pinata.ts +52 -0
- package/src/mina/storage/storage.ts +55 -0
- package/src/mina/token/FungibleToken.ts +316 -0
- package/src/mina/token/FungibleTokenAdmin.ts +95 -0
- package/src/mina/token/api.ts +182 -0
- package/src/mina/token/index.ts +5 -0
- package/src/mina/token/vk.ts +42 -0
- package/src/mina/token/whitelist.ts +178 -0
- package/src/mina/transactions/account.ts +57 -0
- package/src/mina/transactions/blockberry.ts +166 -0
- package/src/mina/transactions/chain.ts +1 -0
- package/src/mina/transactions/index.ts +8 -0
- package/src/mina/transactions/nonce.ts +120 -0
- package/src/mina/transactions/send.ts +186 -0
- package/src/mina/transactions/tiny-contract.ts +9 -0
- package/src/mina/transactions/transaction.ts +255 -0
- package/src/mina/transactions/txstatus.ts +26 -0
- package/src/mina/utils/base64.ts +34 -0
- package/src/mina/utils/fee.ts +11 -0
- package/src/mina/utils/fetch.ts +126 -0
- package/src/mina/utils/fields.ts +39 -0
- package/src/mina/utils/index.ts +6 -0
- package/src/mina/utils/indexed-map.ts +169 -0
- package/src/mina/utils/mina.ts +175 -0
- package/src/mina/verification/index.ts +1 -0
- package/src/mina/verification/verification.ts +23 -0
- package/lib/ts/cloud/config.js.map +0 -1
- package/lib/ts/cloud/index.js.map +0 -1
- package/lib/ts/cloud/networks.js.map +0 -1
- package/lib/ts/cloud/utils/base64.js.map +0 -1
- package/lib/ts/cloud/utils/graphql.js.map +0 -1
- package/lib/ts/cloud/utils/index.js.map +0 -1
- package/lib/ts/cloud/utils/utils.js.map +0 -1
- package/lib/ts/cloud/worker/cloud.js.map +0 -1
- package/lib/ts/cloud/worker/index.js.map +0 -1
- package/lib/ts/cloud/worker/transaction.js.map +0 -1
- package/lib/ts/cloud/worker/worker.js.map +0 -1
- package/lib/ts/index.js.map +0 -1
- package/lib/ts/mina/api/api.js.map +0 -1
- package/lib/ts/mina/index.js.map +0 -1
- package/lib/ts/mina/local/local.js.map +0 -1
- package/lib/ts/mina/storage/index.js.map +0 -1
- package/lib/ts/mina/storage/ipfs.js.map +0 -1
- package/lib/ts/mina/storage/pinata.js.map +0 -1
- package/lib/ts/mina/storage/storage.js.map +0 -1
- package/lib/ts/mina/token/FungibleToken.js.map +0 -1
- package/lib/ts/mina/token/FungibleTokenAdmin.js.map +0 -1
- package/lib/ts/mina/token/api.js.map +0 -1
- package/lib/ts/mina/token/index.js.map +0 -1
- package/lib/ts/mina/token/vk.js.map +0 -1
- package/lib/ts/mina/token/whitelist.js.map +0 -1
- package/lib/ts/mina/transactions/account.js.map +0 -1
- package/lib/ts/mina/transactions/blockberry.js.map +0 -1
- package/lib/ts/mina/transactions/chain.js.map +0 -1
- package/lib/ts/mina/transactions/index.js.map +0 -1
- package/lib/ts/mina/transactions/nonce.js.map +0 -1
- package/lib/ts/mina/transactions/send.js.map +0 -1
- package/lib/ts/mina/transactions/tiny-contract.js.map +0 -1
- package/lib/ts/mina/transactions/transaction.js.map +0 -1
- package/lib/ts/mina/transactions/txstatus.js.map +0 -1
- package/lib/ts/mina/utils/base64.js.map +0 -1
- package/lib/ts/mina/utils/fee.js.map +0 -1
- package/lib/ts/mina/utils/fetch.js.map +0 -1
- package/lib/ts/mina/utils/fields.js.map +0 -1
- package/lib/ts/mina/utils/index.js.map +0 -1
- package/lib/ts/mina/utils/indexed-map.js.map +0 -1
- package/lib/ts/mina/utils/mina.js.map +0 -1
- package/lib/ts/mina/verification/index.js.map +0 -1
- package/lib/ts/mina/verification/verification.js.map +0 -1
- package/lib/tsconfig.web.tsbuildinfo +0 -1
- package/lib/web/cloud/config.js.map +0 -1
- package/lib/web/cloud/index.js.map +0 -1
- package/lib/web/cloud/networks.js.map +0 -1
- package/lib/web/cloud/utils/base64.js.map +0 -1
- package/lib/web/cloud/utils/graphql.js.map +0 -1
- package/lib/web/cloud/utils/index.js.map +0 -1
- package/lib/web/cloud/utils/utils.js.map +0 -1
- package/lib/web/cloud/worker/cloud.js.map +0 -1
- package/lib/web/cloud/worker/index.js.map +0 -1
- package/lib/web/cloud/worker/transaction.js.map +0 -1
- package/lib/web/cloud/worker/worker.js.map +0 -1
- package/lib/web/index.js.map +0 -1
- package/lib/web/mina/api/api.js.map +0 -1
- package/lib/web/mina/index.js.map +0 -1
- package/lib/web/mina/local/local.js.map +0 -1
- package/lib/web/mina/storage/index.js.map +0 -1
- package/lib/web/mina/storage/ipfs.js.map +0 -1
- package/lib/web/mina/storage/pinata.js.map +0 -1
- package/lib/web/mina/storage/storage.js.map +0 -1
- package/lib/web/mina/token/FungibleToken.js.map +0 -1
- package/lib/web/mina/token/FungibleTokenAdmin.js.map +0 -1
- package/lib/web/mina/token/api.js.map +0 -1
- package/lib/web/mina/token/index.js.map +0 -1
- package/lib/web/mina/token/vk.js.map +0 -1
- package/lib/web/mina/token/whitelist.js.map +0 -1
- package/lib/web/mina/transactions/account.js.map +0 -1
- package/lib/web/mina/transactions/blockberry.js.map +0 -1
- package/lib/web/mina/transactions/chain.js.map +0 -1
- package/lib/web/mina/transactions/index.js.map +0 -1
- package/lib/web/mina/transactions/nonce.js.map +0 -1
- package/lib/web/mina/transactions/send.js.map +0 -1
- package/lib/web/mina/transactions/tiny-contract.js.map +0 -1
- package/lib/web/mina/transactions/transaction.js.map +0 -1
- package/lib/web/mina/transactions/txstatus.js.map +0 -1
- package/lib/web/mina/utils/base64.js.map +0 -1
- package/lib/web/mina/utils/fee.js.map +0 -1
- package/lib/web/mina/utils/fetch.js.map +0 -1
- package/lib/web/mina/utils/fields.js.map +0 -1
- package/lib/web/mina/utils/index.js.map +0 -1
- package/lib/web/mina/utils/indexed-map.js.map +0 -1
- package/lib/web/mina/utils/mina.js.map +0 -1
- package/lib/web/mina/verification/index.js.map +0 -1
- package/lib/web/mina/verification/verification.js.map +0 -1
- /package/{lib → dist}/ts/cloud/config.d.ts +0 -0
- /package/{lib → dist}/ts/cloud/config.js +0 -0
- /package/{lib → dist}/ts/cloud/index.d.ts +0 -0
- /package/{lib → dist}/ts/cloud/index.js +0 -0
- /package/{lib → dist}/ts/cloud/networks.d.ts +0 -0
- /package/{lib → dist}/ts/cloud/networks.js +0 -0
- /package/{lib → dist}/ts/cloud/utils/base64.d.ts +0 -0
- /package/{lib → dist}/ts/cloud/utils/base64.js +0 -0
- /package/{lib → dist}/ts/cloud/utils/graphql.d.ts +0 -0
- /package/{lib → dist}/ts/cloud/utils/graphql.js +0 -0
- /package/{lib → dist}/ts/cloud/utils/index.d.ts +0 -0
- /package/{lib → dist}/ts/cloud/utils/index.js +0 -0
- /package/{lib → dist}/ts/cloud/utils/utils.d.ts +0 -0
- /package/{lib → dist}/ts/cloud/utils/utils.js +0 -0
- /package/{lib → dist}/ts/cloud/worker/cloud.d.ts +0 -0
- /package/{lib → dist}/ts/cloud/worker/cloud.js +0 -0
- /package/{lib → dist}/ts/cloud/worker/index.d.ts +0 -0
- /package/{lib → dist}/ts/cloud/worker/index.js +0 -0
- /package/{lib → dist}/ts/cloud/worker/job.d.ts +0 -0
- /package/{lib → dist}/ts/cloud/worker/job.js +0 -0
- /package/{lib → dist}/ts/cloud/worker/task.d.ts +0 -0
- /package/{lib → dist}/ts/cloud/worker/task.js +0 -0
- /package/{lib → dist}/ts/cloud/worker/transaction.d.ts +0 -0
- /package/{lib → dist}/ts/cloud/worker/transaction.js +0 -0
- /package/{lib → dist}/ts/cloud/worker/worker.d.ts +0 -0
- /package/{lib → dist}/ts/cloud/worker/worker.js +0 -0
- /package/{lib → dist}/ts/index.d.ts +0 -0
- /package/{lib → dist}/ts/index.js +0 -0
- /package/{lib → dist}/ts/mina/api/api.d.ts +0 -0
- /package/{lib → dist}/ts/mina/api/api.js +0 -0
- /package/{lib → dist}/ts/mina/index.d.ts +0 -0
- /package/{lib → dist}/ts/mina/index.js +0 -0
- /package/{lib → dist}/ts/mina/local/local.d.ts +0 -0
- /package/{lib → dist}/ts/mina/local/local.js +0 -0
- /package/{lib → dist}/ts/mina/storage/index.d.ts +0 -0
- /package/{lib → dist}/ts/mina/storage/index.js +0 -0
- /package/{lib → dist}/ts/mina/storage/ipfs.d.ts +0 -0
- /package/{lib → dist}/ts/mina/storage/ipfs.js +0 -0
- /package/{lib → dist}/ts/mina/storage/pinata.d.ts +0 -0
- /package/{lib → dist}/ts/mina/storage/pinata.js +0 -0
- /package/{lib → dist}/ts/mina/storage/storage.d.ts +0 -0
- /package/{lib → dist}/ts/mina/storage/storage.js +0 -0
- /package/{lib → dist}/ts/mina/token/FungibleToken.d.ts +0 -0
- /package/{lib → dist}/ts/mina/token/FungibleToken.js +0 -0
- /package/{lib → dist}/ts/mina/token/FungibleTokenAdmin.d.ts +0 -0
- /package/{lib → dist}/ts/mina/token/FungibleTokenAdmin.js +0 -0
- /package/{lib → dist}/ts/mina/token/api.d.ts +0 -0
- /package/{lib → dist}/ts/mina/token/api.js +0 -0
- /package/{lib → dist}/ts/mina/token/index.d.ts +0 -0
- /package/{lib → dist}/ts/mina/token/index.js +0 -0
- /package/{lib → dist}/ts/mina/token/vk.d.ts +0 -0
- /package/{lib → dist}/ts/mina/token/vk.js +0 -0
- /package/{lib → dist}/ts/mina/transactions/account.d.ts +0 -0
- /package/{lib → dist}/ts/mina/transactions/account.js +0 -0
- /package/{lib → dist}/ts/mina/transactions/blockberry.d.ts +0 -0
- /package/{lib → dist}/ts/mina/transactions/blockberry.js +0 -0
- /package/{lib → dist}/ts/mina/transactions/chain.d.ts +0 -0
- /package/{lib → dist}/ts/mina/transactions/chain.js +0 -0
- /package/{lib → dist}/ts/mina/transactions/index.d.ts +0 -0
- /package/{lib → dist}/ts/mina/transactions/index.js +0 -0
- /package/{lib → dist}/ts/mina/transactions/nonce.d.ts +0 -0
- /package/{lib → dist}/ts/mina/transactions/nonce.js +0 -0
- /package/{lib → dist}/ts/mina/transactions/send.d.ts +0 -0
- /package/{lib → dist}/ts/mina/transactions/send.js +0 -0
- /package/{lib → dist}/ts/mina/transactions/tiny-contract.d.ts +0 -0
- /package/{lib → dist}/ts/mina/transactions/tiny-contract.js +0 -0
- /package/{lib → dist}/ts/mina/transactions/transaction.d.ts +0 -0
- /package/{lib → dist}/ts/mina/transactions/transaction.js +0 -0
- /package/{lib → dist}/ts/mina/transactions/txstatus.d.ts +0 -0
- /package/{lib → dist}/ts/mina/transactions/txstatus.js +0 -0
- /package/{lib → dist}/ts/mina/utils/base64.d.ts +0 -0
- /package/{lib → dist}/ts/mina/utils/base64.js +0 -0
- /package/{lib → dist}/ts/mina/utils/fee.d.ts +0 -0
- /package/{lib → dist}/ts/mina/utils/fee.js +0 -0
- /package/{lib → dist}/ts/mina/utils/fetch.d.ts +0 -0
- /package/{lib → dist}/ts/mina/utils/fetch.js +0 -0
- /package/{lib → dist}/ts/mina/utils/fields.d.ts +0 -0
- /package/{lib → dist}/ts/mina/utils/fields.js +0 -0
- /package/{lib → dist}/ts/mina/utils/index.d.ts +0 -0
- /package/{lib → dist}/ts/mina/utils/index.js +0 -0
- /package/{lib → dist}/ts/mina/utils/indexed-map.d.ts +0 -0
- /package/{lib → dist}/ts/mina/utils/indexed-map.js +0 -0
- /package/{lib → dist}/ts/mina/utils/mina.d.ts +0 -0
- /package/{lib → dist}/ts/mina/utils/mina.js +0 -0
- /package/{lib → dist}/ts/mina/verification/index.d.ts +0 -0
- /package/{lib → dist}/ts/mina/verification/index.js +0 -0
- /package/{lib → dist}/ts/mina/verification/verification.d.ts +0 -0
- /package/{lib → dist}/ts/mina/verification/verification.js +0 -0
- /package/{lib → dist}/web/cloud/config.d.ts +0 -0
- /package/{lib → dist}/web/cloud/config.js +0 -0
- /package/{lib → dist}/web/cloud/index.d.ts +0 -0
- /package/{lib → dist}/web/cloud/index.js +0 -0
- /package/{lib → dist}/web/cloud/networks.d.ts +0 -0
- /package/{lib → dist}/web/cloud/networks.js +0 -0
- /package/{lib → dist}/web/cloud/utils/base64.d.ts +0 -0
- /package/{lib → dist}/web/cloud/utils/base64.js +0 -0
- /package/{lib → dist}/web/cloud/utils/graphql.d.ts +0 -0
- /package/{lib → dist}/web/cloud/utils/graphql.js +0 -0
- /package/{lib → dist}/web/cloud/utils/index.d.ts +0 -0
- /package/{lib → dist}/web/cloud/utils/index.js +0 -0
- /package/{lib → dist}/web/cloud/utils/utils.d.ts +0 -0
- /package/{lib → dist}/web/cloud/utils/utils.js +0 -0
- /package/{lib → dist}/web/cloud/worker/cloud.d.ts +0 -0
- /package/{lib → dist}/web/cloud/worker/cloud.js +0 -0
- /package/{lib → dist}/web/cloud/worker/index.d.ts +0 -0
- /package/{lib → dist}/web/cloud/worker/index.js +0 -0
- /package/{lib → dist}/web/cloud/worker/job.d.ts +0 -0
- /package/{lib → dist}/web/cloud/worker/job.js +0 -0
- /package/{lib → dist}/web/cloud/worker/task.d.ts +0 -0
- /package/{lib → dist}/web/cloud/worker/task.js +0 -0
- /package/{lib → dist}/web/cloud/worker/transaction.d.ts +0 -0
- /package/{lib → dist}/web/cloud/worker/transaction.js +0 -0
- /package/{lib → dist}/web/cloud/worker/worker.d.ts +0 -0
- /package/{lib → dist}/web/cloud/worker/worker.js +0 -0
- /package/{lib → dist}/web/index.d.ts +0 -0
- /package/{lib → dist}/web/index.js +0 -0
- /package/{lib → dist}/web/mina/api/api.d.ts +0 -0
- /package/{lib → dist}/web/mina/api/api.js +0 -0
- /package/{lib → dist}/web/mina/index.d.ts +0 -0
- /package/{lib → dist}/web/mina/index.js +0 -0
- /package/{lib → dist}/web/mina/local/local.d.ts +0 -0
- /package/{lib → dist}/web/mina/local/local.js +0 -0
- /package/{lib → dist}/web/mina/storage/index.d.ts +0 -0
- /package/{lib → dist}/web/mina/storage/index.js +0 -0
- /package/{lib → dist}/web/mina/storage/ipfs.d.ts +0 -0
- /package/{lib → dist}/web/mina/storage/ipfs.js +0 -0
- /package/{lib → dist}/web/mina/storage/pinata.d.ts +0 -0
- /package/{lib → dist}/web/mina/storage/pinata.js +0 -0
- /package/{lib → dist}/web/mina/storage/storage.d.ts +0 -0
- /package/{lib → dist}/web/mina/storage/storage.js +0 -0
- /package/{lib → dist}/web/mina/token/FungibleToken.d.ts +0 -0
- /package/{lib → dist}/web/mina/token/FungibleToken.js +0 -0
- /package/{lib → dist}/web/mina/token/FungibleTokenAdmin.d.ts +0 -0
- /package/{lib → dist}/web/mina/token/FungibleTokenAdmin.js +0 -0
- /package/{lib → dist}/web/mina/token/api.d.ts +0 -0
- /package/{lib → dist}/web/mina/token/api.js +0 -0
- /package/{lib → dist}/web/mina/token/index.d.ts +0 -0
- /package/{lib → dist}/web/mina/token/index.js +0 -0
- /package/{lib → dist}/web/mina/token/vk.d.ts +0 -0
- /package/{lib → dist}/web/mina/token/vk.js +0 -0
- /package/{lib → dist}/web/mina/transactions/account.d.ts +0 -0
- /package/{lib → dist}/web/mina/transactions/account.js +0 -0
- /package/{lib → dist}/web/mina/transactions/blockberry.d.ts +0 -0
- /package/{lib → dist}/web/mina/transactions/blockberry.js +0 -0
- /package/{lib → dist}/web/mina/transactions/chain.d.ts +0 -0
- /package/{lib → dist}/web/mina/transactions/chain.js +0 -0
- /package/{lib → dist}/web/mina/transactions/index.d.ts +0 -0
- /package/{lib → dist}/web/mina/transactions/index.js +0 -0
- /package/{lib → dist}/web/mina/transactions/nonce.d.ts +0 -0
- /package/{lib → dist}/web/mina/transactions/nonce.js +0 -0
- /package/{lib → dist}/web/mina/transactions/send.d.ts +0 -0
- /package/{lib → dist}/web/mina/transactions/send.js +0 -0
- /package/{lib → dist}/web/mina/transactions/tiny-contract.d.ts +0 -0
- /package/{lib → dist}/web/mina/transactions/tiny-contract.js +0 -0
- /package/{lib → dist}/web/mina/transactions/transaction.d.ts +0 -0
- /package/{lib → dist}/web/mina/transactions/transaction.js +0 -0
- /package/{lib → dist}/web/mina/transactions/txstatus.d.ts +0 -0
- /package/{lib → dist}/web/mina/transactions/txstatus.js +0 -0
- /package/{lib → dist}/web/mina/utils/base64.d.ts +0 -0
- /package/{lib → dist}/web/mina/utils/base64.js +0 -0
- /package/{lib → dist}/web/mina/utils/fee.d.ts +0 -0
- /package/{lib → dist}/web/mina/utils/fee.js +0 -0
- /package/{lib → dist}/web/mina/utils/fetch.d.ts +0 -0
- /package/{lib → dist}/web/mina/utils/fetch.js +0 -0
- /package/{lib → dist}/web/mina/utils/fields.d.ts +0 -0
- /package/{lib → dist}/web/mina/utils/fields.js +0 -0
- /package/{lib → dist}/web/mina/utils/index.d.ts +0 -0
- /package/{lib → dist}/web/mina/utils/index.js +0 -0
- /package/{lib → dist}/web/mina/utils/indexed-map.d.ts +0 -0
- /package/{lib → dist}/web/mina/utils/indexed-map.js +0 -0
- /package/{lib → dist}/web/mina/utils/mina.d.ts +0 -0
- /package/{lib → dist}/web/mina/utils/mina.js +0 -0
- /package/{lib → dist}/web/mina/verification/index.d.ts +0 -0
- /package/{lib → dist}/web/mina/verification/index.js +0 -0
- /package/{lib → dist}/web/mina/verification/verification.d.ts +0 -0
- /package/{lib → dist}/web/mina/verification/verification.js +0 -0
@@ -0,0 +1,326 @@
|
|
1
|
+
import { blockchain } from "../networks.js";
|
2
|
+
import { JobData } from "./job.js";
|
3
|
+
import { TransactionMetadata } from "./transaction.js";
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Interface for the deployer key pair
|
7
|
+
* Used to get the public and private keys of the deployer for test networks only.
|
8
|
+
* Devnet and Zeko are supported.
|
9
|
+
*/
|
10
|
+
export interface DeployerKeyPair {
|
11
|
+
/** The public key of the deployer */
|
12
|
+
publicKey: string;
|
13
|
+
|
14
|
+
/** The private key of the deployer */
|
15
|
+
privateKey: string;
|
16
|
+
}
|
17
|
+
|
18
|
+
/**
|
19
|
+
* Interface for the cloud transaction
|
20
|
+
* Used to get the transaction id, the transaction, and the time received
|
21
|
+
*/
|
22
|
+
export interface CloudTransaction {
|
23
|
+
/** The transaction id */
|
24
|
+
txId: string;
|
25
|
+
|
26
|
+
/** The transaction */
|
27
|
+
transaction: string;
|
28
|
+
|
29
|
+
/** The time received */
|
30
|
+
timeReceived: number;
|
31
|
+
|
32
|
+
/** The status of the transaction */
|
33
|
+
status: string;
|
34
|
+
}
|
35
|
+
|
36
|
+
/*
|
37
|
+
* Abstract class for the cloud service
|
38
|
+
* Used to define the cloud methods and properties
|
39
|
+
* Should be implemented by for local testing and for the zkCloudWorker in the cloud
|
40
|
+
* @param id the id of the user
|
41
|
+
* @param jobId the job id
|
42
|
+
* @param stepId the step id
|
43
|
+
* @param taskId the task id
|
44
|
+
* @param cache the cache folder. Use it to get the Cache object: cache = Cache.FileSystem(this.cloud.cache);
|
45
|
+
* @param developer the developer id
|
46
|
+
* @param repo the repo id
|
47
|
+
* @param task the task id
|
48
|
+
* @param userId the user id
|
49
|
+
* @param args the arguments, should be a string or serialized JSON
|
50
|
+
* @param metadata the metadata, should be a string or serialized JSON
|
51
|
+
* @param chain the blockchain network
|
52
|
+
* @param isLocalCloud a boolean to check if the cloud is local or not
|
53
|
+
*/
|
54
|
+
export abstract class Cloud {
|
55
|
+
readonly id: string;
|
56
|
+
readonly jobId: string;
|
57
|
+
readonly stepId: string;
|
58
|
+
readonly taskId: string;
|
59
|
+
readonly cache: string;
|
60
|
+
readonly developer: string;
|
61
|
+
readonly repo: string;
|
62
|
+
readonly task?: string;
|
63
|
+
readonly userId?: string;
|
64
|
+
readonly args?: string;
|
65
|
+
readonly metadata?: string;
|
66
|
+
readonly chain: blockchain;
|
67
|
+
readonly isLocalCloud: boolean;
|
68
|
+
|
69
|
+
/**
|
70
|
+
* Constructor for the Cloud class
|
71
|
+
* @param params the parameters for the Cloud class
|
72
|
+
* @param params.id the id of the user
|
73
|
+
* @param params.jobId the job id
|
74
|
+
* @param params.stepId the step id
|
75
|
+
* @param params.taskId the task id
|
76
|
+
* @param params.cache the cache folder. Use it to get the Cache object: cache = Cache.FileSystem(this.cloud.cache);
|
77
|
+
* @param params.developer the developer id
|
78
|
+
* @param params.repo the repo id
|
79
|
+
* @param params.task the task id
|
80
|
+
* @param params.userId the user id
|
81
|
+
* @param params.args the arguments, should be a string or serialized JSON
|
82
|
+
* @param params.metadata the metadata, should be a string or serialized JSON
|
83
|
+
* @param params.chain the blockchain network
|
84
|
+
* @param params.isLocalCloud a boolean to check if the cloud is local or not
|
85
|
+
*/
|
86
|
+
constructor(params: {
|
87
|
+
id: string;
|
88
|
+
jobId: string;
|
89
|
+
stepId: string;
|
90
|
+
taskId: string;
|
91
|
+
cache: string;
|
92
|
+
developer: string;
|
93
|
+
repo: string;
|
94
|
+
task?: string;
|
95
|
+
userId?: string;
|
96
|
+
args?: string;
|
97
|
+
metadata?: string;
|
98
|
+
isLocalCloud?: boolean;
|
99
|
+
chain: blockchain;
|
100
|
+
}) {
|
101
|
+
const {
|
102
|
+
id,
|
103
|
+
jobId,
|
104
|
+
stepId,
|
105
|
+
taskId,
|
106
|
+
cache,
|
107
|
+
developer,
|
108
|
+
repo,
|
109
|
+
task,
|
110
|
+
userId,
|
111
|
+
args,
|
112
|
+
metadata,
|
113
|
+
isLocalCloud,
|
114
|
+
chain,
|
115
|
+
} = params;
|
116
|
+
this.id = id;
|
117
|
+
this.jobId = jobId;
|
118
|
+
this.stepId = stepId;
|
119
|
+
this.taskId = taskId;
|
120
|
+
this.cache = cache;
|
121
|
+
this.developer = developer;
|
122
|
+
this.repo = repo;
|
123
|
+
this.task = task;
|
124
|
+
this.userId = userId;
|
125
|
+
this.args = args;
|
126
|
+
this.metadata = metadata;
|
127
|
+
this.isLocalCloud = isLocalCloud ?? false;
|
128
|
+
this.chain = chain;
|
129
|
+
}
|
130
|
+
|
131
|
+
/**
|
132
|
+
* Abstract method to get the deployer key pair
|
133
|
+
* Used to get the public and private keys of the deployer for test networks only
|
134
|
+
* Devnet and Zeko are supported
|
135
|
+
* @returns the deployer key pair
|
136
|
+
*/
|
137
|
+
abstract getDeployer(): Promise<DeployerKeyPair | undefined>;
|
138
|
+
|
139
|
+
/**
|
140
|
+
* Abstract method to release the deployer
|
141
|
+
* @param params the public key of the deployer and the transactions hashes
|
142
|
+
* Used to release the deployer after the transactions are sent to the blockchain
|
143
|
+
* @param params.publicKey the public key of the deployer
|
144
|
+
* @param params.txsHashes the transactions hashes
|
145
|
+
*/
|
146
|
+
abstract releaseDeployer(params: {
|
147
|
+
publicKey: string;
|
148
|
+
txsHashes: string[];
|
149
|
+
}): Promise<void>;
|
150
|
+
|
151
|
+
/**
|
152
|
+
* Abstract method to get the data by key
|
153
|
+
* Used to get the data by key from the cloud storage
|
154
|
+
* @param key the key
|
155
|
+
* @returns the value of the key
|
156
|
+
*/
|
157
|
+
abstract getDataByKey(key: string): Promise<string | undefined>;
|
158
|
+
|
159
|
+
/**
|
160
|
+
* Abstract method to save the data by key
|
161
|
+
* Used to save the data by key to the cloud storage
|
162
|
+
* @param key the key
|
163
|
+
* @param value the value
|
164
|
+
*/
|
165
|
+
abstract saveDataByKey(key: string, value: string | undefined): Promise<void>;
|
166
|
+
|
167
|
+
/**
|
168
|
+
* Abstract method to save the file
|
169
|
+
* Used to save the file to the cloud storage
|
170
|
+
* @param filename the filename
|
171
|
+
* @param value the value
|
172
|
+
*/
|
173
|
+
abstract saveFile(filename: string, value: Buffer): Promise<void>;
|
174
|
+
|
175
|
+
/**
|
176
|
+
* Abstract method to load the file
|
177
|
+
* Used to load the file from the cloud storage
|
178
|
+
* @param filename the filename
|
179
|
+
* @returns the value of the file
|
180
|
+
*/
|
181
|
+
abstract loadFile(filename: string): Promise<Buffer | undefined>;
|
182
|
+
|
183
|
+
/**
|
184
|
+
* Abstract method to encrypt the data
|
185
|
+
* @param params
|
186
|
+
* @param params.data the data
|
187
|
+
* @param params.context the context
|
188
|
+
* @param params.keyId the key id, optional
|
189
|
+
*/
|
190
|
+
abstract encrypt(params: {
|
191
|
+
data: string;
|
192
|
+
context: string;
|
193
|
+
keyId?: string;
|
194
|
+
}): Promise<string | undefined>;
|
195
|
+
|
196
|
+
/**
|
197
|
+
* Abstract method to decrypt the data
|
198
|
+
* @param params
|
199
|
+
* @param params.data the data
|
200
|
+
* @param params.context the context
|
201
|
+
* @param params.keyId the key id, optional
|
202
|
+
*/
|
203
|
+
abstract decrypt(params: {
|
204
|
+
data: string;
|
205
|
+
context: string;
|
206
|
+
keyId?: string;
|
207
|
+
}): Promise<string | undefined>;
|
208
|
+
|
209
|
+
/**
|
210
|
+
* Abstract method to calculate the recursive proof
|
211
|
+
* Used to calculate the recursive proof
|
212
|
+
* @param data the data
|
213
|
+
* @param data.transactions the transactions
|
214
|
+
* @param data.task the task
|
215
|
+
* @param data.userId the user id
|
216
|
+
* @param data.args the arguments
|
217
|
+
* @param data.metadata the metadata
|
218
|
+
* @returns the proof
|
219
|
+
*/
|
220
|
+
abstract recursiveProof(data: {
|
221
|
+
transactions: string[];
|
222
|
+
task?: string;
|
223
|
+
userId?: string;
|
224
|
+
args?: string;
|
225
|
+
metadata?: string;
|
226
|
+
}): Promise<string>;
|
227
|
+
|
228
|
+
/**
|
229
|
+
* Abstract method to execute the transactions
|
230
|
+
* Used to execute the transactions
|
231
|
+
* @param data the data
|
232
|
+
* @param data.transactions the transactions
|
233
|
+
* @param data.task the task
|
234
|
+
* @param data.userId the user id
|
235
|
+
* @param data.args the arguments
|
236
|
+
* @param data.metadata the metadata
|
237
|
+
* @returns the result
|
238
|
+
*/
|
239
|
+
abstract execute(data: {
|
240
|
+
transactions: string[];
|
241
|
+
task: string;
|
242
|
+
userId?: string;
|
243
|
+
args?: string;
|
244
|
+
metadata?: string;
|
245
|
+
}): Promise<string>;
|
246
|
+
|
247
|
+
/**
|
248
|
+
* Abstract method to add the task
|
249
|
+
* Used to add the task
|
250
|
+
* @param data the data
|
251
|
+
* @param data.task the task
|
252
|
+
* @param data.startTime the start time
|
253
|
+
* @param data.userId the user id
|
254
|
+
* @param data.args the arguments
|
255
|
+
* @param data.metadata the metadata
|
256
|
+
* @param data.maxAttempts the maximum attempts
|
257
|
+
* @returns the task id
|
258
|
+
*/
|
259
|
+
abstract addTask(data: {
|
260
|
+
task: string;
|
261
|
+
startTime?: number;
|
262
|
+
userId?: string;
|
263
|
+
args?: string;
|
264
|
+
metadata?: string;
|
265
|
+
maxAttempts?: number;
|
266
|
+
}): Promise<string>;
|
267
|
+
|
268
|
+
/**
|
269
|
+
* Abstract method to send the transactions
|
270
|
+
* @param transactions
|
271
|
+
*/
|
272
|
+
abstract sendTransactions(
|
273
|
+
transactions: string[] | CloudTransaction[]
|
274
|
+
): Promise<CloudTransaction[]>;
|
275
|
+
|
276
|
+
/**
|
277
|
+
* Abstract method to delete the transaction
|
278
|
+
* Used to delete the transaction
|
279
|
+
* @param txId the transaction id
|
280
|
+
*/
|
281
|
+
abstract deleteTransaction(txId: string): Promise<void>;
|
282
|
+
|
283
|
+
/**
|
284
|
+
* Abstract method to get the transactions
|
285
|
+
* Used to get the transactions
|
286
|
+
* @returns the transactions
|
287
|
+
*/
|
288
|
+
abstract getTransactions(): Promise<CloudTransaction[]>;
|
289
|
+
|
290
|
+
/**
|
291
|
+
* Publish the transaction metadata in human-readable format
|
292
|
+
* @param params
|
293
|
+
* @param params.txId the transaction id
|
294
|
+
* @param params.metadata the metadata
|
295
|
+
*/
|
296
|
+
abstract publishTransactionMetadata(params: {
|
297
|
+
txId: string;
|
298
|
+
metadata: TransactionMetadata;
|
299
|
+
}): Promise<void>;
|
300
|
+
|
301
|
+
/**
|
302
|
+
* Abstract method to delete the task
|
303
|
+
* Used to delete the task
|
304
|
+
* @param taskId the task id
|
305
|
+
*/
|
306
|
+
abstract deleteTask(taskId: string): Promise<void>;
|
307
|
+
|
308
|
+
/**
|
309
|
+
* Abstract method to process the tasks
|
310
|
+
*/
|
311
|
+
abstract processTasks(): Promise<void>;
|
312
|
+
|
313
|
+
/**
|
314
|
+
* Abstract method to get the job result
|
315
|
+
* Used to get the job result
|
316
|
+
* @param jobId the job id
|
317
|
+
* @returns the job result
|
318
|
+
*/
|
319
|
+
abstract jobResult(jobId: string): Promise<JobData | undefined>;
|
320
|
+
|
321
|
+
/**
|
322
|
+
* forces the worker to restart the AWS lambda container
|
323
|
+
* See https://github.com/o1-labs/o1js/issues/1651
|
324
|
+
*/
|
325
|
+
abstract forceWorkerRestart(): Promise<void>;
|
326
|
+
}
|
@@ -0,0 +1,123 @@
|
|
1
|
+
import { blockchain } from "../networks.js";
|
2
|
+
export type JobStatus =
|
3
|
+
| "created"
|
4
|
+
| "started"
|
5
|
+
| "finished"
|
6
|
+
| "failed"
|
7
|
+
| "used"
|
8
|
+
| "restarted";
|
9
|
+
|
10
|
+
/**
|
11
|
+
* LogStream is a subset of the log stream data returned by AWS CloudWatch Logs when running the worker.
|
12
|
+
* @see {@link https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-logs/command/GetLogEventsCommand/}
|
13
|
+
*
|
14
|
+
* Example:
|
15
|
+
* ```
|
16
|
+
* {
|
17
|
+
* logGroupName: '/aws/lambda/zkcloudworker-dev-test',
|
18
|
+
* logStreamName: '2024/05/09/[$LATEST]52d048f64e894d2e8ba2800df93629c5',
|
19
|
+
* awsRequestId: '581d0d45-9165-47e8-84d9-678599938811'
|
20
|
+
* }
|
21
|
+
* ```
|
22
|
+
*/
|
23
|
+
export interface LogStream {
|
24
|
+
/** The log group name */
|
25
|
+
logGroupName: string;
|
26
|
+
|
27
|
+
/** The log stream name */
|
28
|
+
logStreamName: string;
|
29
|
+
|
30
|
+
/** The AWS request ID */
|
31
|
+
awsRequestId: string;
|
32
|
+
}
|
33
|
+
|
34
|
+
/**
|
35
|
+
* JobData is the data structure for a job, keeping track of the job status, result, logs, and metadata.
|
36
|
+
*/
|
37
|
+
export interface JobData {
|
38
|
+
/** The ID of the user */
|
39
|
+
id: string;
|
40
|
+
|
41
|
+
/** The ID of the job */
|
42
|
+
jobId: string;
|
43
|
+
|
44
|
+
/** The ID of the task (optional) */
|
45
|
+
taskId?: string;
|
46
|
+
|
47
|
+
/** The developer of the repo executing the job */
|
48
|
+
developer: string;
|
49
|
+
|
50
|
+
/** The repo executing the job */
|
51
|
+
repo: string;
|
52
|
+
|
53
|
+
/** The task to execute (optional) */
|
54
|
+
task?: string;
|
55
|
+
|
56
|
+
/** The ID of the user (optional) */
|
57
|
+
userId?: string;
|
58
|
+
|
59
|
+
/** The arguments for the job (optional) */
|
60
|
+
args?: string;
|
61
|
+
|
62
|
+
/** The metadata for the job (optional) */
|
63
|
+
metadata?: string;
|
64
|
+
|
65
|
+
/** The blockchain to execute the job on */
|
66
|
+
chain: blockchain;
|
67
|
+
|
68
|
+
/** The filename where transactions data is stored (optional) */
|
69
|
+
filename?: string;
|
70
|
+
|
71
|
+
/** The number of transactions */
|
72
|
+
txNumber: number;
|
73
|
+
|
74
|
+
/** The time the job was created */
|
75
|
+
timeCreated: number;
|
76
|
+
|
77
|
+
/** The time the job was started (optional) */
|
78
|
+
timeStarted?: number;
|
79
|
+
|
80
|
+
/** The time the job was finished (optional) */
|
81
|
+
timeFinished?: number;
|
82
|
+
|
83
|
+
/** The time the job failed (optional) */
|
84
|
+
timeFailed?: number;
|
85
|
+
|
86
|
+
/** The time the job result was used (optional) */
|
87
|
+
timeUsed?: number;
|
88
|
+
|
89
|
+
/** The status of the job */
|
90
|
+
jobStatus: JobStatus;
|
91
|
+
|
92
|
+
/** The duration the job was billed for in ms (optional) */
|
93
|
+
billedDuration?: number;
|
94
|
+
|
95
|
+
/** The result of the job (optional) */
|
96
|
+
result?: string;
|
97
|
+
|
98
|
+
/** The log streams of the job (optional) */
|
99
|
+
logStreams?: LogStream[];
|
100
|
+
|
101
|
+
/** The logs of the job (optional) */
|
102
|
+
logs?: string[];
|
103
|
+
|
104
|
+
/** Whether the logs are full (optional) */
|
105
|
+
isFullLog?: boolean;
|
106
|
+
}
|
107
|
+
|
108
|
+
/**
|
109
|
+
* JobEvent is the data structure for a job events, keeping track of the job status changes.
|
110
|
+
*/
|
111
|
+
export interface JobEvent {
|
112
|
+
/** The ID of the job */
|
113
|
+
jobId: string;
|
114
|
+
|
115
|
+
/** The time the event occurred */
|
116
|
+
eventTime: number;
|
117
|
+
|
118
|
+
/** The status of the job */
|
119
|
+
jobStatus: JobStatus;
|
120
|
+
|
121
|
+
/** The result of the job (optional) */
|
122
|
+
result?: string;
|
123
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { blockchain } from "../networks.js";
|
2
|
+
|
3
|
+
/**
|
4
|
+
* TaskData is the data structure for a task, keeping track of the task status, result, logs, and metadata.
|
5
|
+
*/
|
6
|
+
export interface TaskData {
|
7
|
+
/** The ID of the user */
|
8
|
+
id: string;
|
9
|
+
|
10
|
+
/** The ID of the task */
|
11
|
+
taskId: string;
|
12
|
+
|
13
|
+
/** The time the task was started (optional) */
|
14
|
+
startTime?: number;
|
15
|
+
|
16
|
+
/** The time the task was created */
|
17
|
+
timeCreated: number;
|
18
|
+
|
19
|
+
/** The maximum number of attempts (default is 5) (optional) */
|
20
|
+
maxAttempts?: number;
|
21
|
+
|
22
|
+
/** The number of attempts */
|
23
|
+
attempts: number;
|
24
|
+
|
25
|
+
/** The developer of the repo executing the task */
|
26
|
+
developer: string;
|
27
|
+
|
28
|
+
/** The repo executing the task */
|
29
|
+
repo: string;
|
30
|
+
|
31
|
+
/** The task to execute */
|
32
|
+
task: string;
|
33
|
+
|
34
|
+
/** The ID of the user (optional) */
|
35
|
+
userId?: string;
|
36
|
+
|
37
|
+
/** The arguments for the task (optional) */
|
38
|
+
args?: string;
|
39
|
+
|
40
|
+
/** The metadata for the task (optional) */
|
41
|
+
metadata?: string;
|
42
|
+
|
43
|
+
/** The blockchain to execute the task on */
|
44
|
+
chain: blockchain;
|
45
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/**
|
2
|
+
* Human-readable transaction metadata
|
3
|
+
* events: the events
|
4
|
+
* actions: the actions
|
5
|
+
* custom: the custom metadata defined by the developer
|
6
|
+
*/
|
7
|
+
|
8
|
+
export interface TransactionMetadata {
|
9
|
+
events?: object[];
|
10
|
+
actions?: object[];
|
11
|
+
custom?: object;
|
12
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import { Cloud, CloudTransaction } from "./cloud.js";
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Abstract class for the zkCloudWorker
|
5
|
+
* Used to define the zkCloudWorker methods and properties
|
6
|
+
* Should be implemented for by the developer for the zkCloudWorker in the cloud
|
7
|
+
*/
|
8
|
+
export abstract class zkCloudWorker {
|
9
|
+
/** cloud: the cloud instance */
|
10
|
+
readonly cloud: Cloud;
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Constructor for the zkCloudWorker class
|
14
|
+
* @param cloud the cloud instance provided by the zkCloudWorker in the local environment or in the cloud
|
15
|
+
*/
|
16
|
+
constructor(cloud: Cloud) {
|
17
|
+
this.cloud = cloud;
|
18
|
+
}
|
19
|
+
|
20
|
+
// Those methods should be implemented for recursive proofs calculations
|
21
|
+
/**
|
22
|
+
* Creates a new proof from a transaction
|
23
|
+
* @param transaction the transaction
|
24
|
+
* @returns the serialized proof
|
25
|
+
*/
|
26
|
+
async create(transaction: string): Promise<string | undefined> {
|
27
|
+
return undefined;
|
28
|
+
}
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Merges two proofs
|
32
|
+
* @param proof1 the first proof
|
33
|
+
* @param proof2 the second proof
|
34
|
+
* @returns the merged proof
|
35
|
+
*/
|
36
|
+
async merge(proof1: string, proof2: string): Promise<string | undefined> {
|
37
|
+
return undefined;
|
38
|
+
}
|
39
|
+
|
40
|
+
// Those methods should be implemented for anything except for recursive proofs
|
41
|
+
/**
|
42
|
+
* Executes the transactions
|
43
|
+
* @param transactions the transactions, can be empty list
|
44
|
+
* @returns the result
|
45
|
+
*/
|
46
|
+
async execute(transactions: string[]): Promise<string | undefined> {
|
47
|
+
return undefined;
|
48
|
+
}
|
49
|
+
|
50
|
+
/* Process the transactions received by the cloud
|
51
|
+
* @param transactions: the transactions
|
52
|
+
*/
|
53
|
+
async processTransactions(transactions: CloudTransaction[]): Promise<void> {}
|
54
|
+
|
55
|
+
/**
|
56
|
+
* process the task defined by the developer
|
57
|
+
* @returns the result
|
58
|
+
*/
|
59
|
+
async task(): Promise<string | undefined> {
|
60
|
+
return undefined;
|
61
|
+
}
|
62
|
+
}
|
package/src/index.ts
ADDED