diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..608f038 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +version: 2 +updates: + - package-ecosystem: "npm" + versioning-strategy: increase + directory: "/" + schedule: + interval: "monthly" + labels: + - "dependencies" + open-pull-requests-limit: 100 + pull-request-branch-name: + separator: "-" + ignore: + - dependency-name: "fs-extra" + - dependency-name: "*" + update-types: ["version-update:semver-major"] diff --git a/cli/.editorconfig b/cli/.editorconfig new file mode 100644 index 0000000..beffa30 --- /dev/null +++ b/cli/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/cli/.eslintignore b/cli/.eslintignore index 139bdb4..9b1c8b1 100644 --- a/cli/.eslintignore +++ b/cli/.eslintignore @@ -1,6 +1 @@ -lib -dist -dts -node_modules -scripts -test \ No newline at end of file +/dist diff --git a/cli/.eslintrc.json b/cli/.eslintrc similarity index 91% rename from cli/.eslintrc.json rename to cli/.eslintrc index a9378a1..f1bb0e2 100644 --- a/cli/.eslintrc.json +++ b/cli/.eslintrc @@ -9,6 +9,8 @@ "prettier" ], "plugins": ["@typescript-eslint", "prettier", "unicorn", "import"], + "parserOptions": { "project": ["./tsconfig.json"] }, + "ignorePatterns": ["test/**/*.ts"], "rules": { "valid-jsdoc": "off", "camelcase": "off", diff --git a/cli/.gitignore b/cli/.gitignore index be19f7b..8055e12 100644 --- a/cli/.gitignore +++ b/cli/.gitignore @@ -3,16 +3,7 @@ /.nyc_output /dist /lib +/package-lock.json /tmp -/yarn.lock node_modules -switchboardv2_idl*.json -.archive -.keypairs - - -*-keypair.json -*.schema.json -.data - -oclif.manifest.json \ No newline at end of file +oclif.manifest.json diff --git a/cli/.mocharc.json b/cli/.mocharc.json new file mode 100644 index 0000000..4a09d14 --- /dev/null +++ b/cli/.mocharc.json @@ -0,0 +1,12 @@ +{ + "require": [ + "test/helpers/init.js", + "ts-node/register" + ], + "watch-extensions": [ + "ts" + ], + "recursive": true, + "reporter": "spec", + "timeout": 60000 +} diff --git a/cli/Dockerfile b/cli/Dockerfile new file mode 100644 index 0000000..4215d3a --- /dev/null +++ b/cli/Dockerfile @@ -0,0 +1,8 @@ +FROM node:16-alpine +WORKDIR /usr/src/sbv2-cli +COPY package.json ./ +RUN npm i --legacy-peer-deps +COPY tsconfig.build.json ./tsconfig.json +COPY src ./src +RUN npm run build +RUN ["node", "dist", "print", "GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR"] \ No newline at end of file diff --git a/cli/Dockerfile.sbv2 b/cli/Dockerfile.sbv2 new file mode 100644 index 0000000..a9d90ae --- /dev/null +++ b/cli/Dockerfile.sbv2 @@ -0,0 +1,4 @@ +FROM node:16-alpine +ARG SBV2_VERSION=latest +RUN npm i -g @switchboard-xyz/switchboardv2-cli@$SBV2_VERSION +RUN sbv2 print GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR --verbose \ No newline at end of file diff --git a/cli/LICENSE b/cli/LICENSE index 8e9663d..8897131 100644 --- a/cli/LICENSE +++ b/cli/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Switchboard +Copyright (c) 2019 Salesforce Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/cli/README.md b/cli/README.md index b58cfcd..2ee8538 100644 --- a/cli/README.md +++ b/cli/README.md @@ -12,888 +12,1345 @@ npm install -g @switchboard-xyz/switchboardv2-cli ``` -* [`sbv2 aggregator:add:job AGGREGATORKEY`](#sbv2-aggregatoraddjob-aggregatorkey) -* [`sbv2 aggregator:create:copy AGGREGATORSOURCE`](#sbv2-aggregatorcreatecopy-aggregatorsource) -* [`sbv2 aggregator:create:json DEFINITIONFILE`](#sbv2-aggregatorcreatejson-definitionfile) -* [`sbv2 aggregator:lock AGGREGATORKEY`](#sbv2-aggregatorlock-aggregatorkey) -* [`sbv2 aggregator:permission:create AGGREGATORKEY`](#sbv2-aggregatorpermissioncreate-aggregatorkey) -* [`sbv2 aggregator:remove:job AGGREGATORKEY JOBKEY`](#sbv2-aggregatorremovejob-aggregatorkey-jobkey) -* [`sbv2 aggregator:set AGGREGATORKEY`](#sbv2-aggregatorset-aggregatorkey) -* [`sbv2 aggregator:set:authority AGGREGATORKEY NEWAUTHORITY`](#sbv2-aggregatorsetauthority-aggregatorkey-newauthority) -* [`sbv2 aggregator:set:batchSize AGGREGATORKEY BATCHSIZE`](#sbv2-aggregatorsetbatchsize-aggregatorkey-batchsize) -* [`sbv2 aggregator:set:forceReportPeriod AGGREGATORKEY FORCEREPORTPERIOD`](#sbv2-aggregatorsetforcereportperiod-aggregatorkey-forcereportperiod) -* [`sbv2 aggregator:set:history AGGREGATORKEY SIZE`](#sbv2-aggregatorsethistory-aggregatorkey-size) -* [`sbv2 aggregator:set:minJobs AGGREGATORKEY MINJOBRESULTS`](#sbv2-aggregatorsetminjobs-aggregatorkey-minjobresults) -* [`sbv2 aggregator:set:minOracles AGGREGATORKEY MINORACLERESULTS`](#sbv2-aggregatorsetminoracles-aggregatorkey-minoracleresults) -* [`sbv2 aggregator:set:queue AGGREGATORKEY QUEUEKEY`](#sbv2-aggregatorsetqueue-aggregatorkey-queuekey) -* [`sbv2 aggregator:set:updateInterval AGGREGATORKEY UPDATEINTERVAL`](#sbv2-aggregatorsetupdateinterval-aggregatorkey-updateinterval) -* [`sbv2 aggregator:set:varianceThreshold AGGREGATORKEY VARIANCETHRESHOLD`](#sbv2-aggregatorsetvariancethreshold-aggregatorkey-variancethreshold) -* [`sbv2 aggregator:update AGGREGATORKEY`](#sbv2-aggregatorupdate-aggregatorkey) -* [`sbv2 config:print`](#sbv2-configprint) -* [`sbv2 config:set PARAM [VALUE]`](#sbv2-configset-param-value) -* [`sbv2 crank:list CRANKKEY`](#sbv2-cranklist-crankkey) -* [`sbv2 crank:push CRANKKEY AGGREGATORKEY`](#sbv2-crankpush-crankkey-aggregatorkey) -* [`sbv2 crank:turn CRANKKEY`](#sbv2-crankturn-crankkey) +* [`sbv2 aggregator add crank [CRANKKEY] [AGGREGATORKEY]`](#sbv2-aggregator-add-crank-crankkey-aggregatorkey) +* [`sbv2 aggregator add history [AGGREGATORKEY] [SIZE]`](#sbv2-aggregator-add-history-aggregatorkey-size) +* [`sbv2 aggregator add job [AGGREGATORKEY]`](#sbv2-aggregator-add-job-aggregatorkey) +* [`sbv2 aggregator create copy [AGGREGATORSOURCE]`](#sbv2-aggregator-create-copy-aggregatorsource) +* [`sbv2 aggregator create json [DEFINITIONFILE]`](#sbv2-aggregator-create-json-definitionfile) +* [`sbv2 aggregator history print [AGGREGATORKEY]`](#sbv2-aggregator-history-print-aggregatorkey) +* [`sbv2 aggregator lease create [AGGREGATORKEY]`](#sbv2-aggregator-lease-create-aggregatorkey) +* [`sbv2 aggregator lease extend [AGGREGATORKEY]`](#sbv2-aggregator-lease-extend-aggregatorkey) +* [`sbv2 aggregator lease print [AGGREGATORKEY]`](#sbv2-aggregator-lease-print-aggregatorkey) +* [`sbv2 aggregator lease withdraw [AGGREGATORKEY]`](#sbv2-aggregator-lease-withdraw-aggregatorkey) +* [`sbv2 aggregator lock [AGGREGATORKEY]`](#sbv2-aggregator-lock-aggregatorkey) +* [`sbv2 aggregator permission create [AGGREGATORKEY]`](#sbv2-aggregator-permission-create-aggregatorkey) +* [`sbv2 aggregator permission print [AGGREGATORKEY]`](#sbv2-aggregator-permission-print-aggregatorkey) +* [`sbv2 aggregator print [AGGREGATORKEY]`](#sbv2-aggregator-print-aggregatorkey) +* [`sbv2 aggregator print history [AGGREGATORKEY]`](#sbv2-aggregator-print-history-aggregatorkey) +* [`sbv2 aggregator print lease [AGGREGATORKEY]`](#sbv2-aggregator-print-lease-aggregatorkey) +* [`sbv2 aggregator print permission [AGGREGATORKEY]`](#sbv2-aggregator-print-permission-aggregatorkey) +* [`sbv2 aggregator remove job [AGGREGATORKEY] [JOBKEY]`](#sbv2-aggregator-remove-job-aggregatorkey-jobkey) +* [`sbv2 aggregator set [AGGREGATORKEY]`](#sbv2-aggregator-set-aggregatorkey) +* [`sbv2 aggregator set authority [AGGREGATORKEY] [NEWAUTHORITY]`](#sbv2-aggregator-set-authority-aggregatorkey-newauthority) +* [`sbv2 aggregator set batchSize [AGGREGATORKEY] BATCHSIZE`](#sbv2-aggregator-set-batchsize-aggregatorkey-batchsize) +* [`sbv2 aggregator set forceReport [AGGREGATORKEY] [FORCEREPORTPERIOD]`](#sbv2-aggregator-set-forcereport-aggregatorkey-forcereportperiod) +* [`sbv2 aggregator set forceReportPeriod [AGGREGATORKEY] [FORCEREPORTPERIOD]`](#sbv2-aggregator-set-forcereportperiod-aggregatorkey-forcereportperiod) +* [`sbv2 aggregator set history [AGGREGATORKEY] [SIZE]`](#sbv2-aggregator-set-history-aggregatorkey-size) +* [`sbv2 aggregator set minJobs [AGGREGATORKEY] [MINJOBRESULTS]`](#sbv2-aggregator-set-minjobs-aggregatorkey-minjobresults) +* [`sbv2 aggregator set minOracles [AGGREGATORKEY] [MINORACLERESULTS]`](#sbv2-aggregator-set-minoracles-aggregatorkey-minoracleresults) +* [`sbv2 aggregator set queue [AGGREGATORKEY] [QUEUEKEY]`](#sbv2-aggregator-set-queue-aggregatorkey-queuekey) +* [`sbv2 aggregator set updateInterval [AGGREGATORKEY] [UPDATEINTERVAL]`](#sbv2-aggregator-set-updateinterval-aggregatorkey-updateinterval) +* [`sbv2 aggregator set variance [AGGREGATORKEY] [VARIANCETHRESHOLD]`](#sbv2-aggregator-set-variance-aggregatorkey-variancethreshold) +* [`sbv2 aggregator set varianceThreshold [AGGREGATORKEY] [VARIANCETHRESHOLD]`](#sbv2-aggregator-set-variancethreshold-aggregatorkey-variancethreshold) +* [`sbv2 aggregator update [AGGREGATORKEY]`](#sbv2-aggregator-update-aggregatorkey) +* [`sbv2 aggregator watch [AGGREGATORKEY]`](#sbv2-aggregator-watch-aggregatorkey) +* [`sbv2 config print`](#sbv2-config-print) +* [`sbv2 config set [PARAM] [VALUE]`](#sbv2-config-set-param-value) +* [`sbv2 crank add aggregator [CRANKKEY] [AGGREGATORKEY]`](#sbv2-crank-add-aggregator-crankkey-aggregatorkey) +* [`sbv2 crank list [CRANKKEY]`](#sbv2-crank-list-crankkey) +* [`sbv2 crank print [CRANKKEY]`](#sbv2-crank-print-crankkey) +* [`sbv2 crank push [CRANKKEY] [AGGREGATORKEY]`](#sbv2-crank-push-crankkey-aggregatorkey) +* [`sbv2 crank turn [CRANKKEY]`](#sbv2-crank-turn-crankkey) +* [`sbv2 custom queue`](#sbv2-custom-queue) * [`sbv2 help [COMMAND]`](#sbv2-help-command) -* [`sbv2 job:create JOBDEFINITION`](#sbv2-jobcreate-jobdefinition) -* [`sbv2 job:create:copy JOBSOURCE`](#sbv2-jobcreatecopy-jobsource) -* [`sbv2 job:create:json DEFINITIONFILE`](#sbv2-jobcreatejson-definitionfile) -* [`sbv2 job:create:template TEMPLATE ID`](#sbv2-jobcreatetemplate-template-id) -* [`sbv2 json:add:aggregator`](#sbv2-jsonaddaggregator) -* [`sbv2 json:add:crank SCHEMAFILE`](#sbv2-jsonaddcrank-schemafile) -* [`sbv2 json:add:oracle SCHEMAFILE`](#sbv2-jsonaddoracle-schemafile) -* [`sbv2 json:create:queue INPUTFILE OUTPUTFILE`](#sbv2-jsoncreatequeue-inputfile-outputfile) -* [`sbv2 lease:create AGGREGATORKEY`](#sbv2-leasecreate-aggregatorkey) -* [`sbv2 lease:extend AGGREGATORKEY`](#sbv2-leaseextend-aggregatorkey) -* [`sbv2 lease:withdraw AGGREGATORKEY`](#sbv2-leasewithdraw-aggregatorkey) -* [`sbv2 localnet:env`](#sbv2-localnetenv) -* [`sbv2 oracle:balance ORACLEKEY`](#sbv2-oraclebalance-oraclekey) -* [`sbv2 oracle:create QUEUEKEY`](#sbv2-oraclecreate-queuekey) -* [`sbv2 oracle:deposit ORACLEKEY`](#sbv2-oracledeposit-oraclekey) -* [`sbv2 oracle:nonce ORACLEKEY`](#sbv2-oraclenonce-oraclekey) -* [`sbv2 oracle:permission:create ORACLEKEY`](#sbv2-oraclepermissioncreate-oraclekey) -* [`sbv2 oracle:withdraw ORACLEKEY`](#sbv2-oraclewithdraw-oraclekey) -* [`sbv2 permission:create GRANTER GRANTEE`](#sbv2-permissioncreate-granter-grantee) -* [`sbv2 permission:set PERMISSIONKEY`](#sbv2-permissionset-permissionkey) -* [`sbv2 print PUBLICKEY`](#sbv2-print-publickey) -* [`sbv2 print:aggregator AGGREGATORKEY`](#sbv2-printaggregator-aggregatorkey) -* [`sbv2 print:aggregator:history AGGREGATORKEY`](#sbv2-printaggregatorhistory-aggregatorkey) -* [`sbv2 print:aggregator:lease AGGREGATORKEY`](#sbv2-printaggregatorlease-aggregatorkey) -* [`sbv2 print:aggregator:permission AGGREGATORKEY`](#sbv2-printaggregatorpermission-aggregatorkey) -* [`sbv2 print:crank CRANKKEY`](#sbv2-printcrank-crankkey) -* [`sbv2 print:job JOBKEY`](#sbv2-printjob-jobkey) -* [`sbv2 print:job:templates`](#sbv2-printjobtemplates) -* [`sbv2 print:json:samples OUTPUTDIRECTORY`](#sbv2-printjsonsamples-outputdirectory) -* [`sbv2 print:oracle ORACLEKEY`](#sbv2-printoracle-oraclekey) -* [`sbv2 print:oracle:permission ORACLEKEY`](#sbv2-printoraclepermission-oraclekey) -* [`sbv2 print:program`](#sbv2-printprogram) -* [`sbv2 print:queue QUEUEKEY`](#sbv2-printqueue-queuekey) -* [`sbv2 print:vrf VRFKEY`](#sbv2-printvrf-vrfkey) -* [`sbv2 queue:add:crank QUEUEKEY`](#sbv2-queueaddcrank-queuekey) -* [`sbv2 queue:create`](#sbv2-queuecreate) -* [`sbv2 queue:permit:aggregator AGGREGATORKEY`](#sbv2-queuepermitaggregator-aggregatorkey) -* [`sbv2 queue:permit:oracle ORACLEKEY`](#sbv2-queuepermitoracle-oraclekey) -* [`sbv2 queue:set:rewards QUEUEKEY REWARDS`](#sbv2-queuesetrewards-queuekey-rewards) -* [`sbv2 queue:set:vrf QUEUEKEY`](#sbv2-queuesetvrf-queuekey) +* [`sbv2 job create JOBDEFINITION`](#sbv2-job-create-jobdefinition) +* [`sbv2 job print [JOBKEY]`](#sbv2-job-print-jobkey) +* [`sbv2 json create aggregator [DEFINITIONFILE]`](#sbv2-json-create-aggregator-definitionfile) +* [`sbv2 lease create [AGGREGATORKEY]`](#sbv2-lease-create-aggregatorkey) +* [`sbv2 lease extend [AGGREGATORKEY]`](#sbv2-lease-extend-aggregatorkey) +* [`sbv2 lease withdraw [AGGREGATORKEY]`](#sbv2-lease-withdraw-aggregatorkey) +* [`sbv2 localnet env`](#sbv2-localnet-env) +* [`sbv2 oracle balance [ORACLEKEY]`](#sbv2-oracle-balance-oraclekey) +* [`sbv2 oracle create [QUEUEKEY]`](#sbv2-oracle-create-queuekey) +* [`sbv2 oracle deposit [ORACLEKEY]`](#sbv2-oracle-deposit-oraclekey) +* [`sbv2 oracle nonce [ORACLEKEY]`](#sbv2-oracle-nonce-oraclekey) +* [`sbv2 oracle permission create [ORACLEKEY]`](#sbv2-oracle-permission-create-oraclekey) +* [`sbv2 oracle permission print [ORACLEKEY]`](#sbv2-oracle-permission-print-oraclekey) +* [`sbv2 oracle print [ORACLEKEY]`](#sbv2-oracle-print-oraclekey) +* [`sbv2 oracle print permission [ORACLEKEY]`](#sbv2-oracle-print-permission-oraclekey) +* [`sbv2 oracle withdraw [ORACLEKEY]`](#sbv2-oracle-withdraw-oraclekey) +* [`sbv2 permission create [GRANTER] [GRANTEE]`](#sbv2-permission-create-granter-grantee) +* [`sbv2 permission set [PERMISSIONKEY]`](#sbv2-permission-set-permissionkey) +* [`sbv2 print [PUBLICKEY]`](#sbv2-print-publickey) +* [`sbv2 print aggregator [AGGREGATORKEY]`](#sbv2-print-aggregator-aggregatorkey) +* [`sbv2 print aggregator history [AGGREGATORKEY]`](#sbv2-print-aggregator-history-aggregatorkey) +* [`sbv2 print aggregator lease [AGGREGATORKEY]`](#sbv2-print-aggregator-lease-aggregatorkey) +* [`sbv2 print aggregator permission [AGGREGATORKEY]`](#sbv2-print-aggregator-permission-aggregatorkey) +* [`sbv2 print crank [CRANKKEY]`](#sbv2-print-crank-crankkey) +* [`sbv2 print job [JOBKEY]`](#sbv2-print-job-jobkey) +* [`sbv2 print oracle [ORACLEKEY]`](#sbv2-print-oracle-oraclekey) +* [`sbv2 print oracle permission [ORACLEKEY]`](#sbv2-print-oracle-permission-oraclekey) +* [`sbv2 print program`](#sbv2-print-program) +* [`sbv2 print queue [QUEUEKEY]`](#sbv2-print-queue-queuekey) +* [`sbv2 print vrf [VRFKEY]`](#sbv2-print-vrf-vrfkey) +* [`sbv2 program print`](#sbv2-program-print) +* [`sbv2 queue add crank [QUEUEKEY]`](#sbv2-queue-add-crank-queuekey) +* [`sbv2 queue create`](#sbv2-queue-create) +* [`sbv2 queue print [QUEUEKEY]`](#sbv2-queue-print-queuekey) +* [`sbv2 queue set rewards [QUEUEKEY] [REWARDS]`](#sbv2-queue-set-rewards-queuekey-rewards) +* [`sbv2 queue set vrf [QUEUEKEY]`](#sbv2-queue-set-vrf-queuekey) * [`sbv2 sandbox [PLACEHOLDER]`](#sbv2-sandbox-placeholder) -* [`sbv2 test ORACLEKEY`](#sbv2-test-oraclekey) +* [`sbv2 set aggregator [AGGREGATORKEY]`](#sbv2-set-aggregator-aggregatorkey) +* [`sbv2 test [ORACLEKEY]`](#sbv2-test-oraclekey) * [`sbv2 update [CHANNEL]`](#sbv2-update-channel) -* [`sbv2 vrf:create QUEUEKEY`](#sbv2-vrfcreate-queuekey) -* [`sbv2 vrf:create:example QUEUEKEY`](#sbv2-vrfcreateexample-queuekey) -* [`sbv2 vrf:request VRFKEY`](#sbv2-vrfrequest-vrfkey) -* [`sbv2 watch:aggregator AGGREGATORKEY`](#sbv2-watchaggregator-aggregatorkey) -* [`sbv2 watch:vrf VRFKEY`](#sbv2-watchvrf-vrfkey) - -## `sbv2 aggregator:add:job AGGREGATORKEY` - -add a job account to an aggregator - -``` -USAGE - $ sbv2 aggregator:add:job AGGREGATORKEY - -ARGUMENTS - AGGREGATORKEY public key of the aggregator account - -OPTIONS - -a, --aggregatorAuthority=aggregatorAuthority alternate keypair that is the authority for the aggregator - -f, --outputFile=outputFile output file to save aggregator definition to - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account - authority if no alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --force overwrite outputFile if existing - - --jobDefinition=jobDefinition filesystem path of job json definition file - - --jobKey=jobKey public key of an existing job account to add to an aggregator - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -EXAMPLE - $ sbv2 aggregator:add:job -``` - -_See code: [src/commands/aggregator/add/job.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/aggregator/add/job.ts)_ - -## `sbv2 aggregator:create:copy AGGREGATORSOURCE` - -copy an aggregator account to a new oracle queue - -``` -USAGE - $ sbv2 aggregator:create:copy AGGREGATORSOURCE - -ARGUMENTS - AGGREGATORSOURCE public key of the aggregator account to copy - -OPTIONS - -a, --authority=authority alternate keypair that will be the aggregator authority - -f, --outputFile=outputFile output file to save aggregator definition to - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account - authority if no alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --batchSize=batchSize override source aggregator's oracleRequestBatchSize - - --copyJobs create copy of job accounts instead of referincing existing job account - - --crankKey=crankKey public key of the crank to push aggregator to - - --enable set permissions to PERMIT_ORACLE_QUEUE_USAGE - - --force skip job confirmation - - --forceReportPeriod=forceReportPeriod override source aggregator's forceReportPeriod - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --minJobs=minJobs override source aggregator's minJobResults - - --minOracles=minOracles override source aggregator's minOracleResults - - --minUpdateDelay=minUpdateDelay override source aggregator's minUpdateDelaySeconds - - --programId=programId alternative Switchboard program ID to interact with - - --queueAuthority=queueAuthority alternative keypair to use for queue authority - - --queueKey=queueKey (required) public key of the queue to create aggregator for - - --varianceThreshold=varianceThreshold override source aggregator's varianceThreshold - -EXAMPLES - $ sbv2 aggregator:create:copy GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR --queueKey - 9WZ59yz95bd3XwJxDPVE2PjvVWmSy9WM1NgGD2Hqsohw --keypair ../payer-keypair.json - $ sbv2 aggregator:create:copy GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR --queueKey - 9WZ59yz95bd3XwJxDPVE2PjvVWmSy9WM1NgGD2Hqsohw --keypair ../payer-keypair.json --sourceCluster mainnet-beta - $ sbv2 aggregator:create:copy FcSmdsdWks75YdyCGegRqXdt5BiNGQKxZywyzb8ckD7D --queueKey - 9WZ59yz95bd3XwJxDPVE2PjvVWmSy9WM1NgGD2Hqsohw --keypair ../payer-keypair.json --sourceCluster mainnet-beta -``` - -_See code: [src/commands/aggregator/create/copy.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/aggregator/create/copy.ts)_ - -## `sbv2 aggregator:create:json DEFINITIONFILE` - -create an aggregator from a json file - -``` -USAGE - $ sbv2 aggregator:create:json DEFINITIONFILE - -ARGUMENTS - DEFINITIONFILE filesystem path of queue definition json file - -OPTIONS - -a, --authority=authority alternate keypair that will be the authority for the aggregator - -f, --outputFile=outputFile output aggregator definition to a json file - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -q, --queueKey=queueKey public key of the oracle queue to create aggregator for - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --force overwrite output file - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -ALIASES - $ sbv2 json:create:aggregator - -EXAMPLE - $ sbv2 aggregator:create:json examples/aggregator.json --keypair ../payer-keypair.json --queueKey - GhYg3R1V6DmJbwuc57qZeoYG6gUuvCotUF1zU3WCj98U --outputFile aggregator.schema.json -``` - -_See code: [src/commands/aggregator/create/json.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/aggregator/create/json.ts)_ - -## `sbv2 aggregator:lock AGGREGATORKEY` - -lock an aggregator's configuration and prevent further changes - -``` -USAGE - $ sbv2 aggregator:lock AGGREGATORKEY - -ARGUMENTS - AGGREGATORKEY public key of the aggregator account - -OPTIONS - -a, --authority=authority alternate keypair that is the authority for the aggregator - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with -``` - -_See code: [src/commands/aggregator/lock.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/aggregator/lock.ts)_ - -## `sbv2 aggregator:permission:create AGGREGATORKEY` - -create a permission account for an aggregator - -``` -USAGE - $ sbv2 aggregator:permission:create AGGREGATORKEY - -ARGUMENTS - AGGREGATORKEY public key of the aggregator account - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with -``` - -_See code: [src/commands/aggregator/permission/create.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/aggregator/permission/create.ts)_ - -## `sbv2 aggregator:remove:job AGGREGATORKEY JOBKEY` - -remove a switchboard job account from an aggregator - -``` -USAGE - $ sbv2 aggregator:remove:job AGGREGATORKEY JOBKEY - -ARGUMENTS - AGGREGATORKEY public key of the aggregator account - JOBKEY public key of an existing job account to remove from an aggregator - -OPTIONS - -a, --authority=authority alternate keypair that is the authority for the aggregator - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --force overwrite outputFile if existing - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -EXAMPLE - $ sbv2 aggregator:remove:job -``` - -_See code: [src/commands/aggregator/remove/job.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/aggregator/remove/job.ts)_ - -## `sbv2 aggregator:set AGGREGATORKEY` - -set an aggregator's config - -``` -USAGE - $ sbv2 aggregator:set AGGREGATORKEY - -ARGUMENTS - AGGREGATORKEY public key of the aggregator - -OPTIONS - -a, --authority=authority alternate keypair that is the authority for the aggregator - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account - authority if no alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --forceReportPeriod=forceReportPeriod Number of seconds for which, even if the variance threshold is not passed, - accept new responses from oracles. - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --minJobs=minJobs number of jobs that must respond before an oracle responds - - --minOracles=minOracles number of oracles that must respond before a value is accepted on-chain - - --newQueue=newQueue public key of the new oracle queue - - --programId=programId alternative Switchboard program ID to interact with - - --updateInterval=updateInterval set an aggregator's minimum update delay - - --varianceThreshold=varianceThreshold percentage change between a previous accepted result and the next round before - an oracle reports a value on-chain. Used to conserve lease cost during low - volatility - -ALIASES - $ sbv2 set:aggregator - -EXAMPLE - $ sbv2 aggregator:set GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR --updateInterval 300 --minOracles 3 --keypair - ../payer-keypair.json -``` - -_See code: [src/commands/aggregator/set/index.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/aggregator/set/index.ts)_ - -## `sbv2 aggregator:set:authority AGGREGATORKEY NEWAUTHORITY` - -set an aggregator's authority - -``` -USAGE - $ sbv2 aggregator:set:authority AGGREGATORKEY NEWAUTHORITY - -ARGUMENTS - AGGREGATORKEY public key of the aggregator account - NEWAUTHORITY keypair path of new authority - -OPTIONS - -a, --currentAuthority=currentAuthority alternate keypair that is the authority for the aggregator - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account - authority if no alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with -``` - -_See code: [src/commands/aggregator/set/authority.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/aggregator/set/authority.ts)_ - -## `sbv2 aggregator:set:batchSize AGGREGATORKEY BATCHSIZE` - -set an aggregator's batch size - -``` -USAGE - $ sbv2 aggregator:set:batchSize AGGREGATORKEY BATCHSIZE - -ARGUMENTS - AGGREGATORKEY public key of the aggregator account - BATCHSIZE number of oracles requested for each open round call - -OPTIONS - -a, --authority=authority alternate keypair that is the authority for the aggregator - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with -``` - -_See code: [src/commands/aggregator/set/batchSize.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/aggregator/set/batchSize.ts)_ - -## `sbv2 aggregator:set:forceReportPeriod AGGREGATORKEY FORCEREPORTPERIOD` - -set an aggregator's force report period - -``` -USAGE - $ sbv2 aggregator:set:forceReportPeriod AGGREGATORKEY FORCEREPORTPERIOD - -ARGUMENTS - AGGREGATORKEY public key of the aggregator - - FORCEREPORTPERIOD Number of seconds for which, even if the variance threshold is not passed, accept new responses - from oracles. - -OPTIONS - -a, --authority=authority alternate keypair that is the authority for the aggregator - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -ALIASES - $ sbv2 aggregator:set:forceReport - -EXAMPLE - $ sbv2 aggregator:set:forceReportPeriod GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR 300 --keypair - ../payer-keypair.json -``` - -_See code: [src/commands/aggregator/set/forceReportPeriod.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/aggregator/set/forceReportPeriod.ts)_ - -## `sbv2 aggregator:set:history AGGREGATORKEY SIZE` - -set an aggregator's history buffer account to record the last N accepted results - -``` -USAGE - $ sbv2 aggregator:set:history AGGREGATORKEY SIZE - -ARGUMENTS - AGGREGATORKEY public key of the aggregator to add to a crank - SIZE size of history buffer - -OPTIONS - -a, --authority=authority alternate keypair that is the authority for the aggregator - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -ALIASES - $ sbv2 aggregator:add:history - -EXAMPLE - $ sbv2 aggregator:set:history GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR 10000 --keypair ../payer-keypair.json -``` - -_See code: [src/commands/aggregator/set/history.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/aggregator/set/history.ts)_ - -## `sbv2 aggregator:set:minJobs AGGREGATORKEY MINJOBRESULTS` - -set an aggregator's minimum number of jobs before an oracle responds - -``` -USAGE - $ sbv2 aggregator:set:minJobs AGGREGATORKEY MINJOBRESULTS - -ARGUMENTS - AGGREGATORKEY public key of the aggregator account - MINJOBRESULTS number of jobs that must respond before an oracle responds - -OPTIONS - -a, --authority=authority alternate keypair that is the authority for the aggregator - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with -``` - -_See code: [src/commands/aggregator/set/minJobs.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/aggregator/set/minJobs.ts)_ - -## `sbv2 aggregator:set:minOracles AGGREGATORKEY MINORACLERESULTS` - -set an aggregator's minimum number of oracles that must respond before a result is accepted on-chain - -``` -USAGE - $ sbv2 aggregator:set:minOracles AGGREGATORKEY MINORACLERESULTS - -ARGUMENTS - AGGREGATORKEY public key of the aggregator account - MINORACLERESULTS number of oracles that must respond before a value is accepted on-chain - -OPTIONS - -a, --authority=authority alternate keypair that is the authority for the aggregator - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with -``` - -_See code: [src/commands/aggregator/set/minOracles.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/aggregator/set/minOracles.ts)_ - -## `sbv2 aggregator:set:queue AGGREGATORKEY QUEUEKEY` - -set an aggregator's oracle queue - -``` -USAGE - $ sbv2 aggregator:set:queue AGGREGATORKEY QUEUEKEY - -ARGUMENTS - AGGREGATORKEY public key of the aggregator - QUEUEKEY public key of the oracle queue - -OPTIONS - -a, --authority=authority alternate keypair that is the authority for the aggregator - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with -``` - -_See code: [src/commands/aggregator/set/queue.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/aggregator/set/queue.ts)_ - -## `sbv2 aggregator:set:updateInterval AGGREGATORKEY UPDATEINTERVAL` - -set an aggregator's minimum update delay - -``` -USAGE - $ sbv2 aggregator:set:updateInterval AGGREGATORKEY UPDATEINTERVAL - -ARGUMENTS - AGGREGATORKEY public key of the aggregator account - UPDATEINTERVAL set an aggregator's minimum update delay - -OPTIONS - -a, --authority=authority alternate keypair that is the authority for the aggregator - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -EXAMPLE - $ sbv2 aggregator:set:updateInterval GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR 60 --keypair ../payer-keypair.json -``` - -_See code: [src/commands/aggregator/set/updateInterval.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/aggregator/set/updateInterval.ts)_ - -## `sbv2 aggregator:set:varianceThreshold AGGREGATORKEY VARIANCETHRESHOLD` - -set an aggregator's variance threshold - -``` -USAGE - $ sbv2 aggregator:set:varianceThreshold AGGREGATORKEY VARIANCETHRESHOLD - -ARGUMENTS - AGGREGATORKEY public key of the aggregator - - VARIANCETHRESHOLD percentage change between a previous accepted result and the next round before an oracle reports a - value on-chain. Used to conserve lease cost during low volatility - -OPTIONS - -a, --authority=authority alternate keypair that is the authority for the aggregator - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -ALIASES - $ sbv2 aggregator:set:variance - -EXAMPLE - $ sbv2 aggregator:set:varianceThreshold GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR 0.1 --keypair - ../payer-keypair.json -``` - -_See code: [src/commands/aggregator/set/varianceThreshold.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/aggregator/set/varianceThreshold.ts)_ - -## `sbv2 aggregator:update AGGREGATORKEY` - -request a new aggregator result from a set of oracles - -``` -USAGE - $ sbv2 aggregator:update AGGREGATORKEY - -ARGUMENTS - AGGREGATORKEY public key of the aggregator account to deserialize - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -EXAMPLE - $ sbv2 aggregator:update J7j9xX8JP2B2ErvUzuqGAKBGeggsxPyFXj5MqZcYDxfa --keypair ../payer-keypair.json -``` - -_See code: [src/commands/aggregator/update.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/aggregator/update.ts)_ - -## `sbv2 config:print` - -print cli config - -``` -USAGE - $ sbv2 config:print - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -EXAMPLE - $ sbv2 config:print -``` - -_See code: [src/commands/config/print.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/config/print.ts)_ - -## `sbv2 config:set PARAM [VALUE]` - -set a configuration option - -``` -USAGE - $ sbv2 config:set PARAM [VALUE] - -ARGUMENTS - PARAM (devnet-rpc|mainnet-rpc) configuration parameter to set - VALUE value of the param to set - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -r, --reset remove value or set to default rpc - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with -``` - -_See code: [src/commands/config/set.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/config/set.ts)_ - -## `sbv2 crank:list CRANKKEY` - -list the pubkeys currently on the crank - -``` -USAGE - $ sbv2 crank:list CRANKKEY - -ARGUMENTS - CRANKKEY public key of the crank - -OPTIONS - -f, --outputFile=outputFile output file to save aggregator pubkeys to - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --force overwrite output file if exists - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with -``` - -_See code: [src/commands/crank/list.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/crank/list.ts)_ - -## `sbv2 crank:push CRANKKEY AGGREGATORKEY` +* [`sbv2 version`](#sbv2-version) +* [`sbv2 vrf create [QUEUEKEY]`](#sbv2-vrf-create-queuekey) +* [`sbv2 vrf create example [QUEUEKEY]`](#sbv2-vrf-create-example-queuekey) +* [`sbv2 vrf print [VRFKEY]`](#sbv2-vrf-print-vrfkey) +* [`sbv2 vrf request [VRFKEY]`](#sbv2-vrf-request-vrfkey) +* [`sbv2 vrf watch [VRFKEY]`](#sbv2-vrf-watch-vrfkey) +* [`sbv2 watch aggregator [AGGREGATORKEY]`](#sbv2-watch-aggregator-aggregatorkey) +* [`sbv2 watch vrf [VRFKEY]`](#sbv2-watch-vrf-vrfkey) + +## `sbv2 aggregator add crank [CRANKKEY] [AGGREGATORKEY]` push an aggregator onto a crank ``` USAGE - $ sbv2 crank:push CRANKKEY AGGREGATORKEY + $ sbv2 aggregator add crank [CRANKKEY] [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] ARGUMENTS CRANKKEY public key of the crank AGGREGATORKEY public key of the aggregator -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no alternate authority provided - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - + -u, --rpcUrl= alternate RPC url -v, --verbose log everything - --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with - --programId=programId alternative Switchboard program ID to interact with +DESCRIPTION + push an aggregator onto a crank ALIASES - $ sbv2 aggregator:add:crank - $ sbv2 crank:add:aggregator + $ sbv2 aggregator add crank + $ sbv2 crank add aggregator ``` -_See code: [src/commands/crank/push.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/crank/push.ts)_ +## `sbv2 aggregator add history [AGGREGATORKEY] [SIZE]` -## `sbv2 crank:turn CRANKKEY` +set an aggregator's history buffer account to record the last N accepted results + +``` +USAGE + $ sbv2 aggregator add history [AGGREGATORKEY] [SIZE] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] [-a ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator to add to a crank + SIZE size of history buffer + +FLAGS + -a, --authority= alternate keypair that is the authority for the aggregator + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + set an aggregator's history buffer account to record the last N accepted results + +ALIASES + $ sbv2 aggregator add history + +EXAMPLES + $ sbv2 aggregator:set:history GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR 10000 --keypair ../payer-keypair.json +``` + +## `sbv2 aggregator add job [AGGREGATORKEY]` + +add a job to an aggregator + +``` +USAGE + $ sbv2 aggregator add job [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + [--jobDefinition | --jobKey ] [-a ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account + +FLAGS + -a, --authority= alternate keypair that is the authority for the aggregator + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --jobDefinition= filesystem path of job json definition file + --jobKey= public key of an existing job account to add to an aggregator + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + add a job to an aggregator + +EXAMPLES + $ sbv2 aggregator:add:job +``` + +## `sbv2 aggregator create copy [AGGREGATORSOURCE]` + +copy an aggregator account to a new oracle queue + +``` +USAGE + $ sbv2 aggregator create copy [AGGREGATORSOURCE] --queueKey [-v] [-s] [--mainnetBeta] [-u ] [--programId + ] [-k ] [--force] [-a ] [--minOracles ] [--batchSize ] [--minJobs ] + [--minUpdateDelay ] [--forceReportPeriod ] [--varianceThreshold ] [--crankKey ] + [--enable] [--queueAuthority ] [--copyJobs] + +ARGUMENTS + AGGREGATORSOURCE public key of the aggregator account to copy + +FLAGS + -a, --authority= alternate keypair that will be the aggregator authority + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --batchSize= override source aggregator's oracleRequestBatchSize + --copyJobs create copy of job accounts instead of referincing existing job account + --crankKey= public key of the crank to push aggregator to + --enable set permissions to PERMIT_ORACLE_QUEUE_USAGE + --force skip job confirmation + --forceReportPeriod= override source aggregator's forceReportPeriod + --mainnetBeta WARNING: use mainnet-beta solana cluster + --minJobs= override source aggregator's minJobResults + --minOracles= override source aggregator's minOracleResults + --minUpdateDelay= override source aggregator's minUpdateDelaySeconds + --programId= alternative Switchboard program ID to interact with + --queueAuthority= alternative keypair to use for queue authority + --queueKey= (required) public key of the queue to create aggregator for + --varianceThreshold= override source aggregator's varianceThreshold + +DESCRIPTION + copy an aggregator account to a new oracle queue + +EXAMPLES + $ sbv2 aggregator:create:copy GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR --queueKey 9WZ59yz95bd3XwJxDPVE2PjvVWmSy9WM1NgGD2Hqsohw --keypair ../payer-keypair.json + + $ sbv2 aggregator:create:copy GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR --queueKey 9WZ59yz95bd3XwJxDPVE2PjvVWmSy9WM1NgGD2Hqsohw --keypair ../payer-keypair.json --sourceCluster mainnet-beta + + $ sbv2 aggregator:create:copy FcSmdsdWks75YdyCGegRqXdt5BiNGQKxZywyzb8ckD7D --queueKey 9WZ59yz95bd3XwJxDPVE2PjvVWmSy9WM1NgGD2Hqsohw --keypair ../payer-keypair.json --sourceCluster mainnet-beta +``` + +## `sbv2 aggregator create json [DEFINITIONFILE]` + +create an aggregator from a json file + +``` +USAGE + $ sbv2 aggregator create json [DEFINITIONFILE] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + [--force] [-f ] [-q ] [-a ] + +ARGUMENTS + DEFINITIONFILE filesystem path of queue definition json file + +FLAGS + -a, --authority= alternate keypair that will be the authority for the aggregator + -f, --outputFile= output aggregator definition to a json file + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -q, --queueKey= public key of the oracle queue to create aggregator for + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --force overwrite output file + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + create an aggregator from a json file + +ALIASES + $ sbv2 json create aggregator + +EXAMPLES + $ sbv2 aggregator:create:json examples/aggregator.json --keypair ../payer-keypair.json --queueKey GhYg3R1V6DmJbwuc57qZeoYG6gUuvCotUF1zU3WCj98U --outputFile aggregator.schema.json +``` + +## `sbv2 aggregator history print [AGGREGATORKEY]` + +Print the history buffer associated with an aggregator account + +``` +USAGE + $ sbv2 aggregator history print [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account to fetch permission account and deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + Print the history buffer associated with an aggregator account + +ALIASES + $ sbv2 aggregator history print + $ sbv2 aggregator print history + +EXAMPLES + $ sbv2 aggregator:print:history 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 +``` + +## `sbv2 aggregator lease create [AGGREGATORKEY]` + +fund and re-enable an aggregator lease + +``` +USAGE + $ sbv2 aggregator lease create [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + [--amount ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator to extend a lease for + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --amount= token amount to load into the lease escrow. If decimals provided, amount will be normalized to + raw tokenAmount + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + fund and re-enable an aggregator lease + +ALIASES + $ sbv2 aggregator lease create + +EXAMPLES + $ sbv2 lease:create GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR --amount 1.5 --keypair ../payer-keypair.json +``` + +## `sbv2 aggregator lease extend [AGGREGATORKEY]` + +fund and re-enable an aggregator lease + +``` +USAGE + $ sbv2 aggregator lease extend [AGGREGATORKEY] --amount [-v] [-s] [--mainnetBeta] [-u ] [--programId + ] [-k ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator to extend a lease for + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --amount= (required) token amount to load into the lease escrow. If decimals provided, amount will be + normalized to raw tokenAmount + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + fund and re-enable an aggregator lease + +ALIASES + $ sbv2 aggregator lease extend + +EXAMPLES + $ sbv2 aggregator:lease:extend GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR --amount 1.1 --keypair ../payer-keypair.json +``` + +## `sbv2 aggregator lease print [AGGREGATORKEY]` + +Print the lease account associated with a Switchboard aggregator account + +``` +USAGE + $ sbv2 aggregator lease print [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account to fetch permission account and deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + Print the lease account associated with a Switchboard aggregator account + +ALIASES + $ sbv2 aggregator lease print + $ sbv2 aggregator print lease + +EXAMPLES + $ sbv2 aggregator:lease:print 8SXvChNYFhRq4EZuZvnhjrB3jJRQCv4k3P4W6hesH3Ee +``` + +## `sbv2 aggregator lease withdraw [AGGREGATORKEY]` + +withdraw funds from an aggregator lease + +``` +USAGE + $ sbv2 aggregator lease withdraw [AGGREGATORKEY] --amount [-v] [-s] [--mainnetBeta] [-u ] [--programId + ] [-k ] [--withdrawAddress ] [-a ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator to extend a lease for + +FLAGS + -a, --authority= keypair delegated as the authority for managing the oracle account + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --amount= (required) token amount to withdraw from lease account. If decimals provided, amount will + be normalized to raw tokenAmount + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + --withdrawAddress= tokenAccount to withdraw to. If not provided, payer associated token account will be used + +DESCRIPTION + withdraw funds from an aggregator lease + +ALIASES + $ sbv2 aggregator lease withdraw + +EXAMPLES + $ sbv2 aggregator:lease:withdraw GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR --amount 1.1 --keypair ../payer-keypair.json +``` + +## `sbv2 aggregator lock [AGGREGATORKEY]` + +lock an aggregator's configuration and prevent further changes + +``` +USAGE + $ sbv2 aggregator lock [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + [-a ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account + +FLAGS + -a, --authority= alternate keypair that is the authority for the aggregator + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + lock an aggregator's configuration and prevent further changes +``` + +## `sbv2 aggregator permission create [AGGREGATORKEY]` + +create a permission account for an aggregator + +``` +USAGE + $ sbv2 aggregator permission create [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + create a permission account for an aggregator +``` + +## `sbv2 aggregator permission print [AGGREGATORKEY]` + +Print the permission account associated with a Switchboard aggregator account + +``` +USAGE + $ sbv2 aggregator permission print [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account to fetch permission account and deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + Print the permission account associated with a Switchboard aggregator account + +ALIASES + $ sbv2 aggregator permission print + $ sbv2 aggregator print permission + +EXAMPLES + $ sbv2 aggregator:permission:print 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 +``` + +## `sbv2 aggregator print [AGGREGATORKEY]` + +Print the deserialized Switchboard aggregator account + +``` +USAGE + $ sbv2 aggregator print [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + [--jobs] [-o] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account to deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -o, --oraclePubkeysData print the assigned oracles for the current round + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --jobs output job definitions + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + Print the deserialized Switchboard aggregator account + +ALIASES + $ sbv2 aggregator print + +EXAMPLES + $ sbv2 aggregator:print GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR +``` + +## `sbv2 aggregator print history [AGGREGATORKEY]` + +Print the history buffer associated with an aggregator account + +``` +USAGE + $ sbv2 aggregator print history [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account to fetch permission account and deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + Print the history buffer associated with an aggregator account + +ALIASES + $ sbv2 aggregator history print + $ sbv2 aggregator print history + +EXAMPLES + $ sbv2 aggregator:print:history 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 +``` + +## `sbv2 aggregator print lease [AGGREGATORKEY]` + +Print the lease account associated with a Switchboard aggregator account + +``` +USAGE + $ sbv2 aggregator print lease [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account to fetch permission account and deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + Print the lease account associated with a Switchboard aggregator account + +ALIASES + $ sbv2 aggregator lease print + $ sbv2 aggregator print lease + +EXAMPLES + $ sbv2 aggregator:lease:print 8SXvChNYFhRq4EZuZvnhjrB3jJRQCv4k3P4W6hesH3Ee +``` + +## `sbv2 aggregator print permission [AGGREGATORKEY]` + +Print the permission account associated with a Switchboard aggregator account + +``` +USAGE + $ sbv2 aggregator print permission [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account to fetch permission account and deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + Print the permission account associated with a Switchboard aggregator account + +ALIASES + $ sbv2 aggregator permission print + $ sbv2 aggregator print permission + +EXAMPLES + $ sbv2 aggregator:permission:print 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 +``` + +## `sbv2 aggregator remove job [AGGREGATORKEY] [JOBKEY]` + +remove a switchboard job account from an aggregator + +``` +USAGE + $ sbv2 aggregator remove job [AGGREGATORKEY] [JOBKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] [--force] [-a ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account + JOBKEY public key of an existing job account to remove from an aggregator + +FLAGS + -a, --authority= alternate keypair that is the authority for the aggregator + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --force overwrite outputFile if existing + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + remove a switchboard job account from an aggregator + +EXAMPLES + $ sbv2 aggregator:remove:job +``` + +## `sbv2 aggregator set [AGGREGATORKEY]` + +set an aggregator's config + +``` +USAGE + $ sbv2 aggregator set [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + [-a ] [--forceReportPeriod ] [--minJobs ] [--minOracles ] [--newQueue ] + [--updateInterval ] [--varianceThreshold ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator + +FLAGS + -a, --authority= alternate keypair that is the authority for the aggregator + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --forceReportPeriod= Number of seconds for which, even if the variance threshold is not passed, accept new + responses from oracles. + --mainnetBeta WARNING: use mainnet-beta solana cluster + --minJobs= number of jobs that must respond before an oracle responds + --minOracles= number of oracles that must respond before a value is accepted on-chain + --newQueue= public key of the new oracle queue + --programId= alternative Switchboard program ID to interact with + --updateInterval= set an aggregator's minimum update delay + --varianceThreshold= percentage change between a previous accepted result and the next round before an oracle + reports a value on-chain. Used to conserve lease cost during low volatility + +DESCRIPTION + set an aggregator's config + +ALIASES + $ sbv2 set aggregator + +EXAMPLES + $ sbv2 aggregator:set GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR --updateInterval 300 --minOracles 3 --keypair ../payer-keypair.json +``` + +## `sbv2 aggregator set authority [AGGREGATORKEY] [NEWAUTHORITY]` + +set an aggregator's authority + +``` +USAGE + $ sbv2 aggregator set authority [AGGREGATORKEY] [NEWAUTHORITY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] + [-k ] [-a ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account + NEWAUTHORITY keypair path of new authority + +FLAGS + -a, --currentAuthority= alternate keypair that is the authority for the aggregator + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if + no alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + set an aggregator's authority +``` + +## `sbv2 aggregator set batchSize [AGGREGATORKEY] BATCHSIZE` + +set an aggregator's batch size + +``` +USAGE + $ sbv2 aggregator set batchSize [AGGREGATORKEY] [BATCHSIZE] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] [-a ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account + BATCHSIZE number of oracles requested for each open round call + +FLAGS + -a, --authority= alternate keypair that is the authority for the aggregator + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + set an aggregator's batch size +``` + +## `sbv2 aggregator set forceReport [AGGREGATORKEY] [FORCEREPORTPERIOD]` + +set an aggregator's force report period + +``` +USAGE + $ sbv2 aggregator set forceReport [AGGREGATORKEY] [FORCEREPORTPERIOD] [-v] [-s] [--mainnetBeta] [-u ] [--programId + ] [-k ] [-a ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator + FORCEREPORTPERIOD Number of seconds for which, even if the variance threshold is not passed, accept new responses + from oracles. + +FLAGS + -a, --authority= alternate keypair that is the authority for the aggregator + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + set an aggregator's force report period + +ALIASES + $ sbv2 aggregator set forceReport + +EXAMPLES + $ sbv2 aggregator:set:forceReportPeriod GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR 300 --keypair ../payer-keypair.json +``` + +## `sbv2 aggregator set forceReportPeriod [AGGREGATORKEY] [FORCEREPORTPERIOD]` + +set an aggregator's force report period + +``` +USAGE + $ sbv2 aggregator set forceReportPeriod [AGGREGATORKEY] [FORCEREPORTPERIOD] [-v] [-s] [--mainnetBeta] [-u ] [--programId + ] [-k ] [-a ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator + FORCEREPORTPERIOD Number of seconds for which, even if the variance threshold is not passed, accept new responses + from oracles. + +FLAGS + -a, --authority= alternate keypair that is the authority for the aggregator + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + set an aggregator's force report period + +ALIASES + $ sbv2 aggregator set forceReport + +EXAMPLES + $ sbv2 aggregator:set:forceReportPeriod GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR 300 --keypair ../payer-keypair.json +``` + +## `sbv2 aggregator set history [AGGREGATORKEY] [SIZE]` + +set an aggregator's history buffer account to record the last N accepted results + +``` +USAGE + $ sbv2 aggregator set history [AGGREGATORKEY] [SIZE] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] [-a ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator to add to a crank + SIZE size of history buffer + +FLAGS + -a, --authority= alternate keypair that is the authority for the aggregator + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + set an aggregator's history buffer account to record the last N accepted results + +ALIASES + $ sbv2 aggregator add history + +EXAMPLES + $ sbv2 aggregator:set:history GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR 10000 --keypair ../payer-keypair.json +``` + +## `sbv2 aggregator set minJobs [AGGREGATORKEY] [MINJOBRESULTS]` + +set an aggregator's minimum number of jobs before an oracle responds + +``` +USAGE + $ sbv2 aggregator set minJobs [AGGREGATORKEY] [MINJOBRESULTS] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] + [-k ] [-a ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account + MINJOBRESULTS number of jobs that must respond before an oracle responds + +FLAGS + -a, --authority= alternate keypair that is the authority for the aggregator + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + set an aggregator's minimum number of jobs before an oracle responds +``` + +## `sbv2 aggregator set minOracles [AGGREGATORKEY] [MINORACLERESULTS]` + +set an aggregator's minimum number of oracles that must respond before a result is accepted on-chain + +``` +USAGE + $ sbv2 aggregator set minOracles [AGGREGATORKEY] [MINORACLERESULTS] [-v] [-s] [--mainnetBeta] [-u ] [--programId + ] [-k ] [-a ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account + MINORACLERESULTS number of oracles that must respond before a value is accepted on-chain + +FLAGS + -a, --authority= alternate keypair that is the authority for the aggregator + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + set an aggregator's minimum number of oracles that must respond before a result is accepted on-chain +``` + +## `sbv2 aggregator set queue [AGGREGATORKEY] [QUEUEKEY]` + +set an aggregator's oracle queue + +``` +USAGE + $ sbv2 aggregator set queue [AGGREGATORKEY] [QUEUEKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] [-a ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator + QUEUEKEY public key of the oracle queue + +FLAGS + -a, --authority= alternate keypair that is the authority for the aggregator + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + set an aggregator's oracle queue +``` + +## `sbv2 aggregator set updateInterval [AGGREGATORKEY] [UPDATEINTERVAL]` + +set an aggregator's minimum update delay + +``` +USAGE + $ sbv2 aggregator set updateInterval [AGGREGATORKEY] [UPDATEINTERVAL] [-v] [-s] [--mainnetBeta] [-u ] [--programId + ] [-k ] [-a ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account + UPDATEINTERVAL set an aggregator's minimum update delay + +FLAGS + -a, --authority= alternate keypair that is the authority for the aggregator + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + set an aggregator's minimum update delay + +EXAMPLES + $ sbv2 aggregator:set:updateInterval GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR 60 --keypair ../payer-keypair.json +``` + +## `sbv2 aggregator set variance [AGGREGATORKEY] [VARIANCETHRESHOLD]` + +set an aggregator's variance threshold + +``` +USAGE + $ sbv2 aggregator set variance [AGGREGATORKEY] [VARIANCETHRESHOLD] [-v] [-s] [--mainnetBeta] [-u ] [--programId + ] [-k ] [-a ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator + VARIANCETHRESHOLD percentage change between a previous accepted result and the next round before an oracle reports a + value on-chain. Used to conserve lease cost during low volatility + +FLAGS + -a, --authority= alternate keypair that is the authority for the aggregator + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + set an aggregator's variance threshold + +ALIASES + $ sbv2 aggregator set variance + +EXAMPLES + $ sbv2 aggregator:set:varianceThreshold GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR 0.1 --keypair ../payer-keypair.json +``` + +## `sbv2 aggregator set varianceThreshold [AGGREGATORKEY] [VARIANCETHRESHOLD]` + +set an aggregator's variance threshold + +``` +USAGE + $ sbv2 aggregator set varianceThreshold [AGGREGATORKEY] [VARIANCETHRESHOLD] [-v] [-s] [--mainnetBeta] [-u ] [--programId + ] [-k ] [-a ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator + VARIANCETHRESHOLD percentage change between a previous accepted result and the next round before an oracle reports a + value on-chain. Used to conserve lease cost during low volatility + +FLAGS + -a, --authority= alternate keypair that is the authority for the aggregator + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + set an aggregator's variance threshold + +ALIASES + $ sbv2 aggregator set variance + +EXAMPLES + $ sbv2 aggregator:set:varianceThreshold GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR 0.1 --keypair ../payer-keypair.json +``` + +## `sbv2 aggregator update [AGGREGATORKEY]` + +request a new aggregator result from a set of oracles + +``` +USAGE + $ sbv2 aggregator update [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account to deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + request a new aggregator result from a set of oracles + +EXAMPLES + $ sbv2 aggregator:update J7j9xX8JP2B2ErvUzuqGAKBGeggsxPyFXj5MqZcYDxfa --keypair ../payer-keypair.json +``` + +## `sbv2 aggregator watch [AGGREGATORKEY]` + +watch an aggregator for a new value + +``` +USAGE + $ sbv2 aggregator watch [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account to deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + watch an aggregator for a new value + +ALIASES + $ sbv2 aggregator watch + +EXAMPLES + $ sbv2 watch:aggregator J7j9xX8JP2B2ErvUzuqGAKBGeggsxPyFXj5MqZcYDxfa +``` + +## `sbv2 config print` + +print cli config + +``` +USAGE + $ sbv2 config print [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + print cli config + +EXAMPLES + $ sbv2 config:print +``` + +## `sbv2 config set [PARAM] [VALUE]` + +set a configuration option + +``` +USAGE + $ sbv2 config set [PARAM] [VALUE] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + [-r] + +ARGUMENTS + PARAM (devnet-rpc|mainnet-rpc) configuration parameter to set + VALUE value of the param to set + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -r, --reset remove value or set to default rpc + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + set a configuration option +``` + +## `sbv2 crank add aggregator [CRANKKEY] [AGGREGATORKEY]` + +push an aggregator onto a crank + +``` +USAGE + $ sbv2 crank add aggregator [CRANKKEY] [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] + +ARGUMENTS + CRANKKEY public key of the crank + AGGREGATORKEY public key of the aggregator + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + push an aggregator onto a crank + +ALIASES + $ sbv2 aggregator add crank + $ sbv2 crank add aggregator +``` + +## `sbv2 crank list [CRANKKEY]` + +list the pubkeys currently on the crank + +``` +USAGE + $ sbv2 crank list [CRANKKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + [--force] [-f ] + +ARGUMENTS + CRANKKEY public key of the crank + +FLAGS + -f, --outputFile= output file to save aggregator pubkeys to + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --force overwrite output file if exists + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + list the pubkeys currently on the crank +``` + +## `sbv2 crank print [CRANKKEY]` + +print deserialized switchboard crank account + +``` +USAGE + $ sbv2 crank print [CRANKKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +ARGUMENTS + CRANKKEY public key of the crank account to deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + print deserialized switchboard crank account + +ALIASES + $ sbv2 crank print + +EXAMPLES + $ sbv2 crank:print 85L2cFUvXaeGQ4HrzP8RJEVCL7WvRrXM2msvEmQ82AVr +``` + +## `sbv2 crank push [CRANKKEY] [AGGREGATORKEY]` + +push an aggregator onto a crank + +``` +USAGE + $ sbv2 crank push [CRANKKEY] [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] + +ARGUMENTS + CRANKKEY public key of the crank + AGGREGATORKEY public key of the aggregator + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + push an aggregator onto a crank + +ALIASES + $ sbv2 aggregator add crank + $ sbv2 crank add aggregator +``` + +## `sbv2 crank turn [CRANKKEY]` turn the crank and get rewarded if aggregator updates available ``` USAGE - $ sbv2 crank:turn CRANKKEY + $ sbv2 crank turn [CRANKKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] ARGUMENTS CRANKKEY public key of the crank to turn -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no alternate authority provided - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - + -u, --rpcUrl= alternate RPC url -v, --verbose log everything - --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with - --programId=programId alternative Switchboard program ID to interact with +DESCRIPTION + turn the crank and get rewarded if aggregator updates available -EXAMPLE +EXAMPLES $ sbv2 crank:turn 85L2cFUvXaeGQ4HrzP8RJEVCL7WvRrXM2msvEmQ82AVr --keypair ../payer-keypair.json ``` -_See code: [src/commands/crank/turn.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/crank/turn.ts)_ +## `sbv2 custom queue` + +create a custom queue + +``` +USAGE + $ sbv2 custom queue [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] [--force] [-a + ] [-n ] [--minStake ] [-r ] [-c ] [-o ] [-o ] [--queueSize ] + [--unpermissionedFeeds] [--unpermissionedVrf] [--enableBufferRelayers] [-f ] + +FLAGS + -a, --authority= keypair to delegate authority to for creating permissions targeted at the queue + -c, --crankSize= [default: 100] size of the crank + -f, --outputFile= output queue schema to a json file + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -n, --name= [default: Custom Queue] name of the queue for easier identification + -o, --numOracles= number of oracles to add to the queue + -o, --oracleTimeout= [default: 180] number of oracles to add to the queue + -r, --reward= [default: 0] oracle rewards for successfully responding to an update request + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --enableBufferRelayers enable oracles to fulfill buffer relayer requests + --force overwrite output file if existing + --mainnetBeta WARNING: use mainnet-beta solana cluster + --minStake= [default: 0] minimum stake required by an oracle to join the queue + --programId= alternative Switchboard program ID to interact with + --queueSize= [default: 100] maximum number of oracles the queue can support + --unpermissionedFeeds permit unpermissioned feeds + --unpermissionedVrf permit unpermissioned VRF accounts + +DESCRIPTION + create a custom queue + +ALIASES + $ sbv2 custom queue +``` ## `sbv2 help [COMMAND]` @@ -901,1513 +1358,1195 @@ Display help for sbv2. ``` USAGE - $ sbv2 help [COMMAND] + $ sbv2 help [COMMAND] [-n] ARGUMENTS COMMAND Command to show help for. -OPTIONS +FLAGS -n, --nested-commands Include all nested commands in the output. + +DESCRIPTION + Display help for sbv2. ``` _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.12/src/commands/help.ts)_ -## `sbv2 job:create JOBDEFINITION` +## `sbv2 job create JOBDEFINITION` create a buffer relayer account ``` USAGE - $ sbv2 job:create JOBDEFINITION + $ sbv2 job create [JOBDEFINITION] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + [-a ] [-n ] ARGUMENTS JOBDEFINITION filesystem path to job definition -OPTIONS - -a, --authority=authority alternate keypair that will be the aggregator authority - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -n, --name=name name of the buffer account - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with -``` - -_See code: [src/commands/job/create/index.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/job/create/index.ts)_ - -## `sbv2 job:create:copy JOBSOURCE` - -copy a job account - -``` -USAGE - $ sbv2 job:create:copy JOBSOURCE - -ARGUMENTS - JOBSOURCE public key of the aggregator account to copy - -OPTIONS - -f, --outputFile=outputFile output file to save job definition to - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --force skip job confirmation - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -EXAMPLE - $ sbv2 job:create:copy 7pdb5RVM6cVBU8XDfpGqakb1S4wX2i5QsZxT117tK4HS --keypair ../payer-keypair.json -``` - -_See code: [src/commands/job/create/copy.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/job/create/copy.ts)_ - -## `sbv2 job:create:json DEFINITIONFILE` - -create a job from a json file - -``` -USAGE - $ sbv2 job:create:json DEFINITIONFILE - -ARGUMENTS - DEFINITIONFILE filesystem path of job definition json file - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account - authority if no alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --aggregatorAuthority=aggregatorAuthority filesystem path of aggregator authority keypair to add job account to - - --aggregatorKey=aggregatorKey public key of aggregator to add job to - - --force overwrite output file - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --outputFile=outputFile output job schema to a json file - - --programId=programId alternative Switchboard program ID to interact with - -ALIASES - $ sbv2 json:create:job - -EXAMPLE - $ sbv2 job:create:json examples/job.json --keypair ../payer-keypair.json - --aggregatorAuthority=../aggregator-keypair.json --outputFile=job.schema.json -``` - -_See code: [src/commands/job/create/json.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/job/create/json.ts)_ - -## `sbv2 job:create:template TEMPLATE ID` - -create a new on-chain job account from an existing template - -``` -USAGE - $ sbv2 job:create:template TEMPLATE ID - -ARGUMENTS - TEMPLATE the template type (ftxUs/coinbase/etc) or the filesystem path to the json file containing the task - definitions - - ID api endpoint id for a given source - -OPTIONS - -f, --outputFile=outputFile output file to save job definition to - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -k, --outKeypair=outKeypair existing keypair file to store new account. useful for using the same public key on - different clusters - - -n, --name=name name of the job account for easier identification - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --force skip job confirmation - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -EXAMPLES - $ sbv2 job:create:template ftxUs BTC_USD --keypair ../payer-keypair.json - $ sbv2 job:create:template ftxUs BTC_USD --keypair ../payer-keypair.json --name=ftxUs_Btc - $ sbv2 job:create:template ftxUs BTC_USD -k ../payer-keypair.json -n ftxUs_Btc -f ftx_us_btc_job.json -``` - -_See code: [src/commands/job/create/template.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/job/create/template.ts)_ - -## `sbv2 json:add:aggregator` - -add an aggregator to a schema file - -``` -USAGE - $ sbv2 json:add:aggregator - -OPTIONS - -a, --authority=authority alternate keypair that is the authority for the oracle queue - -a, --schema=schema filesystem path for an oracle queue schema - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority - if no alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --aggregatorFile=aggregatorFile filesystem path of job json definition file - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - - --sourceAggregator=sourceAggregator public key of an existing aggregator account to copy -``` - -_See code: [src/commands/json/add/aggregator.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/json/add/aggregator.ts)_ - -## `sbv2 json:add:crank SCHEMAFILE` - -add a crank to a schema file - -``` -USAGE - $ sbv2 json:add:crank SCHEMAFILE - -ARGUMENTS - SCHEMAFILE filesystem path for an oracle queue schema - -OPTIONS - -a, --authority=authority alternate keypair that is the authority for the oracle queue - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -n, --name=name name of the crank for easier identification - - -r, --maxRows=maxRows maximum number of rows a crank can support - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with -``` - -_See code: [src/commands/json/add/crank.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/json/add/crank.ts)_ - -## `sbv2 json:add:oracle SCHEMAFILE` - -add an oracle to a schema file - -``` -USAGE - $ sbv2 json:add:oracle SCHEMAFILE - -ARGUMENTS - SCHEMAFILE filesystem path for an oracle queue schema - -OPTIONS - -a, --authority=authority alternate keypair that is the authority for the oracle queue - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -n, --name=name name of the crank for easier identification - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with -``` - -_See code: [src/commands/json/add/oracle.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/json/add/oracle.ts)_ - -## `sbv2 json:create:queue INPUTFILE OUTPUTFILE` - -create an oracle queue from a json file - -``` -USAGE - $ sbv2 json:create:queue INPUTFILE OUTPUTFILE - -ARGUMENTS - INPUTFILE filesystem path of queue definition json file - OUTPUTFILE filesystem path of output file to quickly load the queue - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --authority=authority alternate keypair that will be the authority for any created accounts - - --force overwrite output file - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -ALIASES - $ sbv2 queue:create:json - -EXAMPLE - $ sbv2 json:create:queue examples/queue.json queue-1.json -k ../authority-keypair.json -``` - -_See code: [src/commands/json/create/queue.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/json/create/queue.ts)_ - -## `sbv2 lease:create AGGREGATORKEY` - -fund and re-enable an aggregator lease - -``` -USAGE - $ sbv2 lease:create AGGREGATORKEY - -ARGUMENTS - AGGREGATORKEY public key of the aggregator to extend a lease for - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --amount=amount token amount to load into the lease escrow. If decimals provided, amount will be normalized to - raw tokenAmount - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -ALIASES - $ sbv2 aggregator:lease:create - -EXAMPLE - $ sbv2 lease:create GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR --amount 1.5 --keypair ../payer-keypair.json -``` - -_See code: [src/commands/lease/create.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/lease/create.ts)_ - -## `sbv2 lease:extend AGGREGATORKEY` - -fund and re-enable an aggregator lease - -``` -USAGE - $ sbv2 lease:extend AGGREGATORKEY - -ARGUMENTS - AGGREGATORKEY public key of the aggregator to extend a lease for - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --amount=amount (required) token amount to load into the lease escrow. If decimals provided, amount will be - normalized to raw tokenAmount - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -ALIASES - $ sbv2 aggregator:lease:extend - -EXAMPLE - $ sbv2 aggregator:lease:extend GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR --amount 1.1 --keypair - ../payer-keypair.json -``` - -_See code: [src/commands/lease/extend.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/lease/extend.ts)_ - -## `sbv2 lease:withdraw AGGREGATORKEY` - -withdraw funds from an aggregator lease - -``` -USAGE - $ sbv2 lease:withdraw AGGREGATORKEY - -ARGUMENTS - AGGREGATORKEY public key of the aggregator to extend a lease for - -OPTIONS - -a, --authority=authority keypair delegated as the authority for managing the oracle account - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority - if no alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --amount=amount (required) token amount to withdraw from lease account. If decimals provided, - amount will be normalized to raw tokenAmount - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - - --withdrawAddress=withdrawAddress tokenAccount to withdraw to. If not provided, payer associated token account will - be used - -ALIASES - $ sbv2 aggregator:lease:withdraw - -EXAMPLE - $ sbv2 aggregator:lease:withdraw GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR --amount 1.1 --keypair - ../payer-keypair.json -``` - -_See code: [src/commands/lease/withdraw.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/lease/withdraw.ts)_ - -## `sbv2 localnet:env` - -create a localnet switchboard environment - -``` -USAGE - $ sbv2 localnet:env - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -o, --outputDir=outputDir output directory for scripts - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --force overwrite output file if existing - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with -``` - -_See code: [src/commands/localnet/env.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/localnet/env.ts)_ - -## `sbv2 oracle:balance ORACLEKEY` - -check an oracles token balance - -``` -USAGE - $ sbv2 oracle:balance ORACLEKEY - -ARGUMENTS - ORACLEKEY public key of the oracle to check token balance - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -EXAMPLE - $ sbv2 oracle:balance 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 -``` - -_See code: [src/commands/oracle/balance.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/oracle/balance.ts)_ - -## `sbv2 oracle:create QUEUEKEY` - -create a new oracle account for a given queue - -``` -USAGE - $ sbv2 oracle:create QUEUEKEY - -ARGUMENTS - QUEUEKEY public key of the oracle queue to join - -OPTIONS - -a, --authority=authority keypair to delegate authority to for managing the oracle account - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if - no alternate authority provided - - -n, --name=name name of the oracle for easier identification - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --enable enable oracle heartbeat permissions - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - - --queueAuthority=queueAuthority alternative keypair to use for queue authority - -EXAMPLES - $ sbv2 oracle:create GhYg3R1V6DmJbwuc57qZeoYG6gUuvCotUF1zU3WCj98U --keypair ../payer-and-authority-keypair.json - $ sbv2 oracle:create GhYg3R1V6DmJbwuc57qZeoYG6gUuvCotUF1zU3WCj98U --name=oracle-1 --keypair - ../payer-and-authority-keypair.json - $ sbv2 oracle:create GhYg3R1V6DmJbwuc57qZeoYG6gUuvCotUF1zU3WCj98U --keypair ../payer-keypair.json --authority - ../oracle-keypair.json -``` - -_See code: [src/commands/oracle/create.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/oracle/create.ts)_ - -## `sbv2 oracle:deposit ORACLEKEY` - -deposit tokens into an oracle's token wallet - -``` -USAGE - $ sbv2 oracle:deposit ORACLEKEY - -ARGUMENTS - ORACLEKEY public key of the oracle to deposit funds into - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --amount=amount (required) token amount to load into the oracle escrow. If decimals provided, amount will be - normalized to raw tokenAmount - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -EXAMPLE - $ sbv2 oracle:deposit 6kPsQoufdugtHLjM4fH7Z2fNv7jLt5pgvwKHt5JvRhQ6 2500 --keypair ../payer-keypair.json -``` - -_See code: [src/commands/oracle/deposit.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/oracle/deposit.ts)_ - -## `sbv2 oracle:nonce ORACLEKEY` - -view an oracles nonce accounts - -``` -USAGE - $ sbv2 oracle:nonce ORACLEKEY - -ARGUMENTS - ORACLEKEY public key of the oracle to check token balance - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with -``` - -_See code: [src/commands/oracle/nonce/index.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/oracle/nonce/index.ts)_ - -## `sbv2 oracle:permission:create ORACLEKEY` - -create a permission account for an oracle - -``` -USAGE - $ sbv2 oracle:permission:create ORACLEKEY - -ARGUMENTS - ORACLEKEY public key of the oracle account - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with -``` - -_See code: [src/commands/oracle/permission/create.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/oracle/permission/create.ts)_ - -## `sbv2 oracle:withdraw ORACLEKEY` - -withdraw tokens from an oracle's token wallet - -``` -USAGE - $ sbv2 oracle:withdraw ORACLEKEY - -ARGUMENTS - ORACLEKEY public key of the oracle to withdraw from - -OPTIONS - -a, --authority=authority keypair delegated as the authority for managing the oracle account - -f, --force skip minStake balance check. your oracle may be removed from the queue - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account - authority if no alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - -w, --withdrawAccount=withdrawAccount optional solana pubkey or keypair filesystem path to withdraw funds to. default - destination is oracle authority's token wallet - - --amount=amount (required) token amount to withdraw from oracle escrow. If decimals provided, - amount will be normalized to raw tokenAmount - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -EXAMPLES - $ sbv2 oracle:withdraw 6kPsQoufdugtHLjM4fH7Z2fNv7jLt5pgvwKHt5JvRhQ6 2500 --keypair ../oracle-keypair.json - $ sbv2 oracle:withdraw 6kPsQoufdugtHLjM4fH7Z2fNv7jLt5pgvwKHt5JvRhQ6 2500 --keypair ../payer-keypair.json --authority - ../oracle-keypair.json -w ByJs8E29jxvqf2KFLwfyiE2gUh5fivaS7aShcRMAsnzg -``` - -_See code: [src/commands/oracle/withdraw.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/oracle/withdraw.ts)_ - -## `sbv2 permission:create GRANTER GRANTEE` - -create a permission account - -``` -USAGE - $ sbv2 permission:create GRANTER GRANTEE - -ARGUMENTS - GRANTER public key of the account granting permission - GRANTEE public key of the account getting permissions - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with -``` - -_See code: [src/commands/permission/create.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/permission/create.ts)_ - -## `sbv2 permission:set PERMISSIONKEY` - -permit a grantee to use a granters resources - -``` -USAGE - $ sbv2 permission:set PERMISSIONKEY - -ARGUMENTS - PERMISSIONKEY public key of the permission account - -OPTIONS - -a, --authority=authority alternate keypair that is the granters authority - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --disable disable permissions - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with -``` - -_See code: [src/commands/permission/set.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/permission/set.ts)_ - -## `sbv2 print PUBLICKEY` - -find a switchboard account by public key for a given cluster - -``` -USAGE - $ sbv2 print PUBLICKEY - -ARGUMENTS - PUBLICKEY public key of a switchboard account to lookup - -OPTIONS - -h, --help show CLI help - -v, --verbose log everything - -EXAMPLE - $ sbv2 print GhYg3R1V6DmJbwuc57qZeoYG6gUuvCotUF1zU3WCj98U -``` - -_See code: [src/commands/print/index.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/print/index.ts)_ - -## `sbv2 print:aggregator AGGREGATORKEY` - -Print the deserialized Switchboard aggregator account - -``` -USAGE - $ sbv2 print:aggregator AGGREGATORKEY - -ARGUMENTS - AGGREGATORKEY public key of the aggregator account to deserialize - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no +FLAGS + -a, --authority= alternate keypair that will be the aggregator authority + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no alternate authority provided - - -o, --oraclePubkeysData print the assigned oracles for the current round - + -n, --name= name of the buffer account -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - + -u, --rpcUrl= alternate RPC url -v, --verbose log everything - - --jobs output job definitions - --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with - --programId=programId alternative Switchboard program ID to interact with - -ALIASES - $ sbv2 aggregator:print - -EXAMPLE - $ sbv2 aggregator:print GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR +DESCRIPTION + create a buffer relayer account ``` -_See code: [src/commands/print/aggregator.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/print/aggregator.ts)_ - -## `sbv2 print:aggregator:history AGGREGATORKEY` - -Print the history buffer associated with an aggregator account - -``` -USAGE - $ sbv2 print:aggregator:history AGGREGATORKEY - -ARGUMENTS - AGGREGATORKEY public key of the aggregator account to fetch permission account and deserialize - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -ALIASES - $ sbv2 aggregator:history:print - $ sbv2 aggregator:print:history - -EXAMPLE - $ sbv2 aggregator:print:history 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 -``` - -_See code: [src/commands/print/aggregator/history.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/print/aggregator/history.ts)_ - -## `sbv2 print:aggregator:lease AGGREGATORKEY` - -Print the lease account associated with a Switchboard aggregator account - -``` -USAGE - $ sbv2 print:aggregator:lease AGGREGATORKEY - -ARGUMENTS - AGGREGATORKEY public key of the aggregator account to fetch permission account and deserialize - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -ALIASES - $ sbv2 aggregator:lease:print - $ sbv2 aggregator:print:lease - -EXAMPLE - $ sbv2 aggregator:lease:print 8SXvChNYFhRq4EZuZvnhjrB3jJRQCv4k3P4W6hesH3Ee -``` - -_See code: [src/commands/print/aggregator/lease.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/print/aggregator/lease.ts)_ - -## `sbv2 print:aggregator:permission AGGREGATORKEY` - -Print the permission account associated with a Switchboard aggregator account - -``` -USAGE - $ sbv2 print:aggregator:permission AGGREGATORKEY - -ARGUMENTS - AGGREGATORKEY public key of the aggregator account to fetch permission account and deserialize - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -ALIASES - $ sbv2 aggregator:permission:print - $ sbv2 aggregator:print:permission - -EXAMPLE - $ sbv2 aggregator:permission:print 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 -``` - -_See code: [src/commands/print/aggregator/permission.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/print/aggregator/permission.ts)_ - -## `sbv2 print:crank CRANKKEY` - -print deserialized switchboard crank account - -``` -USAGE - $ sbv2 print:crank CRANKKEY - -ARGUMENTS - CRANKKEY public key of the crank account to deserialize - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -ALIASES - $ sbv2 crank:print - -EXAMPLE - $ sbv2 crank:print 85L2cFUvXaeGQ4HrzP8RJEVCL7WvRrXM2msvEmQ82AVr -``` - -_See code: [src/commands/print/crank.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/print/crank.ts)_ - -## `sbv2 print:job JOBKEY` +## `sbv2 job print [JOBKEY]` Print the deserialized Switchboard job account ``` USAGE - $ sbv2 print:job JOBKEY + $ sbv2 job print [JOBKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] ARGUMENTS JOBKEY public key of the job account to deserialize -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no alternate authority provided - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - + -u, --rpcUrl= alternate RPC url -v, --verbose log everything - --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with - --programId=programId alternative Switchboard program ID to interact with +DESCRIPTION + Print the deserialized Switchboard job account ALIASES - $ sbv2 job:print + $ sbv2 job print -EXAMPLE +EXAMPLES $ sbv2 job:print SzTvFZLz3hwjZFMwVWzuEnr1oUF6qyvXwXCvsqf7qeA ``` -_See code: [src/commands/print/job.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/print/job.ts)_ +## `sbv2 json create aggregator [DEFINITIONFILE]` -## `sbv2 print:job:templates` - -list available templates to build a job from +create an aggregator from a json file ``` USAGE - $ sbv2 print:job:templates - -ALIASES - $ sbv2 job:print:templates -``` - -_See code: [src/commands/print/job/templates.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/print/job/templates.ts)_ - -## `sbv2 print:json:samples OUTPUTDIRECTORY` - -write sample definition files to a directory - -``` -USAGE - $ sbv2 print:json:samples OUTPUTDIRECTORY + $ sbv2 json create aggregator [DEFINITIONFILE] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + [--force] [-f ] [-q ] [-a ] ARGUMENTS - OUTPUTDIRECTORY filesystem path to output sample definition files + DEFINITIONFILE filesystem path of queue definition json file -OPTIONS - -h, --help show CLI help +FLAGS + -a, --authority= alternate keypair that will be the authority for the aggregator + -f, --outputFile= output aggregator definition to a json file + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -q, --queueKey= public key of the oracle queue to create aggregator for + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --force overwrite output file + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with +DESCRIPTION + create an aggregator from a json file ALIASES - $ sbv2 json:samples - $ sbv2 write:json:samples + $ sbv2 json create aggregator EXAMPLES - $ sbv2 print:json:samples ~/switchboard_json_samples - $ sbv2 json:samples ~/switchboard_json_samples - $ sbv2 write:json:samples ~/switchboard_json_samples + $ sbv2 aggregator:create:json examples/aggregator.json --keypair ../payer-keypair.json --queueKey GhYg3R1V6DmJbwuc57qZeoYG6gUuvCotUF1zU3WCj98U --outputFile aggregator.schema.json ``` -_See code: [src/commands/print/json/samples.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/print/json/samples.ts)_ +## `sbv2 lease create [AGGREGATORKEY]` -## `sbv2 print:oracle ORACLEKEY` - -Print the deserialized Switchboard oracle account +fund and re-enable an aggregator lease ``` USAGE - $ sbv2 print:oracle ORACLEKEY + $ sbv2 lease create [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + [--amount ] ARGUMENTS - ORACLEKEY public key of the oracle account to deserialize + AGGREGATORKEY public key of the aggregator to extend a lease for -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no alternate authority provided - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - + -u, --rpcUrl= alternate RPC url -v, --verbose log everything - + --amount= token amount to load into the lease escrow. If decimals provided, amount will be normalized to + raw tokenAmount --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with - --programId=programId alternative Switchboard program ID to interact with +DESCRIPTION + fund and re-enable an aggregator lease ALIASES - $ sbv2 oracle:print + $ sbv2 aggregator lease create -EXAMPLE - $ sbv2 oracle:print 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 +EXAMPLES + $ sbv2 lease:create GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR --amount 1.5 --keypair ../payer-keypair.json ``` -_See code: [src/commands/print/oracle.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/print/oracle.ts)_ +## `sbv2 lease extend [AGGREGATORKEY]` -## `sbv2 print:oracle:permission ORACLEKEY` +fund and re-enable an aggregator lease + +``` +USAGE + $ sbv2 lease extend [AGGREGATORKEY] --amount [-v] [-s] [--mainnetBeta] [-u ] [--programId + ] [-k ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator to extend a lease for + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --amount= (required) token amount to load into the lease escrow. If decimals provided, amount will be + normalized to raw tokenAmount + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + fund and re-enable an aggregator lease + +ALIASES + $ sbv2 aggregator lease extend + +EXAMPLES + $ sbv2 aggregator:lease:extend GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR --amount 1.1 --keypair ../payer-keypair.json +``` + +## `sbv2 lease withdraw [AGGREGATORKEY]` + +withdraw funds from an aggregator lease + +``` +USAGE + $ sbv2 lease withdraw [AGGREGATORKEY] --amount [-v] [-s] [--mainnetBeta] [-u ] [--programId + ] [-k ] [--withdrawAddress ] [-a ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator to extend a lease for + +FLAGS + -a, --authority= keypair delegated as the authority for managing the oracle account + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --amount= (required) token amount to withdraw from lease account. If decimals provided, amount will + be normalized to raw tokenAmount + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + --withdrawAddress= tokenAccount to withdraw to. If not provided, payer associated token account will be used + +DESCRIPTION + withdraw funds from an aggregator lease + +ALIASES + $ sbv2 aggregator lease withdraw + +EXAMPLES + $ sbv2 aggregator:lease:withdraw GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR --amount 1.1 --keypair ../payer-keypair.json +``` + +## `sbv2 localnet env` + +create a localnet switchboard environment + +``` +USAGE + $ sbv2 localnet env [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] [--force] [-o + ] + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -o, --outputDir= output directory for scripts + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --force overwrite output file if existing + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + create a localnet switchboard environment +``` + +## `sbv2 oracle balance [ORACLEKEY]` + +check an oracles token balance + +``` +USAGE + $ sbv2 oracle balance [ORACLEKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +ARGUMENTS + ORACLEKEY public key of the oracle to check token balance + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + check an oracles token balance + +EXAMPLES + $ sbv2 oracle:balance 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 +``` + +## `sbv2 oracle create [QUEUEKEY]` + +create a new oracle account for a given queue + +``` +USAGE + $ sbv2 oracle create [QUEUEKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] [-n + ] [-a ] [--enable] [--queueAuthority ] + +ARGUMENTS + QUEUEKEY public key of the oracle queue to join + +FLAGS + -a, --authority= keypair to delegate authority to for managing the oracle account + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -n, --name= name of the oracle for easier identification + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --enable enable oracle heartbeat permissions + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + --queueAuthority= alternative keypair to use for queue authority + +DESCRIPTION + create a new oracle account for a given queue + +EXAMPLES + $ sbv2 oracle:create GhYg3R1V6DmJbwuc57qZeoYG6gUuvCotUF1zU3WCj98U --keypair ../payer-and-authority-keypair.json + + $ sbv2 oracle:create GhYg3R1V6DmJbwuc57qZeoYG6gUuvCotUF1zU3WCj98U --name=oracle-1 --keypair ../payer-and-authority-keypair.json + + $ sbv2 oracle:create GhYg3R1V6DmJbwuc57qZeoYG6gUuvCotUF1zU3WCj98U --keypair ../payer-keypair.json --authority ../oracle-keypair.json +``` + +## `sbv2 oracle deposit [ORACLEKEY]` + +deposit tokens into an oracle's token wallet + +``` +USAGE + $ sbv2 oracle deposit [ORACLEKEY] --amount [-v] [-s] [--mainnetBeta] [-u ] [--programId ] + [-k ] + +ARGUMENTS + ORACLEKEY public key of the oracle to deposit funds into + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --amount= (required) token amount to load into the oracle escrow. If decimals provided, amount will be + normalized to raw tokenAmount + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + deposit tokens into an oracle's token wallet + +EXAMPLES + $ sbv2 oracle:deposit 6kPsQoufdugtHLjM4fH7Z2fNv7jLt5pgvwKHt5JvRhQ6 2500 --keypair ../payer-keypair.json +``` + +## `sbv2 oracle nonce [ORACLEKEY]` + +view an oracles nonce accounts + +``` +USAGE + $ sbv2 oracle nonce [ORACLEKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +ARGUMENTS + ORACLEKEY public key of the oracle to check token balance + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + view an oracles nonce accounts +``` + +## `sbv2 oracle permission create [ORACLEKEY]` + +create a permission account for an oracle + +``` +USAGE + $ sbv2 oracle permission create [ORACLEKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +ARGUMENTS + ORACLEKEY public key of the oracle account + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + create a permission account for an oracle +``` + +## `sbv2 oracle permission print [ORACLEKEY]` Print the permission account associated with a Switchboard oracle account ``` USAGE - $ sbv2 print:oracle:permission ORACLEKEY + $ sbv2 oracle permission print [ORACLEKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] ARGUMENTS ORACLEKEY public key of the oracle account to fetch permission account and deserialize -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no alternate authority provided - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - + -u, --rpcUrl= alternate RPC url -v, --verbose log everything - --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with - --programId=programId alternative Switchboard program ID to interact with +DESCRIPTION + Print the permission account associated with a Switchboard oracle account ALIASES - $ sbv2 oracle:permission:print - $ sbv2 oracle:print:permission + $ sbv2 oracle permission print + $ sbv2 oracle print permission -EXAMPLE +EXAMPLES $ sbv2 oracle:permission:print 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 ``` -_See code: [src/commands/print/oracle/permission.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/print/oracle/permission.ts)_ +## `sbv2 oracle print [ORACLEKEY]` -## `sbv2 print:program` +Print the deserialized Switchboard oracle account + +``` +USAGE + $ sbv2 oracle print [ORACLEKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +ARGUMENTS + ORACLEKEY public key of the oracle account to deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + Print the deserialized Switchboard oracle account + +ALIASES + $ sbv2 oracle print + +EXAMPLES + $ sbv2 oracle:print 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 +``` + +## `sbv2 oracle print permission [ORACLEKEY]` + +Print the permission account associated with a Switchboard oracle account + +``` +USAGE + $ sbv2 oracle print permission [ORACLEKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +ARGUMENTS + ORACLEKEY public key of the oracle account to fetch permission account and deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + Print the permission account associated with a Switchboard oracle account + +ALIASES + $ sbv2 oracle permission print + $ sbv2 oracle print permission + +EXAMPLES + $ sbv2 oracle:permission:print 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 +``` + +## `sbv2 oracle withdraw [ORACLEKEY]` + +withdraw tokens from an oracle's token wallet + +``` +USAGE + $ sbv2 oracle withdraw [ORACLEKEY] --amount [-v] [-s] [--mainnetBeta] [-u ] [--programId ] + [-k ] [-f] [-w ] [-a ] + +ARGUMENTS + ORACLEKEY public key of the oracle to withdraw from + +FLAGS + -a, --authority= keypair delegated as the authority for managing the oracle account + -f, --force skip minStake balance check. your oracle may be removed from the queue + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + -w, --withdrawAccount= optional solana pubkey or keypair filesystem path to withdraw funds to. default + destination is oracle authority's token wallet + --amount= (required) token amount to withdraw from oracle escrow. If decimals provided, amount + will be normalized to raw tokenAmount + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + withdraw tokens from an oracle's token wallet + +EXAMPLES + $ sbv2 oracle:withdraw 6kPsQoufdugtHLjM4fH7Z2fNv7jLt5pgvwKHt5JvRhQ6 2500 --keypair ../oracle-keypair.json + + $ sbv2 oracle:withdraw 6kPsQoufdugtHLjM4fH7Z2fNv7jLt5pgvwKHt5JvRhQ6 2500 --keypair ../payer-keypair.json --authority ../oracle-keypair.json -w ByJs8E29jxvqf2KFLwfyiE2gUh5fivaS7aShcRMAsnzg +``` + +## `sbv2 permission create [GRANTER] [GRANTEE]` + +create a permission account + +``` +USAGE + $ sbv2 permission create [GRANTER] [GRANTEE] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +ARGUMENTS + GRANTER public key of the account granting permission + GRANTEE public key of the account getting permissions + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + create a permission account +``` + +## `sbv2 permission set [PERMISSIONKEY]` + +permit a grantee to use a granters resources + +``` +USAGE + $ sbv2 permission set [PERMISSIONKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + [-a ] [--disable] + +ARGUMENTS + PERMISSIONKEY public key of the permission account + +FLAGS + -a, --authority= alternate keypair that is the granters authority + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --disable disable permissions + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + permit a grantee to use a granters resources +``` + +## `sbv2 print [PUBLICKEY]` + +find a switchboard account by public key for a given cluster + +``` +USAGE + $ sbv2 print [PUBLICKEY] [-h] [-v] + +ARGUMENTS + PUBLICKEY public key of a switchboard account to lookup + +FLAGS + -h, --help Show CLI help. + -v, --verbose log everything + +DESCRIPTION + find a switchboard account by public key for a given cluster + +EXAMPLES + $ sbv2 print GhYg3R1V6DmJbwuc57qZeoYG6gUuvCotUF1zU3WCj98U +``` + +_See code: [dist/commands/print/index.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.2.0/dist/commands/print/index.ts)_ + +## `sbv2 print aggregator [AGGREGATORKEY]` + +Print the deserialized Switchboard aggregator account + +``` +USAGE + $ sbv2 print aggregator [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + [--jobs] [-o] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account to deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -o, --oraclePubkeysData print the assigned oracles for the current round + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --jobs output job definitions + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + Print the deserialized Switchboard aggregator account + +ALIASES + $ sbv2 aggregator print + +EXAMPLES + $ sbv2 aggregator:print GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR +``` + +## `sbv2 print aggregator history [AGGREGATORKEY]` + +Print the history buffer associated with an aggregator account + +``` +USAGE + $ sbv2 print aggregator history [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account to fetch permission account and deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + Print the history buffer associated with an aggregator account + +ALIASES + $ sbv2 aggregator history print + $ sbv2 aggregator print history + +EXAMPLES + $ sbv2 aggregator:print:history 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 +``` + +## `sbv2 print aggregator lease [AGGREGATORKEY]` + +Print the lease account associated with a Switchboard aggregator account + +``` +USAGE + $ sbv2 print aggregator lease [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account to fetch permission account and deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + Print the lease account associated with a Switchboard aggregator account + +ALIASES + $ sbv2 aggregator lease print + $ sbv2 aggregator print lease + +EXAMPLES + $ sbv2 aggregator:lease:print 8SXvChNYFhRq4EZuZvnhjrB3jJRQCv4k3P4W6hesH3Ee +``` + +## `sbv2 print aggregator permission [AGGREGATORKEY]` + +Print the permission account associated with a Switchboard aggregator account + +``` +USAGE + $ sbv2 print aggregator permission [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account to fetch permission account and deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + Print the permission account associated with a Switchboard aggregator account + +ALIASES + $ sbv2 aggregator permission print + $ sbv2 aggregator print permission + +EXAMPLES + $ sbv2 aggregator:permission:print 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 +``` + +## `sbv2 print crank [CRANKKEY]` + +print deserialized switchboard crank account + +``` +USAGE + $ sbv2 print crank [CRANKKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +ARGUMENTS + CRANKKEY public key of the crank account to deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + print deserialized switchboard crank account + +ALIASES + $ sbv2 crank print + +EXAMPLES + $ sbv2 crank:print 85L2cFUvXaeGQ4HrzP8RJEVCL7WvRrXM2msvEmQ82AVr +``` + +## `sbv2 print job [JOBKEY]` + +Print the deserialized Switchboard job account + +``` +USAGE + $ sbv2 print job [JOBKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +ARGUMENTS + JOBKEY public key of the job account to deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + Print the deserialized Switchboard job account + +ALIASES + $ sbv2 job print + +EXAMPLES + $ sbv2 job:print SzTvFZLz3hwjZFMwVWzuEnr1oUF6qyvXwXCvsqf7qeA +``` + +## `sbv2 print oracle [ORACLEKEY]` + +Print the deserialized Switchboard oracle account + +``` +USAGE + $ sbv2 print oracle [ORACLEKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +ARGUMENTS + ORACLEKEY public key of the oracle account to deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + Print the deserialized Switchboard oracle account + +ALIASES + $ sbv2 oracle print + +EXAMPLES + $ sbv2 oracle:print 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 +``` + +## `sbv2 print oracle permission [ORACLEKEY]` + +Print the permission account associated with a Switchboard oracle account + +``` +USAGE + $ sbv2 print oracle permission [ORACLEKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +ARGUMENTS + ORACLEKEY public key of the oracle account to fetch permission account and deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + Print the permission account associated with a Switchboard oracle account + +ALIASES + $ sbv2 oracle permission print + $ sbv2 oracle print permission + +EXAMPLES + $ sbv2 oracle:permission:print 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 +``` + +## `sbv2 print program` print the deserialized switchboard program state account ``` USAGE - $ sbv2 print:program + $ sbv2 print program [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no alternate authority provided - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - + -u, --rpcUrl= alternate RPC url -v, --verbose log everything - --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with - --programId=programId alternative Switchboard program ID to interact with +DESCRIPTION + print the deserialized switchboard program state account ALIASES - $ sbv2 program:print + $ sbv2 program print -EXAMPLE +EXAMPLES $ sbv2 program:print ``` -_See code: [src/commands/print/program.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/print/program.ts)_ - -## `sbv2 print:queue QUEUEKEY` +## `sbv2 print queue [QUEUEKEY]` Print the deserialized Switchboard oraclequeue account ``` USAGE - $ sbv2 print:queue QUEUEKEY + $ sbv2 print queue [QUEUEKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + [--oracles] ARGUMENTS QUEUEKEY public key of the oracle queue account to deserialize -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no alternate authority provided - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - + -u, --rpcUrl= alternate RPC url -v, --verbose log everything - --mainnetBeta WARNING: use mainnet-beta solana cluster - --oracles output oracles that are heartbeating on the queue + --programId= alternative Switchboard program ID to interact with - --programId=programId alternative Switchboard program ID to interact with +DESCRIPTION + Print the deserialized Switchboard oraclequeue account ALIASES - $ sbv2 queue:print + $ sbv2 queue print -EXAMPLE +EXAMPLES $ sbv2 queue:print GhYg3R1V6DmJbwuc57qZeoYG6gUuvCotUF1zU3WCj98U ``` -_See code: [src/commands/print/queue.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/print/queue.ts)_ - -## `sbv2 print:vrf VRFKEY` +## `sbv2 print vrf [VRFKEY]` Print the deserialized Switchboard VRF account ``` USAGE - $ sbv2 print:vrf VRFKEY + $ sbv2 print vrf [VRFKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] ARGUMENTS VRFKEY public key of the vrf account to deserialize -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no alternate authority provided - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - + -u, --rpcUrl= alternate RPC url -v, --verbose log everything - --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with - --programId=programId alternative Switchboard program ID to interact with +DESCRIPTION + Print the deserialized Switchboard VRF account ALIASES - $ sbv2 vrf:print + $ sbv2 vrf print -EXAMPLE +EXAMPLES $ sbv2 vrf:print SzTvFZLz3hwjZFMwVWzuEnr1oUF6qyvXwXCvsqf7qeA ``` -_See code: [src/commands/print/vrf.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/print/vrf.ts)_ +## `sbv2 program print` -## `sbv2 queue:add:crank QUEUEKEY` +print the deserialized switchboard program state account + +``` +USAGE + $ sbv2 program print [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + print the deserialized switchboard program state account + +ALIASES + $ sbv2 program print + +EXAMPLES + $ sbv2 program:print +``` + +## `sbv2 queue add crank [QUEUEKEY]` add a crank to an existing oracle queue ``` USAGE - $ sbv2 queue:add:crank QUEUEKEY + $ sbv2 queue add crank [QUEUEKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] [-n + ] [-r ] [--queueAuthority ] ARGUMENTS QUEUEKEY public key of the oracle queue to create a crank on -OPTIONS - -h, --help show CLI help +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -n, --name= name of the crank for easier identification + -r, --maxRows= maximum number of rows a crank can support + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + --queueAuthority= alternative keypair to use for queue authority - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if - no alternate authority provided +DESCRIPTION + add a crank to an existing oracle queue - -n, --name=name name of the crank for easier identification - - -r, --maxRows=maxRows maximum number of rows a crank can support - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - - --queueAuthority=queueAuthority alternative keypair to use for queue authority - -EXAMPLE +EXAMPLES $ sbv2 queue:add:crank 5aYuxRdcB9GpWrEXVMBQp2R5uf94uoBiFdMEBwcmHuU4 -k ../authority-keypair.json -n crank-1 ``` -_See code: [src/commands/queue/add/crank.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/queue/add/crank.ts)_ - -## `sbv2 queue:create` +## `sbv2 queue create` create a custom queue ``` USAGE - $ sbv2 queue:create + $ sbv2 queue create [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] [--force] [-a + ] [-n ] [--minStake ] [-r ] [-c ] [-o ] [-o ] [--queueSize ] + [--unpermissionedFeeds] [--unpermissionedVrf] [--enableBufferRelayers] [-f ] -OPTIONS - -a, --authority=authority keypair to delegate authority to for creating permissions targeted at the queue - -c, --crankSize=crankSize [default: 100] size of the crank - -f, --outputFile=outputFile output queue schema to a json file - -h, --help show CLI help +FLAGS + -a, --authority= keypair to delegate authority to for creating permissions targeted at the queue + -c, --crankSize= [default: 100] size of the crank + -f, --outputFile= output queue schema to a json file + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -n, --name= [default: Custom Queue] name of the queue for easier identification + -o, --numOracles= number of oracles to add to the queue + -o, --oracleTimeout= [default: 180] number of oracles to add to the queue + -r, --reward= [default: 0] oracle rewards for successfully responding to an update request + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --enableBufferRelayers enable oracles to fulfill buffer relayer requests + --force overwrite output file if existing + --mainnetBeta WARNING: use mainnet-beta solana cluster + --minStake= [default: 0] minimum stake required by an oracle to join the queue + --programId= alternative Switchboard program ID to interact with + --queueSize= [default: 100] maximum number of oracles the queue can support + --unpermissionedFeeds permit unpermissioned feeds + --unpermissionedVrf permit unpermissioned VRF accounts - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority - if no alternate authority provided - - -n, --name=name [default: Custom Queue] name of the queue for easier identification - - -o, --numOracles=numOracles number of oracles to add to the queue - - -o, --oracleTimeout=oracleTimeout [default: 180] number of oracles to add to the queue - - -r, --reward=reward [default: 0] oracle rewards for successfully responding to an update request - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --enableBufferRelayers enable oracles to fulfill buffer relayer requests - - --force overwrite output file if existing - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --minStake=minStake [default: 0] minimum stake required by an oracle to join the queue - - --programId=programId alternative Switchboard program ID to interact with - - --queueSize=queueSize [default: 100] maximum number of oracles the queue can support - - --unpermissionedFeeds permit unpermissioned feeds - - --unpermissionedVrf permit unpermissioned VRF accounts +DESCRIPTION + create a custom queue ALIASES - $ sbv2 custom:queue + $ sbv2 custom queue ``` -_See code: [src/commands/queue/create.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/queue/create.ts)_ +## `sbv2 queue print [QUEUEKEY]` -## `sbv2 queue:permit:aggregator AGGREGATORKEY` - -permit an aggregator to use an oracle queue's resources +Print the deserialized Switchboard oraclequeue account ``` USAGE - $ sbv2 queue:permit:aggregator AGGREGATORKEY + $ sbv2 queue print [QUEUEKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + [--oracles] ARGUMENTS - AGGREGATORKEY public key of the aggregator account to authorize oracle queue usage + QUEUEKEY public key of the oracle queue account to deserialize -OPTIONS - -a, --authority=authority alternate keypair that is the authority for oracle queue - -h, --help show CLI help +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --oracles output oracles that are heartbeating on the queue + --programId= alternative Switchboard program ID to interact with - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided +DESCRIPTION + Print the deserialized Switchboard oraclequeue account - -s, --silent suppress cli prompts +ALIASES + $ sbv2 queue print - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -EXAMPLE - $ sbv2 queue:permit:aggregator 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 --keypair ../queue-authority.json +EXAMPLES + $ sbv2 queue:print GhYg3R1V6DmJbwuc57qZeoYG6gUuvCotUF1zU3WCj98U ``` -_See code: [src/commands/queue/permit/aggregator.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/queue/permit/aggregator.ts)_ - -## `sbv2 queue:permit:oracle ORACLEKEY` - -permit an oracle to heartbeat on a queue - -``` -USAGE - $ sbv2 queue:permit:oracle ORACLEKEY - -ARGUMENTS - ORACLEKEY public key of the oracle account to authorize oracle queue usage - -OPTIONS - -a, --authority=authority alternate keypair that is the authority for oracle queue - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -EXAMPLE - $ sbv2 queue:permit:oracle 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 --keypair ../queue-authority.json -``` - -_See code: [src/commands/queue/permit/oracle.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/queue/permit/oracle.ts)_ - -## `sbv2 queue:set:rewards QUEUEKEY REWARDS` +## `sbv2 queue set rewards [QUEUEKEY] [REWARDS]` set an oracle queue's rewards ``` USAGE - $ sbv2 queue:set:rewards QUEUEKEY REWARDS + $ sbv2 queue set rewards [QUEUEKEY] [REWARDS] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] [-a ] ARGUMENTS QUEUEKEY public key of the oracle queue REWARDS token rewards for each assigned oracle per open round call -OPTIONS - -a, --authority=authority alternate keypair that is the authority for oracle queue - -h, --help show CLI help +FLAGS + -a, --authority= alternate keypair that is the authority for oracle queue + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with +DESCRIPTION + set an oracle queue's rewards ``` -_See code: [src/commands/queue/set/rewards.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/queue/set/rewards.ts)_ +## `sbv2 queue set vrf [QUEUEKEY]` -## `sbv2 queue:set:vrf QUEUEKEY` - -add a crank to an existing oracle queue +set unpermissionedVrfEnabled ``` USAGE - $ sbv2 queue:set:vrf QUEUEKEY + $ sbv2 queue set vrf [QUEUEKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] [-a + ] [--disable] ARGUMENTS QUEUEKEY public key of the oracle queue to create a crank on -OPTIONS - -a, --authority=authority alternate keypair that is the authority for oracle queue - -h, --help show CLI help +FLAGS + -a, --authority= alternate keypair that is the authority for oracle queue + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --disable disable unpermissionedVrfEnabled + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --disable disable unpermissionedVrfEnabled - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with +DESCRIPTION + set unpermissionedVrfEnabled ``` -_See code: [src/commands/queue/set/vrf.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/queue/set/vrf.ts)_ - ## `sbv2 sandbox [PLACEHOLDER]` sandbox ``` USAGE - $ sbv2 sandbox [PLACEHOLDER] + $ sbv2 sandbox [PLACEHOLDER] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] [-n + ] -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no alternate authority provided - - -n, --name=name name of the job account for easier identification - + -n, --name= name of the job account for easier identification -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - + -u, --rpcUrl= alternate RPC url -v, --verbose log everything - --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with - --programId=programId alternative Switchboard program ID to interact with +DESCRIPTION + sandbox ``` -_See code: [src/commands/sandbox.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/sandbox.ts)_ +_See code: [dist/commands/sandbox.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.2.0/dist/commands/sandbox.ts)_ -## `sbv2 test ORACLEKEY` +## `sbv2 set aggregator [AGGREGATORKEY]` + +set an aggregator's config + +``` +USAGE + $ sbv2 set aggregator [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + [-a ] [--forceReportPeriod ] [--minJobs ] [--minOracles ] [--newQueue ] + [--updateInterval ] [--varianceThreshold ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator + +FLAGS + -a, --authority= alternate keypair that is the authority for the aggregator + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --forceReportPeriod= Number of seconds for which, even if the variance threshold is not passed, accept new + responses from oracles. + --mainnetBeta WARNING: use mainnet-beta solana cluster + --minJobs= number of jobs that must respond before an oracle responds + --minOracles= number of oracles that must respond before a value is accepted on-chain + --newQueue= public key of the new oracle queue + --programId= alternative Switchboard program ID to interact with + --updateInterval= set an aggregator's minimum update delay + --varianceThreshold= percentage change between a previous accepted result and the next round before an oracle + reports a value on-chain. Used to conserve lease cost during low volatility + +DESCRIPTION + set an aggregator's config + +ALIASES + $ sbv2 set aggregator + +EXAMPLES + $ sbv2 aggregator:set GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR --updateInterval 300 --minOracles 3 --keypair ../payer-keypair.json +``` + +## `sbv2 test [ORACLEKEY]` sandbox ``` USAGE - $ sbv2 test ORACLEKEY + $ sbv2 test [ORACLEKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] ARGUMENTS ORACLEKEY public key of the oracle to deposit funds into -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no alternate authority provided - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - + -u, --rpcUrl= alternate RPC url -v, --verbose log everything - --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with - --programId=programId alternative Switchboard program ID to interact with +DESCRIPTION + sandbox ``` -_See code: [src/commands/test.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/test.ts)_ +_See code: [dist/commands/test.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.2.0/dist/commands/test.ts)_ ## `sbv2 update [CHANNEL]` @@ -2415,224 +2554,264 @@ update the sbv2 CLI ``` USAGE - $ sbv2 update [CHANNEL] + $ sbv2 update [CHANNEL] [-a] [-v | -i] [--force] -OPTIONS - --from-local interactively choose an already installed version +FLAGS + -a, --available Install a specific version. + -i, --interactive Interactively select version to install. This is ignored if a channel is provided. + -v, --version= Install a specific version. + --force Force a re-download of the requested version. + +DESCRIPTION + update the sbv2 CLI + +EXAMPLES + Update to the stable channel: + + $ sbv2 update stable + + Update to a specific version: + + $ sbv2 update --version 1.0.0 + + Interactively select version: + + $ sbv2 update --interactive + + See available versions: + + $ sbv2 update --available ``` -_See code: [@oclif/plugin-update](https://github.com/oclif/plugin-update/blob/v1.5.0/src/commands/update.ts)_ +_See code: [@oclif/plugin-update](https://github.com/oclif/plugin-update/blob/v3.0.0/src/commands/update.ts)_ -## `sbv2 vrf:create QUEUEKEY` +## `sbv2 version` + +``` +USAGE + $ sbv2 version +``` + +_See code: [@oclif/plugin-version](https://github.com/oclif/plugin-version/blob/v1.0.4/src/commands/version.ts)_ + +## `sbv2 vrf create [QUEUEKEY]` create a Switchboard VRF Account ``` USAGE - $ sbv2 vrf:create QUEUEKEY + $ sbv2 vrf create [QUEUEKEY] -a --callbackPid --ixData [-v] [-s] [--mainnetBeta] [-u + ] [--programId ] [-k ] [--vrfKeypair ] [--enable] [--authority ] + [--queueAuthority ] ARGUMENTS QUEUEKEY public key of the oracle queue to create VRF account for -OPTIONS - -a, --accountMeta=accountMeta (required) account metas for VRF callback - -h, --help show CLI help +FLAGS + -a, --accountMeta=... (required) account metas for VRF callback + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --authority= alternative keypair to use for VRF authority + --callbackPid= (required) callback program ID + --enable enable vrf permissions + --ixData= (required) instruction data + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + --queueAuthority= alternative keypair to use for queue authority + --vrfKeypair= filesystem path of existing keypair to use for VRF Account - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if - no alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --authority=authority alternative keypair to use for VRF authority - - --callbackPid=callbackPid (required) callback program ID - - --enable enable vrf permissions - - --ixData=ixData (required) instruction data - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - - --queueAuthority=queueAuthority alternative keypair to use for queue authority - - --vrfKeypair=vrfKeypair filesystem path of existing keypair to use for VRF Account +DESCRIPTION + create a Switchboard VRF Account EXAMPLES - sbv2 vrf:create 9WZ59yz95bd3XwJxDPVE2PjvVWmSy9WM1NgGD2Hqsohw --keypair ../payer-keypair.json -v --enable - --queueAuthority queue-authority-keypair.json --callbackPid 6MLk7G54uHZ7JuzNxpBAVENANrgM9BZ51pKkzGwPYBCE --ixData - "[145,72,9,94,61,97,126,106]" -a "{"pubkey": "HpQoFL5kxPp2JCFvjsVTvBd7navx4THLefUU68SXAyd6","isSigner": - false,"isWritable": true}" -a "{"pubkey": "8VdBtS8ufkXMCa6Yr9E4KVCfX2inVZVwU4KGg2CL1q7P","isSigner": - false,"isWritable": false}" - sbv2 vrf:create 9WZ59yz95bd3XwJxDPVE2PjvVWmSy9WM1NgGD2Hqsohw --keypair ../payer-keypair.json -v --enable - --queueAuthority oracle-keypair.json --callbackPid 6MLk7G54uHZ7JuzNxpBAVENANrgM9BZ51pKkzGwPYBCE --ixData - "[145,72,9,94,61,97,126,106]" -a "{"pubkey": "HYKi1grticLXPe5vqapUHhm976brwqRob8vqRnWMKWL5","isSigner": - false,"isWritable": true}" -a "{"pubkey": "6vG9QLMgSvsfjvSpDxWfZ2MGPYGzEYoBxviLG7cr4go","isSigner": - false,"isWritable": false}" + $ sbv2 vrf:create 9WZ59yz95bd3XwJxDPVE2PjvVWmSy9WM1NgGD2Hqsohw --keypair ../payer-keypair.json -v --enable --queueAuthority queue-authority-keypair.json --callbackPid 6MLk7G54uHZ7JuzNxpBAVENANrgM9BZ51pKkzGwPYBCE --ixData "[145,72,9,94,61,97,126,106]" -a "{"pubkey": "HpQoFL5kxPp2JCFvjsVTvBd7navx4THLefUU68SXAyd6","isSigner": false,"isWritable": true}" -a "{"pubkey": "8VdBtS8ufkXMCa6Yr9E4KVCfX2inVZVwU4KGg2CL1q7P","isSigner": false,"isWritable": false}" + + $ sbv2 vrf:create 9WZ59yz95bd3XwJxDPVE2PjvVWmSy9WM1NgGD2Hqsohw --keypair ../payer-keypair.json -v --enable --queueAuthority oracle-keypair.json --callbackPid 6MLk7G54uHZ7JuzNxpBAVENANrgM9BZ51pKkzGwPYBCE --ixData "[145,72,9,94,61,97,126,106]" -a "{"pubkey": "HYKi1grticLXPe5vqapUHhm976brwqRob8vqRnWMKWL5","isSigner": false,"isWritable": true}" -a "{"pubkey": "6vG9QLMgSvsfjvSpDxWfZ2MGPYGzEYoBxviLG7cr4go","isSigner": false,"isWritable": false}" ``` -_See code: [src/commands/vrf/create/index.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/vrf/create/index.ts)_ - -## `sbv2 vrf:create:example QUEUEKEY` +## `sbv2 vrf create example [QUEUEKEY]` create a VRF account for the client example program ``` USAGE - $ sbv2 vrf:create:example QUEUEKEY + $ sbv2 vrf create example [QUEUEKEY] --vrfPid [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k + ] [--vrfKeypair ] [--enable] [--queueAuthority ] [--maxResult ] ARGUMENTS QUEUEKEY public key of the oracle queue to create VRF account for -OPTIONS - -h, --help show CLI help +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --enable enable vrf permissions + --mainnetBeta WARNING: use mainnet-beta solana cluster + --maxResult= [default: 256000] the maximum VRF result + --programId= alternative Switchboard program ID to interact with + --queueAuthority= alternative keypair to use for queue authority + --vrfKeypair= filesystem path of existing keypair to use for VRF Account + --vrfPid= (required) program ID for the VRF example program - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if - no alternate authority provided +DESCRIPTION + create a VRF account for the client example program - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --enable enable vrf permissions - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --maxResult=maxResult [default: 256000] the maximum VRF result - - --programId=programId alternative Switchboard program ID to interact with - - --queueAuthority=queueAuthority alternative keypair to use for queue authority - - --vrfKeypair=vrfKeypair filesystem path of existing keypair to use for VRF Account - - --vrfPid=vrfPid (required) program ID for the VRF example program - -EXAMPLE - sbv2 vrf:create:example 9WZ59yz95bd3XwJxDPVE2PjvVWmSy9WM1NgGD2Hqsohw --vrfPid - 6MLk7G54uHZ7JuzNxpBAVENANrgM9BZ51pKkzGwPYBCE --keypair ../payer-keypair.json -v --enable --queueAuthority - queue-authority-keypair.json +EXAMPLES + $ sbv2 vrf:create:example 9WZ59yz95bd3XwJxDPVE2PjvVWmSy9WM1NgGD2Hqsohw --vrfPid 6MLk7G54uHZ7JuzNxpBAVENANrgM9BZ51pKkzGwPYBCE --keypair ../payer-keypair.json -v --enable --queueAuthority queue-authority-keypair.json ``` -_See code: [src/commands/vrf/create/example.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/vrf/create/example.ts)_ +## `sbv2 vrf print [VRFKEY]` -## `sbv2 vrf:request VRFKEY` +Print the deserialized Switchboard VRF account + +``` +USAGE + $ sbv2 vrf print [VRFKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +ARGUMENTS + VRFKEY public key of the vrf account to deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + Print the deserialized Switchboard VRF account + +ALIASES + $ sbv2 vrf print + +EXAMPLES + $ sbv2 vrf:print SzTvFZLz3hwjZFMwVWzuEnr1oUF6qyvXwXCvsqf7qeA +``` + +## `sbv2 vrf request [VRFKEY]` request a new value for a VRF ``` USAGE - $ sbv2 vrf:request VRFKEY + $ sbv2 vrf request [VRFKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + [--funderAuthority ] [--authority ] ARGUMENTS VRFKEY public key of the VRF account to request randomness for -OPTIONS - -h, --help show CLI help +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --authority= alternative keypair that is the VRF authority + --funderAuthority= alternative keypair to pay for VRF request + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority - if no alternate authority provided +DESCRIPTION + request a new value for a VRF - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --authority=authority alternative keypair that is the VRF authority - - --funderAuthority=funderAuthority alternative keypair to pay for VRF request - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -EXAMPLE - sbv2 vrf:create 9WZ59yz95bd3XwJxDPVE2PjvVWmSy9WM1NgGD2Hqsohw --keypair ../payer-keypair.json -v --enable - --queueAuthority queue-authority-keypair.json --callbackPid 6MLk7G54uHZ7JuzNxpBAVENANrgM9BZ51pKkzGwPYBCE --ixData - "[145,72,9,94,61,97,126,106]" -a "{"pubkey": "HpQoFL5kxPp2JCFvjsVTvBd7navx4THLefUU68SXAyd6","isSigner": - false,"isWritable": true}" -a "{"pubkey": "8VdBtS8ufkXMCa6Yr9E4KVCfX2inVZVwU4KGg2CL1q7P","isSigner": - false,"isWritable": false}" +EXAMPLES + $ sbv2 vrf:create 9WZ59yz95bd3XwJxDPVE2PjvVWmSy9WM1NgGD2Hqsohw --keypair ../payer-keypair.json -v --enable --queueAuthority queue-authority-keypair.json --callbackPid 6MLk7G54uHZ7JuzNxpBAVENANrgM9BZ51pKkzGwPYBCE --ixData "[145,72,9,94,61,97,126,106]" -a "{"pubkey": "HpQoFL5kxPp2JCFvjsVTvBd7navx4THLefUU68SXAyd6","isSigner": false,"isWritable": true}" -a "{"pubkey": "8VdBtS8ufkXMCa6Yr9E4KVCfX2inVZVwU4KGg2CL1q7P","isSigner": false,"isWritable": false}" ``` -_See code: [src/commands/vrf/request.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/vrf/request.ts)_ - -## `sbv2 watch:aggregator AGGREGATORKEY` - -watch an aggregator for a new value - -``` -USAGE - $ sbv2 watch:aggregator AGGREGATORKEY - -ARGUMENTS - AGGREGATORKEY public key of the aggregator account to deserialize - -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no - alternate authority provided - - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - - -v, --verbose log everything - - --mainnetBeta WARNING: use mainnet-beta solana cluster - - --programId=programId alternative Switchboard program ID to interact with - -ALIASES - $ sbv2 aggregator:watch - -EXAMPLE - $ sbv2 watch:aggregator J7j9xX8JP2B2ErvUzuqGAKBGeggsxPyFXj5MqZcYDxfa -``` - -_See code: [src/commands/watch/aggregator.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/watch/aggregator.ts)_ - -## `sbv2 watch:vrf VRFKEY` +## `sbv2 vrf watch [VRFKEY]` watch a vrf for a new value ``` USAGE - $ sbv2 watch:vrf VRFKEY + $ sbv2 vrf watch [VRFKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] ARGUMENTS VRFKEY public key of the vrf account to deserialize -OPTIONS - -h, --help show CLI help - - -k, --keypair=keypair keypair that will pay for onchain transactions. defaults to new account authority if no +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no alternate authority provided - -s, --silent suppress cli prompts - - -u, --rpcUrl=rpcUrl alternate RPC url - + -u, --rpcUrl= alternate RPC url -v, --verbose log everything - --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with - --programId=programId alternative Switchboard program ID to interact with +DESCRIPTION + watch a vrf for a new value ALIASES - $ sbv2 vrf:watch + $ sbv2 vrf watch -EXAMPLE +EXAMPLES $ sbv2 vrf:aggregator J7j9xX8JP2B2ErvUzuqGAKBGeggsxPyFXj5MqZcYDxfa ``` -_See code: [src/commands/watch/vrf.ts](https://github.com/switchboard-xyz/switchboard-v2/blob/v0.1.28/src/commands/watch/vrf.ts)_ +## `sbv2 watch aggregator [AGGREGATORKEY]` + +watch an aggregator for a new value + +``` +USAGE + $ sbv2 watch aggregator [AGGREGATORKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +ARGUMENTS + AGGREGATORKEY public key of the aggregator account to deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + watch an aggregator for a new value + +ALIASES + $ sbv2 aggregator watch + +EXAMPLES + $ sbv2 watch:aggregator J7j9xX8JP2B2ErvUzuqGAKBGeggsxPyFXj5MqZcYDxfa +``` + +## `sbv2 watch vrf [VRFKEY]` + +watch a vrf for a new value + +``` +USAGE + $ sbv2 watch vrf [VRFKEY] [-v] [-s] [--mainnetBeta] [-u ] [--programId ] [-k ] + +ARGUMENTS + VRFKEY public key of the vrf account to deserialize + +FLAGS + -k, --keypair= keypair that will pay for onchain transactions. defaults to new account authority if no + alternate authority provided + -s, --silent suppress cli prompts + -u, --rpcUrl= alternate RPC url + -v, --verbose log everything + --mainnetBeta WARNING: use mainnet-beta solana cluster + --programId= alternative Switchboard program ID to interact with + +DESCRIPTION + watch a vrf for a new value + +ALIASES + $ sbv2 vrf watch + +EXAMPLES + $ sbv2 vrf:aggregator J7j9xX8JP2B2ErvUzuqGAKBGeggsxPyFXj5MqZcYDxfa +``` diff --git a/cli/bin/dev b/cli/bin/dev new file mode 100755 index 0000000..bbc3f51 --- /dev/null +++ b/cli/bin/dev @@ -0,0 +1,17 @@ +#!/usr/bin/env node + +const oclif = require('@oclif/core') + +const path = require('path') +const project = path.join(__dirname, '..', 'tsconfig.json') + +// In dev mode -> use ts-node and dev plugins +process.env.NODE_ENV = 'development' + +require('ts-node').register({project}) + +// In dev mode, always show stack traces +oclif.settings.debug = true; + +// Start the CLI +oclif.run().then(oclif.flush).catch(oclif.Errors.handle) diff --git a/cli/bin/dev.cmd b/cli/bin/dev.cmd new file mode 100644 index 0000000..077b57a --- /dev/null +++ b/cli/bin/dev.cmd @@ -0,0 +1,3 @@ +@echo off + +node "%~dp0\dev" %* \ No newline at end of file diff --git a/cli/bin/run b/cli/bin/run index 30b14e1..a7635de 100755 --- a/cli/bin/run +++ b/cli/bin/run @@ -1,5 +1,5 @@ #!/usr/bin/env node -require('@oclif/command').run() -.then(require('@oclif/command/flush')) -.catch(require('@oclif/errors/handle')) +const oclif = require('@oclif/core') + +oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle')) diff --git a/cli/examples/aggregator.json b/cli/examples/aggregator.json deleted file mode 100644 index 2376005..0000000 --- a/cli/examples/aggregator.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "WHEAT", - "metadata": "", - "oracleRequestBatchSize": 1, - "minOracleResults": 1, - "minJobResults": 1, - "minUpdateDelaySeconds": 300, - "jobs": [ - { - "name": "commodities-api WHEAT", - "tasks": [ - { - "httpTask": { - "url": "https://www.commodities-api.com/api/latest?access_key=ke9lwg53l34qis22zr2t568f8k32agaewndr3j8mvzr33ys9wixhrudh73fj&base=USD&symbols=WHEAT" - } - }, - { - "jsonParseTask": { - "path": "$.data.rates.WHEAT" - } - }, - { - "powTask": { - "scalar": -1 - } - } - ] - } - ] -} diff --git a/cli/examples/job.ftxCom.json b/cli/examples/job.ftxCom.json deleted file mode 100644 index 653c8d1..0000000 --- a/cli/examples/job.ftxCom.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "FtxCom MNGO/USD", - "tasks": [ - { - "httpTask": { - "url": "https://ftx.com/api/markets/mngo/usd" - } - }, - { - "jsonParseTask": { - "path": "$.result.price" - } - } - ] -} diff --git a/cli/examples/job.serum.json b/cli/examples/job.serum.json deleted file mode 100644 index f8920f8..0000000 --- a/cli/examples/job.serum.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "Serum SOL/USDC", - "tasks": [ - { - "serumSwapTask": { - "serumPoolAddress": "9wFFyRfZBsuAha4YcuxcXLKwMxJR43S7fPfQLusDBzvT" - } - } - ] -} diff --git a/cli/examples/queue.json b/cli/examples/queue.json deleted file mode 100644 index aa94edf..0000000 --- a/cli/examples/queue.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "test_1", - "metadata": "queue test_1", - "minStake": 0, - "minUpdateDelaySeconds": 10, - "cranks": [ - { - "name": "crank-1", - "maxRows": 125 - }, - { - "name": "crank-2", - "maxRows": 150 - } - ], - "oracles": 1, - "aggregators": [ - { - "name": "MNGO_USD", - "metadata": "", - "crank": "crank-1", - "oracleRequestBatchSize": 1, - "minOracleResults": 1, - "minJobResults": 1, - "minUpdateDelaySeconds": 6, - "jobs": [ - { - "name": "FtxCom MNGO/USD", - "tasks": [ - { - "httpTask": { - "url": "https://ftx.com/api/markets/mngo/usd" - } - }, - { - "jsonParseTask": { - "path": "$.result.price" - } - } - ] - }, - { - "name": "Raydium MNGO/USDC", - "tasks": [ - { - "httpTask": { - "url": "https://api.raydium.io/pairs" - } - }, - { - "jsonParseTask": { - "path": "$[?(@.name == 'MNGO-USDC')].price" - } - } - ] - } - ] - } - ] -} diff --git a/cli/package.json b/cli/package.json index 00812a8..6cf6357 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,7 +1,13 @@ { "name": "@switchboard-xyz/switchboardv2-cli", + "version": "0.2.0", "description": "command line tool to interact with switchboard v2", - "version": "0.1.28", + "author": "gallynaut @gallynaut", + "bin": { + "sbv2": "./bin/run" + }, + "homepage": "https://docs.switchboard.xyz", + "main": "dist/index.js", "license": "MIT", "repository": { "type": "git", @@ -9,17 +15,75 @@ "directory": "cli" }, "bugs": "https://github.com/switchboard-xyz/switchboard-v2/tree/main/cli/issues", - "homepage": "https://docs.switchboard.xyz", - "bin": { - "sbv2": "./bin/run" + "files": [ + "/bin", + "/dist", + "/npm-shrinkwrap.json", + "/oclif.manifest.json" + ], + "dependencies": { + "@google-cloud/secret-manager": "^3.10.1", + "@oclif/core": "^1", + "@oclif/parser": "^3.8.7", + "@oclif/plugin-help": "^5.1.12", + "@oclif/plugin-plugins": "^2.0.1", + "@oclif/plugin-update": "^3.0.0", + "@oclif/plugin-version": "^1.0.4", + "@oclif/plugin-warn-if-update-available": "^2.0.4", + "@project-serum/anchor": "^0.24.2", + "@solana/spl-token": "^0.1.8", + "@solana/web3.js": "^1.43.5", + "@switchboard-xyz/sbv2-utils": "^0.1.19", + "@switchboard-xyz/switchboard-v2": "^0.0.108", + "assert": "^2.0.0", + "big.js": "^6.2.0", + "bs58": "^5.0.0", + "chalk": "4", + "node-fetch": "^2.6.6", + "winston": "^3.3.3" + }, + "devDependencies": { + "@oclif/test": "^2", + "@types/chai": "^4", + "@types/mocha": "^9.0.0", + "@types/node": "^16.9.4", + "@typescript-eslint/eslint-plugin": "^5.5.0", + "@typescript-eslint/parser": "^5.5.0", + "aws-sdk": "^2.1116.0", + "chai": "^4", + "eslint": "^8.3.0", + "eslint-config-airbnb-typescript": "^17.0.0", + "eslint-config-oclif": "^3.1.0", + "eslint-config-oclif-typescript": "^1.0.2", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-unicorn": "^39.0.0", + "globby": "^11", + "mocha": "^9", + "oclif": "^3", + "shx": "^0.3.3", + "ts-node": "^10.2.1", + "tslib": "^2.3.1", + "typescript": "^4.4.3" }, "oclif": { - "commands": "./lib/commands", + "additionalHelpFlags": [ + "-h" + ], + "commands": "./dist/commands", "bin": "sbv2", "dirname": "@switchboard-xyz/sbv2-cli", + "topicSeparator": " ", "macos": { "identifier": "com.sbv2.cli" }, + "plugins": [ + "@oclif/plugin-update", + "@oclif/plugin-help", + "@oclif/plugin-version", + "@oclif/plugin-warn-if-update-available" + ], "update": { "s3": { "bucket": "sbv2-cli", @@ -40,12 +104,6 @@ "version": "16.14.2" } }, - "plugins": [ - "@oclif/plugin-update", - "@oclif/plugin-help", - "@oclif/plugin-warn-if-update-available", - "@oclif/config" - ], "topics": { "aggregator": { "description": "interact with a switchboard aggregator account" @@ -67,90 +125,25 @@ }, "print": { "description": "find and print a switchboard account by public key for a given cluster" - }, - "json": { - "description": "create and manage an oracle queue from a json file" } } }, "scripts": { + "build": "shx rm -rf dist && tsc -b", + "lint": "eslint . --ext .ts --config .eslintrc", + "lint:fix": "eslint . --ext .ts --config .eslintrc --fix", "postpack": "shx rm -f oclif.manifest.json", - "posttest1": "eslint . --ext .ts --config .eslintrc.json", - "prepack": "yarn build", - "build": "shx rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme", - "doc": "oclif-dev readme", - "doc:out": "oclif-dev readme --multi --dir ../website/api/switchboardv2-cli/ && cd ../website/api/switchboardv2-cli/ && for f in *.md; do mv \"${f%.md}.md\" \"_${f%.md}.md\"; sed -i \"\" '1,2d' \"_${f%.md}.md\"; done", - "test:old": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"", - "test": "echo \"No test script for @switchboard-xyz/switchboardv2-cli\" && exit 0", - "version": "oclif-dev readme && git add README.md", - "fmt": "prettier --write 'src/**/*.ts'", - "lint": "eslint . --ext .ts --config .eslintrc.json --fix" - }, - "dependencies": { - "@google-cloud/secret-manager": "^3.10.1", - "@oclif/command": "^1.8.16", - "@oclif/config": "^1.18.2", - "@oclif/parser": "^3.8.6", - "@oclif/plugin-autocomplete": "^1.2.0", - "@oclif/plugin-help": "^5.1.12", - "@oclif/plugin-update": "^1.5.0", - "@oclif/plugin-warn-if-update-available": "^1.7.3", - "@project-serum/anchor": "^0.24.2", - "@solana/spl-token": "^0.1.8", - "@solana/web3.js": "^1.42.0", - "@switchboard-xyz/sbv2-utils": "^0.1.19", - "@switchboard-xyz/switchboard-v2": "^0.0.108", - "assert": "^2.0.0", - "big.js": "^6.1.1", - "bs58": "^5.0.0", - "chalk": "^4.1.2", - "decimal.js": "^10.3.1", - "node-fetch": "^2.6.6", - "readline-sync": "^1.4.10", - "winston": "^3.3.3" - }, - "devDependencies": { - "@oclif/dev-cli": "^1.26.5", - "@oclif/test": "^2.0.3", - "@types/mocha": "^5.2.7", - "@types/node": "^17.0.31", - "@typescript-eslint/eslint-plugin": "^5.5.0", - "@typescript-eslint/parser": "^5.5.0", - "aws-sdk": "^2.1116.0", - "eslint": "^8.3.0", - "eslint-config-airbnb-typescript": "^17.0.0", - "eslint-config-oclif": "^3.1.0", - "eslint-config-oclif-typescript": "^1.0.2", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-import": "^2.25.3", - "eslint-plugin-prettier": "^4.0.0", - "eslint-plugin-unicorn": "^39.0.0", - "mocha": "^9.1.3", - "nyc": "^15.1.0", - "prettier": "^2.5.0", - "prettier-plugin-organize-imports": "^2.3.4", - "shx": "^0.3.4", - "ts-node": "^10.4.0", - "tslib": "^2.3.1", - "typescript": "^4.4.4" + "posttest": "yarn lint", + "prepack": "yarn build && oclif manifest && oclif readme", + "test": "mocha --forbid-only \"test/**/*.test.ts\"", + "version": "oclif readme && git add README.md", + "fmt": "prettier --write 'src/**/*.ts'" }, "engines": { - "node": ">=8.5.0" + "node": ">=12.0.0" }, - "files": [ - "bin", - "lib", - "src", - "examples", - "npm-shrinkwrap.json", - "oclif.manifest.json" - ], "keywords": [ - "oclif", - "switchboard", - "solana", - "oracle" + "oclif" ], - "main": "lib/index.js", - "types": "lib/index.d.ts" + "types": "dist/index.d.ts" } diff --git a/cli/src/BaseCommand.ts b/cli/src/BaseCommand.ts index 3f54814..5cc2944 100644 --- a/cli/src/BaseCommand.ts +++ b/cli/src/BaseCommand.ts @@ -1,4 +1,4 @@ -import Command, { flags } from "@oclif/command"; +import { Command, Flags } from "@oclif/core"; import { Input } from "@oclif/parser"; import * as anchor from "@project-serum/anchor"; import { @@ -17,7 +17,6 @@ import Big from "big.js"; import chalk from "chalk"; import * as fs from "fs"; import * as path from "path"; -import { DEFAULT_KEYPAIR } from "./accounts"; import { CliConfig, ConfigParameter, DEFAULT_CONFIG } from "./config"; import { AuthorityMismatch } from "./types"; import { CommandContext } from "./types/context/context"; @@ -27,28 +26,25 @@ import { FAILED_ICON, loadKeypair, toCluster } from "./utils"; abstract class BaseCommand extends Command { static flags = { - help: flags.help({ char: "h" }), - verbose: flags.boolean({ + verbose: Flags.boolean({ char: "v", description: "log everything", - default: false, }), - silent: flags.boolean({ + silent: Flags.boolean({ char: "s", description: "suppress cli prompts", - default: false, }), - mainnetBeta: flags.boolean({ + mainnetBeta: Flags.boolean({ description: "WARNING: use mainnet-beta solana cluster", }), - rpcUrl: flags.string({ + rpcUrl: Flags.string({ char: "u", description: "alternate RPC url", }), - programId: flags.string({ + programId: Flags.string({ description: "alternative Switchboard program ID to interact with", }), - keypair: flags.string({ + keypair: Flags.string({ char: "k", description: "keypair that will pay for onchain transactions. defaults to new account authority if no alternate authority provided", @@ -71,16 +67,20 @@ abstract class BaseCommand extends Command { public program: anchor.Program; - public payerKeypair?: Keypair | undefined = undefined; + public payerKeypair: Keypair; async init() { - const { flags } = this.parse(>this.constructor); - BaseCommand.flags = flags; + const { flags } = await this.parse((>this.constructor) as any); + BaseCommand.flags = flags as any; // setup logging - this.silent = flags.silent; - this.verbose = flags.verbose; - const level = flags.silent ? "error" : flags.verbose ? "debug" : "info"; + this.silent = (flags as any).silent; + this.verbose = (flags as any).verbose; + const level = (flags as any).silent + ? "error" + : (flags as any).verbose + ? "debug" + : "info"; const logFilename = path.join(this.config.cacheDir, "log.txt"); const logParameters: LoggerParameters = { console: { @@ -90,8 +90,8 @@ abstract class BaseCommand extends Command { level: "debug", filename: logFilename, }, - silent: flags.silent, - verbose: flags.verbose, + silent: this.silent ?? false, + verbose: this.verbose ?? false, }; this.logger = new LogProvider(logParameters); @@ -99,10 +99,14 @@ abstract class BaseCommand extends Command { this.loadConfig(); - this.cluster = flags.mainnetBeta + this.cluster = (flags as any).mainnetBeta ? toCluster("mainnet-beta") : toCluster("devnet"); - const url = flags.rpcUrl ?? clusterApiUrl(this.cluster); + + const url = + (flags as any).rpcUrl ?? + this.getRpcUrl(this.cluster) ?? + clusterApiUrl(this.cluster); try { this.connection = new Connection(url, { commitment: "finalized", @@ -120,12 +124,12 @@ abstract class BaseCommand extends Command { ); } - this.payerKeypair = flags.keypair - ? await loadKeypair(flags.keypair) - : DEFAULT_KEYPAIR; + this.payerKeypair = (flags as any).keypair + ? await loadKeypair((flags as any).keypair) + : Keypair.fromSeed(new Uint8Array(32).fill(1)); - const programId = flags.programId - ? new anchor.web3.PublicKey(flags.programId) + const programId = (flags as any).programId + ? new anchor.web3.PublicKey((flags as any).programId) : getSwitchboardPid(this.cluster as "mainnet-beta" | "devnet"); const wallet = new anchor.Wallet(this.payerKeypair); @@ -158,7 +162,7 @@ abstract class BaseCommand extends Command { }; } - async catch(error, message?: string) { + async catch(error: any, message?: string) { // fall back to console if logger is not initialized yet const logger = this.logger ?? console; @@ -185,12 +189,13 @@ abstract class BaseCommand extends Command { /** Load an authority from a CLI flag and optionally check if it matches the expected account authority */ async loadAuthority( - authorityPath?: string, + authorityPath: string | unknown, expectedAuthority?: PublicKey ): Promise { - const authority = authorityPath - ? await loadKeypair(authorityPath) - : programWallet(this.program); + const authority: Keypair = + typeof authorityPath === "string" + ? await loadKeypair(authorityPath) + : programWallet(this.program); if (expectedAuthority && !expectedAuthority.equals(authority.publicKey)) { throw new AuthorityMismatch(); @@ -202,7 +207,7 @@ abstract class BaseCommand extends Command { mainnetCheck(): void { if (this.cluster === "mainnet-beta") { throw new Error( - `switchboardv2-cli is still in beta, mainnet is disabled for this command.` + "switchboardv2-cli is still in beta, mainnet is disabled for this command." ); } } @@ -270,6 +275,8 @@ abstract class BaseCommand extends Command { this.cliConfig.devnet.rpcUrl || clusterApiUrl(toCluster("mainnet-beta")) ); + default: + return clusterApiUrl(toCluster("devnet")); } } diff --git a/cli/src/JsonBaseCommand.ts b/cli/src/JsonBaseCommand.ts deleted file mode 100644 index 8b1ecb3..0000000 --- a/cli/src/JsonBaseCommand.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { flags } from "@oclif/command"; -import { Input } from "@oclif/parser"; -import { Keypair } from "@solana/web3.js"; -import * as fs from "fs"; -import * as path from "path"; -import { - OracleQueueClass, - pubKeyConverter, - pubKeyReviver, - QueueDefinition, -} from "./accounts"; -import BaseCommand from "./BaseCommand"; -import { loadKeypair } from "./utils"; - -abstract class JsonBaseCommand extends BaseCommand { - public queueAuthority?: Keypair; - - public queueSchemaPath?: string; - - public queueSchema?: QueueDefinition; - - static flags = { - ...BaseCommand.flags, - authority: flags.string({ - char: "a", - description: - "alternate keypair that is the authority for the oracle queue", - }), - schema: flags.string({ - char: "a", - description: "filesystem path for an oracle queue schema", - }), - }; - - async init() { - await super.init(); - const { flags } = this.parse(>this.constructor); - JsonBaseCommand.flags = flags; - - this.queueSchemaPath = - flags.schema && flags.schema.startsWith("/") - ? flags.schema - : path.join(process.cwd(), flags.schema); - - if (fs.existsSync(this.queueSchemaPath)) { - this.queueSchema = JSON.parse( - fs.readFileSync(this.queueSchemaPath, "utf-8"), - pubKeyReviver - ); - } - - if (flags.authority) { - this.queueAuthority = flags.authority - ? await loadKeypair(flags.authority) - : undefined; - } - } - - save(queue: OracleQueueClass) { - const outputString = JSON.stringify(queue, pubKeyConverter, 2); - if (!outputString || outputString.length === 0) { - throw new Error(`failed to save oracle queue (len === 0)`); - } - fs.writeFileSync(this.queueSchemaPath, outputString); - } -} - -export default JsonBaseCommand; diff --git a/cli/src/PrintBaseCommand.ts b/cli/src/PrintBaseCommand.ts index a4b71f8..34e7653 100644 --- a/cli/src/PrintBaseCommand.ts +++ b/cli/src/PrintBaseCommand.ts @@ -1,10 +1,7 @@ -/* eslint-disable unicorn/no-process-exit */ -/* eslint-disable no-process-exit */ -import Command, { flags } from "@oclif/command"; -import { Input } from "@oclif/parser"; +import { Command, Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; import { ACCOUNT_DISCRIMINATOR_SIZE } from "@project-serum/anchor/dist/cjs/coder"; -import { clusterApiUrl, Connection, PublicKey } from "@solana/web3.js"; +import { clusterApiUrl, Connection, Keypair, PublicKey } from "@solana/web3.js"; import { prettyPrintAggregator, prettyPrintCrank, @@ -15,6 +12,8 @@ import { prettyPrintProgramState, prettyPrintQueue, prettyPrintVrf, + SwitchboardAccountType, + SWITCHBOARD_DISCRIMINATOR_MAP, } from "@switchboard-xyz/sbv2-utils"; import { AggregatorAccount, @@ -29,11 +28,6 @@ import { } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; import * as path from "path"; -import { - DEFAULT_KEYPAIR, - SwitchboardAccountType, - SWITCHBOARD_DISCRIMINATOR_MAP, -} from "./accounts"; import { CliConfig } from "./config"; import { FsProvider } from "./types"; import { CommandContext } from "./types/context/context"; @@ -47,8 +41,8 @@ export interface ClusterConfigs { abstract class PrintBaseCommand extends Command { static flags = { - help: flags.help({ char: "h" }), - verbose: flags.boolean({ + help: Flags.help({ char: "h" }), + verbose: Flags.boolean({ char: "v", description: "log everything", default: false, @@ -64,8 +58,8 @@ abstract class PrintBaseCommand extends Command { public clusters: ClusterConfigs; async init() { - const { flags } = this.parse(>this.constructor); - PrintBaseCommand.flags = flags; + const { flags } = (await this.parse(this.constructor as any)) as any; + // this.flags = flags; // setup logging const level = flags.silent ? "error" : flags.verbose ? "debug" : "info"; @@ -93,12 +87,12 @@ abstract class PrintBaseCommand extends Command { devnet: await loadAnchor( "devnet", new Connection(clusterApiUrl("devnet")), - DEFAULT_KEYPAIR + Keypair.fromSeed(new Uint8Array(32).fill(1)) ), mainnet: await loadAnchor( "mainnet-beta", new Connection(clusterApiUrl("mainnet-beta")), - DEFAULT_KEYPAIR + Keypair.fromSeed(new Uint8Array(32).fill(1)) ), }; } @@ -114,6 +108,7 @@ abstract class PrintBaseCommand extends Command { this.logger.log(await prettyPrintJob(job)); break; } + case "AggregatorAccountData": { const aggregator = new AggregatorAccount({ program, publicKey }); this.logger.log( @@ -121,42 +116,50 @@ abstract class PrintBaseCommand extends Command { ); break; } + case "OracleAccountData": { const oracle = new OracleAccount({ program, publicKey }); this.logger.log(await prettyPrintOracle(oracle, undefined, true)); break; } + case "PermissionAccountData": { const permission = new PermissionAccount({ program, publicKey }); - this.logger.log(await prettyPrintPermissions(permission, undefined)); + this.logger.log(await prettyPrintPermissions(permission)); break; } + case "LeaseAccountData": { const lease = new LeaseAccount({ program, publicKey }); - this.logger.log(await prettyPrintLease(lease, undefined)); + this.logger.log(await prettyPrintLease(lease)); break; } + case "OracleQueueAccountData": { const queue = new OracleQueueAccount({ program, publicKey }); this.logger.log(await prettyPrintQueue(queue)); break; } + case "CrankAccountData": { const crank = new CrankAccount({ program, publicKey }); this.logger.log(await prettyPrintCrank(crank)); break; } + case "SbState": case "ProgramStateAccountData": { const [programState] = ProgramStateAccount.fromSeed(program); this.logger.log(await prettyPrintProgramState(programState)); break; } + case "VrfAccountData": { const vrfAccount = new VrfAccount({ program, publicKey }); this.logger.log(await prettyPrintVrf(vrfAccount)); break; } + case "BUFFERxx": { console.log(`Found buffer account but dont know which one`); break; @@ -173,6 +176,7 @@ abstract class PrintBaseCommand extends Command { if (!account) { throw new Error(`devnet account not found`); } + const accountDiscriminator = account.data.slice( 0, ACCOUNT_DISCRIMINATOR_SIZE @@ -228,6 +232,7 @@ abstract class PrintBaseCommand extends Command { if (message) { logger.info(chalk.red(`${FAILED_ICON}${message}`)); } + if (error.message) { const messageLines = error.message.split("\n"); logger.error(messageLines[0]); diff --git a/cli/src/accounts/aggregator/aggregator.ts b/cli/src/accounts/aggregator/aggregator.ts deleted file mode 100644 index 0ac1bab..0000000 --- a/cli/src/accounts/aggregator/aggregator.ts +++ /dev/null @@ -1,600 +0,0 @@ -import * as anchor from "@project-serum/anchor"; -import { Keypair, PublicKey } from "@solana/web3.js"; -import { - AggregatorAccount, - OracleQueueAccount, - programWallet, - SwitchboardDecimal, -} from "@switchboard-xyz/switchboard-v2"; -import Big from "big.js"; -import chalk from "chalk"; -import { ProgramStateClass } from ".."; -import { AggregatorIllegalRoundOpenCall } from "../../types"; -import { - CommandContext, - DEFAULT_CONTEXT, - LogProvider, -} from "../../types/context"; -import { getProgramPayer } from "../../utils"; -import { JobClass, JobDefinition } from "../job"; -import { LeaseClass } from "../lease"; -import { PermissionClass } from "../permission"; -import { copyAccount, DEFAULT_PUBKEY } from "../types"; -import { - anchorBNtoDateTimeString, - buffer2string, - chalkString, - pubKeyConverter, -} from "../utils"; -import { - AggregatorAccountData, - AggregatorDefinition, - fromAggregatorJSON, - IAggregatorClass, -} from "./types"; - -export class AggregatorClass implements IAggregatorClass { - account: AggregatorAccount; - - logger: LogProvider; - - publicKey: PublicKey; - - authorWalletPublicKey: PublicKey; - - authorityPublicKey: PublicKey; - - oracleRequestBatchSize: number; // REQ, will default to some value - - crankPublicKey?: PublicKey; - - historyBufferPublicKey?: PublicKey; - - expiration: anchor.BN; - - forceReportPeriod: anchor.BN; - - isLocked?: boolean; - - metadata: string; - - minRequiredJobResults: number; // REQ, will default to 75% of jobs - - minRequiredOracleResults: number; // REQ, will default to 1 - - minUpdateDelaySeconds: number; // REQ, will default to 30s - - name: string; - - queuePublicKey: PublicKey; - - startAfter: number; - - varianceThreshold: SwitchboardDecimal; - - jobs: JobClass[]; - - leaseAccount: LeaseClass; - - permissionAccount: PermissionClass; - - result: string; - - resultTimestamp: string; - - private constructor() {} - - static async init( - context: CommandContext, - aggregatorAccount: AggregatorAccount, - definition?: AggregatorDefinition - ) { - const aggregator = new AggregatorClass(); - const wallet = programWallet(aggregatorAccount.program); - aggregator.account = aggregatorAccount; - aggregator.publicKey = aggregator.account.publicKey; - aggregator.logger = context.logger; - - await aggregator.loadData(); - const queueAccount = new OracleQueueAccount({ - program: aggregatorAccount.program, - publicKey: aggregator.queuePublicKey, - }); - - try { - aggregator.permissionAccount = await PermissionClass.build( - context, - aggregator.account, - queueAccount, - definition && "permissionAccount" in definition - ? definition.permissionAccount - : undefined - ); - } catch {} - - try { - aggregator.leaseAccount = await LeaseClass.build( - context, - aggregator.account, - queueAccount, - definition && "leaseAccount" in definition - ? definition.leaseAccount - : undefined - ); - } catch {} - - try { - const { authority } = await queueAccount.loadData(); - if ( - aggregator.permissionAccount.permission === "NONE" && - authority.equals(wallet.publicKey) - ) { - aggregator.permissionAccount = await PermissionClass.grantPermission( - context, - aggregator.account, - wallet - ); - } - } catch {} - - await aggregator.loadData(); - - return aggregator; - } - - public static async build( - context: CommandContext, - program: anchor.Program, - definition: AggregatorDefinition, - queueAccount?: OracleQueueAccount - ) { - if ( - "account" in definition && - definition.account instanceof AggregatorAccount - ) { - return AggregatorClass.init(context, definition.account, definition); - } - if ("publicKey" in definition) { - return AggregatorClass.fromPublicKey( - context, - program, - definition.publicKey - ); - } - if (queueAccount) { - // need queue account defined to create any new aggregators - if ("jobs" in definition) { - if (definition.jobs.length > 0) { - return AggregatorClass.fromJSON(context, queueAccount, definition); - } - throw new Error( - "need to provide at least one job definition to build an aggregator" - ); - } - if ("sourcePublicKey" in definition) { - return AggregatorClass.fromCopyAccount( - context, - queueAccount, - definition - ); - } - } - throw new Error(`failed to build aggregator from definition ${definition}`); - } - - public static async fromAccount( - context: CommandContext, - account: AggregatorAccount - ) { - return AggregatorClass.init(context, account); - } - - public static fromPublicKey( - context: CommandContext, - program: anchor.Program, - publicKey: PublicKey - ) { - const account = new AggregatorAccount({ - program, - publicKey, - }); - return AggregatorClass.init(context, account); - } - - public static async fromJSON( - context: CommandContext, - queueAccount: OracleQueueAccount, - definition: fromAggregatorJSON - ) { - if (!definition.jobs || definition.jobs.length === 0) - throw new Error("cannot create an aggregator with no jobs provided"); - const aggregatorAccount = await AggregatorAccount.create( - queueAccount.program, - { - authority: - definition.authorityPublicKey ?? - getProgramPayer(queueAccount.program).publicKey, - authorWallet: - definition.authorWalletPublicKey ?? - (await ProgramStateClass.getProgramTokenAddress( - queueAccount.program - )), - batchSize: definition.oracleRequestBatchSize ?? 1, - expiration: definition.expiration - ? new anchor.BN(definition.expiration) - : undefined, - keypair: definition.existingKeypair ?? undefined, - minRequiredOracleResults: definition.minRequiredOracleResults ?? 1, - minRequiredJobResults: definition.minRequiredJobResults ?? 1, - minUpdateDelaySeconds: definition.minUpdateDelaySeconds ?? 30, - name: definition.name ? Buffer.from(definition.name) : undefined, - metadata: definition.metadata - ? Buffer.from(definition.metadata) - : undefined, - queueAccount, - } - ); - - if (aggregatorAccount.keypair) { - context.fs.saveKeypair(aggregatorAccount.keypair); - } - - try { - if (definition.historyBuffer) { - const size = Math.floor(definition.historyBuffer); - await aggregatorAccount.setHistoryBuffer({ - size, - }); - context.logger.debug(`created history buffer of size ${size}`); - } - } catch {} - - context.logger.info( - `created aggregator ${definition.name} ${aggregatorAccount.publicKey}` - ); - - await AggregatorClass.buildJobs( - context, - aggregatorAccount, - definition.jobs - ); - return AggregatorClass.init(context, aggregatorAccount, definition); - } - - public static async fromCopyAccount( - context: CommandContext, - queueAccount: OracleQueueAccount, - definition: copyAccount - ) { - const wallet = programWallet(queueAccount.program); - const sourceAggregator = new AggregatorAccount({ - program: queueAccount.program, - publicKey: definition.sourcePublicKey, - }); - const source = await AggregatorClass.fromAccount(context, sourceAggregator); - - const variance = new Big(source.varianceThreshold.mantissa.toString()).div( - new Big(10).pow(source.varianceThreshold.scale) - ); - - const targetDefinition: fromAggregatorJSON = { - ...source.toJSON(), - authorityPublicKey: - definition.authorityKeypair?.publicKey || wallet.publicKey, - crank: undefined, - expiration: source.expiration.toString(), - forceReportPeriod: source.forceReportPeriod.toString(), - queuePublicKey: queueAccount.publicKey, - varianceThreshold: variance.toNumber(), - }; - - return AggregatorClass.fromJSON(context, queueAccount, targetDefinition); - } - - async addJob( - jobDefinition: JobDefinition, - context = DEFAULT_CONTEXT - ): Promise { - const job = await JobClass.build( - context, - this.account.program, - jobDefinition - ); - await this.account.addJob( - job.account, - getProgramPayer(this.account.program) - ); - this.jobs.push(job); - const newJobIndex = this.jobs.findIndex((existingJob) => - existingJob.publicKey.equals(job.publicKey) - ); - if (newJobIndex === -1) { - throw new Error(`failed to find new job in aggregator`); - } - return newJobIndex; - } - - async removeJob(jobKey: PublicKey, authority?: Keypair): Promise { - const removeIndex = this.jobs.findIndex((job) => - job.publicKey.equals(jobKey) - ); - if (removeIndex === -1) { - throw new Error(`failed to remove job with publicKey ${jobKey}`); - } - const removedJob = this.jobs[removeIndex]; - await this.account.removeJob(removedJob.account, authority); - this.jobs = this.jobs.filter((job, index) => index !== removeIndex); - return removedJob; - } - - async extendLease( - funderTokenAccount: PublicKey, - amount: anchor.BN - ): Promise { - return this.leaseAccount.account.extend({ - funder: funderTokenAccount, - funderAuthority: getProgramPayer(this.account.program), - loadAmount: amount, - }); - } - - async addHistoryBuffer(size: number, authority?: Keypair): Promise { - return this.account.setHistoryBuffer({ - size, - authority: authority || undefined, - }); - } - - static async buildJobs( - context: CommandContext, - aggregatorAccount: AggregatorAccount, - jobs: JobDefinition[] - ) { - const newJobs: JobClass[] = []; - for await (const jobDefinition of jobs) { - try { - const newJob = await JobClass.build( - context, - aggregatorAccount.program, - jobDefinition - ); - newJobs.push(newJob); - await aggregatorAccount.addJob( - newJob.account, - getProgramPayer(aggregatorAccount.program) - ); - } catch (error) { - context.logger.log( - `failed to add job to aggregator ${error.message}\r\n${jobDefinition} ` - ); - } - } - } - - async grantPermission( - context: CommandContext, - queueAuthority = programWallet(this.account.program) - ): Promise { - if ( - this.permissionAccount.permission === "NONE" && - this.authorityPublicKey.equals( - programWallet(this.account.program).publicKey - ) - ) { - this.permissionAccount = await PermissionClass.grantPermission( - context, - this.account, - queueAuthority - ); - } - return this.permissionAccount.permission; - } - - static updateReady(aggregator: AggregatorAccountData) { - const timestamp: anchor.BN = new anchor.BN(Math.round(Date.now() / 1000)); - const minUpdateDelay: number = aggregator.minUpdateDelaySeconds; - const currentTimestamp = aggregator.currentRound.roundOpenTimestamp; - const diff = timestamp.sub(currentTimestamp).abs().toNumber(); - - if (diff < minUpdateDelay) { - throw new AggregatorIllegalRoundOpenCall( - `${diff} / ${minUpdateDelay} sec` - ); - } - } - - async update( - payoutAddress?: PublicKey, - context = DEFAULT_CONTEXT - ): Promise { - AggregatorClass.updateReady(await this.account.loadData()); - - const oracleQueueAccount = new OracleQueueAccount({ - program: this.account.program, - publicKey: this.queuePublicKey, - }); - - const payoutWallet = - payoutAddress ?? - (await ProgramStateClass.getProgramTokenAddress( - this.account.program, - context - )); - - return this.account.openRound({ - oracleQueueAccount, - payoutWallet, - }); - } - - static async getJobs( - aggregatorAccount: AggregatorAccount, - aggregatorData?: Promise, - context = DEFAULT_CONTEXT - ): Promise { - const data: AggregatorAccountData = aggregatorData - ? await aggregatorData - : await aggregatorAccount.loadData(); - - const jobs: JobClass[] = []; - for await (const jobKey of data.jobPubkeysData) { - if (!jobKey.equals(DEFAULT_PUBKEY)) { - const job = await JobClass.build(context, aggregatorAccount.program, { - publicKey: jobKey, - }); - jobs.push(job); - } - } - return jobs; - } - - // loads onchain jobs, lease, permission, and account data - async loadData() { - const dataPromise: Promise = this.account.loadData(); - this.jobs = await AggregatorClass.getJobs(this.account, dataPromise); - const data = await dataPromise; - - this.result = ""; - try { - this.result = new SwitchboardDecimal( - data.latestConfirmedRound.result.mantissa ?? new anchor.BN(0), - data.latestConfirmedRound.result.scale ?? 0 - ) - .toBig() - .toString(); - } catch {} - - this.resultTimestamp = anchorBNtoDateTimeString( - data.latestConfirmedRound.roundOpenTimestamp - ); - this.publicKey = this.account.publicKey; - this.authorWalletPublicKey = data.authorWallet; - this.authorityPublicKey = data.authority; - this.crankPublicKey = data.crankPubkey; - this.historyBufferPublicKey = data.historyBuffer; - this.oracleRequestBatchSize = data.oracleRequestBatchSize; - this.expiration = data.expiration; - this.forceReportPeriod = data.forceReportPeriod; - this.isLocked = data.isLocked; - this.metadata = buffer2string(data.metadata as any); - this.minRequiredJobResults = data.minJobResults; - this.minRequiredOracleResults = data.minOracleResults; - this.minUpdateDelaySeconds = data.minUpdateDelaySeconds; - this.name = buffer2string(data.name as any); - this.queuePublicKey = data.queuePubkey; - this.startAfter = data.startAfter.toNumber(); - this.varianceThreshold = data.varianceThreshold as SwitchboardDecimal; - } - - toJSON(): IAggregatorClass { - return { - name: this.name, - metadata: this.metadata, - publicKey: this.publicKey, - authorityPublicKey: this.authorityPublicKey, - crankPublicKey: this.crankPublicKey, - authorWalletPublicKey: this.authorWalletPublicKey, - oracleRequestBatchSize: this.oracleRequestBatchSize, - expiration: this.expiration, - forceReportPeriod: this.forceReportPeriod, - isLocked: this.isLocked, - minRequiredJobResults: this.minRequiredJobResults, - minRequiredOracleResults: this.minRequiredOracleResults, - minUpdateDelaySeconds: this.minUpdateDelaySeconds, - queuePublicKey: this.queuePublicKey, - startAfter: this.startAfter, - varianceThreshold: this.varianceThreshold, - leaseAccount: this.leaseAccount.toJSON(), - permissionAccount: this.permissionAccount.toJSON(), - jobs: this.jobs ? this.jobs.map((job) => job.toJSON()) : [], - }; - } - - toString(): string { - return JSON.stringify(this.toJSON(), pubKeyConverter, 2); - } - - prettyPrint(all = false, SPACING = 24): string { - let outputString = ""; - - outputString += chalk.underline( - chalkString("## Aggregator", this.account.publicKey.toString(), SPACING) + - "\r\n" - ); - - outputString += - chalkString( - "latestResult", - `${this.result} (${this.resultTimestamp})`, - SPACING - ) + "\r\n"; - - outputString += chalkString("name", this.name, SPACING) + "\r\n"; - outputString += chalkString("metadata", this.metadata, SPACING) + "\r\n"; - outputString += - chalkString("authority", this.authorityPublicKey, SPACING) + "\r\n"; - outputString += - chalkString("queuePubkey", this.queuePublicKey, SPACING) + "\r\n"; - outputString += - chalkString("crankPubkey", this.crankPublicKey, SPACING) + "\r\n"; - outputString += - chalkString( - "historyBufferPublicKey", - this.historyBufferPublicKey, - SPACING - ) + "\r\n"; - outputString += - chalkString("authorWallet", this.authorWalletPublicKey, SPACING) + "\r\n"; - outputString += - chalkString("jobPubkeysSize", this.jobs.length, SPACING) + "\r\n"; - outputString += - chalkString("minJobResults", this.minRequiredJobResults, SPACING) + - "\r\n"; - outputString += - chalkString( - "oracleRequestBatchSize", - this.oracleRequestBatchSize, - SPACING - ) + "\r\n"; - outputString += - chalkString("minOracleResults", this.minRequiredOracleResults, SPACING) + - "\r\n"; - - outputString += - chalkString( - "varianceThreshold", - SwitchboardDecimal.from(this.varianceThreshold).toBig().toString(), - SPACING - ) + "\r\n"; - outputString += - chalkString( - "minUpdateDelaySeconds", - this.minUpdateDelaySeconds, - SPACING - ) + "\r\n"; - outputString += - chalkString( - "forceReportPeriod", - this.forceReportPeriod.toNumber(), - SPACING - ) + "\r\n"; - outputString += chalkString("isLocked", this.isLocked, SPACING) + "\r\n"; - - if (all) { - if (this.permissionAccount) { - outputString += `\r\n${this.permissionAccount.prettyPrint( - true, - SPACING - )}`; - } - if (this.leaseAccount) { - outputString += `\r\n${this.leaseAccount.prettyPrint(true, SPACING)}`; - } - for (const job of this.jobs) { - outputString += `\r\n${job.prettyPrint(true)}`; - } - } - - return outputString; - } -} diff --git a/cli/src/accounts/aggregator/index.ts b/cli/src/accounts/aggregator/index.ts deleted file mode 100644 index b46bc19..0000000 --- a/cli/src/accounts/aggregator/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./aggregator"; -export * from "./types"; diff --git a/cli/src/accounts/aggregator/types.ts b/cli/src/accounts/aggregator/types.ts deleted file mode 100644 index 7d75448..0000000 --- a/cli/src/accounts/aggregator/types.ts +++ /dev/null @@ -1,121 +0,0 @@ -import * as anchor from "@project-serum/anchor"; -import { Keypair, PublicKey } from "@solana/web3.js"; -import { SwitchboardDecimal } from "@switchboard-xyz/switchboard-v2"; -import { - copyAccount, - fromPublicKey, - fromSwitchboardAccount, - IJobClass, - ILeaseClass, - IPermissionClass, - JobDefinition, - jsonPath, - PermissionDefinition, -} from ".."; - -export interface AggregatorHistoryRow { - timestamp: anchor.BN; - value: SwitchboardDecimal; -} - -export interface AggregatorRound { - numSuccess: number; - numError: number; - isClosed: boolean; - roundOpenSlot: anchor.BN; - roundOpenTimestamp: anchor.BN; - result: SwitchboardDecimal; - stdDeviation: SwitchboardDecimal; - minResponse: SwitchboardDecimal; - maxResponse: SwitchboardDecimal; - oraclePubkeysData: PublicKey[]; - mediansData: SwitchboardDecimal[]; - currentPayout: anchor.BN[]; - mediansFulfilled: boolean[]; - errorsFulfilled: boolean[]; -} - -export interface AggregatorAccountData { - name: Buffer; - metadata: Buffer; - authorWallet: PublicKey; - queuePubkey: PublicKey; - crankPubkey: PublicKey; - oracleRequestBatchSize: number; - minOracleResults: number; - minJobResults: number; - minUpdateDelaySeconds: number; - startAfter: anchor.BN; - varianceThreshold: SwitchboardDecimal; - forceReportPeriod: anchor.BN; - expiration: anchor.BN; - consecutiveFailureCount: anchor.BN; - nextAllowedUpdateTime: anchor.BN; - isLocked: boolean; - schedule: Buffer; - latestConfirmedRound: AggregatorRound; - currentRound: AggregatorRound; - jobPubkeysData: PublicKey[]; // is there a way to define sizeof 16? - jobHashes: Buffer; // Hash[16] - jobPubkeysSize: number; - jobsChecksum: Buffer; - authority: PublicKey; - historyBuffer: PublicKey; -} - -/** JSON interface to construct a new Aggregator Account */ -export interface fromAggregatorJSON { - authorWalletPublicKey?: PublicKey; - authorityPublicKey?: PublicKey; - oracleRequestBatchSize?: number; // REQ, will default to some value - crank?: string | number | boolean | undefined; - expiration?: string | number; // BN - forceReportPeriod?: string | number; // BN - existingKeypair?: Keypair; // TODO: fs path to keypair - metadata?: string; - minRequiredJobResults?: number; // REQ, will default to 75% of jobs - minRequiredOracleResults?: number; // REQ, will default to 1 - minUpdateDelaySeconds?: number; // REQ, will default to 30s - name?: string; - queuePublicKey: PublicKey; - startAfter?: number; - varianceThreshold?: number; - historyBuffer?: number; - // accounts - jobs: JobDefinition[]; - leaseAccount?: ILeaseClass; - permissionAccount?: PermissionDefinition; -} - -/** Object representing a loaded onchain Aggregator Account */ -export interface IAggregatorClass { - publicKey: PublicKey; - authorWalletPublicKey: PublicKey; - historyBufferPublicKey?: PublicKey; - authorityPublicKey: PublicKey; - oracleRequestBatchSize: number; // REQ, will default to some value - crankPublicKey?: PublicKey | string | number | boolean; - expiration: anchor.BN; - forceReportPeriod: anchor.BN; - isLocked?: boolean; - metadata: string; - minRequiredJobResults: number; // REQ, will default to 75% of jobs - minRequiredOracleResults: number; // REQ, will default to 1 - minUpdateDelaySeconds: number; // REQ, will default to 30s - name: string; - queuePublicKey: PublicKey; - startAfter: number; - varianceThreshold: SwitchboardDecimal; - - jobs: IJobClass[]; - leaseAccount?: ILeaseClass; - permissionAccount?: IPermissionClass; -} - -/** Type representing the different ways to build an Aggregator Account */ -export type AggregatorDefinition = - | fromSwitchboardAccount - | fromPublicKey - | fromAggregatorJSON - | copyAccount - | jsonPath; diff --git a/cli/src/accounts/crank/crank.ts b/cli/src/accounts/crank/crank.ts deleted file mode 100644 index 5426a3a..0000000 --- a/cli/src/accounts/crank/crank.ts +++ /dev/null @@ -1,215 +0,0 @@ -import * as anchor from "@project-serum/anchor"; -import { PublicKey } from "@solana/web3.js"; -import { - CrankAccount, - CrankRow, - OracleQueueAccount, -} from "@switchboard-xyz/switchboard-v2"; -import chalk from "chalk"; -import { buffer2string, chalkString, pubKeyConverter } from "../"; -import { CommandContext } from "../../types/context"; -import { DEFAULT_CONTEXT } from "../../types/context/context"; -import { LogProvider } from "../../types/context/logging"; -import { AggregatorClass } from "../aggregator"; -import { ProgramStateClass } from "../state"; -import { - CrankAccountData, - CrankDefinition, - fromCrankJSON, - ICrankClass, -} from "./types"; - -export class CrankClass implements ICrankClass { - account: CrankAccount; - - logger: LogProvider; - - publicKey: PublicKey; - - queuePublicKey: PublicKey; - - maxRows: number; - - metadata: string; - - name: string; - - aggregatorKeys: PublicKey[]; - - dataBuffer: PublicKey; - - size: number; - - private constructor() {} - - private static async init( - context: CommandContext, - account: CrankAccount - ): Promise { - const crank = new CrankClass(); - crank.logger = context.logger; - - crank.account = account; - crank.publicKey = crank.account.publicKey; - - await crank.loadData(); - - return crank; - } - - static async build( - context, - program: anchor.Program, - definition: CrankDefinition, - queueAccount?: OracleQueueAccount - ) { - if ("account" in definition) { - if (definition.account instanceof CrankAccount) { - return CrankClass.fromAccount(context, definition.account); - } - throw new TypeError(`account type should be CrankAccount`); - } else if ("publicKey" in definition) { - return CrankClass.fromPublicKey(context, program, definition.publicKey); - } else if (queueAccount) { - return CrankClass.fromJSON(context, definition, queueAccount); - } - throw new Error("failed to build crank class"); - } - - public static async fromAccount( - context: CommandContext, - account: CrankAccount - ) { - return CrankClass.init(context, account); - } - - public static fromPublicKey( - context: CommandContext, - program: anchor.Program, - publicKey: PublicKey - ) { - return CrankClass.init( - context, - new CrankAccount({ - program, - publicKey, - }) - ); - } - - public static async fromJSON( - context: CommandContext, - definition: fromCrankJSON, - queueAccount: OracleQueueAccount - ) { - const { name, metadata, maxRows } = definition; - - const account = await CrankAccount.create(queueAccount.program, { - queueAccount, - name: name ? Buffer.from(name) : undefined, - metadata: metadata ? Buffer.from(metadata) : undefined, - maxRows, - }); - - context.logger.info(`created crank account ${name} ${account.publicKey}`); - - return CrankClass.init(context, account); - } - - public static async fromDefault( - context: CommandContext, - queueAccount: OracleQueueAccount, - name = "" - ) { - return CrankClass.fromJSON(context, { name }, queueAccount); - } - - static async turn( - crankAccount: CrankAccount, - context = DEFAULT_CONTEXT - ): Promise { - const { queuePubkey } = await crankAccount.loadData(); - const queueAccount = new OracleQueueAccount({ - program: crankAccount.program, - publicKey: queuePubkey, - }); - - const { authority } = await queueAccount.loadData(); - const authorityTokenWallet = await ProgramStateClass.getProgramTokenAddress( - crankAccount.program - ); - - const state = await ProgramStateClass.build(crankAccount.program, context); - - const popTxn = await crankAccount.pop({ - payoutWallet: authorityTokenWallet, - queuePubkey, - queueAuthority: authority, - crank: 0, - queue: 0, - tokenMint: state.tokenMintPublicKey, - }); - return popTxn; - } - - async push(aggregator: AggregatorClass): Promise { - return this.account.push({ aggregatorAccount: aggregator.account }); - } - - // loads anchor idl and parses response - async loadData() { - const data: CrankAccountData | any = await this.account.loadData(); - this.aggregatorKeys = data.pqData - .slice(0, data.pqSize) - .map((item: CrankRow) => item.pubkey); - - this.name = buffer2string(data.name as any); - this.metadata = buffer2string(data.metadata as any); - this.publicKey = this.account.publicKey; - this.queuePublicKey = data.queuePubkey; - this.maxRows = data.maxRows; - this.dataBuffer = data.dataBuffer; - this.size = data.pqSize; - } - - toJSON(): ICrankClass { - return { - name: this.name, - metadata: this.metadata, - publicKey: this.publicKey, - queuePublicKey: this.queuePublicKey, - maxRows: this.maxRows, - }; - } - - toString(): string { - return JSON.stringify(this.toJSON(), pubKeyConverter, 2); - } - - prettyPrint(all = false, SPACING = 30): string { - let outputString = ""; - - outputString += chalk.underline( - chalkString("## Crank", this.publicKey.toString(), SPACING) + "\r\n" - ); - outputString += chalkString("name", this.name, SPACING) + "\r\n"; - outputString += chalkString("metadata", this.metadata, SPACING) + "\r\n"; - outputString += - chalkString("dataBuffer", this.dataBuffer, SPACING) + "\r\n"; - outputString += - chalkString("queuePubkey", this.queuePublicKey, SPACING) + "\r\n"; - outputString += - chalkString("rows", `${this.size} / ${this.maxRows}`, SPACING) + "\r\n"; - - if (all) { - outputString += - chalkString( - "maxRows", - JSON.stringify(this.aggregatorKeys, pubKeyConverter, 2), - SPACING - ) + "\r\n"; - } - - return outputString; - } -} diff --git a/cli/src/accounts/crank/index.ts b/cli/src/accounts/crank/index.ts deleted file mode 100644 index f1d3629..0000000 --- a/cli/src/accounts/crank/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./crank"; -export * from "./types"; diff --git a/cli/src/accounts/crank/types.ts b/cli/src/accounts/crank/types.ts deleted file mode 100644 index cd25ab2..0000000 --- a/cli/src/accounts/crank/types.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { PublicKey } from "@solana/web3.js"; -import { CrankRow } from "@switchboard-xyz/switchboard-v2"; -import { fromPublicKey, fromSwitchboardAccount } from ".."; - -export interface CrankAccountData { - name: Buffer; - metadata: Buffer; - queuePubkey: PublicKey; - pqSize: number; - maxRows: number; - jitterModifier: number; // u8 - pqData: CrankRow[]; - dataBuffer: PublicKey; -} - -/** JSON interface to construct a new Crank Account */ -export interface fromCrankJSON { - name?: string; - metadata?: string; - maxRows?: number; - queuePublicKey?: PublicKey; -} - -/** Object representing a loaded onchain Crank Account */ -export interface ICrankClass { - publicKey: PublicKey; - maxRows: number; - metadata: string; - name: string; - queuePublicKey?: PublicKey; -} - -/** Type representing the different ways to build a Crank Account */ -export type CrankDefinition = - | fromSwitchboardAccount - | fromPublicKey - | fromCrankJSON; - -/** Type representing the different ways to build a set of Crank Accounts */ -export type CrankDefinitions = CrankDefinition[] | number; diff --git a/cli/src/accounts/index.ts b/cli/src/accounts/index.ts deleted file mode 100644 index ddfc989..0000000 --- a/cli/src/accounts/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -export * from "./aggregator"; -export * from "./crank"; -export * from "./job"; -export * from "./lease"; -export * from "./oracle"; -export * from "./permission"; -export * from "./queue"; -export * from "./state"; -export * from "./types"; -export * from "./utils"; diff --git a/cli/src/accounts/job/buildTemplate.ts b/cli/src/accounts/job/buildTemplate.ts deleted file mode 100644 index cbac3ea..0000000 --- a/cli/src/accounts/job/buildTemplate.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import { TemplateSource, TEMPLATE_SOURCES } from "."; -import { Ascendex } from "./jobTemplates/ascendex"; -import { BinanceCom } from "./jobTemplates/binanceCom"; -import { BinanceUs } from "./jobTemplates/binanceUs"; -import { Bitfinex } from "./jobTemplates/bitfinex"; -import { Bitstamp } from "./jobTemplates/bitstamp"; -import { Bittrex } from "./jobTemplates/bittrex"; -import { Bonfida } from "./jobTemplates/bonfida"; -import { Coinbase } from "./jobTemplates/coinbase"; -import { FtxCom } from "./jobTemplates/ftxCom"; -import { FtxUs } from "./jobTemplates/ftxUs"; -import { Gate } from "./jobTemplates/gate"; -import { Huobi } from "./jobTemplates/huobi"; -import { Kraken } from "./jobTemplates/kraken"; -import { Kucoin } from "./jobTemplates/kucoin"; -import { Mexc } from "./jobTemplates/mexc"; -import { Okex } from "./jobTemplates/okex"; -import { Orca } from "./jobTemplates/orca"; -import { Raydium } from "./jobTemplates/raydium"; -import { SMB } from "./jobTemplates/smb"; - -export const buildJobTasks = async ( - source: TemplateSource, - id?: string -): Promise => { - switch (source.toLowerCase()) { - case "ascendex": - return new Ascendex(id).tasks(); - case "binancecom": - return new BinanceCom(id).tasks(); - case "binanceus": - return new BinanceUs(id).tasks(); - case "bitfinex": - return new Bitfinex(id).tasks(); - case "bitstamp": - return new Bitstamp(id).tasks(); - case "bittrex": - return new Bittrex(id).tasks(); - case "bonfida": - return new Bonfida(id).tasks(); - case "coinbase": - return new Coinbase(id).tasks(); - case "ftxcom": - return new FtxCom(id).tasks(); - case "ftxus": - return new FtxUs(id).tasks(); - case "gate": - return new Gate(id).tasks(); - case "huobi": - return new Huobi(id).tasks(); - case "kraken": - return new Kraken(id).tasks(); - case "kucoin": - return new Kucoin(id).tasks(); - case "mexc": - return new Mexc(id).tasks(); - case "okex": - return new Okex(id).tasks(); - case "orca": - return new Orca(id).tasks(); - case "raydium": - return new Raydium(id).tasks(); - case "smb": - return new SMB(id).tasks(); - default: - throw new Error( - `No job template found for ${source}. Available options:\r\n${TEMPLATE_SOURCES}` - ); - } -}; diff --git a/cli/src/accounts/job/index.ts b/cli/src/accounts/job/index.ts deleted file mode 100644 index ffd6670..0000000 --- a/cli/src/accounts/job/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./buildTemplate"; -export * from "./job"; -export * from "./types"; -export * from "./utils"; diff --git a/cli/src/accounts/job/job.ts b/cli/src/accounts/job/job.ts deleted file mode 100644 index 5993df0..0000000 --- a/cli/src/accounts/job/job.ts +++ /dev/null @@ -1,216 +0,0 @@ -import * as anchor from "@project-serum/anchor"; -import { PublicKey } from "@solana/web3.js"; -import { - JobAccount, - OracleJob, - programWallet, -} from "@switchboard-xyz/switchboard-v2"; -import chalk from "chalk"; -import { getUrlFromTask } from "."; -import { buffer2string, chalkString, copyAccount, pubKeyConverter } from "../"; -import { CommandContext } from "../../types/context"; -import { LogProvider } from "../../types/context/logging"; -import { ProgramStateClass } from "../state"; -import { buildJobTasks } from "./buildTemplate"; -import { - fromJobJSON, - fromJobTemplate, - IJobClass, - JobAccountData, - JobDefinition, -} from "./types"; - -export class JobClass implements IJobClass { - account: JobAccount; - - logger: LogProvider; - - publicKey: PublicKey; - - authorityWalletPublicKey: PublicKey; - - expiration: anchor.BN; - - metadata: string; - - name: string; - - tasks: OracleJob.ITask[]; - - private constructor() {} - - private static async init( - context: CommandContext, - account: JobAccount - ): Promise { - const job = new JobClass(); - job.account = account; - job.publicKey = job.account.publicKey; - job.logger = context.logger; - - await job.loadData(); - - return job; - } - - static async build( - context: CommandContext, - program: anchor.Program, - definition: JobDefinition - ): Promise { - if ("account" in definition) { - if (definition.account instanceof JobAccount) { - return JobClass.fromAccount(context, definition.account); - } - throw new TypeError(`account type should be CrankAccount`); - } else if ("publicKey" in definition) { - return JobClass.fromPublicKey(context, program, definition.publicKey); - } else if ("template" in definition) { - return JobClass.fromTemplate(context, program, definition); - } else if ("tasks" in definition) { - return JobClass.fromJSON(context, program, definition); - } else if ("sourcePublicKey" in definition) { - return JobClass.fromCopyAccount(context, program, definition); - } else { - throw new Error(`failed to build job from definition ${definition}`); - } - } - - public static fromAccount(context: CommandContext, account: JobAccount) { - return JobClass.init(context, account); - } - - public static fromPublicKey( - context: CommandContext, - program: anchor.Program, - publicKey: PublicKey - ) { - return JobClass.init( - context, - new JobAccount({ - program, - publicKey, - }) - ); - } - - public static async fromTemplate( - context: CommandContext, - program: anchor.Program, - definition: fromJobTemplate - ) { - const tasks = await buildJobTasks(definition.template, definition.id); - const job = OracleJob.create({ tasks }); - const data = Buffer.from(OracleJob.encodeDelimited(job).finish()); - const jobUrl = getUrlFromTask(job); - const wallet = programWallet(program); - const account = await JobAccount.create(program, { - data, - name: Buffer.from(`${jobUrl} ${definition.id}`), - authority: wallet.publicKey, - }); - return JobClass.init(context, account); - } - - public static async fromJSON( - context: CommandContext, - program: anchor.Program, - definition: fromJobJSON - ) { - const { - name, - tasks, - expiration, - authorityWalletPublicKey, - existingKeypair, - } = definition; - const data = Buffer.from( - OracleJob.encodeDelimited( - OracleJob.create({ - tasks, - }) - ).finish() - ); - - const keypair = existingKeypair ?? anchor.web3.Keypair.generate(); - const account = await JobAccount.create(program, { - data: data, - name: name ? Buffer.from(name) : Buffer.from(""), - expiration: expiration ? new anchor.BN(expiration) : undefined, - authority: - authorityWalletPublicKey ?? - (await ProgramStateClass.getProgramTokenAddress(program)), - keypair, - }); - - context.fs.saveKeypair(keypair); - - context.logger.info(`created job account ${name} ${account.publicKey}`); - - return JobClass.init(context, account); - } - - public static async fromCopyAccount( - context: CommandContext, - program: anchor.Program, - definition: copyAccount - ) { - const sourceJob = new JobAccount({ - program, - publicKey: definition.sourcePublicKey, - }); - const jobData: JobAccountData = await sourceJob.loadData(); - const account = await JobAccount.create(program, { - data: jobData.data, - name: Buffer.from(jobData.name), - expiration: jobData.expiration - ? new anchor.BN(jobData.expiration) - : undefined, - authority: jobData.authority ?? undefined, - }); - return JobClass.init(context, account); - } - - // loads anchor idl and parses response - async loadData() { - const data: JobAccountData = await this.account.loadData(); - - this.authorityWalletPublicKey = data.authority; - this.expiration = data.expiration; - this.metadata = buffer2string(data.metadata as any); - this.name = buffer2string(data.name as any); - this.tasks = OracleJob.decodeDelimited(data.data).tasks; - } - - toJSON(): IJobClass { - return { - name: this.name, - metadata: this.metadata, - publicKey: this.publicKey, - authorityWalletPublicKey: this.authorityWalletPublicKey, - expiration: this.expiration, - tasks: this.tasks, - }; - } - - toString(): string { - return JSON.stringify(this.toJSON(), pubKeyConverter, 2); - } - - prettyPrint(all = false): string { - let outputString = ""; - - outputString += chalk.underline( - chalkString("## Job", this.publicKey) + "\r\n" - ); - outputString += chalkString("name", this.name) + "\r\n"; - outputString += - chalkString("authority", this.authorityWalletPublicKey) + "\r\n"; - outputString += - chalkString("expiration", this.expiration.toString()) + "\r\n"; - outputString += - chalkString("tasks", JSON.stringify(this.tasks, undefined, 2)) + "\r\n"; - - return outputString; - } -} diff --git a/cli/src/accounts/job/jobTemplates/ascendex.ts b/cli/src/accounts/job/jobTemplates/ascendex.ts deleted file mode 100644 index 0061e9d..0000000 --- a/cli/src/accounts/job/jobTemplates/ascendex.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class Ascendex extends AbstractJobTemplate { - public id: string; - - url(): string { - return `https://ascendex.com/api/pro/v1/ticker?symbol=${this.id}`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - httpTask: OracleJob.HttpTask.create({ - url: ``, - }), - }), - OracleJob.Task.create({ - medianTask: OracleJob.MedianTask.create({ - tasks: [ - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: `$.data.ask[0]`, - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: `$.data.bid[0]`, - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: `$.data.close`, - }), - }), - ], - }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/binanceCom.ts b/cli/src/accounts/job/jobTemplates/binanceCom.ts deleted file mode 100644 index db17170..0000000 --- a/cli/src/accounts/job/jobTemplates/binanceCom.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class BinanceCom extends AbstractJobTemplate { - public id: string; - - url(): string { - return `https://www.binance.com/api/v3/ticker/price?symbol=${this.id}`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - httpTask: OracleJob.HttpTask.create({ - url: this.url(), - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ path: "$.price" }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/binanceUs.ts b/cli/src/accounts/job/jobTemplates/binanceUs.ts deleted file mode 100644 index a758487..0000000 --- a/cli/src/accounts/job/jobTemplates/binanceUs.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class BinanceUs extends AbstractJobTemplate { - url(): string { - return `https://www.binance.us/api/v3/ticker/price?symbol=${this.id}`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - httpTask: OracleJob.HttpTask.create({ - url: this.url(), - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ path: "$.price" }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/bitfinex.ts b/cli/src/accounts/job/jobTemplates/bitfinex.ts deleted file mode 100644 index 61cfa2b..0000000 --- a/cli/src/accounts/job/jobTemplates/bitfinex.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class Bitfinex extends AbstractJobTemplate { - public id: string; - - url(): string { - const cleanedupId = - this.id.charAt(0).toLowerCase() + this.id.toUpperCase().slice(1); - return `https://api-pub.bitfinex.com/v2/tickers?symbols=${cleanedupId}`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - httpTask: OracleJob.HttpTask.create({ - url: this.url(), - }), - }), - OracleJob.Task.create({ - medianTask: OracleJob.MedianTask.create({ - tasks: [ - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$[0][1]", - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$[0][3]", - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$[0][7]", - }), - }), - ], - }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/bitstamp.ts b/cli/src/accounts/job/jobTemplates/bitstamp.ts deleted file mode 100644 index 92a808d..0000000 --- a/cli/src/accounts/job/jobTemplates/bitstamp.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class Bitstamp extends AbstractJobTemplate { - public id: string; - - url(): string { - return `https://www.bitstamp.net/api/v2/ticker/${this.id.toLowerCase()}`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - httpTask: OracleJob.HttpTask.create({ - url: this.url(), - }), - }), - OracleJob.Task.create({ - medianTask: OracleJob.MedianTask.create({ - tasks: [ - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ path: "$.ask" }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ path: "$.bid" }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ path: "$.last" }), - }), - ], - }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/bittrex.ts b/cli/src/accounts/job/jobTemplates/bittrex.ts deleted file mode 100644 index e51ddae..0000000 --- a/cli/src/accounts/job/jobTemplates/bittrex.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class Bittrex extends AbstractJobTemplate { - public id: string; - - url(): string { - return `https://api.bittrex.com/v3/markets/${this.id}/ticker`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - httpTask: OracleJob.HttpTask.create({ - url: this.url(), - }), - }), - OracleJob.Task.create({ - medianTask: OracleJob.MedianTask.create({ - tasks: [ - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$.askRate", - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$.bidRate", - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$.lastTradeRate", - }), - }), - ], - }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/bonfida.ts b/cli/src/accounts/job/jobTemplates/bonfida.ts deleted file mode 100644 index b37ff2e..0000000 --- a/cli/src/accounts/job/jobTemplates/bonfida.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class Bonfida extends AbstractJobTemplate { - public id: string; - - url(): string { - return `https://serum-api.bonfida.com/orderbooks/${this.id}`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - httpTask: OracleJob.HttpTask.create({ - url: ``, - }), - }), - OracleJob.Task.create({ - medianTask: OracleJob.MedianTask.create({ - tasks: [ - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$.data.bids[0].price", - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$.data.asks[0].price", - }), - }), - ], - }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/coinbase.ts b/cli/src/accounts/job/jobTemplates/coinbase.ts deleted file mode 100644 index 58e5069..0000000 --- a/cli/src/accounts/job/jobTemplates/coinbase.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class Coinbase extends AbstractJobTemplate { - url(): string { - return `wss://ws-feed.pro.coinbase.com`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - websocketTask: OracleJob.WebsocketTask.create({ - url: this.url(), - subscription: JSON.stringify({ - type: "subscribe", - product_ids: [this.id], - channels: [ - "ticker", - { - name: "ticker", - product_ids: [this.id], - }, - ], - }), - maxDataAgeSeconds: 15, - filter: `$[?(@.type == 'ticker' && @.product_id == '${this.id}')]`, - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ path: "$.price" }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/ftxCom.ts b/cli/src/accounts/job/jobTemplates/ftxCom.ts deleted file mode 100644 index 56b2571..0000000 --- a/cli/src/accounts/job/jobTemplates/ftxCom.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class FtxCom extends AbstractJobTemplate { - url(): string { - return `wss://ftx.com/ws/`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - websocketTask: OracleJob.WebsocketTask.create({ - url: this.url(), - subscription: JSON.stringify({ - op: "subscribe", - channel: "ticker", - market: this.id, - }), - maxDataAgeSeconds: 15, - filter: `$[?(@.type == 'update' && @.channel == 'ticker' && @.market == '${this.id}')]`, - }), - }), - OracleJob.Task.create({ - medianTask: OracleJob.MedianTask.create({ - tasks: [ - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$.data.bid", - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$.data.ask", - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$.data.last", - }), - }), - ], - }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/ftxUs.ts b/cli/src/accounts/job/jobTemplates/ftxUs.ts deleted file mode 100644 index c8825f4..0000000 --- a/cli/src/accounts/job/jobTemplates/ftxUs.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class FtxUs extends AbstractJobTemplate { - url(): string { - return `https://ftx.us/api/markets/${this.id}`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - httpTask: OracleJob.HttpTask.create({ - url: this.url(), - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$.result.price", - }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/gate.ts b/cli/src/accounts/job/jobTemplates/gate.ts deleted file mode 100644 index d3a344a..0000000 --- a/cli/src/accounts/job/jobTemplates/gate.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class Gate extends AbstractJobTemplate { - public id: string; - - url(): string { - return `https://api.gateio.ws/api/v4/spot/tickers?currency_pair=${this.id}`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - httpTask: OracleJob.HttpTask.create({ - url: this.url(), - }), - }), - OracleJob.Task.create({ - medianTask: OracleJob.MedianTask.create({ - tasks: [ - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: `$[0].lowest_ask`, - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: `$[0].highest_bid`, - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: `$[0].last`, - }), - }), - ], - }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/huobi.ts b/cli/src/accounts/job/jobTemplates/huobi.ts deleted file mode 100644 index ba90c38..0000000 --- a/cli/src/accounts/job/jobTemplates/huobi.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class Huobi extends AbstractJobTemplate { - url(): string { - return `https://api.huobi.pro/market/detail/merged?symbol=${this.id}`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - httpTask: OracleJob.HttpTask.create({ - url: this.url(), - }), - }), - OracleJob.Task.create({ - medianTask: OracleJob.MedianTask.create({ - tasks: [ - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$.tick.bid[0]", - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$.tick.ask[0]", - }), - }), - ], - }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/kraken.ts b/cli/src/accounts/job/jobTemplates/kraken.ts deleted file mode 100644 index d155f20..0000000 --- a/cli/src/accounts/job/jobTemplates/kraken.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class Kraken extends AbstractJobTemplate { - url(): string { - return `https://api.kraken.com/0/public/Ticker?pair=${this.id}`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - httpTask: OracleJob.HttpTask.create({ - url: this.url(), - }), - }), - OracleJob.Task.create({ - medianTask: OracleJob.MedianTask.create({ - tasks: [ - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: `$.result.${this.id}.a[0]`, - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: `$.result.${this.id}.b[0]`, - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: `$.result.${this.id}.c[0]`, - }), - }), - ], - }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/kucoin.ts b/cli/src/accounts/job/jobTemplates/kucoin.ts deleted file mode 100644 index db13368..0000000 --- a/cli/src/accounts/job/jobTemplates/kucoin.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class Kucoin extends AbstractJobTemplate { - url(): string { - return `https://api.kucoin.com/api/v1/market/orderbook/level1?symbol=${this.id}`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - httpTask: OracleJob.HttpTask.create({ - url: this.url(), - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ path: `$.data.price` }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/mexc.ts b/cli/src/accounts/job/jobTemplates/mexc.ts deleted file mode 100644 index bf3716b..0000000 --- a/cli/src/accounts/job/jobTemplates/mexc.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class Mexc extends AbstractJobTemplate { - url(): string { - return `https://www.mexc.com/open/api/v2/market/ticker?symbol=${this.id}`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - httpTask: OracleJob.HttpTask.create({ - url: this.url(), - }), - }), - OracleJob.Task.create({ - medianTask: OracleJob.MedianTask.create({ - tasks: [ - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$.data[0].ask", - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$.data[0].bid", - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$.data[0].last", - }), - }), - ], - }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/okex.ts b/cli/src/accounts/job/jobTemplates/okex.ts deleted file mode 100644 index 18f081d..0000000 --- a/cli/src/accounts/job/jobTemplates/okex.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class Okex extends AbstractJobTemplate { - url(): string { - return `wss://ws.okex.com:8443/ws/v5/public`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - websocketTask: OracleJob.WebsocketTask.create({ - url: "wss://ws.okex.com:8443/ws/v5/public", - subscription: JSON.stringify({ - op: "subscribe", - args: [{ channel: "tickers", instId: this.id }], - }), - maxDataAgeSeconds: 15, - filter: - "$[?(" + - `@.event != 'subscribe' && ` + - `@.arg.channel == 'tickers' && ` + - `@.arg.instId == '${this.id}' && ` + - `@.data[0].instType == 'SPOT' && ` + - `@.data[0].instId == '${this.id}')]`, - }), - }), - OracleJob.Task.create({ - medianTask: OracleJob.MedianTask.create({ - tasks: [ - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$.data[0].bidPx", - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$.data[0].askPx", - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: "$.data[0].last", - }), - }), - ], - }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/orca.ts b/cli/src/accounts/job/jobTemplates/orca.ts deleted file mode 100644 index 51317f1..0000000 --- a/cli/src/accounts/job/jobTemplates/orca.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class Orca extends AbstractJobTemplate { - url(): string { - return `https://api.orca.so/pools`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - httpTask: OracleJob.HttpTask.create({ - url: this.url(), - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ - path: `$[?(@.name == '${this.id}[aquafarm]')].price`, - }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/orcaLp.ts b/cli/src/accounts/job/jobTemplates/orcaLp.ts deleted file mode 100644 index 312a325..0000000 --- a/cli/src/accounts/job/jobTemplates/orcaLp.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { PublicKey } from "@solana/web3.js"; -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; - -export async function buildOrcaLpTask( - key: string, - solKey: PublicKey -): Promise { - const tasks = [ - OracleJob.Task.create({ - lpExchangeRateTask: OracleJob.LpExchangeRateTask.create({ - saberPoolAddress: key, - }), - }), - OracleJob.Task.create({ - multiplyTask: OracleJob.MultiplyTask.create({ - aggregatorPubkey: solKey.toBase58(), - }), - }), - ]; - return tasks; -} diff --git a/cli/src/accounts/job/jobTemplates/raydium.ts b/cli/src/accounts/job/jobTemplates/raydium.ts deleted file mode 100644 index 5dc8306..0000000 --- a/cli/src/accounts/job/jobTemplates/raydium.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class Raydium extends AbstractJobTemplate { - url(): string { - return `https://api.raydium.io/coin/price?coins`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - httpTask: OracleJob.HttpTask.create({ - url: this.url(), - }), - }), - OracleJob.Task.create({ - jsonParseTask: OracleJob.JsonParseTask.create({ path: `$.${this.id}` }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/saberLp.ts b/cli/src/accounts/job/jobTemplates/saberLp.ts deleted file mode 100644 index 3aa6551..0000000 --- a/cli/src/accounts/job/jobTemplates/saberLp.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class SaberLp extends AbstractJobTemplate { - url(): string { - return `${this.id}`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - lpTokenPriceTask: OracleJob.LpTokenPriceTask.create({ - saberPoolAddress: this.url(), - }), - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/smb.ts b/cli/src/accounts/job/jobTemplates/smb.ts deleted file mode 100644 index b01dc8d..0000000 --- a/cli/src/accounts/job/jobTemplates/smb.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import AbstractJobTemplate from "./template"; - -export class SMB extends AbstractJobTemplate { - url(): string { - return `https://market.solanamonkey.business/.netlify/functions/fetchOffers`; - } - - async tasks(): Promise { - const tasks = [ - OracleJob.Task.create({ - httpTask: { - url: `https://market.solanamonkey.business/.netlify/functions/fetchOffers`, - }, - }), - OracleJob.Task.create({ - jsonParseTask: { - path: `$.offers[?(@.price)].price`, - aggregationMethod: OracleJob.JsonParseTask.AggregationMethod.MIN, - }, - }), - ]; - return tasks; - } -} diff --git a/cli/src/accounts/job/jobTemplates/solanart.ts b/cli/src/accounts/job/jobTemplates/solanart.ts deleted file mode 100644 index 7bbd669..0000000 --- a/cli/src/accounts/job/jobTemplates/solanart.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; - -export function solanartFloorPrice(projectId: string): Array { - return [ - OracleJob.Task.create({ - httpTask: { - url: `https://jmccmlyu33.medianetwork.cloud/nft_for_sale?collection=${projectId}`, - }, - }), - OracleJob.Task.create({ - jsonParseTask: { - path: `$[?(@.price)].price`, - aggregationMethod: OracleJob.JsonParseTask.AggregationMethod.MIN, - }, - }), - ]; -} diff --git a/cli/src/accounts/job/jobTemplates/template.ts b/cli/src/accounts/job/jobTemplates/template.ts deleted file mode 100644 index 4795d28..0000000 --- a/cli/src/accounts/job/jobTemplates/template.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; - -abstract class AbstractJobTemplate { - public id: string; - - constructor(id: string) { - this.id = id ?? ""; - } - - abstract url(): string; - - abstract tasks(verify?: boolean): Promise; -} - -export default AbstractJobTemplate; diff --git a/cli/src/accounts/job/types.ts b/cli/src/accounts/job/types.ts deleted file mode 100644 index 47940dc..0000000 --- a/cli/src/accounts/job/types.ts +++ /dev/null @@ -1,82 +0,0 @@ -import * as anchor from "@project-serum/anchor"; -import { Keypair, PublicKey } from "@solana/web3.js"; -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import { - copyAccount, - fromPublicKey, - fromSwitchboardAccount, - jsonPath, -} from "../types/types"; - -export interface JobAccountData { - name: Buffer; // Uint8Array - metadata: Buffer; - authority: PublicKey; - expiration: anchor.BN; - hash: Buffer; - data: Buffer; // ?? - referenceCount: number; -} - -export const TEMPLATE_SOURCES = [ - "ascendex", - "binanceCom", - "binanceUs", - "bitfinex", - "bitstamp", - "bittrex", - "bonfida", - "coinbase", - "ftxCom", - "ftxUs", - "gate", - "huobi", - "kraken", - "kucoin", - "mexc", - "okex", - "orca", - "raydium", - "smb", -] as const; - -/** Type representing the different predefined job templates */ -export type TemplateSource = typeof TEMPLATE_SOURCES[number]; - -/** Create a job account from a predefined template */ -export interface fromJobTemplate { - template: TemplateSource; - id?: string; - existingKeypair?: Keypair; - name?: string; -} - -/** JSON interface to construct a new Job Account */ -export interface fromJobJSON { - aggregator?: string | PublicKey; // add by agg name (BTC_USD) - authorityWalletPublicKey?: PublicKey; // Defaults to authority who created - existingKeypair?: Keypair; - expiration?: number; - metadata?: string; - name?: string; - tasks: OracleJob.ITask[]; -} - -/** Type representing the different ways to build a Job Account */ -export type JobDefinition = - | fromSwitchboardAccount - | fromPublicKey - | fromJobJSON - | fromJobTemplate - | copyAccount - | jsonPath; - -/** Object representing a loaded onchain Job Account */ -export interface IJobClass { - publicKey: PublicKey; - authorityWalletPublicKey: PublicKey; - expiration: anchor.BN; - metadata: string; - name: string; - tasks: OracleJob.ITask[]; -} diff --git a/cli/src/accounts/job/utils.ts b/cli/src/accounts/job/utils.ts deleted file mode 100644 index 0caec69..0000000 --- a/cli/src/accounts/job/utils.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { OracleJob } from "@switchboard-xyz/switchboard-v2"; -import { URL } from "url"; - -export const getUrlFromTask = (job: OracleJob): string => { - const { tasks } = job; - const firstTask = tasks[0]; - const jobUrl: string = firstTask.httpTask - ? firstTask.httpTask.url - : firstTask.websocketTask - ? firstTask.websocketTask.url - : ""; - if (jobUrl === "") return jobUrl; - const parsedUrl = new URL(jobUrl); - return parsedUrl.hostname; -}; diff --git a/cli/src/accounts/lease/index.ts b/cli/src/accounts/lease/index.ts deleted file mode 100644 index 3c1f2d3..0000000 --- a/cli/src/accounts/lease/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./lease"; -export * from "./types"; diff --git a/cli/src/accounts/lease/lease.ts b/cli/src/accounts/lease/lease.ts deleted file mode 100644 index d37e1d2..0000000 --- a/cli/src/accounts/lease/lease.ts +++ /dev/null @@ -1,244 +0,0 @@ -import * as anchor from "@project-serum/anchor"; -import { PublicKey } from "@solana/web3.js"; -import { - AggregatorAccount, - LeaseAccount, - OracleQueueAccount, - programWallet, -} from "@switchboard-xyz/switchboard-v2"; -import chalk from "chalk"; -import { - AggregatorAccountData, - chalkString, - LeaseAccountData, - pubKeyConverter, -} from "../"; -import { CommandContext } from "../../types/context"; -import { LogProvider } from "../../types/context/logging"; -import { programHasPayer } from "../../utils"; -import { ProgramStateClass } from "../state"; -import { ILeaseClass, LeaseDefinition } from "./types"; - -export class LeaseClass implements ILeaseClass { - account: LeaseAccount; - - logger: LogProvider; - - publicKey: PublicKey; - - aggregatorPublicKey: PublicKey; - - escrowPublicKey: PublicKey; - - isActive: boolean; - - tokenProgramPublicKey: PublicKey; - - queuePublicKey: PublicKey; - - withdrawAuthorityPublicKey: PublicKey; - - escrowBalance: number; - - private constructor() {} - - private static async init(context: CommandContext, account: LeaseAccount) { - const lease = new LeaseClass(); - lease.account = account; - lease.publicKey = lease.account.publicKey; - lease.logger = context.logger; - - await lease.loadData(); - return lease; - } - - public static async build( - context: CommandContext, - aggregatorAccount: AggregatorAccount, - queueAccount: OracleQueueAccount, - definition?: LeaseDefinition - ): Promise { - // eslint-disable-next-line unicorn/prefer-ternary - if (definition && "account" in definition) { - if (definition.account instanceof LeaseAccount) { - return LeaseClass.fromAccount(context, definition.account); - } - throw new TypeError("account must be an instance of PermissionAccount"); - } else if (definition && "publicKey" in definition) { - return LeaseClass.fromPublicKey( - context, - aggregatorAccount.program, - definition.publicKey - ); - } - - if (programHasPayer(aggregatorAccount.program)) { - return LeaseClass.getOrCreateLeaseAccount( - context, - aggregatorAccount, - queueAccount - ); - } - - return LeaseClass.getLeaseAccount(context, aggregatorAccount, queueAccount); - } - - public static fromAccount(context: CommandContext, account: LeaseAccount) { - return LeaseClass.init(context, account); - } - - public static fromPublicKey( - context: CommandContext, - program: anchor.Program, - publicKey: PublicKey - ) { - return LeaseClass.init( - context, - new LeaseAccount({ - program, - publicKey, - }) - ); - } - - public static async getLeaseAccount( - context: CommandContext, - aggregatorAccount: AggregatorAccount, - queueAccount?: OracleQueueAccount - ): Promise { - let leaseAccount: LeaseAccount; - - let queue = queueAccount; - if (!queue) { - const agg: AggregatorAccountData = await aggregatorAccount.loadData(); - queue = new OracleQueueAccount({ - program: aggregatorAccount.program, - publicKey: agg.queuePubkey, - }); - } - - try { - [leaseAccount] = LeaseAccount.fromSeed( - aggregatorAccount.program, - queueAccount, - aggregatorAccount - ); - await leaseAccount.loadData(); - return await LeaseClass.init(context, leaseAccount); - } catch { - context.logger.debug( - `no lease account found for ${aggregatorAccount.publicKey}` - ); - } - } - - public static async getOrCreateLeaseAccount( - context: CommandContext, - aggregatorAccount: AggregatorAccount, - queueAccount?: OracleQueueAccount - ): Promise { - let queue = queueAccount; - if (!queue) { - const agg: AggregatorAccountData = await aggregatorAccount.loadData(); - queue = new OracleQueueAccount({ - program: aggregatorAccount.program, - publicKey: agg.queuePubkey, - }); - } - - // find existing account - const lease: LeaseClass | undefined = await LeaseClass.getLeaseAccount( - context, - aggregatorAccount, - queue - ); - if (lease) return lease; - - // if payer, create new - if (programHasPayer(aggregatorAccount.program)) { - const programTokenWallet = await ProgramStateClass.getProgramTokenAddress( - aggregatorAccount.program - ); - try { - const leaseAccount = await LeaseAccount.create( - aggregatorAccount.program, - { - aggregatorAccount, - oracleQueueAccount: queueAccount, - loadAmount: new anchor.BN(0), - funder: programTokenWallet, - funderAuthority: programWallet(aggregatorAccount.program), - withdrawAuthority: programWallet(aggregatorAccount.program) - .publicKey, - } - ); - return await LeaseClass.init(context, leaseAccount); - } catch (error) { - throw new Error(`failed to create lease account ${error.message}`); - } - } - } - - async getBalance(): Promise { - const resp = - await this.account.program.provider.connection.getTokenAccountBalance( - this.escrowPublicKey - ); - return Number.parseInt(resp.value.amount, 10); - } - - // loads anchor idl and parses response - async loadData() { - const data: LeaseAccountData = await this.account.loadData(); - - this.publicKey = this.account.publicKey; - this.aggregatorPublicKey = data.aggregator; - this.escrowPublicKey = data.escrow; - this.isActive = data.isActive; - this.tokenProgramPublicKey = data.tokenProgram; - this.queuePublicKey = data.queue; - this.withdrawAuthorityPublicKey = data.withdrawAuthority; - - this.escrowBalance = await this.getBalance(); - } - - toJSON(): ILeaseClass { - return { - publicKey: this.account.publicKey, - aggregatorPublicKey: this.aggregatorPublicKey, - queuePublicKey: this.queuePublicKey, - escrowPublicKey: this.escrowPublicKey, - isActive: this.isActive, - tokenProgramPublicKey: this.tokenProgramPublicKey, - withdrawAuthorityPublicKey: this.withdrawAuthorityPublicKey, - }; - } - - toString(): string { - return JSON.stringify(this.toJSON(), pubKeyConverter, 2); - } - - prettyPrint(all = false, SPACING = 24): string { - let outputString = ""; - - outputString += chalk.underline( - chalkString("## Lease", this.publicKey, SPACING) + "\r\n" - ); - outputString += - chalkString("escrow", this.escrowPublicKey, SPACING) + "\r\n"; - outputString += - chalkString("escrowBalance", this.escrowBalance, SPACING) + "\r\n"; - outputString += - chalkString( - "withdrawAuthority", - this.withdrawAuthorityPublicKey, - SPACING - ) + "\r\n"; - outputString += chalkString("queue", this.queuePublicKey, SPACING) + "\r\n"; - outputString += - chalkString("aggregator", this.aggregatorPublicKey, SPACING) + "\r\n"; - outputString += chalkString("isActive", this.isActive, SPACING) + "\r\n"; - - return outputString; - } -} diff --git a/cli/src/accounts/lease/types.ts b/cli/src/accounts/lease/types.ts deleted file mode 100644 index 5eb3377..0000000 --- a/cli/src/accounts/lease/types.ts +++ /dev/null @@ -1,31 +0,0 @@ -import * as anchor from "@project-serum/anchor"; -import { PublicKey } from "@solana/web3.js"; -import { fromPublicKey, fromSwitchboardAccount } from ".."; - -export interface LeaseAccountData { - escrow: PublicKey; - queue: PublicKey; - aggregator: PublicKey; - tokenProgram: PublicKey; - isActive: boolean; - crankRowCount: number; - createdAt: anchor.BN; - updateCount: anchor.BN; - withdrawAuthority: PublicKey; -} - -/** Object representing a loaded onchain Lease Account */ -export interface ILeaseClass { - publicKey: PublicKey; - aggregatorPublicKey: PublicKey; - escrowPublicKey: PublicKey; - isActive: boolean; - tokenProgramPublicKey: PublicKey; - queuePublicKey: PublicKey; - withdrawAuthorityPublicKey: PublicKey; -} - -export type LeaseDefinition = - | fromSwitchboardAccount - | fromPublicKey - | ILeaseClass; diff --git a/cli/src/accounts/oracle/index.ts b/cli/src/accounts/oracle/index.ts deleted file mode 100644 index ca3a060..0000000 --- a/cli/src/accounts/oracle/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./oracle"; -export * from "./types"; diff --git a/cli/src/accounts/oracle/oracle.ts b/cli/src/accounts/oracle/oracle.ts deleted file mode 100644 index c41961e..0000000 --- a/cli/src/accounts/oracle/oracle.ts +++ /dev/null @@ -1,374 +0,0 @@ -import * as anchor from "@project-serum/anchor"; -import { Keypair, PublicKey } from "@solana/web3.js"; -import { - OracleAccount, - OracleQueueAccount, - programWallet, -} from "@switchboard-xyz/switchboard-v2"; -import chalk from "chalk"; -import { - anchorBNtoDateTimeString, - buffer2string, - chalkString, - pubKeyConverter, -} from "../"; -import { CommandContext, DEFAULT_CONTEXT } from "../../types/context"; -import { LogProvider } from "../../types/context/logging"; -import { getProgramPayer } from "../../utils"; -import { PermissionClass } from "../permission"; -import { ProgramStateClass } from "../state"; -import { - fromOracleJSON, - IOracleClass, - OracleAccountData, - OracleDefinition, - OracleMetricsData, -} from "./types"; - -export class OracleClass implements IOracleClass { - account: OracleAccount; - - logger: LogProvider; - - publicKey: PublicKey; - - name: string; - - metadata: string; - - authorityPublicKey: PublicKey; - - tokenAccountPublicKey: PublicKey; - - queuePublicKey: PublicKey; - - balance: number; - - lastHeartbeat: string; - - numInUse: number; - - metrics: OracleMetricsData; - - permissionAccount?: PermissionClass; - - private constructor() {} - - private static async init( - context: CommandContext, - account: OracleAccount, - definition: OracleDefinition - ): Promise { - const oracle = new OracleClass(); - oracle.logger = context.logger; - oracle.account = account; - oracle.publicKey = oracle.account.publicKey; - - await oracle.loadData(); - - const queueAccount = new OracleQueueAccount({ - program: account.program, - publicKey: oracle.queuePublicKey, - }); - - try { - oracle.permissionAccount = await PermissionClass.build( - context, - oracle.account, - queueAccount, - definition && "permissionAccount" in definition - ? definition.permissionAccount - : undefined - ); - } catch {} - - await oracle.loadData(); - - return oracle; - } - - async grantPermission( - context: CommandContext, - queueAuthority = programWallet(this.account.program) - ): Promise { - const queueAccount = new OracleQueueAccount({ - program: this.account.program, - publicKey: this.queuePublicKey, - }); - - const { authority } = await queueAccount.loadData(); - - if ( - this.permissionAccount.permission === "NONE" && - queueAuthority.publicKey.equals(authority) - ) { - const anchorWallet = programWallet(this.account.program); - this.permissionAccount = await PermissionClass.grantPermission( - context, - this.account, - anchorWallet - ); - } - - return this.permissionAccount.permission; - } - - static async build( - context: CommandContext, - program: anchor.Program, - definition: OracleDefinition, - queueAccount?: OracleQueueAccount - ): Promise { - if ("account" in definition) { - if (definition.account instanceof OracleAccount) { - return OracleClass.fromAccount(context, definition.account); - } - throw new TypeError("account must be an instance of OracleAccount"); - } else if ("publicKey" in definition) { - return OracleClass.fromPublicKey(context, program, definition.publicKey); - } else if (queueAccount) { - return OracleClass.fromJSON(context, queueAccount, definition); - } - throw new Error( - `need to provide oracle queue account to build new oracle account` - ); - } - - public static async fromAccount( - context: CommandContext, - account: OracleAccount - ): Promise { - return OracleClass.init(context, account, {}); - } - - public static fromPublicKey( - context: CommandContext, - program: anchor.Program, - publicKey: PublicKey - ) { - return OracleClass.init( - context, - new OracleAccount({ - program, - publicKey, - }), - {} - ); - } - - private static async fromJSON( - context: CommandContext, - queueAccount: OracleQueueAccount, - definition: fromOracleJSON - ) { - const account = await OracleAccount.create(queueAccount.program, { - queueAccount, - name: definition.name ? Buffer.from(definition.name) : Buffer.from(""), - oracleAuthority: definition.authorityKeypair, - metadata: definition.metadata - ? Buffer.from(definition.metadata) - : Buffer.from(""), - }); - - context.logger.info( - `created oracle account ${definition.name} ${account.publicKey}` - ); - - return OracleClass.init(context, account, definition); - } - - static async fromDefault( - context: CommandContext, - queueAccount: OracleQueueAccount, - name = "" - ): Promise { - return OracleClass.build( - context, - queueAccount.program, - { name }, - queueAccount - ); - } - - static async getBalance( - oracleAccount: OracleAccount, - tokenAccount?: PublicKey, - context = DEFAULT_CONTEXT - ): Promise { - const oracleTokenAccount = - // eslint-disable-next-line unicorn/no-await-expression-member - tokenAccount ?? (await oracleAccount.loadData()).tokenAccount; - const tokenAmount = - await oracleAccount.program.provider.connection.getTokenAccountBalance( - oracleTokenAccount - ); - return Number.parseInt(tokenAmount.value.amount, 10); - } - - static async withdrawTokens( - context: CommandContext, - oracleAccount: OracleAccount, - amount: number, - withdrawAccount: PublicKey, - authority?: Keypair, - force = false - ): Promise { - const { queuePubkey, tokenAccount, oracleAuthority } = - await oracleAccount.loadData(); - - const authorityKeypair = - authority || getProgramPayer(oracleAccount.program); - if (!oracleAuthority.equals(authorityKeypair.publicKey)) { - throw new Error( - `invalid oracle authority provided (expected) ${oracleAuthority}, (received) ${authority.publicKey}` - ); - } - const oracleQueueAccount = new OracleQueueAccount({ - program: oracleAccount.program, - publicKey: queuePubkey, - }); - const oracleQueueData = await oracleQueueAccount.loadData(); - const minStake: number = oracleQueueData.minStake.toNumber(); - - // check final balance is greater than min stake - const initialOracleBalance = await OracleClass.getBalance( - oracleAccount, - tokenAccount - ); - const finalOracleBalance = initialOracleBalance - amount; - if (amount > initialOracleBalance) { - throw new Error( - `requested withdraw amount ${amount} exceeds current balance ${initialOracleBalance}` - ); - } - if (!force && minStake > finalOracleBalance) - throw new Error( - `withdrawing will result in your account falling below the minimum stake` - ); - - // withdraw - const withdrawTxn = await oracleAccount.withdraw({ - amount: new anchor.BN(amount), - oracleAuthority: authorityKeypair, - withdrawAccount, - }); - return withdrawTxn; - } - - static async depositTokens( - context: CommandContext, - oracleAccount: OracleAccount, - amount: number, - funderTokenAccount?: PublicKey - ): Promise { - const oracleTokenAccount = - // eslint-disable-next-line unicorn/no-await-expression-member - (await oracleAccount.loadData()).tokenAccount; - const state = await ProgramStateClass.build(oracleAccount.program, context); - const payerTokenAccount = - funderTokenAccount || - (await ProgramStateClass.getProgramTokenAddress( - oracleAccount.program, - context - )); - - // check payer has enough funds - const payerTokenBalance = - await oracleAccount.program.provider.connection.getBalance( - payerTokenAccount - ); - if (amount > payerTokenBalance) - throw new Error( - `trying to deposit ${amount} tokens but current balance is ${payerTokenBalance}` - ); - - return state.token.transfer( - payerTokenAccount, - oracleTokenAccount, - programWallet(oracleAccount.program), - [], - amount - ); - } - - // loads anchor idl and parses response - async loadData() { - const data: OracleAccountData = await this.account.loadData(); - - this.publicKey = this.account.publicKey; - this.name = buffer2string(data.name as any); - this.metadata = buffer2string(data.metadata as any); - this.authorityPublicKey = data.oracleAuthority; - this.lastHeartbeat = anchorBNtoDateTimeString(data.lastHeartbeat); - this.numInUse = data.numInUse; - this.tokenAccountPublicKey = data.tokenAccount; - this.queuePublicKey = data.queuePubkey; - this.metrics = data.metrics; - this.balance = await OracleClass.getBalance( - this.account, - this.tokenAccountPublicKey - ); - } - - toJSON(): IOracleClass { - return { - name: this.name, - metadata: this.metadata, - publicKey: this.publicKey, - authorityPublicKey: this.authorityPublicKey, - queuePublicKey: this.queuePublicKey, - tokenAccountPublicKey: this.tokenAccountPublicKey, - permissionAccount: this.permissionAccount.toJSON(), - }; - } - - toString(): string { - return JSON.stringify(this.toJSON(), pubKeyConverter, 2); - } - - prettyPrint(all = false, SPACING = 24): string { - let outputString = ""; - - outputString += chalk.underline( - chalkString("## Oracle", this.publicKey.toString(), SPACING) + "\r\n" - ); - outputString += chalkString("name", this.name, SPACING) + "\r\n"; - outputString += chalkString("metadata", this.metadata, SPACING) + "\r\n"; - outputString += chalkString("balance", this.balance, SPACING) + "\r\n"; - outputString += - chalkString("oracleAuthority", this.authorityPublicKey, SPACING) + "\r\n"; - outputString += - chalkString("tokenAccount", this.tokenAccountPublicKey, SPACING) + "\r\n"; - outputString += - chalkString("queuePubkey", this.queuePublicKey, SPACING) + "\r\n"; - if (this.permissionAccount) { - outputString += - chalkString( - "permissionAccount", - this.permissionAccount.publicKey || "N/A", - SPACING - ) + "\r\n"; - outputString += - chalkString( - "permissions", - this.permissionAccount.permission || "", - SPACING - ) + "\r\n"; - } - outputString += - chalkString("lastHeartbeat", this.lastHeartbeat, SPACING) + "\r\n"; - outputString += chalkString("numInUse", this.numInUse, SPACING) + "\r\n"; - outputString += - chalkString( - "metrics", - JSON.stringify(this.metrics, undefined, 2), - SPACING - ) + "\r\n"; - - if (all && this.permissionAccount) { - outputString += this.permissionAccount.prettyPrint(all, SPACING); - } - - return outputString; - } -} diff --git a/cli/src/accounts/oracle/types.ts b/cli/src/accounts/oracle/types.ts deleted file mode 100644 index b0be3e3..0000000 --- a/cli/src/accounts/oracle/types.ts +++ /dev/null @@ -1,61 +0,0 @@ -import * as anchor from "@project-serum/anchor"; -import { Keypair, PublicKey } from "@solana/web3.js"; -import { - fromPublicKey, - fromSwitchboardAccount, - IPermissionClass, - PermissionDefinition, -} from ".."; - -export interface OracleMetricsData { - consecutiveSuccess: anchor.BN; - consecutiveError: anchor.BN; - consecutiveDisagreement: anchor.BN; - consecutiveLateResponse: anchor.BN; - consecutiveFailure: anchor.BN; - totalSuccess: anchor.BN; - totalError: anchor.BN; - totalDisagreement: anchor.BN; - totalLateResponse: anchor.BN; -} - -export interface OracleAccountData { - name: Buffer; - metadata: Buffer; - oracleAuthority: PublicKey; - lastHeartbeat: anchor.BN; - numInUse: number; - tokenAccount: PublicKey; - queuePubkey: PublicKey; - metrics: OracleMetricsData; -} - -/** JSON interface to construct a new Oracle Account */ -export interface fromOracleJSON { - name?: string; - metadata?: string; - queuePublicKey?: PublicKey; - tokenAccountPublicKey?: PublicKey; - authorityKeypair?: Keypair; - permissionAccount?: PermissionDefinition; -} - -/** Object representing a loaded onchain Oracle Account */ -export interface IOracleClass { - publicKey: PublicKey; - name: string; - metadata: string; - queuePublicKey?: PublicKey; - tokenAccountPublicKey?: PublicKey; - authorityPublicKey?: PublicKey; - permissionAccount?: IPermissionClass; -} - -/** Type representing the different ways to build an Oracle Account */ -export type OracleDefinition = - | fromSwitchboardAccount - | fromPublicKey - | fromOracleJSON; - -/** Type representing the different ways to build a set of Oracle Accounts */ -export type OracleDefinitions = OracleDefinition[] | number; diff --git a/cli/src/accounts/permission/index.ts b/cli/src/accounts/permission/index.ts deleted file mode 100644 index 86ed40a..0000000 --- a/cli/src/accounts/permission/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./permission"; -export * from "./types"; diff --git a/cli/src/accounts/permission/permission.ts b/cli/src/accounts/permission/permission.ts deleted file mode 100644 index da5c33d..0000000 --- a/cli/src/accounts/permission/permission.ts +++ /dev/null @@ -1,304 +0,0 @@ -import * as anchor from "@project-serum/anchor"; -import { Keypair, PublicKey } from "@solana/web3.js"; -import { - AggregatorAccount, - OracleAccount, - OracleQueueAccount, - PermissionAccount, - SwitchboardPermission, -} from "@switchboard-xyz/switchboard-v2"; -import chalk from "chalk"; -import { CommandContext } from "../../types/context"; -import { LogProvider } from "../../types/context/logging"; -import { programHasPayer } from "../../utils"; -import { AggregatorAccountData } from "../aggregator"; -import { OracleAccountData } from "../oracle"; -import { - anchorBNtoDateTimeString, - chalkString, - pubKeyConverter, - toPermissionString, -} from "../utils"; -import { - IPermissionClass, - PermissionAccountData, - PermissionDefinition, -} from "./types"; - -export class PermissionClass implements IPermissionClass { - account: PermissionAccount; - - logger: LogProvider; - - publicKey: PublicKey; - - authorityPublicKey: PublicKey; - - granterPublicKey: PublicKey; - - granteePublicKey: PublicKey; - - permission: string; - - expiration: anchor.BN; - - private constructor() {} - - private static async init( - context: CommandContext, - account: PermissionAccount - ) { - const permission = new PermissionClass(); - permission.logger = context.logger; - - permission.account = account; - permission.publicKey = permission.account.publicKey; - - await permission.loadData(); - - return permission; - } - - static async build( - context: CommandContext, - granteeAccount: AggregatorAccount | OracleAccount, - queueAccount?: OracleQueueAccount, - definition?: PermissionDefinition - ): Promise { - // eslint-disable-next-line unicorn/prefer-ternary - if (definition && "account" in definition) { - if (definition.account instanceof PermissionAccount) { - return PermissionClass.fromAccount(context, definition.account); - } - throw new TypeError("account must be an instance of PermissionAccount"); - } else if (definition && "publicKey" in definition) { - return PermissionClass.fromPublicKey( - context, - granteeAccount.program, - definition.publicKey - ); - } - - if (programHasPayer(granteeAccount.program)) { - return PermissionClass.getOrCreatePermissionAccount( - context, - granteeAccount, - queueAccount - ); - } - return PermissionClass.getPermissionAccount( - context, - granteeAccount, - queueAccount - ); - } - - public static fromAccount( - context: CommandContext, - account: PermissionAccount - ) { - return PermissionClass.init(context, account); - } - - public static fromPublicKey( - context: CommandContext, - program: anchor.Program, - publicKey: PublicKey - ) { - return PermissionClass.init( - context, - new PermissionAccount({ - program, - publicKey, - }) - ); - } - - static async grantPermission( - context: CommandContext, - granteeAccount: OracleAccount | AggregatorAccount, - granterAuthority: Keypair - ): Promise { - const permission: PermissionClass | undefined = programHasPayer( - granteeAccount.program - ) - ? await PermissionClass.getOrCreatePermissionAccount( - context, - granteeAccount - ) - : await PermissionClass.getPermissionAccount(context, granteeAccount); - if (permission === undefined) { - throw new Error( - `no payer provided and no existing permission account found for ${granteeAccount.publicKey}` - ); - } - - if (!permission.authorityPublicKey.equals(granterAuthority.publicKey)) { - throw new Error( - `wrong authority provided to grant permission, expected ${permission.authorityPublicKey}, received ${granterAuthority.publicKey}` - ); - } - - if (granteeAccount instanceof AggregatorAccount) { - await permission.account.set({ - authority: granterAuthority, - enable: true, - permission: SwitchboardPermission.PERMIT_ORACLE_QUEUE_USAGE, - }); - await permission.loadData(); - return permission; - } - if (granteeAccount instanceof OracleAccount) { - await permission.account.set({ - authority: granterAuthority, - enable: true, - permission: SwitchboardPermission.PERMIT_ORACLE_HEARTBEAT, - }); - await permission.loadData(); - return permission; - } - throw new Error( - `permission grantee account isnt an aggregator or oracle account` - ); - } - - static async getPermissionAccount( - context: CommandContext, - granteeAccount: OracleAccount | AggregatorAccount, - oracleQueueAccount?: OracleQueueAccount - ): Promise { - let queueAccount = oracleQueueAccount; - if (!queueAccount) { - const data: AggregatorAccountData | OracleAccountData = - await granteeAccount.loadData(); - queueAccount = new OracleQueueAccount({ - program: granteeAccount.program, - publicKey: data.queuePubkey, - }); - } - - const queueAuthority: anchor.web3.PublicKey = - // eslint-disable-next-line unicorn/no-await-expression-member - new PublicKey((await queueAccount.loadData()).authority); - - try { - const [permissionAccount] = PermissionAccount.fromSeed( - granteeAccount.program, - queueAuthority, - queueAccount.publicKey, - granteeAccount.publicKey - ); - await permissionAccount.loadData(); - context.logger.debug( - `loaded permission account ${permissionAccount.publicKey} from seed for ${granteeAccount.publicKey}` - ); - return await PermissionClass.init(context, permissionAccount); - } catch {} - context.logger.debug( - `no permission account found for ${granteeAccount.publicKey}` - ); - } - - static async getOrCreatePermissionAccount( - context: CommandContext, - granteeAccount: OracleAccount | AggregatorAccount, - oracleQueueAccount?: OracleQueueAccount - ): Promise { - let queueAccount = oracleQueueAccount; - if (!queueAccount) { - const data: AggregatorAccountData | OracleAccountData = - await granteeAccount.loadData(); - queueAccount = new OracleQueueAccount({ - program: granteeAccount.program, - publicKey: data.queuePubkey, - }); - } - - const queueAuthority: anchor.web3.PublicKey = - // eslint-disable-next-line unicorn/no-await-expression-member - new PublicKey((await queueAccount.loadData()).authority); - - try { - const [permissionAccount] = PermissionAccount.fromSeed( - granteeAccount.program, - queueAuthority, - queueAccount.publicKey, - granteeAccount.publicKey - ); - await permissionAccount.loadData(); - context.logger.debug( - `loaded permission account ${permissionAccount.publicKey} from seed for ${granteeAccount.publicKey}` - ); - return await PermissionClass.init(context, permissionAccount); - } catch { - try { - const permissionAccount = await PermissionAccount.create( - queueAccount.program, - { - authority: queueAuthority, - grantee: granteeAccount.publicKey, - granter: queueAccount.publicKey, - } - ); - await permissionAccount.loadData(); - context.logger.debug( - `created new permission account ${permissionAccount.publicKey} for ${granteeAccount.publicKey}` - ); - return PermissionClass.init(context, permissionAccount); - } catch (error) { - throw new Error(`failed to create permission account ${error.message}`); - } - } - } - - // loads anchor idl and parses response - async loadData() { - const data: PermissionAccountData = await this.account.loadData(); - - this.publicKey = this.account.publicKey; - this.permission = toPermissionString(data.permissions); - this.authorityPublicKey = data.authority; - this.expiration = data.expiration; - this.granterPublicKey = data.granter; - this.granteePublicKey = data.grantee; - } - - toJSON(): IPermissionClass { - return { - publicKey: this.account.publicKey, - permission: this.permission, - authorityPublicKey: this.authorityPublicKey, - expiration: this.expiration, - granterPublicKey: this.granterPublicKey, - granteePublicKey: this.granteePublicKey, - }; - } - - toString(): string { - return JSON.stringify(this.toJSON(), pubKeyConverter, 2); - } - - prettyPrint(all = false, SPACING = 24): string { - let outputString = ""; - - outputString += chalk.underline( - chalkString("## Permission", this.publicKey, SPACING) + "\r\n" - ); - outputString += - chalkString("authority", this.authorityPublicKey, SPACING) + "\r\n"; - outputString += - chalkString("permissions", this.permission, SPACING) + "\r\n"; - outputString += - chalkString("granter", this.granterPublicKey, SPACING) + "\r\n"; - outputString += - chalkString("grantee", this.granteePublicKey, SPACING) + "\r\n"; - outputString += - chalkString( - "expiration", - anchorBNtoDateTimeString(this.expiration), - SPACING - ) + "\r\n"; - - return outputString; - } -} diff --git a/cli/src/accounts/permission/types.ts b/cli/src/accounts/permission/types.ts deleted file mode 100644 index 06bf83f..0000000 --- a/cli/src/accounts/permission/types.ts +++ /dev/null @@ -1,27 +0,0 @@ -import * as anchor from "@project-serum/anchor"; -import { PublicKey } from "@solana/web3.js"; -import { SwitchboardPermissionValue } from "@switchboard-xyz/switchboard-v2"; -import { fromPublicKey, fromSwitchboardAccount } from ".."; - -export interface PermissionAccountData { - authority: PublicKey; - permissions: SwitchboardPermissionValue; - granter: PublicKey; - grantee: PublicKey; - expiration: anchor.BN; -} - -/** Object representing a loaded onchain Permission Account */ -export interface IPermissionClass { - publicKey: PublicKey; - authorityPublicKey: PublicKey; - granterPublicKey: PublicKey; - granteePublicKey: PublicKey; - permission: string; - expiration: anchor.BN; -} - -export type PermissionDefinition = - | fromSwitchboardAccount - | fromPublicKey - | IPermissionClass; diff --git a/cli/src/accounts/queue/index.ts b/cli/src/accounts/queue/index.ts deleted file mode 100644 index c167952..0000000 --- a/cli/src/accounts/queue/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./queue"; -export * from "./types"; diff --git a/cli/src/accounts/queue/queue.ts b/cli/src/accounts/queue/queue.ts deleted file mode 100644 index 50aab1b..0000000 --- a/cli/src/accounts/queue/queue.ts +++ /dev/null @@ -1,540 +0,0 @@ -/* eslint-disable max-depth */ -import * as anchor from "@project-serum/anchor"; -import * as spl from "@solana/spl-token"; -import { PublicKey } from "@solana/web3.js"; -import { - OracleQueueAccount, - programWallet, - SwitchboardDecimal, -} from "@switchboard-xyz/switchboard-v2"; -import chalk from "chalk"; -import { fromPublicKey, fromQueueJSON } from ".."; -import { CommandContext } from "../../types/context"; -import { LogProvider } from "../../types/context/logging"; -import { AggregatorClass, AggregatorDefinition } from "../aggregator"; -import { CrankClass, CrankDefinition, CrankDefinitions } from "../crank"; -import { OracleClass, OracleDefinition, OracleDefinitions } from "../oracle"; -import { - buffer2string, - chalkString, - getArrayOfSizeN, - pubKeyConverter, -} from "../utils"; -import { - IOracleQueueClass, - OracleQueueAccountData, - QueueDefinition, -} from "./types"; - -export class OracleQueueClass implements IOracleQueueClass { - account: OracleQueueAccount; - - logger: LogProvider; - - publicKey: PublicKey; - - authorityPublicKey: PublicKey; - - consecutiveFeedFailureLimit: anchor.BN; - - consecutiveOracleFailureLimit: anchor.BN; - - feedProbationPeriod: number; - - metadata: string; - - minStake: anchor.BN; - - minUpdateDelaySeconds: number; - - name: string; - - oracleTimeout: anchor.BN; - - queueSize: number; - - reward: anchor.BN; - - slashingEnabled: boolean; - - unpermissionedFeedsEnabled: boolean; - - unpermissionedVrfEnabled: boolean; - - varianceToleranceMultiplier: SwitchboardDecimal; - - oracleBuffer: PublicKey; - - cranks: CrankClass[] = []; - - oracles: OracleClass[] = []; - - aggregators: AggregatorClass[] = []; - - private constructor() {} - - private static async init( - context: CommandContext, - account: OracleQueueAccount, - definition: QueueDefinition - ) { - const queue = new OracleQueueClass(); - queue.logger = context.logger; - - queue.account = account; - queue.publicKey = queue.account.publicKey; - - await queue.loadData(); - - if (definition && "oracles" in definition) { - queue.oracles = await OracleQueueClass.buildOracles( - context, - queue.account, - definition.oracles - ); - } - - if (definition && "cranks" in definition) { - queue.cranks = await OracleQueueClass.buildCranks( - context, - queue.account, - definition.cranks - ); - } - - if (definition && "aggregators" in definition) { - queue.logger.debug( - `creating ${definition.aggregators.length} aggregators from json definition` - ); - for await (const aggregatorDefinition of definition.aggregators) { - const aggregator = await AggregatorClass.build( - context, - queue.account.program, - aggregatorDefinition, - queue.account - ); - - await aggregator.grantPermission(context); - queue.aggregators.push(aggregator); - - if ( - "crank" in aggregatorDefinition && - queue.cranks && - queue.cranks.length > 0 - ) { - const key = aggregatorDefinition.crank; - const crank = await OracleQueueClass.findCrankByKey( - context, - queue.cranks, - key - ); - if (typeof key === "object" && !("publicKey" in key)) { - crank.account.push({ - aggregatorAccount: aggregator.account, - }); - context.logger.debug( - `added aggregator ${aggregator.name} to crank ${key} ${crank.publicKey}` - ); - } - - aggregator.crankPublicKey = crank.publicKey; - } - } - } - - return queue; - } - - static async build( - context: CommandContext, - program: anchor.Program, - definition: QueueDefinition - ): Promise { - if ("account" in definition) { - if (definition.account instanceof OracleQueueAccount) { - return OracleQueueClass.fromAccount(context, definition.account); - } - const errorMessage = `found account key in definition file but account is not an instanceof OracleQueueAccount`; - context.logger.error(errorMessage); - throw new Error(errorMessage); - } else if ("publicKey" in definition) { - return OracleQueueClass.fromPublicKey(context, program, definition); - } else if ("name" in definition) { - return OracleQueueClass.fromJSON(context, program, definition); - } - throw new Error("failed to build QueueClass"); - } - - public static fromAccount( - context: CommandContext, - account: OracleQueueAccount - ) { - return OracleQueueClass.init(context, account, { name: "queue" }); - } - - public static fromPublicKey( - context: CommandContext, - program: anchor.Program, - definition: fromPublicKey - ) { - return OracleQueueClass.init( - context, - new OracleQueueAccount({ - program, - publicKey: definition.publicKey, - }), - definition - ); - } - - public static async fromJSON( - context: CommandContext, - program: anchor.Program, - definition: fromQueueJSON - ) { - const payer = programWallet(program); - const queueAccount = await OracleQueueAccount.create(program, { - authority: definition.authorityPublicKey ?? payer.publicKey, - name: definition.name ? Buffer.from(definition.name) : undefined, - metadata: definition.metadata - ? Buffer.from(definition.metadata) - : undefined, - reward: definition.reward - ? new anchor.BN(definition.reward) - : new anchor.BN(0), - minStake: definition.minStake - ? new anchor.BN(definition.minStake) - : new anchor.BN(0), - minimumDelaySeconds: definition.minUpdateDelaySeconds, - oracleTimeout: definition.oracleTimeout - ? new anchor.BN(definition.oracleTimeout) - : undefined, - slashingEnabled: definition.slashingEnabled, - unpermissionedFeeds: definition.unpermissionedFeedsEnabled, - feedProbationPeriod: definition.feedProbationPeriod, - consecutiveFeedFailureLimit: definition.consecutiveFeedFailureLimit - ? new anchor.BN(definition.consecutiveFeedFailureLimit) - : undefined, - consecutiveOracleFailureLimit: definition.consecutiveOracleFailureLimit - ? new anchor.BN(definition.consecutiveOracleFailureLimit) - : undefined, - varianceToleranceMultiplier: definition.varianceToleranceMultiplier, - mint: spl.NATIVE_MINT, - }); - - context.logger.info(`created queue ${queueAccount.publicKey}`); - - return OracleQueueClass.init(context, queueAccount, definition); - } - - async addCrank( - context: CommandContext, - crankDefinition: CrankDefinition - ): Promise { - const crank = await CrankClass.fromJSON( - context, - { - ...crankDefinition, - queuePublicKey: this.publicKey, - }, - this.account - ); - this.cranks.push(crank); - const newCrankIndex = this.cranks.findIndex((c) => - c.publicKey.equals(crank.publicKey) - ); - if (newCrankIndex === -1) { - throw new Error(`failed to find new crank in queue`); - } - return newCrankIndex; - } - - static async buildCranks( - context: CommandContext, - queueAccount: OracleQueueAccount, - cranks: CrankDefinitions - ): Promise { - const newCranks: CrankClass[] = []; - if (typeof cranks === "number") { - context.logger.debug(`creating ${cranks} cranks`); - for await (const index of getArrayOfSizeN(cranks)) { - const crank = await CrankClass.fromDefault( - context, - queueAccount, - `Crank-${index}` // should we get last crank num and increment? - ); - newCranks.push(crank); - } - } else { - context.logger.debug( - `creating ${cranks.length} cranks from json definition` - ); - for await (const crankDefinition of cranks) { - const crank = await CrankClass.fromJSON( - context, - { - ...crankDefinition, - queuePublicKey: queueAccount.publicKey, - }, - queueAccount - ); - newCranks.push(crank); - } - } - return newCranks; - } - - async addOracle( - context: CommandContext, - oracleDefinition: OracleDefinition - ): Promise { - const oracle = await OracleClass.build( - context, - this.account.program, - { - ...oracleDefinition, - queuePublicKey: this.publicKey, - }, - this.account - ); - - this.oracles.push(oracle); - const newOracleIndex = this.oracles.findIndex((o) => - o.publicKey.equals(oracle.publicKey) - ); - if (newOracleIndex === -1) { - throw new Error(`failed to find new oracle in queue`); - } - return newOracleIndex; - } - - static async buildOracles( - context: CommandContext, - queueAccount: OracleQueueAccount, - oracles: OracleDefinitions - ): Promise { - const newOracles: OracleClass[] = []; - if (typeof oracles === "number") { - context.logger.debug(`creating ${oracles} oracles`); - for await (const index of getArrayOfSizeN(oracles)) { - const oracle = await OracleClass.fromDefault( - context, - queueAccount, - `Oracle-${index}` - ); - await oracle.grantPermission(context); - newOracles.push(oracle); - } - } else { - context.logger.debug( - `creating ${oracles.length} oracles from json definition` - ); - for await (const oracleDefinition of oracles) { - const oracle = await OracleClass.build( - context, - queueAccount.program, - { - ...oracleDefinition, - queuePublicKey: queueAccount.publicKey, - }, - queueAccount - ); - await oracle.grantPermission(context); - newOracles.push(oracle); - } - } - return newOracles; - } - - async addAggregator( - context: CommandContext, - aggregatorDefinition: AggregatorDefinition - ): Promise { - const aggregator = await AggregatorClass.build( - context, - this.account.program, - aggregatorDefinition, - this.account - ); - await aggregator.grantPermission(context); - this.aggregators.push(aggregator); - const newAggregatorIndex = this.aggregators.findIndex((aggregator) => - aggregator.publicKey.equals(aggregator.publicKey) - ); - if (newAggregatorIndex === -1) { - throw new Error(`failed to find new aggregator in queue`); - } - return newAggregatorIndex; - } - - private static async findCrankByKey( - context: CommandContext, - cranks: CrankClass[], - key: string | number | boolean | PublicKey - ): Promise { - if (typeof key === "number") { - if (cranks.length >= key) { - const crank = cranks[key]; - return crank; - } - throw new Error( - `failed to find crank by key ${key}, length ${cranks.length}` - ); - } else if (typeof key === "boolean") { - if (cranks.length > 0) { - const crank = cranks[0]; - return crank; - } - throw new Error(`failed to find any cranks`); - } else if (typeof key === "string") { - const foundCrank = cranks.find((c) => c.name === key); - if (foundCrank) { - return foundCrank; - } - try { - const crankKey = new PublicKey(key); - const crank = cranks.find((c) => c.publicKey === crankKey); - if (crank) { - return crank; - } - } catch {} - } - } - - static async addAggregatorToCrank( - context: CommandContext, - aggregator: AggregatorClass, - cranks: CrankClass[], - key: string | number | boolean - ) { - const crank = await OracleQueueClass.findCrankByKey(context, cranks, key); - crank.account.push({ - aggregatorAccount: aggregator.account, - }); - context.logger.debug( - `added aggregator ${aggregator.name} to crank ${key} ${crank.publicKey}` - ); - aggregator.crankPublicKey = crank.publicKey; - } - - // loads anchor idl and parses response - async loadData() { - const data: OracleQueueAccountData = await this.account.loadData(); - this.name = buffer2string(data.name as any); - this.metadata = buffer2string(data.metadata as any); - this.authorityPublicKey = data.authority; - this.oracleTimeout = data.oracleTimeout; - this.reward = data.reward; - this.minStake = data.minStake; - this.slashingEnabled = data.slashingEnabled; - this.varianceToleranceMultiplier = data.varianceToleranceMultiplier; - this.feedProbationPeriod = data.feedProbationPeriod; - this.consecutiveFeedFailureLimit = data.consecutiveFeedFailureLimit; - this.consecutiveOracleFailureLimit = data.consecutiveOracleFailureLimit; - this.unpermissionedFeedsEnabled = data.unpermissionedFeedsEnabled; - this.unpermissionedVrfEnabled = data.unpermissionedVrfEnabled; - this.oracleBuffer = data.dataBuffer; - } - - // needed to enforce ordering of json output - toJSON(): IOracleQueueClass { - return { - name: this.name, - metadata: this.metadata, - publicKey: this.publicKey, - authorityPublicKey: this.authorityPublicKey, - queueSize: this.queueSize, - minStake: this.minStake, - reward: this.reward, - slashingEnabled: this.slashingEnabled, - unpermissionedFeedsEnabled: this.unpermissionedFeedsEnabled, - unpermissionedVrfEnabled: this.unpermissionedVrfEnabled, - minUpdateDelaySeconds: this.minUpdateDelaySeconds, - consecutiveFeedFailureLimit: this.consecutiveFeedFailureLimit, - feedProbationPeriod: this.feedProbationPeriod, - consecutiveOracleFailureLimit: this.consecutiveOracleFailureLimit, - oracleTimeout: this.oracleTimeout, - varianceToleranceMultiplier: this.varianceToleranceMultiplier, - cranks: this.cranks ? this.cranks.map((crank) => crank.toJSON()) : [], - oracles: this.oracles - ? this.oracles.map((oracle) => oracle.toJSON()) - : [], - aggregators: this.aggregators - ? this.aggregators.map((aggregator) => aggregator.toJSON()) - : [], - }; - } - - toString(): string { - return JSON.stringify(this.toJSON(), pubKeyConverter, 2); - } - - prettyPrint(all = false, SPACING = 30): string { - let outputString = ""; - - outputString += chalk.underline( - chalkString("## Queue", this.account.publicKey, SPACING) + "\r\n" - ); - outputString += chalkString("name", this.name, SPACING) + "\r\n"; - outputString += chalkString("metadata", this.metadata, SPACING) + "\r\n"; - outputString += - chalkString("oracleBuffer", this.oracleBuffer, SPACING) + "\r\n"; - outputString += - chalkString("authority", this.authorityPublicKey, SPACING) + "\r\n"; - outputString += - chalkString("oracleTimeout", this.oracleTimeout.toString(), SPACING) + - "\r\n"; - outputString += - chalkString("reward", this.reward.toString(), SPACING) + "\r\n"; - outputString += - chalkString("minStake", this.minStake.toString(), SPACING) + "\r\n"; - outputString += - chalkString("slashingEnabled", this.slashingEnabled, SPACING) + "\r\n"; - outputString += - chalkString( - "consecutiveFeedFailureLimit", - this.consecutiveFeedFailureLimit.toString(), - SPACING - ) + "\r\n"; - outputString += - chalkString( - "consecutiveOracleFailureLimit", - this.consecutiveOracleFailureLimit.toString(), - SPACING - ) + "\r\n"; - // outputString += chalkString( - // "varianceToleranceMultiplier", - // this.varianceToleranceMultiplier.toBig().toString(), - // SPACING - // ) + "\r\n"; - outputString += - chalkString( - "feedProbationPeriod", - this.feedProbationPeriod.toString(), - SPACING - ) + "\r\n"; - outputString += - chalkString( - "unpermissionedFeedsEnabled", - this.unpermissionedFeedsEnabled.toString(), - SPACING - ) + "\r\n"; - outputString += - chalkString( - "unpermissionedVrfEnabled", - this.unpermissionedVrfEnabled.toString(), - SPACING - ) + "\r\n"; - - if (all) { - for (const crank of this.cranks) { - outputString += crank.prettyPrint(true, SPACING); - } - for (const oracle of this.oracles) { - outputString += oracle.prettyPrint(true, SPACING); - } - } - - return outputString; - } -} diff --git a/cli/src/accounts/queue/types.ts b/cli/src/accounts/queue/types.ts deleted file mode 100644 index 2a035a9..0000000 --- a/cli/src/accounts/queue/types.ts +++ /dev/null @@ -1,89 +0,0 @@ -import * as anchor from "@project-serum/anchor"; -import { PublicKey } from "@solana/web3.js"; -import { SwitchboardDecimal } from "@switchboard-xyz/switchboard-v2"; -import { - AggregatorDefinition, - CrankDefinitions, - fromPublicKey, - fromSwitchboardAccount, - IAggregatorClass, - ICrankClass, - IOracleClass, - OracleDefinitions, -} from ".."; - -export interface OracleQueueAccountData { - name: Buffer; - metadata: Buffer; - authority: PublicKey; - oracleTimeout: anchor.BN; - reward: anchor.BN; - minStake: anchor.BN; - slashingEnabled: boolean; - varianceToleranceMultiplier: SwitchboardDecimal; - feedProbationPeriod: number; - currIdx: number; - size: number; - gcIdx: number; - consecutiveFeedFailureLimit: anchor.BN; - consecutiveOracleFailureLimit: anchor.BN; - unpermissionedFeedsEnabled: boolean; - unpermissionedVrfEnabled: boolean; - maxSize: number; - dataBuffer: PublicKey; -} - -/** JSON interface to construct a new Oracle Queue Account */ -export interface fromQueueJSON { - authorityPublicKey?: PublicKey; - consecutiveFeedFailureLimit?: string | number; // BN - consecutiveOracleFailureLimit?: string | number; // BN - feedProbationPeriod?: number; - metadata?: string; // Buffer - minStake?: string | number; // BN - minUpdateDelaySeconds?: number; - // queues should be named for easy lookup - name: string; // Buffer - oracleTimeout?: string | number; // BN - queueSize?: number; - reward?: string | number; // BN - slashingEnabled?: boolean; - unpermissionedFeedsEnabled?: boolean; - unpermissionedVrfEnabled?: boolean; - varianceToleranceMultiplier?: number; - // accounts - cranks?: CrankDefinitions; // can have crank-less queues - oracles?: OracleDefinitions; - aggregators?: AggregatorDefinition[]; -} - -/** Object representing a loaded onchain Oracle Queue Account */ -export interface IOracleQueueClass { - publicKey: PublicKey; - authorityPublicKey: PublicKey; - consecutiveFeedFailureLimit: anchor.BN; - consecutiveOracleFailureLimit: anchor.BN; - feedProbationPeriod: number; - metadata: string; // Buffer - minStake: anchor.BN; - minUpdateDelaySeconds: number; - // queues should be named for easy lookup - name: string; // Buffer - oracleTimeout: anchor.BN; - queueSize: number; - reward: anchor.BN; - slashingEnabled: boolean; - unpermissionedFeedsEnabled?: boolean; - unpermissionedVrfEnabled?: boolean; - varianceToleranceMultiplier: SwitchboardDecimal; - // accounts - cranks?: ICrankClass[]; - oracles?: IOracleClass[]; - aggregators?: IAggregatorClass[]; -} - -export type QueueDefinition = - | fromSwitchboardAccount - | fromPublicKey - | fromQueueJSON - | IOracleQueueClass; diff --git a/cli/src/accounts/state/index.ts b/cli/src/accounts/state/index.ts deleted file mode 100644 index e283661..0000000 --- a/cli/src/accounts/state/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./state"; -export * from "./types"; diff --git a/cli/src/accounts/state/state.ts b/cli/src/accounts/state/state.ts deleted file mode 100644 index 58711ba..0000000 --- a/cli/src/accounts/state/state.ts +++ /dev/null @@ -1,131 +0,0 @@ -import * as anchor from "@project-serum/anchor"; -import { MintInfo, Token } from "@solana/spl-token"; -import { PublicKey } from "@solana/web3.js"; -import { - ProgramStateAccount, - programWallet, -} from "@switchboard-xyz/switchboard-v2"; -import chalk from "chalk"; -import { DEFAULT_CONTEXT } from "../../types/context/context"; -import { LogProvider } from "../../types/context/logging"; -import { chalkString, pubKeyConverter } from "../utils"; -import { IProgramStateClass, ProgramStateData } from "./types"; - -export class ProgramStateClass implements IProgramStateClass { - account: ProgramStateAccount; - - logger: LogProvider; - - publicKey: PublicKey; - - authorityPublicKey: PublicKey; - - tokenMintPublicKey: PublicKey; - - tokenVaultPublicKey: PublicKey; - - token: Token; - - mintInfo: MintInfo; - - private constructor() {} - - static async build( - program: anchor.Program, - context = DEFAULT_CONTEXT - ): Promise { - const state = new ProgramStateClass(); - state.logger = context.logger; - - // eslint-disable-next-line unicorn/prefer-ternary - [state.account] = ProgramStateAccount.fromSeed(program); - - await state.loadData(); - return state; - } - - // loads anchor idl and parses response - async loadData() { - const data: ProgramStateData = await this.account.loadData(); - - this.publicKey = this.account.publicKey; - - this.authorityPublicKey = data.authority; - this.tokenMintPublicKey = data.tokenMint; - this.tokenVaultPublicKey = data.tokenVault; - - this.token = await this.account.getTokenMint(); - this.mintInfo = await this.token.getMintInfo(); - } - - static async getAssociatedTokenAddress( - program: anchor.Program, - publicKey: PublicKey, - context = DEFAULT_CONTEXT - ): Promise { - const state = await ProgramStateClass.build(program, context); - const account = await state.token.getOrCreateAssociatedAccountInfo( - publicKey - ); - return account.address; - } - - static async getProgramTokenAddress( - program: anchor.Program, - context = DEFAULT_CONTEXT - ): Promise { - const state = await ProgramStateClass.build(program, context); - const wallet = programWallet(program); - const account = await state.token.getOrCreateAssociatedAccountInfo( - wallet.publicKey - ); - return account.address; - } - - toJSON(): IProgramStateClass { - return { - publicKey: this.account.publicKey, - authorityPublicKey: this.authorityPublicKey, - tokenMintPublicKey: this.tokenMintPublicKey, - tokenVaultPublicKey: this.tokenVaultPublicKey, - }; - } - - toString(): string { - return JSON.stringify(this.toJSON(), pubKeyConverter, 2); - } - - prettyPrint(): string { - let outputString = ""; - - outputString += chalk.underline( - chalkString("## Program State", this.publicKey) + "\r\n" - ); - outputString += - chalkString("programId", this.account.program.programId) + "\r\n"; - outputString += chalkString("authority", this.authorityPublicKey) + "\r\n"; - outputString += chalkString("tokenMint", this.tokenMintPublicKey) + "\r\n"; - outputString += - chalkString("tokenVault", this.tokenVaultPublicKey) + "\r\n"; - - return outputString; - } - - prettyPrintTokenMint(): string { - let outputString = ""; - - outputString += chalk.underline( - chalkString("## Token Mint", this.token.publicKey) + "\r\n" - ); - outputString += chalkString("decimals", this.mintInfo.decimals) + "\r\n"; - outputString += - chalkString("supply", this.mintInfo.supply.toString()) + "\r\n"; - - return outputString; - } - - static async print(program: anchor.Program): Promise { - const accountClass = await ProgramStateClass.build(program); - return accountClass.prettyPrint() + accountClass.prettyPrintTokenMint(); - } -} diff --git a/cli/src/accounts/state/types.ts b/cli/src/accounts/state/types.ts deleted file mode 100644 index c3504a4..0000000 --- a/cli/src/accounts/state/types.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { PublicKey } from "@solana/web3.js"; - -export interface ProgramStateData { - authority: PublicKey; - tokenMint: PublicKey; - tokenVault: PublicKey; -} - -export interface IProgramStateClass { - publicKey: PublicKey; - authorityPublicKey: PublicKey; - tokenMintPublicKey: PublicKey; - tokenVaultPublicKey: PublicKey; -} diff --git a/cli/src/accounts/types/index.ts b/cli/src/accounts/types/index.ts deleted file mode 100644 index eea524d..0000000 --- a/cli/src/accounts/types/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./types"; diff --git a/cli/src/accounts/types/types.ts b/cli/src/accounts/types/types.ts deleted file mode 100644 index 56e1f59..0000000 --- a/cli/src/accounts/types/types.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* eslint-disable no-use-before-define */ -import * as anchor from "@project-serum/anchor"; -import { Keypair, PublicKey } from "@solana/web3.js"; -import { - AggregatorAccount, - CrankAccount, - JobAccount, - LeaseAccount, - OracleAccount, - OracleQueueAccount, - PermissionAccount, - ProgramStateAccount, -} from "@switchboard-xyz/switchboard-v2"; - -export const DEFAULT_KEYPAIR = Keypair.fromSeed(new Uint8Array(32).fill(1)); -export const DEFAULT_PUBKEY = new PublicKey("11111111111111111111111111111111"); - -/** An existing on-chain account to load */ -export interface fromPublicKey { - publicKey: PublicKey; -} - -export const SWITCHBOARD_ACCOUNT_TYPES = [ - "JobAccountData", - "AggregatorAccountData", - "OracleAccountData", - "OracleQueueAccountData", - "PermissionAccountData", - "LeaseAccountData", - "ProgramStateAccountData", - "VrfAccountData", - "SbState", - "BUFFERxx", - "CrankAccountData", -] as const; - -export type SwitchboardAccountType = typeof SWITCHBOARD_ACCOUNT_TYPES[number]; - -export const SWITCHBOARD_DISCRIMINATOR_MAP = new Map< - SwitchboardAccountType, - Buffer ->( - SWITCHBOARD_ACCOUNT_TYPES.map((accountType) => [ - accountType, - anchor.BorshAccountsCoder.accountDiscriminator(accountType), - ]) -); - -// export type SwitchboardAccountType = -// | "JobAccount" -// | "AggregatorAccount" -// | "OracleAccount" -// | "OracleQueueAccount" -// | "PermissionAccount" -// | "LeaseAccount" -// | "ProgramStateAccount" -// | "CrankAccount"; - -export type SwitchboardAccount = - | JobAccount - | AggregatorAccount - | OracleAccount - | ProgramStateAccount - | CrankAccount - | PermissionAccount - | LeaseAccount - | OracleQueueAccount; - -export interface fromSwitchboardAccount { - account: SwitchboardAccount; -} - -/** Copy an existing account type */ -export interface copyAccount { - sourcePublicKey: PublicKey; - existingKeypair?: Keypair; - authorityKeypair?: Keypair; -} - -/** Load a JSON definition from a file path */ -export interface jsonPath { - jsonPath: string; -} diff --git a/cli/src/accounts/utils/index.ts b/cli/src/accounts/utils/index.ts deleted file mode 100644 index 178cd64..0000000 --- a/cli/src/accounts/utils/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./utils"; diff --git a/cli/src/commands/aggregator/add/job.ts b/cli/src/commands/aggregator/add/job.ts index b65182f..d914505 100644 --- a/cli/src/commands/aggregator/add/job.ts +++ b/cli/src/commands/aggregator/add/job.ts @@ -1,51 +1,21 @@ -import { flags } from "@oclif/command"; -import { Keypair, PublicKey } from "@solana/web3.js"; -import { AggregatorAccount, JobAccount } from "@switchboard-xyz/switchboard-v2"; -import chalk from "chalk"; -import * as fs from "fs"; -import { - AggregatorClass, - fromJobJSON, - JobClass, - pubKeyConverter, - pubKeyReviver, -} from "../../../accounts"; +import { Flags } from "@oclif/core"; import BaseCommand from "../../../BaseCommand"; -import { OutputFileExistsNoForce } from "../../../types"; -import { CHECK_ICON, loadKeypair } from "../../../utils"; export default class AggregatorAddJob extends BaseCommand { - aggregatorAuthority?: Keypair | undefined = undefined; - - aggregatorAccount: AggregatorAccount; - - jobDefinition?: fromJobJSON = undefined; - - jobAccount?: JobAccount; - - outputFile = ""; - - static description = "add a job account to an aggregator"; + static description = "add a job to an aggregator"; static flags = { ...BaseCommand.flags, - force: flags.boolean({ - description: "overwrite outputFile if existing", - }), - outputFile: flags.string({ - char: "f", - description: "output file to save aggregator definition to", - }), - jobDefinition: flags.string({ + jobDefinition: Flags.string({ description: "filesystem path of job json definition file", exclusive: ["jobKey"], }), - jobKey: flags.string({ + jobKey: Flags.string({ description: "public key of an existing job account to add to an aggregator", exclusive: ["jobDefinition"], }), - aggregatorAuthority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that is the authority for the aggregator", }), @@ -54,88 +24,61 @@ export default class AggregatorAddJob extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator account", }, ]; static examples = ["$ sbv2 aggregator:add:job"]; - async init() { - await super.init(); - const { args, flags } = this.parse(AggregatorAddJob); - - if (flags.aggregatorAuthority) { - this.aggregatorAuthority = await loadKeypair(flags.aggregatorAuthority); - this.context.logger.debug( - `using aggregator authority ${this.aggregatorAuthority.publicKey}` - ); - } - - this.aggregatorAccount = new AggregatorAccount({ - program: this.program, - publicKey: args.aggregatorKey, - }); - - if (flags.jobDefinition) { - this.jobDefinition = JSON.parse(flags.jobDefinition, pubKeyReviver); - } - - if (flags.jobKey) { - this.jobAccount = new JobAccount({ - program: this.program, - publicKey: new PublicKey(flags.jobKey), - }); - } - - if (!this.jobDefinition && !this.jobAccount) { - throw new Error("need to provide --jobDefinition or --jobKey"); - } - - if (flags.outputFile) { - if (fs.existsSync(flags.outputFile) && !flags.force) { - throw new OutputFileExistsNoForce(flags.outputFile); - } - - this.outputFile = flags.outputFile; - } - } - async run() { - const job = this.jobAccount - ? await JobClass.fromAccount(this.context, this.jobAccount) - : await JobClass.build(this.context, this.program, this.jobDefinition); + const { args, flags } = await this.parse(AggregatorAddJob); - const txn = await this.aggregatorAccount.addJob( - job.account, - this.aggregatorAuthority - ); + // const aggregatorAccount = new AggregatorAccount({ + // program: this.program, + // publicKey: new PublicKey(args.aggregatorKey), + // }); + // const aggregator = await aggregatorAccount.loadData(); + // const authority = await this.loadAuthority( + // flags.authority, + // aggregator.authority + // ); - const aggregator = await AggregatorClass.fromAccount( - this.context, - this.aggregatorAccount - ); + // let jobAccount: JobAccount; + // if (flags.jobDefinition) { + // const jobDefinition = JSON.parse(flags.jobDefinition, pubKeyReviver); + // // create job account + // } - if (this.silent) { - console.log(txn); - } else { - this.logger.log( - `${chalk.green( - `${CHECK_ICON}Job succesfully added to aggregator account\r\n` - )}` - ); - this.logger.log( - `https://explorer.solana.com/tx/${txn}?cluster=${this.cluster}` - ); - } + // if (flags.jobKey) { + // jobAccount = new JobAccount({ + // program: this.program, + // publicKey: new PublicKey(flags.jobKey), + // }); + // } - if (this.outputFile) { - fs.writeFileSync( - this.outputFile, - JSON.stringify(aggregator, pubKeyConverter, 2) - ); - } + // const job = this.jobAccount + // ? await JobClass.fromAccount(this.context, this.jobAccount) + // : await JobClass.build(this.context, this.program, this.jobDefinition); + // const txn = await this.aggregatorAccount.addJob( + // job.account, + // this.aggregatorAuthority + // ); + // const aggregator = await AggregatorClass.fromAccount( + // this.context, + // this.aggregatorAccount + // ); + // if (this.silent) { + // console.log(txn); + // ReadableStreamDefaultController; + // } + // this.logger.log( + // `${chalk.green( + // `${CHECK_ICON}Job succesfully added to aggregator account\r\n` + // )}` + // ); + // this.logger.log( + // `https://explorer.solana.com/tx/${txn}?cluster=${this.cluster}` + // ); } async catch(error) { diff --git a/cli/src/commands/aggregator/create/copy.ts b/cli/src/commands/aggregator/create/copy.ts index cdc3f7e..b1c5229 100644 --- a/cli/src/commands/aggregator/create/copy.ts +++ b/cli/src/commands/aggregator/create/copy.ts @@ -1,5 +1,5 @@ /* eslint-disable unicorn/no-array-push-push */ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; import * as spl from "@solana/spl-token"; import { @@ -13,6 +13,7 @@ import { packAndSend, prettyPrintAggregator, promiseWithTimeout, + verifyProgramHasPayer, } from "@switchboard-xyz/sbv2-utils"; import { AggregatorAccount, @@ -28,7 +29,6 @@ import { } from "@switchboard-xyz/switchboard-v2"; import Big from "big.js"; import BaseCommand from "../../../BaseCommand"; -import { verifyProgramHasPayer } from "../../../utils"; // TODO: Fix command so it accepts a feed authority flag // TODO: Add flag that skips job creation @@ -37,52 +37,47 @@ export default class AggregatorCreateCopy extends BaseCommand { static flags = { ...BaseCommand.flags, - force: flags.boolean({ description: "skip job confirmation" }), - outputFile: flags.string({ - char: "f", - description: "output file to save aggregator definition to", - }), - authority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that will be the aggregator authority", }), - minOracles: flags.integer({ + minOracles: Flags.integer({ description: "override source aggregator's minOracleResults", }), - batchSize: flags.integer({ + batchSize: Flags.integer({ description: "override source aggregator's oracleRequestBatchSize", }), - minJobs: flags.integer({ + minJobs: Flags.integer({ description: "override source aggregator's minJobResults", }), - minUpdateDelay: flags.integer({ + minUpdateDelay: Flags.integer({ description: "override source aggregator's minUpdateDelaySeconds", }), - forceReportPeriod: flags.integer({ + forceReportPeriod: Flags.integer({ description: "override source aggregator's forceReportPeriod", }), - varianceThreshold: flags.string({ + varianceThreshold: Flags.string({ description: "override source aggregator's varianceThreshold", }), - queueKey: flags.string({ + queueKey: Flags.string({ description: "public key of the queue to create aggregator for", required: true, }), - crankKey: flags.string({ + crankKey: Flags.string({ description: "public key of the crank to push aggregator to", required: false, }), - enable: flags.boolean({ + enable: Flags.boolean({ description: "set permissions to PERMIT_ORACLE_QUEUE_USAGE", }), - queueAuthority: flags.string({ + queueAuthority: Flags.string({ description: "alternative keypair to use for queue authority", }), - copyJobs: flags.boolean({ + copyJobs: Flags.boolean({ description: "create copy of job accounts instead of referincing existing job account", }), - // sourceCluster: flags.string({ + // sourceCluster: Flags.string({ // description: "alternative solana cluster to copy source aggregator from", // required: false, // options: ["devnet", "mainnet-beta"], @@ -92,8 +87,6 @@ export default class AggregatorCreateCopy extends BaseCommand { static args = [ { name: "aggregatorSource", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator account to copy", }, ]; @@ -106,7 +99,7 @@ export default class AggregatorCreateCopy extends BaseCommand { async run() { verifyProgramHasPayer(this.program); - const { args, flags } = this.parse(AggregatorCreateCopy); + const { args, flags } = await this.parse(AggregatorCreateCopy); const payerKeypair = programWallet(this.program); const feedAuthority = await this.loadAuthority(flags.authority); diff --git a/cli/src/commands/aggregator/create/index.ts b/cli/src/commands/aggregator/create/index.ts index 2c98b31..5362138 100644 --- a/cli/src/commands/aggregator/create/index.ts +++ b/cli/src/commands/aggregator/create/index.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; import * as spl from "@solana/spl-token"; import { @@ -40,46 +40,45 @@ export default class AggregatorCreate extends BaseCommand { static flags = { ...BaseCommand.flags, - force: flags.boolean({ description: "skip job confirmation" }), - authority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that is the authority for the aggregator", }), - crankKey: flags.string({ + crankKey: Flags.string({ description: "public key of the crank to join", }), - enable: flags.boolean({ + enable: Flags.boolean({ description: "set permissions to PERMIT_ORACLE_QUEUE_USAGE", }), - queueAuthority: flags.string({ + queueAuthority: Flags.string({ description: "alternative keypair to use for queue authority", }), - name: flags.string({ + name: Flags.string({ char: "n", description: "name of the aggregator", }), - forceReportPeriod: flags.integer({ + forceReportPeriod: Flags.integer({ description: "Number of seconds for which, even if the variance threshold is not passed, accept new responses from oracles.", }), - batchSize: flags.string({ + batchSize: Flags.integer({ description: "number of oracles requested for each open round call", }), - minJobs: flags.string({ + minJobs: Flags.integer({ description: "number of jobs that must respond before an oracle responds", }), - minOracles: flags.string({ + minOracles: Flags.integer({ description: "number of oracles that must respond before a value is accepted on-chain", }), - updateInterval: flags.string({ + updateInterval: Flags.integer({ description: "set an aggregator's minimum update delay", }), - varianceThreshold: flags.string({ + varianceThreshold: Flags.string({ description: "percentage change between a previous accepted result and the next round before an oracle reports a value on-chain. Used to conserve lease cost during low volatility", }), - job: flags.string({ + job: Flags.string({ char: "j", description: "filesystem path to job definition file", multiple: true, @@ -89,8 +88,6 @@ export default class AggregatorCreate extends BaseCommand { static args = [ { name: "queueKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the oracle queue account to create aggregator for", }, @@ -98,7 +95,7 @@ export default class AggregatorCreate extends BaseCommand { async run() { verifyProgramHasPayer(this.program); - const { args, flags } = this.parse(AggregatorCreate); + const { args, flags } = await this.parse(AggregatorCreate); const payerKeypair = programWallet(this.program); const feedAuthority = await this.loadAuthority(flags.authority); @@ -109,7 +106,7 @@ export default class AggregatorCreate extends BaseCommand { ); const queueAccount = new OracleQueueAccount({ program: this.program, - publicKey: args.queueKey, + publicKey: new PublicKey(args.queueKey), }); const queue = await queueAccount.loadData(); const switchTokenMint = await queueAccount.loadMint(); @@ -135,7 +132,7 @@ export default class AggregatorCreate extends BaseCommand { flags.job.map( async ( jobDefinition - ): Promise<[TransactionInstruction, Keypair]> => { + ): Promise<[TransactionInstruction[], Keypair]> => { const jobJson = JSON.parse( fs.readFileSync( jobDefinition.startsWith("/") @@ -158,6 +155,19 @@ export default class AggregatorCreate extends BaseCommand { ).finish() ); + const size = 280 + data.length; + + const allocateAccountIxn = SystemProgram.createAccount({ + fromPubkey: payerKeypair.publicKey, + newAccountPubkey: jobKeypair.publicKey, + space: size, + lamports: + await this.program.provider.connection.getMinimumBalanceForRentExemption( + size + ), + programId: this.program.programId, + }); + const createJobIxn = await this.program.methods .jobInit({ name: Buffer.from("").slice(0, 32), @@ -175,13 +185,15 @@ export default class AggregatorCreate extends BaseCommand { .signers([feedAuthority]) .instruction(); - return [createJobIxn, jobKeypair]; + return [[allocateAccountIxn, createJobIxn], jobKeypair]; } ) ) : []; - createAccountInstructions.push(createJobs.map((index) => index[0])); - createAccountSigners.push(...createJobs.map((index) => index[1])); + + const createJobIxn = createJobs.map((index) => index[0]); + const createJobSigners = createJobs.map((index) => index[1]); + const jobAccounts = createJobs .map((index) => index[1]) .map((jobKeypair) => { @@ -229,7 +241,7 @@ export default class AggregatorCreate extends BaseCommand { varianceThreshold: flags.varianceThreshold ? SwitchboardDecimal.fromBig(new Big(flags.varianceThreshold)) : SwitchboardDecimal.fromBig(new Big(0)), - forceReportPeriod: flags.forceReportPeriod ?? 0, + forceReportPeriod: new anchor.BN(flags.forceReportPeriod ?? 0), stateBump, }) .accounts({ @@ -363,8 +375,8 @@ export default class AggregatorCreate extends BaseCommand { const createAccountSignatures = packAndSend( this.program, - [createAccountInstructions, addJobIxns], - createAccountSigners, + [createJobIxn, createAccountInstructions, addJobIxns], + [...createJobSigners, ...createAccountSigners], payerKeypair.publicKey ).catch((error) => { throw error; diff --git a/cli/src/commands/aggregator/create/json.ts b/cli/src/commands/aggregator/create/json.ts index 46043a8..fc04343 100644 --- a/cli/src/commands/aggregator/create/json.ts +++ b/cli/src/commands/aggregator/create/json.ts @@ -1,7 +1,11 @@ -import { flags } from "@oclif/command"; +/* eslint-disable complexity */ +import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; import { PublicKey } from "@solana/web3.js"; -import { prettyPrintAggregator } from "@switchboard-xyz/sbv2-utils"; +import { + prettyPrintAggregator, + verifyProgramHasPayer, +} from "@switchboard-xyz/sbv2-utils"; import { AggregatorAccount, JobAccount, @@ -12,14 +16,13 @@ import { import chalk from "chalk"; import * as fs from "fs"; import * as path from "path"; +import BaseCommand from "../../../BaseCommand"; import { - fromAggregatorJSON, - fromJobJSON, + CHECK_ICON, + loadKeypair, pubKeyConverter, pubKeyReviver, -} from "../../../accounts"; -import BaseCommand from "../../../BaseCommand"; -import { CHECK_ICON, loadKeypair, verifyProgramHasPayer } from "../../../utils"; +} from "../../../utils"; export default class JsonCreateAggregator extends BaseCommand { static description = "create an aggregator from a json file"; @@ -28,18 +31,11 @@ export default class JsonCreateAggregator extends BaseCommand { static flags = { ...BaseCommand.flags, - force: flags.boolean({ - description: "overwrite output file", - }), - outputFile: flags.string({ - description: "output aggregator definition to a json file", - char: "f", - }), - queueKey: flags.string({ + queueKey: Flags.string({ description: "public key of the oracle queue to create aggregator for", char: "q", }), - authority: flags.string({ + authority: Flags.string({ description: "alternate keypair that will be the authority for the aggregator", char: "a", @@ -49,7 +45,6 @@ export default class JsonCreateAggregator extends BaseCommand { static args = [ { name: "definitionFile", - required: true, description: "filesystem path of queue definition json file", }, ]; @@ -59,7 +54,7 @@ export default class JsonCreateAggregator extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(JsonCreateAggregator); + const { args, flags } = await this.parse(JsonCreateAggregator); verifyProgramHasPayer(this.program); const payerKeypair = programWallet(this.program); @@ -71,17 +66,11 @@ export default class JsonCreateAggregator extends BaseCommand { throw new Error("input file does not exist"); } - const aggregatorDefinition: fromAggregatorJSON = JSON.parse( + const aggregatorDefinition: any = JSON.parse( fs.readFileSync(definitionFile, "utf-8"), pubKeyReviver ); - if (flags.outputFile && fs.existsSync(flags.outputFile) && !flags.force) { - throw new Error( - "output file exists. Run the command with '--force' to overwrite it" - ); - } - let authority = programWallet(this.program); if (flags.authority) { authority = await loadKeypair(flags.authority); @@ -146,7 +135,7 @@ export default class JsonCreateAggregator extends BaseCommand { const jobs: JobAccount[] = []; if (aggregatorDefinition.jobs) { for await (const job of aggregatorDefinition.jobs) { - const jobDefinition: fromJobJSON = JSON.parse( + const jobDefinition: any = JSON.parse( JSON.stringify(job), pubKeyConverter ); @@ -190,13 +179,6 @@ export default class JsonCreateAggregator extends BaseCommand { ); } - if (flags.outputFile) { - fs.writeFileSync( - flags.outputFile, - JSON.stringify(aggregator, pubKeyConverter, 2) - ); - } - if (this.silent) { console.log(aggregator.publicKey.toString()); } else { diff --git a/cli/src/commands/aggregator/lock.ts b/cli/src/commands/aggregator/lock.ts index 99184ff..c7dcab5 100644 --- a/cli/src/commands/aggregator/lock.ts +++ b/cli/src/commands/aggregator/lock.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; import { AggregatorAccount } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; @@ -11,7 +11,7 @@ export default class AggregatorLock extends BaseCommand { static flags = { ...BaseCommand.flags, - authority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that is the authority for the aggregator", }), @@ -20,8 +20,6 @@ export default class AggregatorLock extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator account", }, ]; @@ -29,12 +27,12 @@ export default class AggregatorLock extends BaseCommand { // static examples = ["$ sbv2 aggregator:set:authority"]; async run() { - const { args, flags } = this.parse(AggregatorLock); + const { args, flags } = await this.parse(AggregatorLock); verifyProgramHasPayer(this.program); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); const authority = await this.loadAuthority( diff --git a/cli/src/commands/aggregator/permission/create.ts b/cli/src/commands/aggregator/permission/create.ts index 182554f..60efac0 100644 --- a/cli/src/commands/aggregator/permission/create.ts +++ b/cli/src/commands/aggregator/permission/create.ts @@ -19,19 +19,17 @@ export default class AggregatorPermissionCreate extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator account", }, ]; async run() { - const { args } = this.parse(AggregatorPermissionCreate); + const { args } = await this.parse(AggregatorPermissionCreate); verifyProgramHasPayer(this.program); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); @@ -69,9 +67,7 @@ export default class AggregatorPermissionCreate extends BaseCommand { console.log(permissionAccount.publicKey.toString()); } else { this.logger.log( - `${chalk.green( - `${CHECK_ICON}Permission account created successfully` - )}` + `${chalk.green(`${CHECK_ICON}Permission account created successfully`)}` ); this.logger.log(await prettyPrintPermissions(permissionAccount)); } diff --git a/cli/src/commands/aggregator/remove/job.ts b/cli/src/commands/aggregator/remove/job.ts index 840bf8a..2ef568c 100644 --- a/cli/src/commands/aggregator/remove/job.ts +++ b/cli/src/commands/aggregator/remove/job.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; import { AggregatorAccount, JobAccount } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; @@ -10,10 +10,7 @@ export default class AggregatorRemoveJob extends BaseCommand { static flags = { ...BaseCommand.flags, - force: flags.boolean({ - description: "overwrite outputFile if existing", - }), - authority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that is the authority for the aggregator", }), @@ -22,14 +19,10 @@ export default class AggregatorRemoveJob extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator account", }, { name: "jobKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of an existing job account to remove from an aggregator", }, @@ -38,12 +31,12 @@ export default class AggregatorRemoveJob extends BaseCommand { static examples = ["$ sbv2 aggregator:remove:job"]; async run() { - const { args, flags } = this.parse(AggregatorRemoveJob); + const { args, flags } = await this.parse(AggregatorRemoveJob); verifyProgramHasPayer(this.program); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); const authority = await this.loadAuthority( diff --git a/cli/src/commands/aggregator/set/authority.ts b/cli/src/commands/aggregator/set/authority.ts index e2873d0..93f8faf 100644 --- a/cli/src/commands/aggregator/set/authority.ts +++ b/cli/src/commands/aggregator/set/authority.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; import { AggregatorAccount } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; @@ -10,7 +10,7 @@ export default class AggregatorSetAuthority extends BaseCommand { static flags = { ...BaseCommand.flags, - currentAuthority: flags.string({ + currentAuthority: Flags.string({ char: "a", description: "alternate keypair that is the authority for the aggregator", }), @@ -19,13 +19,10 @@ export default class AggregatorSetAuthority extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator account", }, { name: "newAuthority", - required: true, description: "keypair path of new authority", }, ]; @@ -33,13 +30,13 @@ export default class AggregatorSetAuthority extends BaseCommand { // static examples = ["$ sbv2 aggregator:set:authority"]; async run() { - const { args, flags } = this.parse(AggregatorSetAuthority); + const { args, flags } = await this.parse(AggregatorSetAuthority); const newAuthority = await loadKeypair(args.newAuthority); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); const currentAuthority = await this.loadAuthority( diff --git a/cli/src/commands/aggregator/set/batchSize.ts b/cli/src/commands/aggregator/set/batchSize.ts index e40bde1..f3f1a2b 100644 --- a/cli/src/commands/aggregator/set/batchSize.ts +++ b/cli/src/commands/aggregator/set/batchSize.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; import { AggregatorAccount } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; @@ -10,7 +10,7 @@ export default class AggregatorSetBatchSize extends BaseCommand { static flags = { ...BaseCommand.flags, - authority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that is the authority for the aggregator", }), @@ -19,8 +19,6 @@ export default class AggregatorSetBatchSize extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator account", }, { @@ -33,7 +31,7 @@ export default class AggregatorSetBatchSize extends BaseCommand { // static examples = ["$ sbv2 aggregator:set:authority"]; async run() { - const { args, flags } = this.parse(AggregatorSetBatchSize); + const { args, flags } = await this.parse(AggregatorSetBatchSize); verifyProgramHasPayer(this.program); const batchSize = Number.parseInt(args.batchSize, 10); @@ -43,7 +41,7 @@ export default class AggregatorSetBatchSize extends BaseCommand { const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); diff --git a/cli/src/commands/aggregator/set/forceReportPeriod.ts b/cli/src/commands/aggregator/set/forceReportPeriod.ts index fbc940c..4fd35d7 100644 --- a/cli/src/commands/aggregator/set/forceReportPeriod.ts +++ b/cli/src/commands/aggregator/set/forceReportPeriod.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; import { AggregatorAccount } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; @@ -12,7 +12,7 @@ export default class AggregatorSetForceReportPeriod extends BaseCommand { static flags = { ...BaseCommand.flags, - authority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that is the authority for the aggregator", }), @@ -21,14 +21,10 @@ export default class AggregatorSetForceReportPeriod extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator", }, { name: "forceReportPeriod", - required: true, - parse: (value: string) => Number.parseInt(value), description: "Number of seconds for which, even if the variance threshold is not passed, accept new responses from oracles.", }, @@ -39,12 +35,12 @@ export default class AggregatorSetForceReportPeriod extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(AggregatorSetForceReportPeriod); + const { args, flags } = await this.parse(AggregatorSetForceReportPeriod); verifyProgramHasPayer(this.program); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); const authority = await this.loadAuthority( diff --git a/cli/src/commands/aggregator/set/history.ts b/cli/src/commands/aggregator/set/history.ts index 61f7866..d54d370 100644 --- a/cli/src/commands/aggregator/set/history.ts +++ b/cli/src/commands/aggregator/set/history.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; import { AggregatorAccount } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; @@ -13,7 +13,7 @@ export default class AggregatorSetHistoryBuffer extends BaseCommand { static flags = { ...BaseCommand.flags, - authority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that is the authority for the aggregator", }), @@ -22,14 +22,10 @@ export default class AggregatorSetHistoryBuffer extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator to add to a crank", }, { name: "size", - required: true, - parse: (value: string) => Number.parseInt(value, 10), description: "size of history buffer", }, ]; @@ -39,12 +35,12 @@ export default class AggregatorSetHistoryBuffer extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(AggregatorSetHistoryBuffer); + const { args, flags } = await this.parse(AggregatorSetHistoryBuffer); verifyProgramHasPayer(this.program); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); const authority = await this.loadAuthority( diff --git a/cli/src/commands/aggregator/set/index.ts b/cli/src/commands/aggregator/set/index.ts index 0f27c7a..0a5400a 100644 --- a/cli/src/commands/aggregator/set/index.ts +++ b/cli/src/commands/aggregator/set/index.ts @@ -1,5 +1,6 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { PublicKey, Transaction } from "@solana/web3.js"; +import { verifyProgramHasPayer } from "@switchboard-xyz/sbv2-utils"; import { AggregatorAccount, OracleQueueAccount, @@ -9,7 +10,7 @@ import { import Big from "big.js"; import chalk from "chalk"; import BaseCommand from "../../../BaseCommand"; -import { CHECK_ICON, verifyProgramHasPayer } from "../../../utils"; +import { CHECK_ICON } from "../../../utils"; export default class AggregatorSet extends BaseCommand { static description = "set an aggregator's config"; @@ -18,31 +19,31 @@ export default class AggregatorSet extends BaseCommand { static flags = { ...BaseCommand.flags, - authority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that is the authority for the aggregator", }), - forceReportPeriod: flags.string({ + forceReportPeriod: Flags.string({ description: "Number of seconds for which, even if the variance threshold is not passed, accept new responses from oracles.", }), - // batchSize: flags.string({ + // batchSize: Flags.string({ // description: "number of oracles requested for each open round call", // }), - minJobs: flags.string({ + minJobs: Flags.string({ description: "number of jobs that must respond before an oracle responds", }), - minOracles: flags.string({ + minOracles: Flags.string({ description: "number of oracles that must respond before a value is accepted on-chain", }), - newQueue: flags.string({ + newQueue: Flags.string({ description: "public key of the new oracle queue", }), - updateInterval: flags.string({ + updateInterval: Flags.string({ description: "set an aggregator's minimum update delay", }), - varianceThreshold: flags.string({ + varianceThreshold: Flags.string({ description: "percentage change between a previous accepted result and the next round before an oracle reports a value on-chain. Used to conserve lease cost during low volatility", }), @@ -51,8 +52,6 @@ export default class AggregatorSet extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator", }, ]; @@ -62,14 +61,14 @@ export default class AggregatorSet extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(AggregatorSet); + const { args, flags } = await this.parse(AggregatorSet); verifyProgramHasPayer(this.program); const payerKeypair = programWallet(this.program); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); const authority = await this.loadAuthority( @@ -114,7 +113,7 @@ export default class AggregatorSet extends BaseCommand { // min oracles responses if (flags.minOracles) { - const minOracles = Number.parseInt(flags.minOracles); + const minOracles = Number.parseInt(flags.minOracles, 10); txn.add( await this.program.methods .aggregatorSetMinOracles({ @@ -130,7 +129,7 @@ export default class AggregatorSet extends BaseCommand { // min job responses if (flags.minJobs) { - const minJobs = Number.parseInt(flags.minJobs); + const minJobs = Number.parseInt(flags.minJobs, 10); txn.add( await this.program.methods .aggregatorSetMinJobs({ @@ -167,7 +166,7 @@ export default class AggregatorSet extends BaseCommand { txn.add( await this.program.methods .aggregatorSetForceReportPeriod({ - forceReportPeriod: Number.parseInt(flags.forceReportPeriod), + forceReportPeriod: Number.parseInt(flags.forceReportPeriod, 10), }) .accounts({ aggregator: aggregatorAccount.publicKey, diff --git a/cli/src/commands/aggregator/set/minJobs.ts b/cli/src/commands/aggregator/set/minJobs.ts index ab4fdee..d7f4890 100644 --- a/cli/src/commands/aggregator/set/minJobs.ts +++ b/cli/src/commands/aggregator/set/minJobs.ts @@ -1,9 +1,10 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; +import { verifyProgramHasPayer } from "@switchboard-xyz/sbv2-utils"; import { AggregatorAccount } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; import BaseCommand from "../../../BaseCommand"; -import { CHECK_ICON, verifyProgramHasPayer } from "../../../utils"; +import { CHECK_ICON } from "../../../utils"; export default class AggregatorSetMinJobResults extends BaseCommand { static description = @@ -11,7 +12,7 @@ export default class AggregatorSetMinJobResults extends BaseCommand { static flags = { ...BaseCommand.flags, - authority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that is the authority for the aggregator", }), @@ -20,13 +21,10 @@ export default class AggregatorSetMinJobResults extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator account", }, { name: "minJobResults", - required: true, description: "number of jobs that must respond before an oracle responds", }, ]; @@ -34,12 +32,12 @@ export default class AggregatorSetMinJobResults extends BaseCommand { // static examples = ["$ sbv2 aggregator:set:authority"]; async run() { - const { args, flags } = this.parse(AggregatorSetMinJobResults); + const { args, flags } = await this.parse(AggregatorSetMinJobResults); verifyProgramHasPayer(this.program); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); const authority = await this.loadAuthority( @@ -51,6 +49,7 @@ export default class AggregatorSetMinJobResults extends BaseCommand { if (minJobResults <= 0 || minJobResults > 16) { throw new Error(`Invalid min job size (1 - 16), ${minJobResults}`); } + if (minJobResults > aggregator.jobPubkeysSize) { throw new Error( `Min jobs ${minJobResults} is greater than current number of jobs ${aggregator.jobPubkeysSize} ` diff --git a/cli/src/commands/aggregator/set/minOracles.ts b/cli/src/commands/aggregator/set/minOracles.ts index 033f50f..ce286aa 100644 --- a/cli/src/commands/aggregator/set/minOracles.ts +++ b/cli/src/commands/aggregator/set/minOracles.ts @@ -1,9 +1,10 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; +import { verifyProgramHasPayer } from "@switchboard-xyz/sbv2-utils"; import { AggregatorAccount } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; import BaseCommand from "../../../BaseCommand"; -import { CHECK_ICON, verifyProgramHasPayer } from "../../../utils"; +import { CHECK_ICON } from "../../../utils"; export default class AggregatorSetMinOracleResults extends BaseCommand { static description = @@ -11,7 +12,7 @@ export default class AggregatorSetMinOracleResults extends BaseCommand { static flags = { ...BaseCommand.flags, - authority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that is the authority for the aggregator", }), @@ -20,13 +21,10 @@ export default class AggregatorSetMinOracleResults extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator account", }, { name: "minOracleResults", - required: true, description: "number of oracles that must respond before a value is accepted on-chain", }, @@ -35,12 +33,12 @@ export default class AggregatorSetMinOracleResults extends BaseCommand { // static examples = ["$ sbv2 aggregator:set:authority"]; async run() { - const { args, flags } = this.parse(AggregatorSetMinOracleResults); + const { args, flags } = await this.parse(AggregatorSetMinOracleResults); verifyProgramHasPayer(this.program); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); diff --git a/cli/src/commands/aggregator/set/queue.ts b/cli/src/commands/aggregator/set/queue.ts index 67211eb..9dbe060 100644 --- a/cli/src/commands/aggregator/set/queue.ts +++ b/cli/src/commands/aggregator/set/queue.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; import { AggregatorAccount, @@ -13,7 +13,7 @@ export default class AggregatorSetQueue extends BaseCommand { static flags = { ...BaseCommand.flags, - authority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that is the authority for the aggregator", }), @@ -22,31 +22,27 @@ export default class AggregatorSetQueue extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator", }, { name: "queueKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the oracle queue", }, ]; async run() { - const { args, flags } = this.parse(AggregatorSetQueue); + const { args, flags } = await this.parse(AggregatorSetQueue); verifyProgramHasPayer(this.program); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); const oracleQueue = new OracleQueueAccount({ program: this.program, - publicKey: args.queueKey, + publicKey: new PublicKey(args.queueKey), }); const authority = await this.loadAuthority( diff --git a/cli/src/commands/aggregator/set/updateInterval.ts b/cli/src/commands/aggregator/set/updateInterval.ts index b6760bd..fa2ee25 100644 --- a/cli/src/commands/aggregator/set/updateInterval.ts +++ b/cli/src/commands/aggregator/set/updateInterval.ts @@ -1,16 +1,17 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; +import { verifyProgramHasPayer } from "@switchboard-xyz/sbv2-utils"; import { AggregatorAccount } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; import BaseCommand from "../../../BaseCommand"; -import { CHECK_ICON, verifyProgramHasPayer } from "../../../utils"; +import { CHECK_ICON } from "../../../utils"; export default class AggregatorSetUpdateInterval extends BaseCommand { static description = "set an aggregator's minimum update delay"; static flags = { ...BaseCommand.flags, - authority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that is the authority for the aggregator", }), @@ -19,14 +20,10 @@ export default class AggregatorSetUpdateInterval extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator account", }, { name: "updateInterval", - required: true, - parse: (newInterval: string) => Number.parseInt(newInterval, 10), description: "set an aggregator's minimum update delay", }, ]; @@ -36,12 +33,12 @@ export default class AggregatorSetUpdateInterval extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(AggregatorSetUpdateInterval); + const { args, flags } = await this.parse(AggregatorSetUpdateInterval); verifyProgramHasPayer(this.program); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); @@ -63,7 +60,7 @@ export default class AggregatorSetUpdateInterval extends BaseCommand { ); const txn = await aggregatorAccount.setUpdateInterval({ - newInterval: args.updateInterval, + newInterval: Number.parseInt(args.updateInterval, 10), authority, }); diff --git a/cli/src/commands/aggregator/set/varianceThreshold.ts b/cli/src/commands/aggregator/set/varianceThreshold.ts index f478d32..af18245 100644 --- a/cli/src/commands/aggregator/set/varianceThreshold.ts +++ b/cli/src/commands/aggregator/set/varianceThreshold.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; import { AggregatorAccount } from "@switchboard-xyz/switchboard-v2"; import Big from "big.js"; @@ -13,7 +13,7 @@ export default class AggregatorSetVarianceThreshold extends BaseCommand { static flags = { ...BaseCommand.flags, - authority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that is the authority for the aggregator", }), @@ -22,14 +22,10 @@ export default class AggregatorSetVarianceThreshold extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator", }, { name: "varianceThreshold", - required: true, - parse: (variance: string) => new Big(variance), description: "percentage change between a previous accepted result and the next round before an oracle reports a value on-chain. Used to conserve lease cost during low volatility", }, @@ -40,12 +36,12 @@ export default class AggregatorSetVarianceThreshold extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(AggregatorSetVarianceThreshold); + const { args, flags } = await this.parse(AggregatorSetVarianceThreshold); verifyProgramHasPayer(this.program); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); const authority = await this.loadAuthority( @@ -55,7 +51,7 @@ export default class AggregatorSetVarianceThreshold extends BaseCommand { const txn = await aggregatorAccount.setVarianceThreshold({ authority, - threshold: args.varianceThreshold, + threshold: new Big(args.varianceThreshold), }); if (this.silent) { diff --git a/cli/src/commands/aggregator/update.ts b/cli/src/commands/aggregator/update.ts index 97ea20e..8ae9755 100644 --- a/cli/src/commands/aggregator/update.ts +++ b/cli/src/commands/aggregator/update.ts @@ -19,8 +19,6 @@ export default class AggregatorUpdate extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator account to deserialize", }, ]; @@ -30,11 +28,11 @@ export default class AggregatorUpdate extends BaseCommand { ]; async run() { - const { args } = this.parse(AggregatorUpdate); + const { args } = await this.parse(AggregatorUpdate); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); @@ -79,6 +77,7 @@ export default class AggregatorUpdate extends BaseCommand { this.context.logger.info(error.toString()); this.exit(0); } + super.catch(error, "failed to open a new aggregator update round"); } } diff --git a/cli/src/commands/config.ts b/cli/src/commands/config.ts index 9feca37..eb45bee 100644 --- a/cli/src/commands/config.ts +++ b/cli/src/commands/config.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import BaseCommand from "../BaseCommand"; import OracleDeposit from "./oracle/deposit"; import OracleWithdraw from "./oracle/withdraw"; @@ -16,7 +16,7 @@ export default class Config extends BaseCommand { static flags = { ...BaseCommand.flags, - pubkey: flags.string({ + pubkey: Flags.string({ description: "command specific. override default account with provided public key", }), @@ -39,7 +39,7 @@ export default class Config extends BaseCommand { async init() { await super.init(); - const { args, flags, argv } = this.parse(Config); + const { args, flags, argv } = await this.parse(Config); this.passThroughArguments = argv.slice(1); this.baseCommand = args.baseCommand; this.flags = flags; @@ -51,6 +51,7 @@ export default class Config extends BaseCommand { await OracleWithdraw.run(this.passThroughArguments); break; } + case "oracle:deposit": { await OracleDeposit.run(this.passThroughArguments); break; diff --git a/cli/src/commands/config/print.ts b/cli/src/commands/config/print.ts index 045cd0c..29c5eb2 100644 --- a/cli/src/commands/config/print.ts +++ b/cli/src/commands/config/print.ts @@ -1,5 +1,5 @@ +import { chalkString } from "@switchboard-xyz/sbv2-utils"; import chalk from "chalk"; -import { chalkString } from "../../accounts/utils"; import BaseCommand from "../../BaseCommand"; export default class ConfigPrint extends BaseCommand { @@ -13,9 +13,9 @@ export default class ConfigPrint extends BaseCommand { async run() { const { devnet, mainnet } = this.cliConfig; - this.log(chalk.underline(chalk.blue("## Mainnet-Beta".padEnd(16))), "info"); - this.log(chalkString("mainnet-rpc", mainnet.rpcUrl || "N/A"), "info"); - this.log(chalk.underline(chalk.blue("## Devnet".padEnd(16))), "info"); - this.log(chalkString("devnet-rpc", devnet.rpcUrl || "N/A"), "info"); + this.log(chalk.underline(chalk.blue("## Mainnet-Beta".padEnd(16)))); + this.log(chalkString("mainnet-rpc", mainnet.rpcUrl || "N/A")); + this.log(chalk.underline(chalk.blue("## Devnet".padEnd(16)))); + this.log(chalkString("devnet-rpc", devnet.rpcUrl || "N/A")); } } diff --git a/cli/src/commands/config/set.ts b/cli/src/commands/config/set.ts index db1f874..9a491d3 100644 --- a/cli/src/commands/config/set.ts +++ b/cli/src/commands/config/set.ts @@ -1,6 +1,5 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import BaseCommand from "../../BaseCommand"; -import { ConfigParameter } from "../../config"; export default class ConfigSet extends BaseCommand { hidden = true; @@ -9,7 +8,7 @@ export default class ConfigSet extends BaseCommand { static flags = { ...BaseCommand.flags, - reset: flags.boolean({ + reset: Flags.boolean({ char: "r", description: "remove value or set to default rpc", }), @@ -18,9 +17,7 @@ export default class ConfigSet extends BaseCommand { static args = [ { name: "param", - required: true, options: ["devnet-rpc", "mainnet-rpc"], - parse: (string_: string) => string_ as ConfigParameter, description: "configuration parameter to set", }, { @@ -31,7 +28,7 @@ export default class ConfigSet extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(ConfigSet); + const { args, flags } = await this.parse(ConfigSet); this.setConfig(args.param, flags.reset ? undefined : args.value); } diff --git a/cli/src/commands/queue/add/crank.ts b/cli/src/commands/crank/create.ts similarity index 89% rename from cli/src/commands/queue/add/crank.ts rename to cli/src/commands/crank/create.ts index f85ddef..3a55f98 100644 --- a/cli/src/commands/queue/add/crank.ts +++ b/cli/src/commands/crank/create.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; import { PublicKey, SystemProgram } from "@solana/web3.js"; import { @@ -11,23 +11,25 @@ import { programWallet, } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; -import BaseCommand from "../../../BaseCommand"; -import { CHECK_ICON } from "../../../utils"; +import BaseCommand from "../../BaseCommand"; +import { CHECK_ICON } from "../../utils"; export default class QueueAddCrank extends BaseCommand { static description = "add a crank to an existing oracle queue"; + static alias = ["queue:add:crank"]; + static flags = { ...BaseCommand.flags, - name: flags.string({ + name: Flags.string({ char: "n", description: "name of the crank for easier identification", }), - maxRows: flags.integer({ + maxRows: Flags.integer({ char: "r", description: "maximum number of rows a crank can support", }), - queueAuthority: flags.string({ + queueAuthority: Flags.string({ description: "alternative keypair to use for queue authority", }), }; @@ -35,8 +37,6 @@ export default class QueueAddCrank extends BaseCommand { static args = [ { name: "queueKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the oracle queue to create a crank on", }, ]; @@ -47,7 +47,7 @@ export default class QueueAddCrank extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(QueueAddCrank); + const { args, flags } = await this.parse(QueueAddCrank); verifyProgramHasPayer(this.program); const payerKeypair = programWallet(this.program); @@ -59,7 +59,7 @@ export default class QueueAddCrank extends BaseCommand { const queueAccount = new OracleQueueAccount({ program: this.program, - publicKey: args.queueKey, + publicKey: new PublicKey(args.queueKey), }); const queue = await queueAccount.loadData(); diff --git a/cli/src/commands/crank/list.ts b/cli/src/commands/crank/list.ts index 3a6b23b..df0b9ce 100644 --- a/cli/src/commands/crank/list.ts +++ b/cli/src/commands/crank/list.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; import { CrankAccount, CrankRow } from "@switchboard-xyz/switchboard-v2"; import * as fs from "fs"; @@ -10,8 +10,8 @@ export default class CrankList extends BaseCommand { static flags = { ...BaseCommand.flags, - force: flags.boolean({ description: "overwrite output file if exists" }), - outputFile: flags.string({ + force: Flags.boolean({ description: "overwrite output file if exists" }), + outputFile: Flags.string({ char: "f", description: "output file to save aggregator pubkeys to", }), @@ -20,14 +20,12 @@ export default class CrankList extends BaseCommand { static args = [ { name: "crankKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the crank", }, ]; async run() { - const { args, flags } = this.parse(CrankList); + const { args, flags } = await this.parse(CrankList); const outputFile = flags.outputFile ? path.join(process.cwd(), flags.outputFile) @@ -40,7 +38,7 @@ export default class CrankList extends BaseCommand { const crankAccount = new CrankAccount({ program: this.program, - publicKey: args.crankKey, + publicKey: new PublicKey(args.crankKey), }); const crank = await crankAccount.loadData(); diff --git a/cli/src/commands/crank/push.ts b/cli/src/commands/crank/push.ts index dff779f..a1a4a7a 100644 --- a/cli/src/commands/crank/push.ts +++ b/cli/src/commands/crank/push.ts @@ -19,30 +19,26 @@ export default class CrankPush extends BaseCommand { static args = [ { name: "crankKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the crank", }, { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator", }, ]; async run() { - const { args } = this.parse(CrankPush); + const { args } = await this.parse(CrankPush); verifyProgramHasPayer(this.program); const crankAccount = new CrankAccount({ program: this.program, - publicKey: args.crankKey, + publicKey: new PublicKey(args.crankKey), }); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const txn = await crankAccount.push({ aggregatorAccount }); @@ -51,9 +47,7 @@ export default class CrankPush extends BaseCommand { console.log(txn); } else { this.logger.log( - `${chalk.green( - `${CHECK_ICON}Aggregator pushed to crank successfully` - )}` + `${chalk.green(`${CHECK_ICON}Aggregator pushed to crank successfully`)}` ); this.logger.log( `https://explorer.solana.com/tx/${txn}?cluster=${this.cluster}` diff --git a/cli/src/commands/crank/turn.ts b/cli/src/commands/crank/turn.ts index 2a73b7f..674b354 100644 --- a/cli/src/commands/crank/turn.ts +++ b/cli/src/commands/crank/turn.ts @@ -22,8 +22,6 @@ export default class CrankTurn extends BaseCommand { static args = [ { name: "crankKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the crank to turn", }, ]; @@ -33,14 +31,14 @@ export default class CrankTurn extends BaseCommand { ]; async run() { - const { args } = this.parse(CrankTurn); + const { args } = await this.parse(CrankTurn); verifyProgramHasPayer(this.program); const payer = programWallet(this.program); // load crank const crankAccount = new CrankAccount({ program: this.program, - publicKey: args.crankKey, + publicKey: new PublicKey(args.crankKey), }); const crank = await crankAccount.loadData(); diff --git a/cli/src/commands/job/create/copy.ts b/cli/src/commands/job/create/copy.ts deleted file mode 100644 index e315d63..0000000 --- a/cli/src/commands/job/create/copy.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { flags } from "@oclif/command"; -import { PublicKey } from "@solana/web3.js"; -import { JobAccount } from "@switchboard-xyz/switchboard-v2"; -import chalk from "chalk"; -import * as fs from "fs"; -import { JobClass, pubKeyConverter } from "../../../accounts"; -import BaseCommand from "../../../BaseCommand"; -import { OutputFileExistsNoForce } from "../../../types"; -import { CHECK_ICON } from "../../../utils"; - -export default class JobCreateCopy extends BaseCommand { - sourceJob: JobAccount; - - outputFile = ""; - - static description = "copy a job account"; - - static flags = { - ...BaseCommand.flags, - force: flags.boolean({ description: "skip job confirmation" }), - outputFile: flags.string({ - char: "f", - description: "output file to save job definition to", - }), - }; - - static args = [ - { - name: "jobSource", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), - description: "public key of the aggregator account to copy", - }, - ]; - - static examples = [ - "$ sbv2 job:create:copy 7pdb5RVM6cVBU8XDfpGqakb1S4wX2i5QsZxT117tK4HS --keypair ../payer-keypair.json", - ]; - - async init() { - await super.init(); - const { args, flags } = this.parse(JobCreateCopy); - - this.sourceJob = new JobAccount({ - program: this.program, - publicKey: args.jobSource, - }); - - if (flags.outputFile) { - if (fs.existsSync(flags.outputFile) && !flags.force) { - throw new OutputFileExistsNoForce(flags.outputFile); - } - this.outputFile = flags.outputFile; - } - } - - async run() { - // create aggregator - const job = await JobClass.fromCopyAccount(this.context, this.program, { - sourcePublicKey: this.sourceJob.publicKey, - }); - - if (this.silent) { - console.log(job.publicKey.toString()); - } else { - this.logger.log(job.prettyPrint()); - - this.logger.log( - `${chalk.green(`${CHECK_ICON}Job account successfully copied`)}` - ); - - if (job.account.keypair) { - this.context.fs.saveKeypair(job.account.keypair); - } - } - - if (this.outputFile) { - fs.writeFileSync( - this.outputFile, - JSON.stringify(job, pubKeyConverter, 2) - ); - } - } - - async catch(error) { - super.catch(error, "failed to copy job account"); - } -} diff --git a/cli/src/commands/job/create/index.ts b/cli/src/commands/job/create/index.ts index d9b482e..0e21f7e 100644 --- a/cli/src/commands/job/create/index.ts +++ b/cli/src/commands/job/create/index.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { prettyPrintJob } from "@switchboard-xyz/sbv2-utils"; import { JobAccount, @@ -15,11 +15,11 @@ export default class JobCreate extends BaseCommand { static flags = { ...BaseCommand.flags, - authority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that will be the aggregator authority", }), - name: flags.string({ + name: Flags.string({ char: "n", description: "name of the buffer account", }), @@ -35,7 +35,7 @@ export default class JobCreate extends BaseCommand { async run() { verifyProgramHasPayer(this.program); - const { args, flags } = this.parse(JobCreate); + const { args, flags } = await this.parse(JobCreate); const payerKeypair = programWallet(this.program); const authority = await this.loadAuthority(flags.authority); diff --git a/cli/src/commands/job/create/json.ts b/cli/src/commands/job/create/json.ts deleted file mode 100644 index b38d52b..0000000 --- a/cli/src/commands/job/create/json.ts +++ /dev/null @@ -1,156 +0,0 @@ -import { flags } from "@oclif/command"; -import * as anchor from "@project-serum/anchor"; -import { Keypair, PublicKey } from "@solana/web3.js"; -import { AggregatorAccount } from "@switchboard-xyz/switchboard-v2"; -import chalk from "chalk"; -import * as fs from "fs"; -import * as path from "path"; -import { fromJobJSON, JobClass, pubKeyReviver } from "../../../accounts"; -import BaseCommand from "../../../BaseCommand"; -import { - CHECK_ICON, - FAILED_ICON, - loadAnchor, - loadKeypair, - programHasPayer, -} from "../../../utils"; - -export default class JsonCreateJob extends BaseCommand { - program: anchor.Program; - - payerKeypair: Keypair; - - definitionFile: string; - - schemaFile?: string; - - aggregatorAuthority: Keypair; - - aggregatorAccount: AggregatorAccount; - - static description = "create a job from a json file"; - - static aliases = ["json:create:job"]; - - static flags = { - ...BaseCommand.flags, - force: flags.boolean({ - description: "overwrite output file", - }), - outputFile: flags.string({ - description: "output job schema to a json file", - }), - aggregatorAuthority: flags.string({ - description: - "filesystem path of aggregator authority keypair to add job account to ", - }), - aggregatorKey: flags.string({ - description: "public key of aggregator to add job to", - dependsOn: ["aggregatorAuthority"], - }), - }; - - static args = [ - { - name: "definitionFile", - required: true, - description: "filesystem path of job definition json file", - }, - ]; - - static examples = [ - "$ sbv2 job:create:json examples/job.json --keypair ../payer-keypair.json --aggregatorAuthority=../aggregator-keypair.json --outputFile=job.schema.json", - ]; - - async init() { - await super.init(); - const { args, flags } = this.parse(JsonCreateJob); - - if (!fs.existsSync(args.definitionFile)) { - throw new Error("input file does not exist"); - } - this.definitionFile = path.join(process.cwd(), args.definitionFile); - - if (flags.outputFile) { - if (fs.existsSync(flags.outputFile) && !flags.force) { - throw new Error( - "output file exists. Run the command with '--force' to overwrite it" - ); - } - this.schemaFile = flags.outputFile; - } - - this.payerKeypair = await args.payerKeypair; - - this.program = await loadAnchor( - this.cluster, - this.connection, - this.payerKeypair - ); - - if (flags.aggregatorKey) { - if (flags.aggregatorAuthority) { - this.aggregatorAuthority = await loadKeypair(flags.aggregatorAuthority); - const aggregatorProgram = await loadAnchor( - this.cluster, - this.connection, - await loadKeypair(flags.aggregatorAuthority) - ); - this.aggregatorAccount = new AggregatorAccount({ - program: aggregatorProgram, - publicKey: new PublicKey(flags.aggregatorKey), - }); - } else { - this.logger.warn("failed to provide aggregator authority keypair"); - } - } - - if (!programHasPayer(this.program)) { - throw new Error( - `need to provide --keypair flag to pay for any onchain accounts` - ); - } - } - - async run() { - const jobDefinition: fromJobJSON = JSON.parse( - fs.readFileSync(this.definitionFile, "utf-8"), - pubKeyReviver - ); - - const job = await JobClass.build(this.context, this.program, jobDefinition); - - if (this.aggregatorAccount) { - await this.aggregatorAccount.addJob( - job.account, - this.aggregatorAuthority - ); - this.logger.info( - `job added to aggregator ${this.aggregatorAccount.publicKey}` - ); - } - - if (this.silent) { - console.log(job.publicKey.toString()); - } else { - this.logger.info( - `${chalk.green( - `${CHECK_ICON}Job created successfully from JSON file\r\n` - )}` - ); - } - - if (this.schemaFile) fs.writeFileSync(this.schemaFile, job.toString()); - } - - async catch(error) { - if (!this.silent) { - this.logger.error( - chalk.red(`${FAILED_ICON}Failed to create aggregator from json file`) - ); - this.logger.error(error.message); - this.logger.error(error.stack); - this.exit(1); - } - } -} diff --git a/cli/src/commands/job/create/template.ts b/cli/src/commands/job/create/template.ts deleted file mode 100644 index 5080263..0000000 --- a/cli/src/commands/job/create/template.ts +++ /dev/null @@ -1,112 +0,0 @@ -import { flags } from "@oclif/command"; -import * as anchor from "@project-serum/anchor"; -import chalk from "chalk"; -import * as fs from "fs"; -import { fromJobTemplate, pubKeyConverter } from "../../../accounts"; -import { JobClass } from "../../../accounts/job/job"; -import BaseCommand from "../../../BaseCommand"; -import { OutputFileExistsNoForce } from "../../../types"; -import { CHECK_ICON, loadKeypair } from "../../../utils"; - -export default class JobCreateTemplate extends BaseCommand { - templateDefinition: fromJobTemplate; - - outputFile = ""; - - static description = - "create a new on-chain job account from an existing template"; - - static flags = { - ...BaseCommand.flags, - force: flags.boolean({ description: "skip job confirmation" }), - name: flags.string({ - char: "n", - description: "name of the job account for easier identification", - default: "", - }), - outKeypair: flags.string({ - char: "k", - description: - "existing keypair file to store new account. useful for using the same public key on different clusters", - }), - outputFile: flags.string({ - char: "f", - description: "output file to save job definition to", - }), - }; - - static args = [ - { - name: "template", - required: true, - description: - "the template type (ftxUs/coinbase/etc) or the filesystem path to the json file containing the task definitions", - }, - { - name: "id", - required: true, - description: "api endpoint id for a given source", - }, - ]; - - static examples = [ - "$ sbv2 job:create:template ftxUs BTC_USD --keypair ../payer-keypair.json", - "$ sbv2 job:create:template ftxUs BTC_USD --keypair ../payer-keypair.json --name=ftxUs_Btc", - "$ sbv2 job:create:template ftxUs BTC_USD -k ../payer-keypair.json -n ftxUs_Btc -f ftx_us_btc_job.json", - ]; - - async init() { - await super.init(); - const { args, flags } = this.parse(JobCreateTemplate); - - this.templateDefinition = { - template: args.template, - id: args.id, - name: flags.name, - existingKeypair: flags.outKeypair - ? await loadKeypair(flags.outKeypair) - : anchor.web3.Keypair.generate(), - }; - - if (flags.outputFile) { - if (fs.existsSync(flags.outputFile) && !flags.force) { - throw new OutputFileExistsNoForce(flags.outputFile); - } - this.outputFile = flags.outputFile; - } - } - - async run() { - const job = await JobClass.fromTemplate( - this.context, - this.program, - this.templateDefinition - ); - - if (this.silent) { - console.log(job.publicKey.toString()); - } else { - this.logger.info(job.prettyPrint()); - - this.logger.info( - `\r\n${chalk.green( - `${CHECK_ICON}Job account created from template successfully` - )}` - ); - if (this.templateDefinition.existingKeypair) { - this.context.fs.saveKeypair(this.templateDefinition.existingKeypair); - } - } - - if (this.outputFile) { - fs.writeFileSync( - this.outputFile, - JSON.stringify(job, pubKeyConverter, 2) - ); - } - } - - async catch(error) { - super.catch(error, "failed to create job account from template"); - } -} diff --git a/cli/src/commands/json/add/aggregator.ts b/cli/src/commands/json/add/aggregator.ts deleted file mode 100644 index d2b837f..0000000 --- a/cli/src/commands/json/add/aggregator.ts +++ /dev/null @@ -1,103 +0,0 @@ -import { flags } from "@oclif/command"; -import { PublicKey } from "@solana/web3.js"; -import chalk from "chalk"; -import * as fs from "fs"; -import { - copyAccount, - fromAggregatorJSON, - OracleQueueClass, - PermissionClass, - pubKeyReviver, -} from "../../../accounts"; -import JsonBaseCommand from "../../../JsonBaseCommand"; -import { CHECK_ICON, verifyProgramHasPayer } from "../../../utils"; - -export default class SchemaAddAggregator extends JsonBaseCommand { - aggregatorDefinition?: fromAggregatorJSON | copyAccount; - - static description = "add an aggregator to a schema file"; - - static flags = { - ...JsonBaseCommand.flags, - aggregatorFile: flags.string({ - description: "filesystem path of job json definition file", - exclusive: ["sourceAggregator"], - }), - sourceAggregator: flags.string({ - description: "public key of an existing aggregator account to copy", - exclusive: ["aggregatorFile"], - }), - authority: flags.string({ - char: "a", - description: - "alternate keypair that is the authority for the oracle queue", - }), - }; - - async init() { - await super.init(); - this.mainnetCheck(); - verifyProgramHasPayer(this.program); - - const { flags } = this.parse(SchemaAddAggregator); - - if (!fs.existsSync(this.queueSchemaPath)) { - throw new Error(`schema file does not exist ${this.queueSchemaPath}`); - } - - if (flags.sourceAggregator) { - this.aggregatorDefinition = { - sourcePublicKey: new PublicKey(flags.sourceAggregator), - }; - } else if (flags.aggregatorFile) { - if (!fs.existsSync(flags.aggregatorFile)) { - throw new Error(`file does not exist ${flags.aggregatorFile}`); - } - this.aggregatorDefinition = JSON.parse( - fs.readFileSync(flags.aggregatorFile, "utf-8"), - pubKeyReviver - ); - } - - if (!this.aggregatorDefinition) { - throw new Error( - "you must provide --sourceAggregator or --aggregatorFIle flag" - ); - } - } - - async run() { - const queue = await OracleQueueClass.build( - this.context, - this.program, - this.queueSchema - ); - - const newAggregatorIndex = await queue.addAggregator( - this.context, - this.aggregatorDefinition - ); - - queue.aggregators[newAggregatorIndex].permissionAccount = - await PermissionClass.grantPermission( - this.context, - queue.aggregators[newAggregatorIndex].account, - this.queueAuthority - ); - - if (this.silent) { - console.log(queue.aggregators[newAggregatorIndex].publicKey.toString()); - } else { - this.logger.log(queue.aggregators[newAggregatorIndex].prettyPrint()); - this.logger.log( - `${chalk.green(`${CHECK_ICON}Aggregator added to queue successfully`)}` - ); - } - - this.save(queue); - } - - async catch(error) { - super.catch(error, "failed to add aggregator to schema"); - } -} diff --git a/cli/src/commands/json/add/crank.ts b/cli/src/commands/json/add/crank.ts deleted file mode 100644 index e772b07..0000000 --- a/cli/src/commands/json/add/crank.ts +++ /dev/null @@ -1,107 +0,0 @@ -import { flags } from "@oclif/command"; -import { Keypair } from "@solana/web3.js"; -import chalk from "chalk"; -import * as fs from "fs"; -import * as path from "path"; -import { - fromCrankJSON, - OracleQueueClass, - pubKeyReviver, - QueueDefinition, -} from "../../../accounts"; -import BaseCommand from "../../../BaseCommand"; -import { - CHECK_ICON, - getProgramPayer, - loadKeypair, - verifyProgramHasPayer, -} from "../../../utils"; - -export default class SchemaAddCrank extends BaseCommand { - queueAuthority: Keypair; - - schemaPath: string; - - crankDefinition: fromCrankJSON; - - static description = "add a crank to a schema file"; - - static flags = { - ...BaseCommand.flags, - name: flags.string({ - char: "n", - description: "name of the crank for easier identification", - }), - maxRows: flags.integer({ - char: "r", - description: "maximum number of rows a crank can support", - }), - authority: flags.string({ - char: "a", - description: - "alternate keypair that is the authority for the oracle queue", - }), - }; - - static args = [ - { - name: "schemaFile", - required: true, - description: "filesystem path for an oracle queue schema", - }, - ]; - - async init() { - await super.init(); - this.mainnetCheck(); - verifyProgramHasPayer(this.program); - - const { args, flags } = this.parse(SchemaAddCrank); - - if (!fs.existsSync(args.schemaFile)) { - throw new Error(`schema file does not exist ${args.schemaFile}`); - } - this.schemaPath = path.join(process.cwd(), args.schemaFile); - - this.queueAuthority = flags.authority - ? await loadKeypair(flags.authority) - : getProgramPayer(this.program); - - this.crankDefinition = { - name: flags.name ?? "", - maxRows: flags.maxRows ?? undefined, - }; - } - - async run() { - const schemaFile: QueueDefinition = JSON.parse( - fs.readFileSync(this.schemaPath, "utf-8"), - pubKeyReviver - ); - const queue = await OracleQueueClass.build( - this.context, - this.program, - schemaFile - ); - - const newCrankIndex = await queue.addCrank( - this.context, - this.crankDefinition - ); - - if (this.silent) { - console.log(queue.cranks[newCrankIndex].publicKey.toString()); - } else { - this.logger.log(queue.cranks[newCrankIndex].prettyPrint()); - this.logger.log( - `${chalk.green(`${CHECK_ICON}Crank added to queue successfully`)}` - ); - } - - fs.writeFileSync(this.schemaPath, queue.toString()); - } - - async catch(error) { - super.catch(error, "failed to add crank to schema"); - } -} diff --git a/cli/src/commands/json/add/oracle.ts b/cli/src/commands/json/add/oracle.ts deleted file mode 100644 index d981d59..0000000 --- a/cli/src/commands/json/add/oracle.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { flags } from "@oclif/command"; -import * as anchor from "@project-serum/anchor"; -import { Keypair } from "@solana/web3.js"; -import chalk from "chalk"; -import * as fs from "fs"; -import * as path from "path"; -import { - fromOracleJSON, - IOracleQueueClass, - OracleQueueClass, - pubKeyReviver, -} from "../../../accounts"; -import BaseCommand from "../../../BaseCommand"; -import { CHECK_ICON, loadAnchor } from "../../../utils"; - -export default class SchemaAddOracle extends BaseCommand { - program: anchor.Program; - - queueAuthority: Keypair; - - oracleDefinition: fromOracleJSON; - - schemaPath: string; - - static description = "add an oracle to a schema file"; - - static flags = { - ...BaseCommand.flags, - name: flags.string({ - char: "n", - description: "name of the crank for easier identification", - }), - authority: flags.string({ - char: "a", - description: - "alternate keypair that is the authority for the oracle queue", - }), - }; - - static args = [ - { - name: "schemaFile", - required: true, - description: "filesystem path for an oracle queue schema", - }, - ]; - - async init() { - await super.init(); - this.mainnetCheck(); - - const { args, flags } = this.parse(SchemaAddOracle); - - if (!fs.existsSync(args.schemaFile)) { - throw new Error(`schema file does not exist ${args.schemaFile}`); - } - this.schemaPath = path.join(process.cwd(), args.schemaFile); - - this.queueAuthority = await args.queueAuthority; - - this.program = await loadAnchor( - this.cluster, - this.connection, - this.queueAuthority - ); - - this.oracleDefinition = { - name: flags.name ?? "", - }; - } - - async run() { - const schemaFile: IOracleQueueClass = JSON.parse( - fs.readFileSync(this.schemaPath, "utf-8"), - pubKeyReviver - ); - - const queue = await OracleQueueClass.build( - this.context, - this.program, - schemaFile - ); - - const newOracleIndex = await queue.addOracle( - this.context, - this.oracleDefinition - ); - - if (this.silent) { - console.log(queue.oracles[newOracleIndex].publicKey.toString()); - } else { - this.logger.log(queue.oracles[newOracleIndex].prettyPrint()); - this.logger.log( - `${chalk.green(`${CHECK_ICON}Oracle added to queue successfully`)}` - ); - } - - fs.writeFileSync(this.schemaPath, queue.toString()); - } - - async catch(error) { - super.catch(error, "failed to add oracle to schema"); - } -} diff --git a/cli/src/commands/json/create/queue.ts b/cli/src/commands/json/create/queue.ts deleted file mode 100644 index a5775b5..0000000 --- a/cli/src/commands/json/create/queue.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { flags } from "@oclif/command"; -import { Keypair } from "@solana/web3.js"; -import chalk from "chalk"; -import * as fs from "fs"; -import * as path from "path"; -import { - fromQueueJSON, - OracleQueueClass, - pubKeyReviver, -} from "../../../accounts"; -import BaseCommand from "../../../BaseCommand"; -import { InputFileNotFound, OutputFileExistsNoForce } from "../../../types"; -import { CHECK_ICON, verifyProgramHasPayer } from "../../../utils"; - -export default class JsonCreateQueue extends BaseCommand { - authority: Keypair; - - definitionFile: string; - - schemaFile: string; - - static description = "create an oracle queue from a json file"; - - static aliases = ["queue:create:json"]; - - static flags = { - ...BaseCommand.flags, - force: flags.boolean({ - description: "overwrite output file", - }), - authority: flags.string({ - description: - "alternate keypair that will be the authority for any created accounts", - }), - }; - - static args = [ - { - name: "inputFile", - required: true, - description: "filesystem path of queue definition json file", - }, - { - name: "outputFile", - required: true, - description: "filesystem path of output file to quickly load the queue ", - }, - ]; - - static examples = [ - "$ sbv2 json:create:queue examples/queue.json queue-1.json -k ../authority-keypair.json", - ]; - - async init() { - await super.init(); - this.mainnetCheck(); // json builder needs more testing - verifyProgramHasPayer(this.program); - - const { args, flags } = this.parse(JsonCreateQueue); - - if (!fs.existsSync(args.inputFile)) { - throw new InputFileNotFound(args.inputFile); - } - this.definitionFile = path.join(process.cwd(), args.inputFile); - - if (fs.existsSync(args.outputFile) && !flags.force) { - throw new OutputFileExistsNoForce(args.outputFile); - } - this.schemaFile = args.outputFile; - - this.authority = await args.authorityKeypair; - } - - async run() { - const queueDefinition: fromQueueJSON = JSON.parse( - fs.readFileSync(this.definitionFile, "utf-8"), - pubKeyReviver - ); - this.logger.debug( - `creating oracle queue from json file ${this.definitionFile}` - ); - const queue = await OracleQueueClass.build( - this.context, - this.program, - queueDefinition - ); - - if (this.silent) { - console.log(this.schemaFile); - } else { - this.logger.log( - `${chalk.green( - `${CHECK_ICON}Oracle Queue created successfully from JSON file` - )}` - ); - } - - fs.writeFileSync(this.schemaFile, queue.toString()); - } - - async catch(error) { - super.catch(error, "failed to create queue from json file"); - } -} diff --git a/cli/src/commands/lease/create.ts b/cli/src/commands/lease/create.ts index 74df397..6e8bd56 100644 --- a/cli/src/commands/lease/create.ts +++ b/cli/src/commands/lease/create.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; import { PublicKey } from "@solana/web3.js"; import { prettyPrintLease } from "@switchboard-xyz/sbv2-utils"; @@ -19,7 +19,7 @@ export default class LeaseCreate extends BaseCommand { static flags = { ...BaseCommand.flags, - amount: flags.string({ + amount: Flags.string({ required: false, description: "token amount to load into the lease escrow. If decimals provided, amount will be normalized to raw tokenAmount", @@ -29,8 +29,6 @@ export default class LeaseCreate extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator to extend a lease for", }, ]; @@ -40,7 +38,7 @@ export default class LeaseCreate extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(LeaseCreate); + const { args, flags } = await this.parse(LeaseCreate); verifyProgramHasPayer(this.program); const payer = programWallet(this.program); @@ -50,13 +48,14 @@ export default class LeaseCreate extends BaseCommand { if (flags.amount) { loadAmount = this.getTokenAmount(flags.amount); } + if (loadAmount.lt(new anchor.BN(0))) { throw new Error("amount to deposit must be greater than or equal to 0"); } const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); diff --git a/cli/src/commands/lease/extend.ts b/cli/src/commands/lease/extend.ts index 4dadd86..7e8e850 100644 --- a/cli/src/commands/lease/extend.ts +++ b/cli/src/commands/lease/extend.ts @@ -1,6 +1,10 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; import { PublicKey } from "@solana/web3.js"; +import { + chalkString, + verifyProgramHasPayer, +} from "@switchboard-xyz/sbv2-utils"; import { AggregatorAccount, LeaseAccount, @@ -8,9 +12,8 @@ import { programWallet, } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; -import { chalkString } from "../../accounts/utils"; import BaseCommand from "../../BaseCommand"; -import { CHECK_ICON, verifyProgramHasPayer } from "../../utils"; +import { CHECK_ICON } from "../../utils"; export default class LeaseExtend extends BaseCommand { static description = "fund and re-enable an aggregator lease"; @@ -19,7 +22,7 @@ export default class LeaseExtend extends BaseCommand { static flags = { ...BaseCommand.flags, - amount: flags.string({ + amount: Flags.string({ required: true, description: "token amount to load into the lease escrow. If decimals provided, amount will be normalized to raw tokenAmount", @@ -29,8 +32,7 @@ export default class LeaseExtend extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), + description: "public key of the aggregator to extend a lease for", }, ]; @@ -40,19 +42,19 @@ export default class LeaseExtend extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(LeaseExtend); + const { args, flags } = await this.parse(LeaseExtend); verifyProgramHasPayer(this.program); const payerKeypair = programWallet(this.program); - let amount = this.getTokenAmount(flags.amount); + const amount = this.getTokenAmount(flags.amount); if (amount.lte(new anchor.BN(0))) { throw new Error("amount to deposit must be greater than 0"); } const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); @@ -72,6 +74,7 @@ export default class LeaseExtend extends BaseCommand { } catch { throw new Error(`Failed to load lease account. Has it been created yet?`); } + const lease = await leaseAccount.loadData(); const escrow: PublicKey = lease.escrow; diff --git a/cli/src/commands/lease/withdraw.ts b/cli/src/commands/lease/withdraw.ts index 057cb89..283ef0d 100644 --- a/cli/src/commands/lease/withdraw.ts +++ b/cli/src/commands/lease/withdraw.ts @@ -1,6 +1,10 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; import { PublicKey } from "@solana/web3.js"; +import { + chalkString, + verifyProgramHasPayer, +} from "@switchboard-xyz/sbv2-utils"; import { AggregatorAccount, LeaseAccount, @@ -8,9 +12,8 @@ import { programWallet, } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; -import { chalkString } from "../../accounts/utils"; import BaseCommand from "../../BaseCommand"; -import { CHECK_ICON, loadKeypair, verifyProgramHasPayer } from "../../utils"; +import { CHECK_ICON, loadKeypair } from "../../utils"; export default class AggregatorLeaseWithdraw extends BaseCommand { static description = "withdraw funds from an aggregator lease"; @@ -19,17 +22,17 @@ export default class AggregatorLeaseWithdraw extends BaseCommand { static flags = { ...BaseCommand.flags, - withdrawAddress: flags.string({ + withdrawAddress: Flags.string({ required: false, description: "tokenAccount to withdraw to. If not provided, payer associated token account will be used", }), - amount: flags.string({ + amount: Flags.string({ required: true, description: "token amount to withdraw from lease account. If decimals provided, amount will be normalized to raw tokenAmount", }), - authority: flags.string({ + authority: Flags.string({ char: "a", description: "keypair delegated as the authority for managing the oracle account", @@ -39,8 +42,7 @@ export default class AggregatorLeaseWithdraw extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), + description: "public key of the aggregator to extend a lease for", }, ]; @@ -50,12 +52,12 @@ export default class AggregatorLeaseWithdraw extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(AggregatorLeaseWithdraw); + const { args, flags } = await this.parse(AggregatorLeaseWithdraw); verifyProgramHasPayer(this.program); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); @@ -113,16 +115,15 @@ export default class AggregatorLeaseWithdraw extends BaseCommand { const lease = await leaseAccount.loadData(); const escrow: PublicKey = lease.escrow; - let amount: anchor.BN; - if (flags.amount) { - amount = this.getTokenAmount(flags.amount); - } else { - amount = new anchor.BN( - ( - await this.program.provider.connection.getTokenAccountBalance(escrow) - ).value.amount - ); - } + const amount: anchor.BN = flags.amount + ? this.getTokenAmount(flags.amount) + : new anchor.BN( + ( + await this.program.provider.connection.getTokenAccountBalance( + escrow + ) + ).value.amount + ); const txn = await leaseAccount.withdraw({ amount: amount, diff --git a/cli/src/commands/localnet/env.ts b/cli/src/commands/localnet/env.ts index 5c46005..904ec3d 100644 --- a/cli/src/commands/localnet/env.ts +++ b/cli/src/commands/localnet/env.ts @@ -1,6 +1,6 @@ /* eslint-disable unicorn/prevent-abbreviations */ -/* eslint-disable unicorn/new-for-builtins */ -import { flags } from "@oclif/command"; + +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; import { SwitchboardTestEnvironment } from "@switchboard-xyz/sbv2-utils"; import { programWallet } from "@switchboard-xyz/switchboard-v2"; @@ -14,11 +14,11 @@ export default class LocalnetEnvironment extends BaseCommand { static flags = { ...BaseCommand.flags, - force: flags.boolean({ + force: Flags.boolean({ description: "overwrite output file if existing", default: false, }), - outputDir: flags.string({ + outputDir: Flags.string({ char: "o", description: "output directory for scripts", }), @@ -26,7 +26,7 @@ export default class LocalnetEnvironment extends BaseCommand { async run() { verifyProgramHasPayer(this.program); - const { flags } = this.parse(LocalnetEnvironment); + const { flags } = await this.parse(LocalnetEnvironment); const payerKeypair = programWallet(this.program); const outputDir = flags.outputDir @@ -40,21 +40,25 @@ export default class LocalnetEnvironment extends BaseCommand { "switchboard.env already exists, use --force to overwrite" ); } + if (fs.existsSync(path.join(outputDir, "switchboard.json"))) { throw new Error( "switchboard.json already exists, use --force to overwrite" ); } + if (fs.existsSync(path.join(outputDir, "start-local-validator.sh"))) { throw new Error( "start-local-validator.sh already exists, use --force to overwrite" ); } + if (fs.existsSync(path.join(outputDir, "start-oracle.sh"))) { throw new Error( "start-oracle.sh already exists, use --force to overwrite" ); } + if ( fs.existsSync( path.join(process.cwd(), "docker-compose.switchboard.yml") diff --git a/cli/src/commands/metrics/aggregator.ts b/cli/src/commands/metrics/aggregator.ts index 1f9cbef..e915673 100644 --- a/cli/src/commands/metrics/aggregator.ts +++ b/cli/src/commands/metrics/aggregator.ts @@ -1,4 +1,6 @@ -import { flags } from "@oclif/command"; +/* eslint-disable unicorn/prevent-abbreviations */ +/* eslint-disable complexity */ +import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; import { AccountInfo, PublicKey } from "@solana/web3.js"; import { buffer2string } from "@switchboard-xyz/sbv2-utils"; @@ -16,8 +18,11 @@ export default class MetricsAggregator extends BaseCommand { static hidden = true; outputBasePath: string; + outputTxtFile?: string; + outputJsonFile?: string; + outputCsvFile?: string; aggregatorAccounts: { pubkey: PublicKey; account: AccountInfo }[]; @@ -26,28 +31,28 @@ export default class MetricsAggregator extends BaseCommand { static flags = { ...BaseCommand.flags, - force: flags.boolean({ + force: Flags.boolean({ description: "overwrite outputFile if it already exists", }), - task: flags.string({ + task: Flags.string({ description: "search for a given string in an aggregator task definitions", required: false, }), - queue: flags.string({ + queue: Flags.string({ description: "oracle queue to filter aggregators by", required: false, }), - json: flags.boolean({ + json: Flags.boolean({ description: "output aggregator accounts in json format", }), - csv: flags.boolean({ + csv: Flags.boolean({ description: "output aggregator accounts in csv format", }), - txt: flags.boolean({ + txt: Flags.boolean({ description: "output aggregator pubkeys in txt format", }), - jobDirectory: flags.string({ + jobDirectory: Flags.string({ description: "output the aggregator jobs to a directory sorted by the first task type", }), @@ -63,7 +68,7 @@ export default class MetricsAggregator extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(MetricsAggregator); + const { args, flags } = await this.parse(MetricsAggregator); const parsedPath = path.parse( args.outputFile.startsWith("/") || args.outputFile.startsWith("C:") @@ -79,6 +84,7 @@ export default class MetricsAggregator extends BaseCommand { ); } } + if (parsedPath.ext === ".json" || flags.json) { this.outputJsonFile = `${this.outputBasePath}.json`; if (fs.existsSync(this.outputJsonFile) && !flags.force) { @@ -87,6 +93,7 @@ export default class MetricsAggregator extends BaseCommand { ); } } + if (parsedPath.ext === ".csv" || flags.csv) { this.outputCsvFile = `${this.outputBasePath}.csv`; if (fs.existsSync(this.outputCsvFile) && !flags.force) { @@ -95,6 +102,7 @@ export default class MetricsAggregator extends BaseCommand { ); } } + if (!(this.outputJsonFile || this.outputCsvFile || this.outputTxtFile)) { throw new Error( `no output format specified, try --txt, --json, or --csv` @@ -145,20 +153,24 @@ export default class MetricsAggregator extends BaseCommand { this.logger.debug(`Job is undefined`); continue; } + if (!("tasks" in job)) { this.logger.debug(`Job has no tasks - ${job.publicKey}`); continue; } + const firstTask = Object.keys(job.tasks[0])[0]; const oracleJob = OracleJob.create({ tasks: job.tasks }); const jobObject: { [k: string]: any } = {}; // const jobObject = oracleJob.toJSON(); if (job.name) { - jobObject["name"] = job.name; + jobObject.name = job.name; } + if (job.metadata) { - jobObject["metadata"] = job.metadata; + jobObject.metadata = job.metadata; } + // if (job.authority) { // jobObject["authority"] = job.authority; // } @@ -176,7 +188,7 @@ export default class MetricsAggregator extends BaseCommand { 2 ) ); - } catch (error) { + } catch { this.logger.debug(`Error - ${firstTask}`); } } @@ -194,8 +206,9 @@ export default class MetricsAggregator extends BaseCommand { if (job === undefined || job.tasks === undefined) { continue; } + const jobString = JSON.stringify(job.tasks).toLowerCase(); - if (jobString.indexOf(flags.task.toLowerCase()) !== -1) { + if (jobString.includes(flags.task.toLowerCase())) { aggregators.push(aggregator); break; } @@ -297,24 +310,22 @@ async function buildAggregators( ): Promise { const accountCoder = new anchor.BorshAccountsCoder(program.idl); // get all job pubkeys tied to aggregators - const jobPubkeys = aggregatorAccounts - .map((agg) => { - const aggregatorData = accountCoder.decode( - "AggregatorAccountData", - agg.account.data - ); - const jobKeys = ( - aggregatorData.jobPubkeysData.slice( - 0, - aggregatorData.jobPubkeysSize - ) as anchor.web3.PublicKey[] - ).filter( - (pubkey: anchor.web3.PublicKey) => - pubkey !== anchor.web3.PublicKey.default - ); - return jobKeys; - }) - .flat(); + const jobPubkeys = aggregatorAccounts.flatMap((agg) => { + const aggregatorData = accountCoder.decode( + "AggregatorAccountData", + agg.account.data + ); + const jobKeys = ( + aggregatorData.jobPubkeysData.slice( + 0, + aggregatorData.jobPubkeysSize + ) as anchor.web3.PublicKey[] + ).filter( + (pubkey: anchor.web3.PublicKey) => + pubkey !== anchor.web3.PublicKey.default + ); + return jobKeys; + }); // store a map of job pubkeys and their definitions const jobMap = await buildJobMap(logger, program, jobPubkeys); @@ -349,25 +360,32 @@ async function buildJobMap( pubkeys: PublicKey[], max = 300 ): Promise> { - function sliceIntoChunks(arr: PublicKey[], chunkSize: number): PublicKey[][] { + function sliceIntoChunks( + array: PublicKey[], + chunkSize: number + ): PublicKey[][] { const res = []; - for (let i = 0; i < arr.length; i += chunkSize) { - const chunk = arr.slice(i, i + chunkSize); + for (let index = 0; index < array.length; index += chunkSize) { + const chunk = array.slice(index, index + chunkSize); res.push(chunk); } + return res; } + const jobMap = new Map(); const publicKeys = sliceIntoChunks(pubkeys, max); for await (const pubKeyBatch of publicKeys) { const jobAccountInfos = await program.account.jobAccountData.fetchMultiple( pubKeyBatch ); - for (const [index, jobAccount] of jobAccountInfos.entries()) { + for (const [index, jobAccountData] of jobAccountInfos.entries()) { try { const publicKey = pubKeyBatch[index]; - const oracleJob = OracleJob.decodeDelimited(jobAccount["data"]); - const job = new Job(publicKey, jobAccount, oracleJob.tasks); + const oracleJob = OracleJob.decodeDelimited( + (jobAccountData as any).data + ); + const job = new Job(publicKey, jobAccountData, oracleJob.tasks); // console.log(`jobKey: ${publicKey}, ${JSON.stringify(job)}`); jobMap.set(publicKey.toString(), job); } catch (error) { @@ -393,13 +411,21 @@ interface JobData { class Job { publicKey: PublicKey; + tasks: OracleJob.ITask[]; + name?: string; + metadata?: string; + authority?: PublicKey; + expiration?: number; + hash?: Buffer; + referenceCount?: number; + totalSpent?: number; constructor(publicKey: PublicKey, jobData: any, tasks: OracleJob.ITask[]) { @@ -434,23 +460,41 @@ class Job { class Aggregator { publicKey: PublicKey; + jobs: Job[]; + name?: string; + metadata?: string; + authorWallet?: PublicKey; + queuePubkey?: PublicKey; + oracleRequestBatchSize?: number; + minOracleResults?: number; + minJobResults?: number; + minUpdateDelaySeconds?: number; + startAfter: anchor.BN; + varianceThreshold?: Big; + forceReportPeriod?: anchor.BN; + expiration?: number; + crankPubkey?: PublicKey; + jobPubkeysSize?: number; + authority?: PublicKey; + historyBuffer?: PublicKey; + disableCrank?: boolean; constructor(publicKey: PublicKey, aggregatorData: any, jobs: Job[]) { @@ -523,7 +567,7 @@ class Aggregator { ? "N/A" : this.historyBuffer.toString(), disableCrank: this.disableCrank, - jobs: this.jobs.map((job) => (job !== undefined ? job.toJSON() : "N/A")), + jobs: this.jobs.map((job) => (job === undefined ? "N/A" : job.toJSON())), }; } } diff --git a/cli/src/commands/metrics/vrf.ts b/cli/src/commands/metrics/vrf.ts index 89b2edf..08b47b1 100644 --- a/cli/src/commands/metrics/vrf.ts +++ b/cli/src/commands/metrics/vrf.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; import { AccountInfo, PublicKey } from "@solana/web3.js"; import bs58 from "bs58"; @@ -12,8 +12,11 @@ export default class MetricsVrf extends BaseCommand { static hidden = true; outputBasePath: string; + outputTxtFile?: string; + outputJsonFile?: string; + outputCsvFile?: string; vrfAccounts: { pubkey: PublicKey; account: AccountInfo }[]; @@ -22,20 +25,20 @@ export default class MetricsVrf extends BaseCommand { static flags = { ...BaseCommand.flags, - force: flags.boolean({ + force: Flags.boolean({ description: "overwrite outputFile if it already exists", }), - queue: flags.string({ + queue: Flags.string({ description: "oracle queue to filter aggregators by", required: false, }), - json: flags.boolean({ + json: Flags.boolean({ description: "output aggregator accounts in json format", }), - csv: flags.boolean({ + csv: Flags.boolean({ description: "output aggregator accounts in csv format", }), - txt: flags.boolean({ + txt: Flags.boolean({ description: "output aggregator pubkeys in txt format", }), }; @@ -49,7 +52,7 @@ export default class MetricsVrf extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(MetricsVrf); + const { args, flags } = await this.parse(MetricsVrf); const parsedPath = path.parse( args.outputFile.startsWith("/") || args.outputFile.startsWith("C:") @@ -65,6 +68,7 @@ export default class MetricsVrf extends BaseCommand { ); } } + if (parsedPath.ext === ".json" || flags.json) { this.outputJsonFile = `${this.outputBasePath}.json`; if (fs.existsSync(this.outputJsonFile) && flags.force === false) { @@ -73,6 +77,7 @@ export default class MetricsVrf extends BaseCommand { ); } } + if (parsedPath.ext === ".csv" || flags.csv) { this.outputCsvFile = `${this.outputBasePath}.csv`; if (fs.existsSync(this.outputCsvFile) && flags.force === false) { @@ -81,6 +86,7 @@ export default class MetricsVrf extends BaseCommand { ); } } + if (!(this.outputJsonFile || this.outputCsvFile || this.outputTxtFile)) { throw new Error( `no output format specified, try --txt, --json, or --csv` diff --git a/cli/src/commands/oracle/balance.ts b/cli/src/commands/oracle/balance.ts index 3b53112..a7126cb 100644 --- a/cli/src/commands/oracle/balance.ts +++ b/cli/src/commands/oracle/balance.ts @@ -1,6 +1,6 @@ import { PublicKey } from "@solana/web3.js"; +import { chalkString } from "@switchboard-xyz/sbv2-utils"; import { OracleAccount } from "@switchboard-xyz/switchboard-v2"; -import { chalkString } from "../../accounts/utils"; import BaseCommand from "../../BaseCommand"; export default class OracleBalance extends BaseCommand { @@ -13,8 +13,7 @@ export default class OracleBalance extends BaseCommand { static args = [ { name: "oracleKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), + description: "public key of the oracle to check token balance", }, ]; @@ -24,11 +23,11 @@ export default class OracleBalance extends BaseCommand { ]; async run() { - const { args } = this.parse(OracleBalance); + const { args } = await this.parse(OracleBalance); const oracleAccount = new OracleAccount({ program: this.program, - publicKey: args.oracleKey, + publicKey: new PublicKey(args.oracleKey), }); const oracle = await oracleAccount.loadData(); diff --git a/cli/src/commands/oracle/create.ts b/cli/src/commands/oracle/create.ts index 8aee833..de4d734 100644 --- a/cli/src/commands/oracle/create.ts +++ b/cli/src/commands/oracle/create.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; import * as spl from "@solana/spl-token"; import { @@ -27,20 +27,20 @@ export default class OracleCreate extends BaseCommand { static flags = { ...BaseCommand.flags, - name: flags.string({ + name: Flags.string({ char: "n", description: "name of the oracle for easier identification", default: "", }), - authority: flags.string({ + authority: Flags.string({ char: "a", description: "keypair to delegate authority to for managing the oracle account", }), - enable: flags.boolean({ + enable: Flags.boolean({ description: "enable oracle heartbeat permissions", }), - queueAuthority: flags.string({ + queueAuthority: Flags.string({ description: "alternative keypair to use for queue authority", }), }; @@ -48,8 +48,7 @@ export default class OracleCreate extends BaseCommand { static args = [ { name: "queueKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), + description: "public key of the oracle queue to join", }, ]; @@ -61,7 +60,7 @@ export default class OracleCreate extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(OracleCreate); + const { args, flags } = await this.parse(OracleCreate); verifyProgramHasPayer(this.program); const payerKeypair = programWallet(this.program); const signers: Keypair[] = [payerKeypair]; @@ -80,7 +79,7 @@ export default class OracleCreate extends BaseCommand { const queueAccount = new OracleQueueAccount({ program: this.program, - publicKey: args.queueKey, + publicKey: new PublicKey(args.queueKey), }); const queue = await queueAccount.loadData(); const tokenMint = await queueAccount.loadMint(); diff --git a/cli/src/commands/oracle/deposit.ts b/cli/src/commands/oracle/deposit.ts index 51edb60..1a3c267 100644 --- a/cli/src/commands/oracle/deposit.ts +++ b/cli/src/commands/oracle/deposit.ts @@ -1,13 +1,13 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; import { PublicKey } from "@solana/web3.js"; +import { chalkString } from "@switchboard-xyz/sbv2-utils"; import { OracleAccount, OracleQueueAccount, programWallet, } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; -import { chalkString } from "../../accounts/utils"; import BaseCommand from "../../BaseCommand"; import { CHECK_ICON, verifyProgramHasPayer } from "../../utils"; @@ -16,7 +16,7 @@ export default class OracleDeposit extends BaseCommand { static flags = { ...BaseCommand.flags, - amount: flags.string({ + amount: Flags.string({ required: true, description: "token amount to load into the oracle escrow. If decimals provided, amount will be normalized to raw tokenAmount", @@ -26,8 +26,7 @@ export default class OracleDeposit extends BaseCommand { static args = [ { name: "oracleKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), + description: "public key of the oracle to deposit funds into", }, ]; @@ -38,7 +37,7 @@ export default class OracleDeposit extends BaseCommand { async run() { verifyProgramHasPayer(this.program); - const { args, flags } = this.parse(OracleDeposit); + const { args, flags } = await this.parse(OracleDeposit); const payer = programWallet(this.program); @@ -50,7 +49,7 @@ export default class OracleDeposit extends BaseCommand { const oracleAccount = new OracleAccount({ program: this.program, - publicKey: args.oracleKey, + publicKey: new PublicKey(args.oracleKey), }); const oracle = await oracleAccount.loadData(); diff --git a/cli/src/commands/oracle/nonce/index.ts b/cli/src/commands/oracle/nonce/index.ts index a58d7ec..14f3a99 100644 --- a/cli/src/commands/oracle/nonce/index.ts +++ b/cli/src/commands/oracle/nonce/index.ts @@ -20,18 +20,16 @@ export default class OracleNonce extends BaseCommand { static args = [ { name: "oracleKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the oracle to check token balance", }, ]; async run() { - const { args } = this.parse(OracleNonce); + const { args } = await this.parse(OracleNonce); const oracleAccount = new OracleAccount({ program: this.program, - publicKey: args.oracleKey, + publicKey: new PublicKey(args.oracleKey), }); const oracleNonceAccounts = await getOracleNonceAccounts(oracleAccount); console.log( @@ -56,21 +54,23 @@ export default class OracleNonce extends BaseCommand { ) ); - let numNonces = 0; + let numberNonces = 0; if (oracleNonceAccounts?.heartbeatNonce) { - numNonces++; + numberNonces++; } + if (oracleNonceAccounts?.unwrapStakeNonce) { - numNonces++; + numberNonces++; } - numNonces += oracleNonceAccounts.queueNonces.length; + + numberNonces += oracleNonceAccounts.queueNonces.length; const nonceRentExemption = await this.program.provider.connection.getMinimumBalanceForRentExemption( NONCE_ACCOUNT_LENGTH ); - const totalCost = (numNonces * nonceRentExemption) / LAMPORTS_PER_SOL; + const totalCost = (numberNonces * nonceRentExemption) / LAMPORTS_PER_SOL; console.log(chalkString("Total Cost (SOL)", totalCost, 20)); // if (this.silent) { diff --git a/cli/src/commands/oracle/permission/create.ts b/cli/src/commands/oracle/permission/create.ts index 8ea4f16..002f409 100644 --- a/cli/src/commands/oracle/permission/create.ts +++ b/cli/src/commands/oracle/permission/create.ts @@ -19,19 +19,17 @@ export default class OraclePermissionCreate extends BaseCommand { static args = [ { name: "oracleKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the oracle account", }, ]; async run() { - const { args } = this.parse(OraclePermissionCreate); + const { args } = await this.parse(OraclePermissionCreate); verifyProgramHasPayer(this.program); const oracleAccount = new OracleAccount({ program: this.program, - publicKey: args.oracleKey, + publicKey: new PublicKey(args.oracleKey), }); const oracle = await oracleAccount.loadData(); diff --git a/cli/src/commands/oracle/withdraw.ts b/cli/src/commands/oracle/withdraw.ts index adb111b..0f36c57 100644 --- a/cli/src/commands/oracle/withdraw.ts +++ b/cli/src/commands/oracle/withdraw.ts @@ -1,6 +1,7 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; import { PublicKey } from "@solana/web3.js"; +import { chalkString } from "@switchboard-xyz/sbv2-utils"; import { OracleAccount, OracleQueueAccount, @@ -8,7 +9,6 @@ import { programWallet, } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; -import { chalkString } from "../../accounts/utils"; import BaseCommand from "../../BaseCommand"; import { CHECK_ICON, loadKeypair, verifyProgramHasPayer } from "../../utils"; @@ -17,23 +17,23 @@ export default class OracleWithdraw extends BaseCommand { static flags = { ...BaseCommand.flags, - force: flags.boolean({ + force: Flags.boolean({ char: "f", description: "skip minStake balance check. your oracle may be removed from the queue", }), - withdrawAccount: flags.string({ + withdrawAccount: Flags.string({ char: "w", required: false, description: "optional solana pubkey or keypair filesystem path to withdraw funds to. default destination is oracle authority's token wallet", }), - authority: flags.string({ + authority: Flags.string({ char: "a", description: "keypair delegated as the authority for managing the oracle account", }), - amount: flags.string({ + amount: Flags.string({ required: true, description: "token amount to withdraw from oracle escrow. If decimals provided, amount will be normalized to raw tokenAmount", @@ -43,8 +43,7 @@ export default class OracleWithdraw extends BaseCommand { static args = [ { name: "oracleKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), + description: "public key of the oracle to withdraw from", }, ]; @@ -56,7 +55,7 @@ export default class OracleWithdraw extends BaseCommand { async run() { verifyProgramHasPayer(this.program); - const { args, flags } = this.parse(OracleWithdraw); + const { args, flags } = await this.parse(OracleWithdraw); const payer = programWallet(this.program); const amount = this.getTokenAmount(flags.amount); @@ -64,7 +63,7 @@ export default class OracleWithdraw extends BaseCommand { // get oracle account const oracleAccount = new OracleAccount({ program: this.program, - publicKey: args.oracleKey, + publicKey: new PublicKey(args.oracleKey), }); const oracle = await oracleAccount.loadData(); diff --git a/cli/src/commands/permission/create.ts b/cli/src/commands/permission/create.ts index 31e6f19..9e03bb2 100644 --- a/cli/src/commands/permission/create.ts +++ b/cli/src/commands/permission/create.ts @@ -1,10 +1,9 @@ -import { PublicKey } from "@solana/web3.js"; +import { prettyPrintPermissions } from "@switchboard-xyz/sbv2-utils"; import { OracleQueueAccount, PermissionAccount, } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; -import { PermissionClass } from "../../accounts"; import BaseCommand from "../../BaseCommand"; import { CHECK_ICON, verifyProgramHasPayer } from "../../utils"; @@ -18,20 +17,18 @@ export default class PermissionCreate extends BaseCommand { static args = [ { name: "granter", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), + description: "public key of the account granting permission", }, { name: "grantee", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), + description: "public key of the account getting permissions", }, ]; async run() { - const { args } = this.parse(PermissionCreate); + const { args } = await this.parse(PermissionCreate); verifyProgramHasPayer(this.program); // assuming granter is an oracle queue, will need to fix @@ -70,13 +67,7 @@ export default class PermissionCreate extends BaseCommand { this.logger.log( `${chalk.green(`${CHECK_ICON}Permission account created successfully`)}` ); - const permission = await PermissionClass.fromPublicKey( - this.context, - this.program, - permissionAccount.publicKey - ); - const printString = permission.prettyPrint(); - this.logger.log(printString); + console.log(await prettyPrintPermissions(permissionAccount)); } } diff --git a/cli/src/commands/permission/set.ts b/cli/src/commands/permission/set.ts index 7805fa4..3b6fe65 100644 --- a/cli/src/commands/permission/set.ts +++ b/cli/src/commands/permission/set.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; import { PermissionAccount, @@ -17,11 +17,11 @@ export default class PermissionSet extends BaseCommand { static flags = { ...BaseCommand.flags, - authority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that is the granters authority", }), - disable: flags.boolean({ + disable: Flags.boolean({ description: "disable permissions", }), }; @@ -29,14 +29,13 @@ export default class PermissionSet extends BaseCommand { static args = [ { name: "permissionKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), + description: "public key of the permission account", }, ]; async run() { - const { args, flags } = this.parse(PermissionSet); + const { args, flags } = await this.parse(PermissionSet); verifyProgramHasPayer(this.program); const permissionAccount = new PermissionAccount({ diff --git a/cli/src/commands/print/aggregator.ts b/cli/src/commands/print/aggregator.ts index a162bce..6318507 100644 --- a/cli/src/commands/print/aggregator.ts +++ b/cli/src/commands/print/aggregator.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; import { chalkString, @@ -14,11 +14,11 @@ export default class AggregatorPrint extends BaseCommand { static flags = { ...BaseCommand.flags, - jobs: flags.boolean({ + jobs: Flags.boolean({ description: "output job definitions", default: false, }), - oraclePubkeysData: flags.boolean({ + oraclePubkeysData: Flags.boolean({ char: "o", description: "print the assigned oracles for the current round", }), @@ -27,8 +27,6 @@ export default class AggregatorPrint extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator account to deserialize", }, ]; @@ -38,11 +36,11 @@ export default class AggregatorPrint extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(AggregatorPrint); + const { args, flags } = await this.parse(AggregatorPrint); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); diff --git a/cli/src/commands/print/aggregator/history.ts b/cli/src/commands/print/aggregator/history.ts index 453484f..ba1c9dc 100644 --- a/cli/src/commands/print/aggregator/history.ts +++ b/cli/src/commands/print/aggregator/history.ts @@ -1,7 +1,10 @@ import { PublicKey } from "@solana/web3.js"; +import { + anchorBNtoDateTimeString, + chalkString, +} from "@switchboard-xyz/sbv2-utils"; import { AggregatorAccount } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; -import { anchorBNtoDateTimeString, chalkString } from "../../../accounts"; import BaseCommand from "../../../BaseCommand"; export default class AggregatorHistoryPrint extends BaseCommand { @@ -17,8 +20,6 @@ export default class AggregatorHistoryPrint extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator account to fetch permission account and deserialize", }, @@ -29,11 +30,11 @@ export default class AggregatorHistoryPrint extends BaseCommand { ]; async run() { - const { args } = this.parse(AggregatorHistoryPrint); + const { args } = await this.parse(AggregatorHistoryPrint); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); diff --git a/cli/src/commands/print/aggregator/lease.ts b/cli/src/commands/print/aggregator/lease.ts index 706fc31..6086dbc 100644 --- a/cli/src/commands/print/aggregator/lease.ts +++ b/cli/src/commands/print/aggregator/lease.ts @@ -20,8 +20,6 @@ export default class AggregatorLeasePrint extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator account to fetch permission account and deserialize", }, @@ -32,11 +30,11 @@ export default class AggregatorLeasePrint extends BaseCommand { ]; async run() { - const { args } = this.parse(AggregatorLeasePrint); + const { args } = await this.parse(AggregatorLeasePrint); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); diff --git a/cli/src/commands/print/aggregator/permission.ts b/cli/src/commands/print/aggregator/permission.ts index 338dc48..07f0986 100644 --- a/cli/src/commands/print/aggregator/permission.ts +++ b/cli/src/commands/print/aggregator/permission.ts @@ -23,8 +23,6 @@ export default class AggregatorPermissionPrint extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator account to fetch permission account and deserialize", }, @@ -35,11 +33,11 @@ export default class AggregatorPermissionPrint extends BaseCommand { ]; async run() { - const { args } = this.parse(AggregatorPermissionPrint); + const { args } = await this.parse(AggregatorPermissionPrint); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); diff --git a/cli/src/commands/print/crank.ts b/cli/src/commands/print/crank.ts index 8d09d66..d90964e 100644 --- a/cli/src/commands/print/crank.ts +++ b/cli/src/commands/print/crank.ts @@ -17,8 +17,6 @@ export default class CrankPrint extends BaseCommand { static args = [ { name: "crankKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the crank account to deserialize", }, ]; @@ -28,11 +26,11 @@ export default class CrankPrint extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(CrankPrint); + const { args, flags } = await this.parse(CrankPrint); const crankAccount = new CrankAccount({ program: this.program, - publicKey: args.crankKey, + publicKey: new PublicKey(args.crankKey), }); this.logger.log(await prettyPrintCrank(crankAccount, undefined, true)); diff --git a/cli/src/commands/print/index.ts b/cli/src/commands/print/index.ts index 40f43fc..2c3660f 100644 --- a/cli/src/commands/print/index.ts +++ b/cli/src/commands/print/index.ts @@ -13,8 +13,6 @@ export default class Print extends PrintBaseCommand { static args = [ { name: "publicKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of a switchboard account to lookup", }, ]; @@ -24,19 +22,19 @@ export default class Print extends PrintBaseCommand { ]; async run() { - const { args } = this.parse(Print); + const { args } = await this.parse(Print); const { publicKey } = args; console.log(`${chalk.green("############ DEVNET ############")}`); try { - await this.printDevnetAccount(publicKey); + await this.printDevnetAccount(new PublicKey(publicKey)); } catch (error) { console.error(error.message); } console.log(`${chalk.green("############ MAINNET ############")}`); try { - await this.printMainnetAccount(publicKey); + await this.printMainnetAccount(new PublicKey(publicKey)); } catch (error) { console.error(error.message); } diff --git a/cli/src/commands/print/job.ts b/cli/src/commands/print/job.ts index 15d7ad1..4a2a4a6 100644 --- a/cli/src/commands/print/job.ts +++ b/cli/src/commands/print/job.ts @@ -17,8 +17,6 @@ export default class JobPrint extends BaseCommand { static args = [ { name: "jobKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the job account to deserialize", }, ]; @@ -28,11 +26,11 @@ export default class JobPrint extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(JobPrint); + const { args, flags } = await this.parse(JobPrint); const jobAccount = new JobAccount({ program: this.program, - publicKey: args.jobKey, + publicKey: new PublicKey(args.jobKey), }); this.logger.log(await prettyPrintJob(jobAccount)); diff --git a/cli/src/commands/print/job/templates.ts b/cli/src/commands/print/job/templates.ts deleted file mode 100644 index 08ce300..0000000 --- a/cli/src/commands/print/job/templates.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Command } from "@oclif/command"; -import chalk from "chalk"; -import { TEMPLATE_SOURCES } from "../../../accounts/job"; - -export default class PrintJobTemplates extends Command { - static description = "list available templates to build a job from"; - - static aliases = ["job:print:templates"]; - - async run() { - for (const t of TEMPLATE_SOURCES) this.log(" - " + chalk.yellow(t)); - } -} diff --git a/cli/src/commands/print/json/samples.ts b/cli/src/commands/print/json/samples.ts deleted file mode 100644 index 4963a45..0000000 --- a/cli/src/commands/print/json/samples.ts +++ /dev/null @@ -1,61 +0,0 @@ -import * as fs from "fs"; -import * as path from "path"; -import BaseCommand from "../../../BaseCommand"; - -export default class PrintJsonSamples extends BaseCommand { - static description = "write sample definition files to a directory"; - - static aliases = ["json:samples", "write:json:samples"]; - - static flags = { - ...BaseCommand.flags, - }; - - static args = [ - { - name: "outputDirectory", - required: true, - description: "filesystem path to output sample definition files", - }, - ]; - - static examples = [ - "$ sbv2 print:json:samples ~/switchboard_json_samples", - "$ sbv2 json:samples ~/switchboard_json_samples", - "$ sbv2 write:json:samples ~/switchboard_json_samples", - ]; - - async run() { - const { args } = this.parse(PrintJsonSamples); - // eslint-disable-next-line unicorn/prefer-module - const projectPath = path.join(__dirname, "../../../../examples"); // this path is relative to the current *.ts file - const files = [ - "aggregator.json", - "job.ftxCom.json", - "job.serum.json", - "queue.json", - ]; - - const outputPath = args.outputDirectory; - - if (!fs.existsSync(outputPath)) { - fs.mkdirSync(outputPath, { recursive: true }); - if (!fs.existsSync(outputPath)) { - throw new Error("outputDirectory is not a valid file path"); - } - } - if (!fs.lstatSync(outputPath).isDirectory) { - throw new Error("outputDirectory is not a valid directory"); - } - - for (const f of files) { - const outputFile = path.join(outputPath, f); - fs.copyFileSync(path.join(projectPath, f), outputFile); - this.logger.log(`${outputFile}`); - } - } - - async catch(error) { - super.catch(error, "failed to write sample json files to disk"); - } -} diff --git a/cli/src/commands/print/oracle.ts b/cli/src/commands/print/oracle.ts index e963bde..2caca55 100644 --- a/cli/src/commands/print/oracle.ts +++ b/cli/src/commands/print/oracle.ts @@ -17,8 +17,6 @@ export default class OraclePrint extends BaseCommand { static args = [ { name: "oracleKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the oracle account to deserialize", }, ]; @@ -28,11 +26,11 @@ export default class OraclePrint extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(OraclePrint); + const { args, flags } = await this.parse(OraclePrint); const oracleAccount = new OracleAccount({ program: this.program, - publicKey: args.oracleKey, + publicKey: new PublicKey(args.oracleKey), }); const data = await oracleAccount.loadData(); diff --git a/cli/src/commands/print/oracle/permission.ts b/cli/src/commands/print/oracle/permission.ts index bee902e..fe4610d 100644 --- a/cli/src/commands/print/oracle/permission.ts +++ b/cli/src/commands/print/oracle/permission.ts @@ -20,8 +20,6 @@ export default class OraclePermissionPrint extends BaseCommand { static args = [ { name: "oracleKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the oracle account to fetch permission account and deserialize", }, @@ -32,11 +30,11 @@ export default class OraclePermissionPrint extends BaseCommand { ]; async run() { - const { args } = this.parse(OraclePermissionPrint); + const { args } = await this.parse(OraclePermissionPrint); const oracleAccount = new OracleAccount({ program: this.program, - publicKey: args.oracleKey, + publicKey: new PublicKey(args.oracleKey), }); const oracle = await oracleAccount.loadData(); diff --git a/cli/src/commands/print/permission.ts b/cli/src/commands/print/permission.ts new file mode 100644 index 0000000..62ceade --- /dev/null +++ b/cli/src/commands/print/permission.ts @@ -0,0 +1,47 @@ +import { PublicKey } from "@solana/web3.js"; +import { + prettyPrintOracle, + prettyPrintPermissions, +} from "@switchboard-xyz/sbv2-utils"; +import { + OracleAccount, + PermissionAccount, +} from "@switchboard-xyz/switchboard-v2"; +import BaseCommand from "../../BaseCommand"; + +export default class PermissionPrint extends BaseCommand { + static description = "Print the deserialized Switchboard permission account"; + + static aliases = ["permission:print"]; + + static flags = { + ...BaseCommand.flags, + }; + + static args = [ + { + name: "permissionKey", + description: "public key of the permission account to deserialize", + }, + ]; + + static examples = [ + "$ sbv2 permission:print 94XXM72K2aKu2wcuJaawV8njuGaFZvhy8iKgPxoa1tJk", + ]; + + async run() { + const { args, flags } = await this.parse(PermissionPrint); + + const permissionAccount = new PermissionAccount({ + program: this.program, + publicKey: new PublicKey(args.permissionKey), + }); + const data = await permissionAccount.loadData(); + + this.logger.log(await prettyPrintPermissions(permissionAccount, data)); + } + + async catch(error) { + super.catch(error, "failed to print permission account"); + } +} diff --git a/cli/src/commands/print/queue.ts b/cli/src/commands/print/queue.ts index 29a159b..5e40995 100644 --- a/cli/src/commands/print/queue.ts +++ b/cli/src/commands/print/queue.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; import { prettyPrintQueue } from "@switchboard-xyz/sbv2-utils"; import { OracleQueueAccount } from "@switchboard-xyz/switchboard-v2"; @@ -13,7 +13,7 @@ export default class QueuePrint extends BaseCommand { static flags = { ...BaseCommand.flags, - oracles: flags.boolean({ + oracles: Flags.boolean({ description: "output oracles that are heartbeating on the queue", default: false, }), @@ -22,8 +22,6 @@ export default class QueuePrint extends BaseCommand { static args = [ { name: "queueKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the oracle queue account to deserialize", }, ]; @@ -33,11 +31,11 @@ export default class QueuePrint extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(QueuePrint); + const { args, flags } = await this.parse(QueuePrint); const queueAccount = new OracleQueueAccount({ program: this.program, - publicKey: args.queueKey, + publicKey: new PublicKey(args.queueKey), }); const data = await queueAccount.loadData(); diff --git a/cli/src/commands/print/vrf.ts b/cli/src/commands/print/vrf.ts index 7b464bb..1fe24c7 100644 --- a/cli/src/commands/print/vrf.ts +++ b/cli/src/commands/print/vrf.ts @@ -17,22 +17,18 @@ export default class VrfPrint extends BaseCommand { static args = [ { name: "vrfKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the vrf account to deserialize", }, ]; - static examples = [ - "$ sbv2 vrf:print SzTvFZLz3hwjZFMwVWzuEnr1oUF6qyvXwXCvsqf7qeA", - ]; + static examples = ["$ sbv2 vrf:print"]; async run() { - const { args, flags } = this.parse(VrfPrint); + const { args, flags } = await this.parse(VrfPrint); const vrfAccount = new VrfAccount({ program: this.program, - publicKey: args.vrfKey, + publicKey: new PublicKey(args.vrfKey), }); this.logger.log(await prettyPrintVrf(vrfAccount, undefined, true)); diff --git a/cli/src/commands/queue/create.ts b/cli/src/commands/queue/create.ts index 6829813..c6cc16d 100644 --- a/cli/src/commands/queue/create.ts +++ b/cli/src/commands/queue/create.ts @@ -1,6 +1,6 @@ /* eslint-disable complexity */ /* eslint-disable unicorn/new-for-builtins */ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; import * as spl from "@solana/spl-token"; import { @@ -37,61 +37,61 @@ export default class QueueCreate extends BaseCommand { static flags = { ...BaseCommand.flags, - force: flags.boolean({ + force: Flags.boolean({ description: "overwrite output file if existing", default: false, }), - authority: flags.string({ + authority: Flags.string({ char: "a", description: "keypair to delegate authority to for creating permissions targeted at the queue", }), - name: flags.string({ + name: Flags.string({ char: "n", description: "name of the queue for easier identification", default: "Custom Queue", }), - minStake: flags.string({ + minStake: Flags.string({ description: "minimum stake required by an oracle to join the queue", default: "0", }), - reward: flags.string({ + reward: Flags.string({ char: "r", description: "oracle rewards for successfully responding to an update request", default: "0", }), - crankSize: flags.integer({ + crankSize: Flags.integer({ char: "c", description: "size of the crank", default: 100, }), - oracleTimeout: flags.integer({ + oracleTimeout: Flags.integer({ char: "o", description: "number of oracles to add to the queue", default: 180, }), - numOracles: flags.integer({ + numOracles: Flags.integer({ char: "o", description: "number of oracles to add to the queue", }), - queueSize: flags.integer({ + queueSize: Flags.integer({ description: "maximum number of oracles the queue can support", default: 100, }), - unpermissionedFeeds: flags.boolean({ + unpermissionedFeeds: Flags.boolean({ description: "permit unpermissioned feeds", default: false, }), - unpermissionedVrf: flags.boolean({ + unpermissionedVrf: Flags.boolean({ description: "permit unpermissioned VRF accounts", default: false, }), - enableBufferRelayers: flags.boolean({ + enableBufferRelayers: Flags.boolean({ description: "enable oracles to fulfill buffer relayer requests", default: false, }), - outputFile: flags.string({ + outputFile: Flags.string({ char: "f", description: "output queue schema to a json file", required: false, @@ -100,7 +100,7 @@ export default class QueueCreate extends BaseCommand { async run() { verifyProgramHasPayer(this.program); - const { flags, args } = this.parse(QueueCreate); + const { flags, args } = await this.parse(QueueCreate); const payerKeypair = programWallet(this.program); const signers: Keypair[] = [payerKeypair]; diff --git a/cli/src/commands/queue/permit/aggregator.ts b/cli/src/commands/queue/permit/aggregator.ts deleted file mode 100644 index 7f66d77..0000000 --- a/cli/src/commands/queue/permit/aggregator.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { flags } from "@oclif/command"; -import { Keypair, PublicKey } from "@solana/web3.js"; -import { - AggregatorAccount, - OracleQueueAccount, -} from "@switchboard-xyz/switchboard-v2"; -import chalk from "chalk"; -import { PermissionClass } from "../../../accounts"; -import BaseCommand from "../../../BaseCommand"; -import { CHECK_ICON, getProgramPayer, loadKeypair } from "../../../utils"; - -export default class QueuePermitAggregator extends BaseCommand { - queueAuthority: Keypair; - - queueAccount: OracleQueueAccount; - - aggregatorAccount: AggregatorAccount; - - static description = - "permit an aggregator to use an oracle queue's resources"; - - static flags = { - ...BaseCommand.flags, - authority: flags.string({ - char: "a", - description: "alternate keypair that is the authority for oracle queue", - }), - }; - - static args = [ - { - name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), - description: - "public key of the aggregator account to authorize oracle queue usage", - }, - ]; - - static examples = [ - "$ sbv2 queue:permit:aggregator 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 --keypair ../queue-authority.json", - ]; - - async init() { - await super.init(); - const { args, flags } = this.parse(QueuePermitAggregator); - - this.queueAuthority = flags.authority - ? await loadKeypair(flags.authority) - : getProgramPayer(this.program); - - this.queueAccount = new OracleQueueAccount({ - program: this.program, - keypair: this.queueAuthority, - }); - - this.aggregatorAccount = new AggregatorAccount({ - program: this.program, - publicKey: args.aggregatorKey, - }); - } - - async run() { - const permission = await PermissionClass.grantPermission( - this.context, - this.aggregatorAccount, - this.queueAuthority - ); - - if (this.silent) { - console.log(permission.publicKey.toString()); - } else { - this.logger.log( - `${chalk.green(`${CHECK_ICON}Aggregator permitted on queue`)}` - ); - } - } - - async catch(error) { - super.catch(error, "failed to grant aggregator permission to use a queue"); - } -} diff --git a/cli/src/commands/queue/permit/oracle.ts b/cli/src/commands/queue/permit/oracle.ts deleted file mode 100644 index a586d14..0000000 --- a/cli/src/commands/queue/permit/oracle.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { flags } from "@oclif/command"; -import { Keypair, PublicKey } from "@solana/web3.js"; -import { - OracleAccount, - OracleQueueAccount, -} from "@switchboard-xyz/switchboard-v2"; -import chalk from "chalk"; -import { PermissionClass } from "../../../accounts"; -import BaseCommand from "../../../BaseCommand"; -import { CHECK_ICON, getProgramPayer, loadKeypair } from "../../../utils"; - -export default class QueuePermitOracle extends BaseCommand { - queueAuthority: Keypair; - - queueAccount: OracleQueueAccount; - - oracleAccount: OracleAccount; - - static description = "permit an oracle to heartbeat on a queue"; - - static flags = { - ...BaseCommand.flags, - authority: flags.string({ - char: "a", - description: "alternate keypair that is the authority for oracle queue", - }), - }; - - static args = [ - { - name: "oracleKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), - description: - "public key of the oracle account to authorize oracle queue usage", - }, - ]; - - static examples = [ - "$ sbv2 queue:permit:oracle 9CmLriMhykZ8xAoNTSHjHbk6SkuMhie1NCZn9P6LCuZ4 --keypair ../queue-authority.json", - ]; - - async init() { - await super.init(); - const { args, flags } = this.parse(QueuePermitOracle); - - this.queueAuthority = flags.authority - ? await loadKeypair(flags.authority) - : getProgramPayer(this.program); - - this.queueAccount = new OracleQueueAccount({ - program: this.program, - keypair: this.queueAuthority, - }); - - this.oracleAccount = new OracleAccount({ - program: this.program, - publicKey: args.oracleKey, - }); - } - - async run() { - const permission = await PermissionClass.grantPermission( - this.context, - this.oracleAccount, - this.queueAuthority - ); - - if (this.silent) { - console.log(permission.publicKey.toString()); - } else { - this.logger.log( - `${chalk.green(`${CHECK_ICON}Oracle heartbeat permitted on queue`)}` - ); - } - } - - async catch(error) { - super.catch(error, "failed to grant oracle permission to use a queue"); - } -} diff --git a/cli/src/commands/queue/set/rewards.ts b/cli/src/commands/queue/set/rewards.ts index bfd7e91..d08e078 100644 --- a/cli/src/commands/queue/set/rewards.ts +++ b/cli/src/commands/queue/set/rewards.ts @@ -1,5 +1,4 @@ -import { flags } from "@oclif/command"; -import * as anchor from "@project-serum/anchor"; +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; import { OracleQueueAccount } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; @@ -11,7 +10,7 @@ export default class QueueSetRewards extends BaseCommand { static flags = { ...BaseCommand.flags, - authority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that is the authority for oracle queue", }), @@ -20,14 +19,11 @@ export default class QueueSetRewards extends BaseCommand { static args = [ { name: "queueKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), + description: "public key of the oracle queue", }, { name: "rewards", - required: true, - parse: (reward: string) => new anchor.BN(reward), description: "token rewards for each assigned oracle per open round call", }, ]; @@ -38,12 +34,12 @@ export default class QueueSetRewards extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(QueueSetRewards); + const { args, flags } = await this.parse(QueueSetRewards); verifyProgramHasPayer(this.program); const queueAccount = new OracleQueueAccount({ program: this.program, - publicKey: args.queueKey, + publicKey: new PublicKey(args.queueKey), }); const queue = await queueAccount.loadData(); diff --git a/cli/src/commands/queue/set/vrf.ts b/cli/src/commands/queue/set/vrf.ts index e33f017..8cc0eda 100644 --- a/cli/src/commands/queue/set/vrf.ts +++ b/cli/src/commands/queue/set/vrf.ts @@ -1,27 +1,25 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { Keypair, PublicKey } from "@solana/web3.js"; +import { prettyPrintQueue } from "@switchboard-xyz/sbv2-utils"; import { OracleQueueAccount } from "@switchboard-xyz/switchboard-v2"; import chalk from "chalk"; -import { fromCrankJSON, OracleQueueClass } from "../../../accounts"; import BaseCommand from "../../../BaseCommand"; -import { CHECK_ICON, getProgramPayer, loadKeypair } from "../../../utils"; +import { CHECK_ICON, getProgramPayer } from "../../../utils"; export default class QueueSetVrf extends BaseCommand { queueAccount: OracleQueueAccount; - crankDefinition: fromCrankJSON; - queueAuthority: Keypair | undefined = undefined; - static description = "add a crank to an existing oracle queue"; + static description = "set unpermissionedVrfEnabled"; static flags = { ...BaseCommand.flags, - authority: flags.string({ + authority: Flags.string({ char: "a", description: "alternate keypair that is the authority for oracle queue", }), - disable: flags.boolean({ + disable: Flags.boolean({ description: "disable unpermissionedVrfEnabled", }), }; @@ -29,8 +27,6 @@ export default class QueueSetVrf extends BaseCommand { static args = [ { name: "queueKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the oracle queue to create a crank on", }, ]; @@ -40,36 +36,29 @@ export default class QueueSetVrf extends BaseCommand { // "$ sbv2 queue:add:crank 5aYuxRdcB9GpWrEXVMBQp2R5uf94uoBiFdMEBwcmHuU4 -k ../payer-keypair.json -a ../authority-keypair.json", ]; - async init() { - await super.init(); - const { args, flags } = this.parse(QueueSetVrf); - - this.queueAccount = new OracleQueueAccount({ - program: this.program, - publicKey: args.queueKey, - }); - - // TODO: Not implemented yet - if (flags.authority) { - this.queueAuthority = await loadKeypair(flags.authority); - } - } - async run() { + const { args, flags } = await this.parse(QueueSetVrf); + + const queueAccount = new OracleQueueAccount({ + program: this.program, + publicKey: new PublicKey(args.queueKey), + }); + const queue = await queueAccount.loadData(); + + const queueAuthority = await this.loadAuthority( + flags.authority, + queue.authority + ); + const setVrfTxn = await this.queueAccount.setVrfSettings({ unpermissionedVrf: true, authority: this.queueAuthority ?? getProgramPayer(this.program), }); - const queue = await OracleQueueClass.fromAccount( - this.context, - this.queueAccount - ); - if (this.silent) { console.log(setVrfTxn); } else { - this.logger.log(queue.prettyPrint()); + this.logger.log(await prettyPrintQueue(queueAccount, undefined, true)); this.logger.log( `${chalk.green(`${CHECK_ICON}Queue VRF successfully set\r\n`)}` ); diff --git a/cli/src/commands/sandbox.ts b/cli/src/commands/sandbox.ts index 224a908..3420111 100644 --- a/cli/src/commands/sandbox.ts +++ b/cli/src/commands/sandbox.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import { PublicKey } from "@solana/web3.js"; import BaseCommand from "../BaseCommand"; @@ -7,7 +7,7 @@ export default class SandboxCommand extends BaseCommand { static flags = { ...BaseCommand.flags, - name: flags.string({ + name: Flags.string({ char: "n", description: "name of the job account for easier identification", default: "", @@ -23,7 +23,7 @@ export default class SandboxCommand extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(SandboxCommand); + const { args, flags } = await this.parse(SandboxCommand); // const size = this.program.account.vrfAccountData.size; // const rentExemption = diff --git a/cli/src/commands/test.ts b/cli/src/commands/test.ts index 00bc6a2..29e8317 100644 --- a/cli/src/commands/test.ts +++ b/cli/src/commands/test.ts @@ -1,3 +1,4 @@ +/* eslint-disable new-cap */ import * as anchor from "@project-serum/anchor"; import * as spl from "@solana/spl-token"; import { @@ -32,7 +33,7 @@ export default class TestCommand extends BaseCommand { static flags = { ...BaseCommand.flags, - // name: flags.string({ + // name: Flags.string({ // char: "n", // description: "name of the job account for easier identification", // default: "", @@ -42,24 +43,22 @@ export default class TestCommand extends BaseCommand { static args = [ { name: "oracleKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the oracle to deposit funds into", }, ]; async run() { - const { args, flags } = this.parse(TestCommand); + const { args, flags } = await this.parse(TestCommand); verifyProgramHasPayer(this.program); const oracleAuthority = programWallet(this.program); const oracleAccount = new OracleAccount({ program: this.program, - publicKey: args.oracleKey, + publicKey: new PublicKey(args.oracleKey), }); - ///////////////////////////////////////////////////// + /// ////////////////////////////////////////////////// const oracle = await oracleAccount.loadData(); const queueAccount = new OracleQueueAccount({ program: oracleAccount.program, @@ -103,6 +102,7 @@ export default class TestCommand extends BaseCommand { if (error.message !== "NonceAccount has not been created") { throw error; } + const nonceRentExemption = await oracleAccount.program.provider.connection.getMinimumBalanceForRentExemption( NONCE_ACCOUNT_LENGTH @@ -152,6 +152,7 @@ export default class TestCommand extends BaseCommand { `Oracle Authority is low on funds and not enough funds in the staking wallet to cover` ); } + const unwrapAmountUi = fromBN(unwrapAmountBN).div(LAMPORTS_PER_SOL); this.logger.info( `NodeBalance: ${nodeBalance}, unwrapping ${unwrapAmountUi} SOL` @@ -255,7 +256,7 @@ function decodeTokenAccount( throw new Error("INVALID_ACCOUNT_OWNER"); } - if (info.data.length != spl.AccountLayout.span) { + if (info.data.length !== spl.AccountLayout.span) { throw new Error(`Invalid account size`); } @@ -267,7 +268,7 @@ function decodeTokenAccount( accountInfo.amount = spl.u64.fromBuffer(accountInfo.amount); if (accountInfo.delegateOption === 0) { - accountInfo.delegate = null; + accountInfo.delegate = undefined; accountInfo.delegatedAmount = new spl.u64(0); } else { accountInfo.delegate = new PublicKey(accountInfo.delegate); @@ -283,15 +284,14 @@ function decodeTokenAccount( accountInfo.rentExemptReserve = spl.u64.fromBuffer(accountInfo.isNative); accountInfo.isNative = true; } else { - accountInfo.rentExemptReserve = null; + accountInfo.rentExemptReserve = undefined; accountInfo.isNative = false; } - if (accountInfo.closeAuthorityOption === 0) { - accountInfo.closeAuthority = null; - } else { - accountInfo.closeAuthority = new PublicKey(accountInfo.closeAuthority); - } + accountInfo.closeAuthority = + accountInfo.closeAuthorityOption === 0 + ? undefined + : new PublicKey(accountInfo.closeAuthority); return accountInfo; } diff --git a/cli/src/commands/vrf/create/example.ts b/cli/src/commands/vrf/create/example.ts index 05f201f..9d623f7 100644 --- a/cli/src/commands/vrf/create/example.ts +++ b/cli/src/commands/vrf/create/example.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; import * as spl from "@solana/spl-token"; import { @@ -28,20 +28,20 @@ export default class VrfCreateExample extends BaseCommand { static flags = { ...BaseCommand.flags, - vrfPid: flags.string({ + vrfPid: Flags.string({ description: "program ID for the VRF example program", required: true, }), - vrfKeypair: flags.string({ + vrfKeypair: Flags.string({ description: "filesystem path of existing keypair to use for VRF Account", }), - enable: flags.boolean({ + enable: Flags.boolean({ description: "enable vrf permissions", }), - queueAuthority: flags.string({ + queueAuthority: Flags.string({ description: "alternative keypair to use for queue authority", }), - maxResult: flags.string({ + maxResult: Flags.string({ description: "the maximum VRF result", default: "256000", }), @@ -50,14 +50,12 @@ export default class VrfCreateExample extends BaseCommand { static args = [ { name: "queueKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the oracle queue to create VRF account for", }, ]; async run() { - const { args, flags } = this.parse(VrfCreateExample); + const { args, flags } = await this.parse(VrfCreateExample); verifyProgramHasPayer(this.program); const payerKeypair = programWallet(this.program); this.mainnetCheck(); @@ -81,6 +79,7 @@ export default class VrfCreateExample extends BaseCommand { `failed to read VRF Example program idl for ${this.cluster} ${vrfProgramId}` ); } + const vrfclientProgram = new anchor.Program( vrfExampleIdl, vrfProgramId, @@ -114,7 +113,7 @@ export default class VrfCreateExample extends BaseCommand { ); const queueAccount = new OracleQueueAccount({ program: this.program, - publicKey: args.queueKey, + publicKey: new PublicKey(args.queueKey), }); const queue = await queueAccount.loadData(); const tokenMint = await queueAccount.loadMint(); @@ -195,10 +194,11 @@ export default class VrfCreateExample extends BaseCommand { `Invalid queue authority, received ${queueAuthority.publicKey}, expected ${queue.authority}` ); } + createTxn.add( await this.program.methods .permissionSet({ - permission: { permitVrfRequests: null }, + permission: { permitVrfRequests: undefined }, enable: true, }) .accounts({ diff --git a/cli/src/commands/vrf/create/index.ts b/cli/src/commands/vrf/create/index.ts index 283208d..0a7697a 100644 --- a/cli/src/commands/vrf/create/index.ts +++ b/cli/src/commands/vrf/create/index.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; import * as spl from "@solana/spl-token"; import { @@ -24,29 +24,29 @@ export default class VrfCreate extends BaseCommand { static flags = { ...BaseCommand.flags, - vrfKeypair: flags.string({ + vrfKeypair: Flags.string({ description: "filesystem path of existing keypair to use for VRF Account", }), - enable: flags.boolean({ + enable: Flags.boolean({ description: "enable vrf permissions", }), - authority: flags.string({ + authority: Flags.string({ description: "alternative keypair to use for VRF authority", }), - queueAuthority: flags.string({ + queueAuthority: Flags.string({ description: "alternative keypair to use for queue authority", }), - accountMeta: flags.string({ + accountMeta: Flags.string({ char: "a", description: "account metas for VRF callback", multiple: true, required: true, }), - callbackPid: flags.string({ + callbackPid: Flags.string({ description: "callback program ID", required: true, }), - ixData: flags.string({ + ixData: Flags.string({ description: "instruction data", required: true, }), @@ -55,8 +55,7 @@ export default class VrfCreate extends BaseCommand { static args = [ { name: "queueKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), + description: "public key of the oracle queue to create VRF account for", }, ]; @@ -67,28 +66,28 @@ export default class VrfCreate extends BaseCommand { ]; async run() { - const { args, flags } = this.parse(VrfCreate); + const { args, flags } = await this.parse(VrfCreate); verifyProgramHasPayer(this.program); const payerKeypair = programWallet(this.program); - const ixDataStr = + const ixDataString = flags.ixData.startsWith("[") && flags.ixData.endsWith("]") ? flags.ixData.slice(1, -1) : flags.ixData; - const ixDataArr = ixDataStr.split(","); - const ixData = ixDataArr.map((n) => Number.parseInt(n)); + const ixDataArray = ixDataString.split(","); + const ixData = ixDataArray.map((n) => Number.parseInt(n, 10)); const callback: Callback = { programId: new PublicKey(flags.callbackPid), accounts: flags.accountMeta.map((a) => { - const parsedObj: { + const parsedObject: { pubkey: string; isSigner: boolean; isWritable: boolean; } = JSON.parse(a); return { - pubkey: new PublicKey(parsedObj.pubkey), - isSigner: Boolean(parsedObj.isSigner), - isWritable: Boolean(parsedObj.isWritable), + pubkey: new PublicKey(parsedObject.pubkey), + isSigner: Boolean(parsedObject.isSigner), + isWritable: Boolean(parsedObject.isWritable), }; }), ixData: Buffer.from(ixData), @@ -111,7 +110,7 @@ export default class VrfCreate extends BaseCommand { ); const queueAccount = new OracleQueueAccount({ program: this.program, - publicKey: args.queueKey, + publicKey: new PublicKey(args.queueKey), }); const queue = await queueAccount.loadData(); const tokenMint = await queueAccount.loadMint(); @@ -191,10 +190,11 @@ export default class VrfCreate extends BaseCommand { `Invalid queue authority, received ${queueAuthority.publicKey}, expected ${queue.authority}` ); } + createTxn.add( await this.program.methods .permissionSet({ - permission: { permitVrfRequests: null }, + permission: { permitVrfRequests: undefined }, enable: true, }) .accounts({ diff --git a/cli/src/commands/vrf/request.ts b/cli/src/commands/vrf/request.ts index 0b795d0..f26f754 100644 --- a/cli/src/commands/vrf/request.ts +++ b/cli/src/commands/vrf/request.ts @@ -1,4 +1,4 @@ -import { flags } from "@oclif/command"; +import { Flags } from "@oclif/core"; import * as spl from "@solana/spl-token"; import { PublicKey, SYSVAR_RECENT_BLOCKHASHES_PUBKEY } from "@solana/web3.js"; import { @@ -20,10 +20,10 @@ export default class VrfRequest extends BaseCommand { static flags = { ...BaseCommand.flags, - funderAuthority: flags.string({ + funderAuthority: Flags.string({ description: "alternative keypair to pay for VRF request", }), - authority: flags.string({ + authority: Flags.string({ description: "alternative keypair that is the VRF authority", }), }; @@ -31,20 +31,19 @@ export default class VrfRequest extends BaseCommand { static args = [ { name: "vrfKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), + description: "public key of the VRF account to request randomness for", }, ]; async run() { - const { args, flags } = this.parse(VrfRequest); + const { args, flags } = await this.parse(VrfRequest); verifyProgramHasPayer(this.program); const payerKeypair = programWallet(this.program); const vrfAccount = new VrfAccount({ program: this.program, - publicKey: args.vrfKey, + publicKey: new PublicKey(args.vrfKey), }); const vrf = await vrfAccount.loadData(); const queueAccount = new OracleQueueAccount({ diff --git a/cli/src/commands/watch/aggregator.ts b/cli/src/commands/watch/aggregator.ts index 383d735..bf95683 100644 --- a/cli/src/commands/watch/aggregator.ts +++ b/cli/src/commands/watch/aggregator.ts @@ -21,8 +21,6 @@ export default class WatchAggregator extends BaseCommand { static args = [ { name: "aggregatorKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the aggregator account to deserialize", }, ]; @@ -34,11 +32,11 @@ export default class WatchAggregator extends BaseCommand { ]; async run() { - const { args } = this.parse(WatchAggregator); + const { args } = await this.parse(WatchAggregator); const aggregatorAccount = new AggregatorAccount({ program: this.program, - publicKey: args.aggregatorKey, + publicKey: new PublicKey(args.aggregatorKey), }); const aggregator = await aggregatorAccount.loadData(); const name = buffer2string(aggregator.name) ?? ""; diff --git a/cli/src/commands/watch/vrf.ts b/cli/src/commands/watch/vrf.ts index 48383bc..2dce4af 100644 --- a/cli/src/commands/watch/vrf.ts +++ b/cli/src/commands/watch/vrf.ts @@ -15,8 +15,6 @@ export default class WatchVrf extends BaseCommand { static args = [ { name: "vrfKey", - required: true, - parse: (pubkey: string) => new PublicKey(pubkey), description: "public key of the vrf account to deserialize", }, ]; @@ -28,11 +26,11 @@ export default class WatchVrf extends BaseCommand { ]; async run() { - const { args } = this.parse(WatchVrf); + const { args } = await this.parse(WatchVrf); const vrfAccount = new VrfAccount({ program: this.program, - publicKey: args.vrfKey, + publicKey: new PublicKey(args.vrfKey), }); const vrfData = await vrfAccount.loadData(); diff --git a/cli/src/index.ts b/cli/src/index.ts index 8bdb76f..2337853 100644 --- a/cli/src/index.ts +++ b/cli/src/index.ts @@ -1 +1 @@ -export { run } from "@oclif/command"; +export { run } from "@oclif/core"; diff --git a/cli/src/types/context/FsProvider.ts b/cli/src/types/context/FsProvider.ts index faa040e..25deef4 100644 --- a/cli/src/types/context/FsProvider.ts +++ b/cli/src/types/context/FsProvider.ts @@ -2,7 +2,7 @@ import { Keypair } from "@solana/web3.js"; import chalk from "chalk"; import * as fs from "fs"; import * as path from "path"; -import { pubKeyConverter } from "../../accounts"; +import { pubKeyConverter } from "../../utils"; import { DEFAULT_LOGGER, LogProvider } from "./logging"; export class FsProvider { @@ -48,4 +48,4 @@ export class FsProvider { } } -// export const DEFAULT_KEYPAIR_PROVIDER = new FsProvider("."); +// export const Keypair.fromSeed(new Uint8Array(32).fill(1))_PROVIDER = new FsProvider("."); diff --git a/cli/src/utils/anchor.ts b/cli/src/utils/anchor.ts index bd212fa..45d5a12 100644 --- a/cli/src/utils/anchor.ts +++ b/cli/src/utils/anchor.ts @@ -5,7 +5,6 @@ import { SBV2_DEVNET_PID, SBV2_MAINNET_PID, } from "@switchboard-xyz/switchboard-v2"; -import { DEFAULT_KEYPAIR } from "../accounts"; import { NoPayerKeypairProvided } from "../types"; export const loadAnchor = async ( @@ -24,6 +23,7 @@ export const loadAnchor = async ( PID = SBV2_MAINNET_PID; break; } + case "testnet": { throw new Error(`${cluster} PID not implemented yet`); } @@ -75,7 +75,9 @@ export const getNewProgram = ( export const programHasPayer = (program: anchor.Program): boolean => { const payer = programWallet(program); - return !payer.publicKey.equals(DEFAULT_KEYPAIR.publicKey); + return !payer.publicKey.equals( + Keypair.fromSeed(new Uint8Array(32).fill(1)).publicKey + ); }; export const getProgramPayer = (program: anchor.Program): Keypair => { diff --git a/cli/src/utils/index.ts b/cli/src/utils/index.ts index 9d7ea59..a9d7d47 100644 --- a/cli/src/utils/index.ts +++ b/cli/src/utils/index.ts @@ -1,6 +1,7 @@ export * from "./anchor"; export * from "./icons"; export * from "./keypair"; +export * from "./misc"; export * from "./sleep"; export * from "./state"; export * from "./switchboard"; diff --git a/cli/src/utils/keypair.ts b/cli/src/utils/keypair.ts index 56e9921..ae757b7 100644 --- a/cli/src/utils/keypair.ts +++ b/cli/src/utils/keypair.ts @@ -65,7 +65,7 @@ export const loadGoogleSecretKeypair = async ( : `${secretPath}/versions/latest`, }); - const secrets = accessResponse?.payload.data; + const secrets = accessResponse.payload.data; if (secrets === undefined) { throw new Error("Google secret not found."); } diff --git a/cli/src/accounts/utils/utils.ts b/cli/src/utils/misc.ts similarity index 67% rename from cli/src/accounts/utils/utils.ts rename to cli/src/utils/misc.ts index c4d0261..26ce5a2 100644 --- a/cli/src/accounts/utils/utils.ts +++ b/cli/src/utils/misc.ts @@ -1,5 +1,4 @@ import * as anchor from "@project-serum/anchor"; -import { ACCOUNT_DISCRIMINATOR_SIZE } from "@project-serum/anchor/dist/cjs/coder"; import { PublicKey } from "@solana/web3.js"; import { AggregatorAccount, @@ -13,26 +12,10 @@ import { SwitchboardDecimal, SwitchboardPermission, SwitchboardPermissionValue, - VrfAccount, } from "@switchboard-xyz/switchboard-v2"; import Big from "big.js"; import chalk from "chalk"; -import { - AggregatorClass, - CrankClass, - JobClass, - LeaseClass, - OracleClass, - OracleQueueClass, - PermissionClass, - ProgramStateClass, -} from ".."; -import { CommandContext } from "../../types"; -import { loadKeypair } from "../../utils"; -import { - SwitchboardAccountType, - SWITCHBOARD_DISCRIMINATOR_MAP, -} from "../types"; +import { loadKeypair } from "./keypair"; export const getArrayOfSizeN = (number_: number): number[] => { return Array.from({ length: number_ }, (_, index) => index + 1); @@ -71,55 +54,68 @@ export const toVrfStatus1 = (status: object): string => { if ("statusNone" in status) { return "StatusNone"; } + if ("statusRequesting" in status) { return "StatusRequesting"; } + if ("statusVerifying" in status) { return "StatusVerifying"; } + if ("statusVerified" in status) { return "StatusVerified"; } + if ("statusCallbackSuccess" in status) { return "StatusCallbackSuccess"; } + if ("statusVerifyFailure" in status) { return "StatusVerifyFailure"; } + return "Unknown"; }; -export const toVrfStatus = (status: object): VrfStatus => { +export const toVrfStatus = (status: object): VrfStatus | "NONE" => { if ("statusNone" in status) { return VrfStatus.STATUS_NONE; } + if ("statusRequesting" in status) { return VrfStatus.STATUS_REQUESTING; } + if ("statusVerifying" in status) { return VrfStatus.STATUS_VERIFYING; } + if ("statusVerified" in status) { return VrfStatus.STATUS_VERIFIED; } + if ("statusCallbackSuccess" in status) { return VrfStatus.STATUS_CALLBACK_SUCCESS; } + if ("statusVerifyFailure" in status) { return VrfStatus.STATUS_VERIFY_FAILURE; } + + return "NONE"; }; export const toPermission = ( permissionString: string -): SwitchboardPermission => { +): SwitchboardPermission | "NONE" => { switch (permissionString) { case "PERMIT_ORACLE_HEARTBEAT": return SwitchboardPermission.PERMIT_ORACLE_HEARTBEAT; case "PERMIT_ORACLE_QUEUE_USAGE": return SwitchboardPermission.PERMIT_ORACLE_QUEUE_USAGE; default: - return SwitchboardPermission[0]; + return "NONE"; } }; @@ -128,38 +124,47 @@ export const pubKeyConverter = (key: any, value: any): any => { if (value instanceof PublicKey || key.toLowerCase().endsWith("publickey")) { return value.toString() ?? ""; } + if (value instanceof Uint8Array) { return `[${value.toString()}]`; } + if (value instanceof anchor.BN) { return value.toString(); } + if (value instanceof Big) { return value.toString(); } + if (value instanceof SwitchboardDecimal) { return new Big(value.mantissa.toString()) .div(new Big(10).pow(value.scale)) .toString(); } + if (IGNORE_JSON_OUTPUT_KEYS.has(key)) return undefined; return value; }; // JSON.parse: String => Object -export const pubKeyReviver = (key, value): any => { +export const pubKeyReviver = (key: string, value: any): any => { if (key.toLowerCase().endsWith("publickey")) { return new PublicKey(value); } + if (key.toLowerCase().endsWith("secretkey")) { return new Uint8Array(JSON.parse(value)); } + if (key.toLowerCase().endsWith("keypair")) { return loadKeypair(value); } + if (key.toLowerCase().startsWith("variancethreshold")) { return new SwitchboardDecimal(new anchor.BN(value.mantissa), value.scale); } + return value; }; @@ -316,109 +321,26 @@ export const isProgramStateAccount = async ( } }; -// should also check if pubkey is a token account -export const findAccountType = async ( - program: anchor.Program, - publicKey: PublicKey -): Promise => { - const account = await program.provider.connection.getAccountInfo(publicKey); - const accountDiscriminator = account.data.slice( - 0, - ACCOUNT_DISCRIMINATOR_SIZE - ); +// // should also check if pubkey is a token account +// export const findAccountType = async ( +// program: anchor.Program, +// publicKey: PublicKey +// ): Promise => { +// const account = await program.provider.connection.getAccountInfo(publicKey); +// if (!account) { +// throw new Error(`Failed to find account ${publicKey}`); +// } - for (const [name, discriminator] of SWITCHBOARD_DISCRIMINATOR_MAP.entries()) { - if (Buffer.compare(accountDiscriminator, discriminator) === 0) { - return name; - } - } +// const accountDiscriminator = account.data.slice( +// 0, +// ACCOUNT_DISCRIMINATOR_SIZE +// ); - throw new Error(`no switchboard account found for ${publicKey}`); -}; +// for (const [name, discriminator] of SWITCHBOARD_DISCRIMINATOR_MAP.entries()) { +// if (Buffer.compare(accountDiscriminator, discriminator) === 0) { +// return name; +// } +// } -export const buildClassFromKey = async ( - context: CommandContext, - program: anchor.Program, - publicKey: PublicKey -): Promise< - | JobClass - | AggregatorClass - | OracleClass - | PermissionClass - | LeaseClass - | OracleQueueClass - | CrankClass - | ProgramStateClass - | VrfAccount -> => { - const accountType = await findAccountType(program, publicKey); - switch (accountType) { - case "JobAccountData": { - const job = await JobClass.fromAccount( - context, - new JobAccount({ program, publicKey }) - ); - context.logger.log(job.prettyPrint()); - break; - } - case "AggregatorAccountData": { - const aggregator = await AggregatorClass.fromAccount( - context, - new AggregatorAccount({ program, publicKey }) - ); - context.logger.log(aggregator.prettyPrint()); - break; - } - case "OracleAccountData": { - const oracle = await OracleClass.fromAccount( - context, - new OracleAccount({ program, publicKey }) - ); - context.logger.log(oracle.prettyPrint()); - break; - } - case "PermissionAccountData": { - const permission = await PermissionClass.fromAccount( - context, - new PermissionAccount({ program, publicKey }) - ); - context.logger.log(permission.prettyPrint()); - break; - } - case "LeaseAccountData": { - const lease = await LeaseClass.fromAccount( - context, - new LeaseAccount({ program, publicKey }) - ); - context.logger.log(lease.prettyPrint()); - break; - } - case "OracleQueueAccountData": { - const queue = await OracleQueueClass.fromAccount( - context, - new OracleQueueAccount({ program, publicKey }) - ); - context.logger.log(queue.prettyPrint()); - break; - } - case "CrankAccountData": { - const crank = await CrankClass.fromAccount( - context, - new CrankAccount({ program, publicKey }) - ); - context.logger.log(crank.prettyPrint()); - break; - } - case "ProgramStateAccountData": { - const state = await ProgramStateClass.build(program); - context.logger.log(state.prettyPrint()); - break; - } - // case "VrfAccountData": { - // const state = new VrfAccount - // context.logger.log(state.prettyPrint()); - // break; - // } - } - throw new Error(`no switchboard account found for ${publicKey}`); -}; +// throw new Error(`no switchboard account found for ${publicKey}`); +// }; diff --git a/cli/src/utils/sleep.ts b/cli/src/utils/sleep.ts index 9ed2561..dfe999a 100644 --- a/cli/src/utils/sleep.ts +++ b/cli/src/utils/sleep.ts @@ -9,6 +9,7 @@ export const callWithRetry = async (function_, depth = 0) => { if (depth > 7) { throw error; } + await sleep(2 ** depth * 10); return callWithRetry(function_, depth + 1); diff --git a/cli/src/utils/state.ts b/cli/src/utils/state.ts index 406c7a8..2f67da5 100644 --- a/cli/src/utils/state.ts +++ b/cli/src/utils/state.ts @@ -25,6 +25,7 @@ export const getOrCreateSwitchboardMintTokenAccount = async ( if (mint) { returnAssociatedAddress(mint); } + const [programState] = ProgramStateAccount.fromSeed(program); mint = await programState.getTokenMint(); if (mint) { diff --git a/cli/src/utils/switchboard.ts b/cli/src/utils/switchboard.ts index 682f703..f9a2e1b 100644 --- a/cli/src/utils/switchboard.ts +++ b/cli/src/utils/switchboard.ts @@ -90,28 +90,36 @@ export const loadSwitchboardAccount = async ( case "JobAccountData": { return [accountType, new JobAccount({ program, publicKey })]; } + case "AggregatorAccountData": { return [accountType, new AggregatorAccount({ program, publicKey })]; } + case "OracleAccountData": { return [accountType, new OracleAccount({ program, publicKey })]; } + case "PermissionAccountData": { return [accountType, new PermissionAccount({ program, publicKey })]; } + case "LeaseAccountData": { return [accountType, new LeaseAccount({ program, publicKey })]; } + case "OracleQueueAccountData": { return [accountType, new OracleQueueAccount({ program, publicKey })]; } + case "CrankAccountData": { return [accountType, new CrankAccount({ program, publicKey })]; } + case "SbState": case "ProgramStateAccountData": { return [accountType, new ProgramStateAccount({ program, publicKey })]; } + case "VrfAccountData": { return [accountType, new VrfAccount({ program, publicKey })]; } diff --git a/cli/test/commands/bad-cluster.test.ts b/cli/test/commands/bad-cluster.test.ts deleted file mode 100644 index 29f8276..0000000 --- a/cli/test/commands/bad-cluster.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { test } from "@oclif/test"; - -describe("incorrect cluster provided", () => { - test - .stdout() - .command([ - "job:create:template", - "-c", - "nocluster", - "./dummy-keypair.json", - "ftxUs", - "BTC_USD", - ]) - .catch("Invalid cluster provided nocluster") - .it("incorrect cluster should throw an error"); -}); diff --git a/cli/test/commands/hello/index.test.ts b/cli/test/commands/hello/index.test.ts new file mode 100644 index 0000000..f4e5ebe --- /dev/null +++ b/cli/test/commands/hello/index.test.ts @@ -0,0 +1,10 @@ +import {expect, test} from '@oclif/test' + +describe('hello', () => { + test + .stdout() + .command(['hello', 'friend', '--from=oclif']) + .it('runs hello cmd', ctx => { + expect(ctx.stdout).to.contain('hello friend from oclif!') + }) +}) diff --git a/cli/test/commands/hello/world.test.ts b/cli/test/commands/hello/world.test.ts new file mode 100644 index 0000000..8096cba --- /dev/null +++ b/cli/test/commands/hello/world.test.ts @@ -0,0 +1,10 @@ +import {expect, test} from '@oclif/test' + +describe('hello world', () => { + test + .stdout() + .command(['hello:world']) + .it('runs hello world cmd', ctx => { + expect(ctx.stdout).to.contain('hello world!') + }) +}) diff --git a/cli/test/helpers/init.js b/cli/test/helpers/init.js new file mode 100644 index 0000000..338e715 --- /dev/null +++ b/cli/test/helpers/init.js @@ -0,0 +1,6 @@ +const path = require('path') +process.env.TS_NODE_PROJECT = path.resolve('test/tsconfig.json') +process.env.NODE_ENV = 'development' + +global.oclif = global.oclif || {} +global.oclif.columns = 80 diff --git a/cli/test/mocha.opts b/cli/test/mocha.opts deleted file mode 100644 index 73fb836..0000000 --- a/cli/test/mocha.opts +++ /dev/null @@ -1,5 +0,0 @@ ---require ts-node/register ---watch-extensions ts ---recursive ---reporter spec ---timeout 5000 diff --git a/cli/test/tsconfig.json b/cli/test/tsconfig.json index 1025cf6..95898fc 100644 --- a/cli/test/tsconfig.json +++ b/cli/test/tsconfig.json @@ -3,5 +3,7 @@ "compilerOptions": { "noEmit": true }, - "references": [{ "path": "../", "composite": true }] + "references": [ + {"path": ".."} + ] } diff --git a/cli/tsconfig.build.json b/cli/tsconfig.build.json new file mode 100644 index 0000000..8254e18 --- /dev/null +++ b/cli/tsconfig.build.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "declaration": true, + "importHelpers": true, + "module": "commonjs", + "outDir": "dist", + "rootDir": "src", + "strict": false, + "target": "es2019", + "esModuleInterop": true, + "skipLibCheck": true, + "strictPropertyInitialization": false + }, + "files": ["src/index.ts"], + "include": ["src/**/*"] +} diff --git a/cli/tsconfig.json b/cli/tsconfig.json index 8351e25..8fdd2e0 100644 --- a/cli/tsconfig.json +++ b/cli/tsconfig.json @@ -1,23 +1,11 @@ { - "extends": "../tsconfig.json", + "extends": "./tsconfig.build.json", "compilerOptions": { - "noEmit": false, - "outDir": "lib", - "rootDir": "src", - "strict": false, - "importsNotUsedAsValues": "preserve", - "noImplicitOverride": false, - "noImplicitReturns": false, - "declaration": true, - "esModuleInterop": true, "paths": { "@switchboard-xyz/switchboard-v2": ["../libraries/ts"], "@switchboard-xyz/sbv2-utils": ["../libraries/sbv2-utils"] } }, - "types": ["node"], - "include": ["src/**/*"], - "exclude": ["node_modules", "bin", "lib", "test/**/*"], "references": [ { "path": "../libraries/ts" }, { "path": "../libraries/sbv2-utils" } diff --git a/lerna.json b/lerna.json index bb87944..5333a9d 100644 --- a/lerna.json +++ b/lerna.json @@ -11,5 +11,17 @@ ], "npmClient": "yarn", "version": "independent", - "useWorkspaces": true + "useWorkspaces": true, + "publish": { + "registry": "https://npm.pkg.github.com", + "ignoreChanges": [ + "./website/**/*", + "./programs/**/*", + "./packages/**/*", + "./libraries/rs", + "./directory/**", + "./tools/**", + "./**/README.md" + ] + } } diff --git a/packages/feed-parser/package.json b/packages/feed-parser/package.json index c18b9af..c365a7b 100644 --- a/packages/feed-parser/package.json +++ b/packages/feed-parser/package.json @@ -1,5 +1,6 @@ { "name": "@switchboard-xyz/v2-feed-parser", + "version": "1.0.0", "description": "switchboard v2 example demonstrating how to parse a data feed", "private": true, "repository": { diff --git a/packages/feed-walkthrough/package.json b/packages/feed-walkthrough/package.json index e422c69..51aab0f 100644 --- a/packages/feed-walkthrough/package.json +++ b/packages/feed-walkthrough/package.json @@ -1,6 +1,8 @@ { "name": "@switchboard-xyz/v2-feed-walkthrough", + "version": "1.0.0", "description": "switchboard v2 example demonstrating how to create a private queue, oracle, and data feed", + "license": "MIT", "private": true, "repository": { "type": "git", @@ -14,14 +16,11 @@ "build": "rimraf dist && ./esbuild.js -inline-sourcemap", "test": "echo \"No test script for @switchboard-xyz/v2-feed-walkthrough\" && exit 0" }, - "author": "", - "license": "ISC", "dependencies": { "@project-serum/anchor": "^0.24.2", "@solana/spl-token": "^0.2.0", "@solana/web3.js": "^1.37.1", "@switchboard-xyz/switchboard-v2": "^0.0.108", - "@switchboard-xyz/v2-task-library": "^0.1.1", "chalk": "^4.1.2", "dotenv": "^16.0.0", "readline-sync": "^1.4.10" diff --git a/packages/feed-walkthrough/src/main.ts b/packages/feed-walkthrough/src/main.ts index cfa3728..6afd30c 100644 --- a/packages/feed-walkthrough/src/main.ts +++ b/packages/feed-walkthrough/src/main.ts @@ -12,8 +12,8 @@ import { PermissionAccount, ProgramStateAccount, SwitchboardPermission, + OracleJob, } from "@switchboard-xyz/switchboard-v2"; -import { OracleJob } from "@switchboard-xyz/v2-task-library"; import chalk from "chalk"; import dotenv from "dotenv"; import os from "os"; diff --git a/packages/lease-observer/package.json b/packages/lease-observer/package.json index b2fdc16..85cbfde 100644 --- a/packages/lease-observer/package.json +++ b/packages/lease-observer/package.json @@ -1,8 +1,9 @@ { "name": "@switchboard-xyz/lease-observer", - "version": "0.1.7", + "version": "1.0.0", "description": "receive pager duty alerts when a switchboard v2 lease crosses a provided threshold", "private": true, + "license": "MIT", "repository": { "type": "git", "url": "https://github.com/switchboard-xyz/switchboard-v2", diff --git a/programs/anchor-feed-parser/package.json b/programs/anchor-feed-parser/package.json index 74de197..910df65 100644 --- a/programs/anchor-feed-parser/package.json +++ b/programs/anchor-feed-parser/package.json @@ -1,5 +1,6 @@ { "name": "anchor-feed-parser", + "version": "1.0.0", "private": true, "repository": { "type": "git", diff --git a/programs/anchor-vrf-parser/package.json b/programs/anchor-vrf-parser/package.json index 3e5bb31..d7f08fd 100644 --- a/programs/anchor-vrf-parser/package.json +++ b/programs/anchor-vrf-parser/package.json @@ -1,5 +1,6 @@ { "name": "anchor-vrf-parser", + "version": "1.0.0", "private": true, "repository": { "type": "git", diff --git a/programs/spl-feed-parser/package.json b/programs/spl-feed-parser/package.json index e054ee2..f74e07e 100644 --- a/programs/spl-feed-parser/package.json +++ b/programs/spl-feed-parser/package.json @@ -1,5 +1,6 @@ { "name": "spl-feed-parser", + "version": "1.0.0", "private": true, "repository": { "type": "git", diff --git a/yarn.lock b/yarn.lock index 0ce301f..6446887 100644 --- a/yarn.lock +++ b/yarn.lock @@ -183,7 +183,7 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/core@^7.12.16", "@babel/core@^7.12.3", "@babel/core@^7.15.5", "@babel/core@^7.7.5": +"@babel/core@^7.12.16", "@babel/core@^7.12.3", "@babel/core@^7.15.5": version "7.17.9" resolved "https://registry.npmjs.org/@babel/core/-/core-7.17.9.tgz" integrity sha512-5ug+SfZCpDAkVp9SFIZAzlW18rlzsOcJGaetCjkySnrXXDUw9AR8cDUm1iByTmdWM6yxX6/zycaV76w3YTF2gw== @@ -1958,9 +1958,16 @@ dependencies: "@cspotcode/source-map-consumer" "0.8.0" +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + "@dabh/diagnostics@^2.0.2": version "2.0.3" - resolved "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz" + resolved "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz#7f7e97ee9a725dffc7808d93668cc984e1dc477a" integrity sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA== dependencies: colorspace "1.1.x" @@ -2547,35 +2554,35 @@ jsonpath-plus "^6.0.1" lodash "^4.17.21" -"@gar/promisify@^1.0.1": +"@gar/promisify@^1.0.1", "@gar/promisify@^1.1.3": version "1.1.3" resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== "@google-cloud/secret-manager@^3.10.1": version "3.12.0" - resolved "https://registry.npmjs.org/@google-cloud/secret-manager/-/secret-manager-3.12.0.tgz" + resolved "https://registry.npmjs.org/@google-cloud/secret-manager/-/secret-manager-3.12.0.tgz#ff975190e45da3aaa762905f2b7c679c06a0f4a3" integrity sha512-nFNm5lYgH2RRAn1x8vPKt1c+MBMJtBXqkYB5Jpi68PjN7Emjcu7/kl+0/+FamFLp3qJUU7RKRCwETFNNZAOkuw== dependencies: google-gax "^2.30.0" "@grpc/grpc-js@~1.6.0": version "1.6.7" - resolved "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.6.7.tgz" + resolved "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.6.7.tgz#4c4fa998ff719fe859ac19fe977fdef097bb99aa" integrity sha512-eBM03pu9hd3VqDQG+kHahiG1x80RGkkqqRb1Pchcwqej/KkAH95gAvKs6laqaHCycYaPK+TKuNQnOz9UXYA8qw== dependencies: "@grpc/proto-loader" "^0.6.4" "@types/node" ">=12.12.47" -"@grpc/proto-loader@^0.6.1", "@grpc/proto-loader@^0.6.4": - version "0.6.9" - resolved "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.9.tgz" - integrity sha512-UlcCS8VbsU9d3XTXGiEVFonN7hXk+oMXZtoHHG2oSA1/GcDP1q6OUgs20PzHDGizzyi8ufGSUDlk3O2NyY7leg== +"@grpc/proto-loader@^0.6.12", "@grpc/proto-loader@^0.6.4": + version "0.6.13" + resolved "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.13.tgz#008f989b72a40c60c96cd4088522f09b05ac66bc" + integrity sha512-FjxPYDRTn6Ec3V0arm1FtSpmP6V50wuph2yILpyvTKzjc76oDdoihXqM1DzOW5ubvCC8GivfCnNtfaRE8myJ7g== dependencies: "@types/long" "^4.0.1" lodash.camelcase "^4.3.0" long "^4.0.0" - protobufjs "^6.10.0" + protobufjs "^6.11.3" yargs "^16.2.0" "@hapi/hoek@^9.0.0": @@ -2623,22 +2630,6 @@ resolved "https://registry.npmjs.org/@isaacs/string-locale-compare/-/string-locale-compare-1.1.0.tgz" integrity sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ== -"@istanbuljs/load-nyc-config@^1.0.0": - version "1.1.0" - resolved "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz" - integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== - dependencies: - camelcase "^5.3.1" - find-up "^4.1.0" - get-package-type "^0.1.0" - js-yaml "^3.13.1" - resolve-from "^5.0.0" - -"@istanbuljs/schema@^0.1.2": - version "0.1.3" - resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz" - integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== - "@jridgewell/gen-mapping@^0.3.0": version "0.3.1" resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.1.tgz#cf92a983c83466b8c0ce9124fadeaf09f7c66ea9" @@ -2663,7 +2654,7 @@ resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz" integrity sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg== -"@jridgewell/trace-mapping@^0.3.0": +"@jridgewell/trace-mapping@0.3.9", "@jridgewell/trace-mapping@^0.3.0": version "0.3.9" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== @@ -3536,6 +3527,44 @@ treeverse "^1.0.4" walk-up-path "^1.0.0" +"@npmcli/arborist@^4.0.4": + version "4.3.1" + resolved "https://registry.npmjs.org/@npmcli/arborist/-/arborist-4.3.1.tgz#a08cddce3339882f688c1dea1651f6971e781c44" + integrity sha512-yMRgZVDpwWjplorzt9SFSaakWx6QIK248Nw4ZFgkrAy/GvJaFRaSZzE6nD7JBK5r8g/+PTxFq5Wj/sfciE7x+A== + dependencies: + "@isaacs/string-locale-compare" "^1.1.0" + "@npmcli/installed-package-contents" "^1.0.7" + "@npmcli/map-workspaces" "^2.0.0" + "@npmcli/metavuln-calculator" "^2.0.0" + "@npmcli/move-file" "^1.1.0" + "@npmcli/name-from-folder" "^1.0.1" + "@npmcli/node-gyp" "^1.0.3" + "@npmcli/package-json" "^1.0.1" + "@npmcli/run-script" "^2.0.0" + bin-links "^3.0.0" + cacache "^15.0.3" + common-ancestor-path "^1.0.1" + json-parse-even-better-errors "^2.3.1" + json-stringify-nice "^1.1.4" + mkdirp "^1.0.4" + mkdirp-infer-owner "^2.0.0" + npm-install-checks "^4.0.0" + npm-package-arg "^8.1.5" + npm-pick-manifest "^6.1.0" + npm-registry-fetch "^12.0.1" + pacote "^12.0.2" + parse-conflict-json "^2.0.1" + proc-log "^1.0.0" + promise-all-reject-late "^1.0.0" + promise-call-limit "^1.0.1" + read-package-json-fast "^2.0.2" + readdir-scoped-modules "^1.1.0" + rimraf "^3.0.2" + semver "^7.3.5" + ssri "^8.0.1" + treeverse "^1.0.4" + walk-up-path "^1.0.0" + "@npmcli/ci-detect@^1.0.0", "@npmcli/ci-detect@^1.2.0", "@npmcli/ci-detect@^1.3.0": version "1.4.0" resolved "https://registry.npmjs.org/@npmcli/ci-detect/-/ci-detect-1.4.0.tgz" @@ -3567,6 +3596,14 @@ "@gar/promisify" "^1.0.1" semver "^7.3.5" +"@npmcli/fs@^2.1.0": + version "2.1.0" + resolved "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.0.tgz#f2a21c28386e299d1a9fae8051d35ad180e33109" + integrity sha512-DmfBvNXGaetMxj9LTp8NAN9vEidXURrf5ZTslQzEAi/6GbW+4yjaLFQc6Tue5cpZ9Frlk4OBo/Snf1Bh/S7qTQ== + dependencies: + "@gar/promisify" "^1.1.3" + semver "^7.3.5" + "@npmcli/git@^2.0.7", "@npmcli/git@^2.1.0": version "2.1.0" resolved "https://registry.npmjs.org/@npmcli/git/-/git-2.1.0.tgz" @@ -3599,6 +3636,16 @@ minimatch "^3.0.4" read-package-json-fast "^2.0.1" +"@npmcli/map-workspaces@^2.0.0": + version "2.0.3" + resolved "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-2.0.3.tgz#2d3c75119ee53246e9aa75bc469a55281cd5f08f" + integrity sha512-X6suAun5QyupNM8iHkNPh0AHdRC2rb1W+MTdMvvA/2ixgmqZwlq5cGUBgmKHUHT2LgrkKJMAXbfAoTxOigpK8Q== + dependencies: + "@npmcli/name-from-folder" "^1.0.1" + glob "^8.0.1" + minimatch "^5.0.1" + read-package-json-fast "^2.0.3" + "@npmcli/metavuln-calculator@^1.1.0": version "1.1.1" resolved "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-1.1.1.tgz#2f95ff3c6d88b366dd70de1c3f304267c631b458" @@ -3608,6 +3655,16 @@ pacote "^11.1.11" semver "^7.3.2" +"@npmcli/metavuln-calculator@^2.0.0": + version "2.0.0" + resolved "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-2.0.0.tgz#70937b8b5a5cad5c588c8a7b38c4a8bd6f62c84c" + integrity sha512-VVW+JhWCKRwCTE+0xvD6p3uV4WpqocNYYtzyvenqL/u1Q3Xx6fGTJ+6UoIoii07fbuEO9U3IIyuGY0CYHDv1sg== + dependencies: + cacache "^15.0.5" + json-parse-even-better-errors "^2.3.1" + pacote "^12.0.0" + semver "^7.3.2" + "@npmcli/move-file@^1.0.1", "@npmcli/move-file@^1.1.0": version "1.1.2" resolved "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz" @@ -3616,12 +3673,20 @@ mkdirp "^1.0.4" rimraf "^3.0.2" +"@npmcli/move-file@^2.0.0": + version "2.0.0" + resolved "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.0.tgz#417f585016081a0184cef3e38902cd917a9bbd02" + integrity sha512-UR6D5f4KEGWJV6BGPH3Qb2EtgH+t+1XQ1Tt85c7qicN6cezzuHPdZwwAxqZr4JLtnQu0LZsTza/5gmNmSl8XLg== + dependencies: + mkdirp "^1.0.4" + rimraf "^3.0.2" + "@npmcli/name-from-folder@^1.0.1": version "1.0.1" resolved "https://registry.npmjs.org/@npmcli/name-from-folder/-/name-from-folder-1.0.1.tgz" integrity sha512-qq3oEfcLFwNfEYOQ8HLimRGKlD8WSeGEdtUa7hmzpR8Sa7haL1KVQrvgO6wqMjhWFFVjgtrh1gIxDz+P8sjUaA== -"@npmcli/node-gyp@^1.0.1", "@npmcli/node-gyp@^1.0.2": +"@npmcli/node-gyp@^1.0.1", "@npmcli/node-gyp@^1.0.2", "@npmcli/node-gyp@^1.0.3": version "1.0.3" resolved "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-1.0.3.tgz" integrity sha512-fnkhw+fmX65kiLqk6E3BFLXNC26rUhK90zVwe2yncPliVT/Qos3xjhTLE59Df8KnPlcwIERXKVlU1bXoUQ+liA== @@ -3650,9 +3715,19 @@ node-gyp "^7.1.0" read-package-json-fast "^2.0.1" +"@npmcli/run-script@^2.0.0": + version "2.0.0" + resolved "https://registry.npmjs.org/@npmcli/run-script/-/run-script-2.0.0.tgz#9949c0cab415b17aaac279646db4f027d6f1e743" + integrity sha512-fSan/Pu11xS/TdaTpTB0MRn9guwGU8dye+x56mEVgBEd/QsybBbYcAL0phPXi8SGWFEChkQd6M9qL4y6VOpFig== + dependencies: + "@npmcli/node-gyp" "^1.0.2" + "@npmcli/promise-spawn" "^1.3.2" + node-gyp "^8.2.0" + read-package-json-fast "^2.0.1" + "@oclif/color@^0.1.0": version "0.1.2" - resolved "https://registry.npmjs.org/@oclif/color/-/color-0.1.2.tgz" + resolved "https://registry.npmjs.org/@oclif/color/-/color-0.1.2.tgz#28b07e2850d9ce814d0b587ce3403b7ad8f7d987" integrity sha512-M9o+DOrb8l603qvgz1FogJBUGLqcMFL1aFg2ZEL0FbXJofiNTLOWIeB4faeZTLwE6dt0xH9GpCVpzksMMzGbmA== dependencies: ansi-styles "^3.2.1" @@ -3661,7 +3736,7 @@ supports-color "^5.4.0" tslib "^1" -"@oclif/color@^1.0.1": +"@oclif/color@^1.0.0", "@oclif/color@^1.0.1": version "1.0.1" resolved "https://registry.npmjs.org/@oclif/color/-/color-1.0.1.tgz" integrity sha512-qjYr+izgWdIVOroiBKqTzQgc1r5Wd9QB1J7yGM2EeelqhBARiiVLRZL45vhV4zdyTRdDkZS0EBzFwQap+nliLA== @@ -3672,9 +3747,9 @@ supports-color "^8.1.1" tslib "^2" -"@oclif/command@^1.7.0", "@oclif/command@^1.8.14", "@oclif/command@^1.8.15", "@oclif/command@^1.8.16", "@oclif/command@^1.8.6": +"@oclif/command@^1.7.0", "@oclif/command@^1.8.15", "@oclif/command@^1.8.16", "@oclif/command@^1.8.6": version "1.8.16" - resolved "https://registry.npmjs.org/@oclif/command/-/command-1.8.16.tgz" + resolved "https://registry.npmjs.org/@oclif/command/-/command-1.8.16.tgz#bea46f81b2061b47e1cda318a0b923e62ca4cc0c" integrity sha512-rmVKYEsKzurfRU0xJz+iHelbi1LGlihIWZ7Qvmb/CBz1EkhL7nOkW4SVXmG2dA5Ce0si2gr88i6q4eBOMRNJ1w== dependencies: "@oclif/config" "^1.18.2" @@ -3686,7 +3761,7 @@ "@oclif/config@1.18.2": version "1.18.2" - resolved "https://registry.npmjs.org/@oclif/config/-/config-1.18.2.tgz" + resolved "https://registry.npmjs.org/@oclif/config/-/config-1.18.2.tgz#5bfe74a9ba6a8ca3dceb314a81bd9ce2e15ebbfe" integrity sha512-cE3qfHWv8hGRCP31j7fIS7BfCflm/BNZ2HNqHexH+fDrdF2f1D5S8VmXWLC77ffv3oDvWyvE9AZeR0RfmHCCaA== dependencies: "@oclif/errors" "^1.3.3" @@ -3698,7 +3773,7 @@ "@oclif/config@^1.16.0", "@oclif/config@^1.17.1", "@oclif/config@^1.18.2": version "1.18.3" - resolved "https://registry.npmjs.org/@oclif/config/-/config-1.18.3.tgz" + resolved "https://registry.npmjs.org/@oclif/config/-/config-1.18.3.tgz#ddfc144fdab66b1658c2f1b3478fa7fbfd317e79" integrity sha512-sBpko86IrTscc39EvHUhL+c++81BVTsIZ3ETu/vG+cCdi0N6vb2DoahR67A9FI2CGnxRRHjnTfa3m6LulwNATA== dependencies: "@oclif/errors" "^1.3.5" @@ -3743,24 +3818,39 @@ widest-line "^3.1.0" wrap-ansi "^7.0.0" -"@oclif/dev-cli@^1.26.5": - version "1.26.10" - resolved "https://registry.npmjs.org/@oclif/dev-cli/-/dev-cli-1.26.10.tgz" - integrity sha512-dJ+II9rVXckzFvG+82PbfphMTnoqiHvsuAAbcHrLdZWPBnFAiDKhNYE0iHnA/knAC4VGXhogsrAJ3ERT5d5r2g== +"@oclif/core@^1.0.8", "@oclif/core@^1.1.1", "@oclif/core@^1.2.1", "@oclif/core@^1.3.0", "@oclif/core@^1.6.4", "@oclif/core@^1.7.0": + version "1.9.0" + resolved "https://registry.npmjs.org/@oclif/core/-/core-1.9.0.tgz#bb2a7820a9176f28921f449c0f577d39c15e74d0" + integrity sha512-duvlaRQf4JM+mKuwwos1DNa/Q9x6tnF3khV5RU0fy5hhETF7THlTmxioKlIvKMyQDVpySqtZXZ0OKHeCi2EWuQ== dependencies: - "@oclif/command" "^1.8.15" - "@oclif/config" "^1.18.2" - "@oclif/errors" "^1.3.5" - "@oclif/plugin-help" "3.2.18" - cli-ux "5.6.7" - debug "^4.1.1" - find-yarn-workspace-root "^2.0.0" - fs-extra "^8.1" - github-slugger "^1.2.1" - lodash "^4.17.11" - normalize-package-data "^3.0.0" - qqjs "^0.3.10" - tslib "^2.0.3" + "@oclif/linewrap" "^1.0.0" + "@oclif/screen" "^3.0.2" + ansi-escapes "^4.3.2" + ansi-styles "^4.3.0" + cardinal "^2.1.1" + chalk "^4.1.2" + clean-stack "^3.0.1" + cli-progress "^3.10.0" + debug "^4.3.4" + ejs "^3.1.6" + fs-extra "^9.1.0" + get-package-type "^0.1.0" + globby "^11.1.0" + hyperlinker "^1.0.0" + indent-string "^4.0.0" + is-wsl "^2.2.0" + js-yaml "^3.14.1" + natural-orderby "^2.0.3" + object-treeify "^1.1.33" + password-prompt "^1.1.2" + semver "^7.3.7" + string-width "^4.2.3" + strip-ansi "^6.0.1" + supports-color "^8.1.1" + supports-hyperlinks "^2.2.0" + tslib "^2.3.1" + widest-line "^3.1.0" + wrap-ansi "^7.0.0" "@oclif/errors@1.3.5", "@oclif/errors@^1.3.3", "@oclif/errors@^1.3.4", "@oclif/errors@^1.3.5": version "1.3.5" @@ -3773,9 +3863,9 @@ strip-ansi "^6.0.0" wrap-ansi "^7.0.0" -"@oclif/help@^1.0.0", "@oclif/help@^1.0.1": +"@oclif/help@^1.0.1": version "1.0.1" - resolved "https://registry.npmjs.org/@oclif/help/-/help-1.0.1.tgz" + resolved "https://registry.npmjs.org/@oclif/help/-/help-1.0.1.tgz#fd96a3dd9fb2314479e6c8584c91b63754a7dff5" integrity sha512-8rsl4RHL5+vBUAKBL6PFI3mj58hjPCp2VYyXD4TAa7IMStikFfOH2gtWmqLzIlxAED2EpD0dfYwo9JJxYsH7Aw== dependencies: "@oclif/config" "1.18.2" @@ -3793,9 +3883,9 @@ resolved "https://registry.npmjs.org/@oclif/linewrap/-/linewrap-1.0.0.tgz" integrity sha512-Ups2dShK52xXa8w6iBWLgcjPJWjais6KPJQq3gQ/88AY6BXoTX+MIGFPrWQO1KLMiQfoTpcLnUwloN4brrVUHw== -"@oclif/parser@^3.8.0", "@oclif/parser@^3.8.6": +"@oclif/parser@^3.8.0", "@oclif/parser@^3.8.6", "@oclif/parser@^3.8.7": version "3.8.7" - resolved "https://registry.npmjs.org/@oclif/parser/-/parser-3.8.7.tgz" + resolved "https://registry.npmjs.org/@oclif/parser/-/parser-3.8.7.tgz#236d48db05d0b00157d3b42d31f9dac7550d2a7c" integrity sha512-b11xBmIUK+LuuwVGJpFs4LwQN2xj2cBWj2c4z1FtiXGrJ85h9xV6q+k136Hw0tGg1jQoRXuvuBnqQ7es7vO9/Q== dependencies: "@oclif/errors" "^1.3.5" @@ -3804,32 +3894,15 @@ tslib "^2.3.1" "@oclif/plugin-autocomplete@^1.2.0": - version "1.2.0" - resolved "https://registry.npmjs.org/@oclif/plugin-autocomplete/-/plugin-autocomplete-1.2.0.tgz" - integrity sha512-Y64uhbhQLcLms2N6kvoIb40s2czOECeMzGs0ATf/3kNojY2nsYaQ0mI6PghQs/JgpVg4DnZOJivleYBr+XPn7Q== + version "1.3.0" + resolved "https://registry.npmjs.org/@oclif/plugin-autocomplete/-/plugin-autocomplete-1.3.0.tgz#ee03fe517e015cfe9e7ab4636a029a23515ceac4" + integrity sha512-N2DRWKvuSXTGuaYf4buRbRfh5yNybb1cjQmPl9viY0BIqTwZgtQdzSD6ZSOkwda51RbGcQomYcc/h8T+ZFAkMQ== dependencies: - "@oclif/core" "^1.2.0" + "@oclif/core" "^1.7.0" chalk "^4.1.0" - debug "^4.0.0" + debug "^4.3.4" fs-extra "^9.0.1" -"@oclif/plugin-help@3.2.18": - version "3.2.18" - resolved "https://registry.npmjs.org/@oclif/plugin-help/-/plugin-help-3.2.18.tgz" - integrity sha512-5n5Pkz4L0duknIvFwx2Ko9Xda3miT6RZP8bgaaK3Q/9fzVBrhi4bOM0u05/OThI6V+3NsSdxYS2o1NLcXToWDg== - dependencies: - "@oclif/command" "^1.8.14" - "@oclif/config" "1.18.2" - "@oclif/errors" "1.3.5" - "@oclif/help" "^1.0.0" - chalk "^4.1.2" - indent-string "^4.0.0" - lodash "^4.17.21" - string-width "^4.2.0" - strip-ansi "^6.0.0" - widest-line "^3.1.0" - wrap-ansi "^6.2.0" - "@oclif/plugin-help@^5", "@oclif/plugin-help@^5.1.12": version "5.1.12" resolved "https://registry.npmjs.org/@oclif/plugin-help/-/plugin-help-5.1.12.tgz" @@ -3837,6 +3910,16 @@ dependencies: "@oclif/core" "^1.3.6" +"@oclif/plugin-not-found@^2.3.1": + version "2.3.1" + resolved "https://registry.npmjs.org/@oclif/plugin-not-found/-/plugin-not-found-2.3.1.tgz#8fe1019fdeeb77be055314662bb9180808222e80" + integrity sha512-AeNBw+zSkRpePmpXO8xlL072VF2/R2yK3qsVs/JF26Yw1w77TWuRTdFR+hFotJtFCJ4QYqhNtKSjdryCO9AXsA== + dependencies: + "@oclif/color" "^1.0.0" + "@oclif/core" "^1.2.1" + fast-levenshtein "^3.0.0" + lodash "^4.17.21" + "@oclif/plugin-plugins@^2.0.1": version "2.1.0" resolved "https://registry.npmjs.org/@oclif/plugin-plugins/-/plugin-plugins-2.1.0.tgz" @@ -3856,7 +3939,7 @@ "@oclif/plugin-update@^1.5.0": version "1.5.0" - resolved "https://registry.npmjs.org/@oclif/plugin-update/-/plugin-update-1.5.0.tgz" + resolved "https://registry.npmjs.org/@oclif/plugin-update/-/plugin-update-1.5.0.tgz#a9e0092a9b7ae01e54708938e2a424903f5079ef" integrity sha512-GsWK1CMeBBO8YknThoOZulj3xE+ZgZAXW1ouNJALXcs3mbROzszLDGjXV3RM6ffbJpnWLiMIqSFNOE8d+vGcgQ== dependencies: "@oclif/color" "^0.1.0" @@ -3875,9 +3958,34 @@ semver "^7.3.5" tar-fs "^2.1.1" +"@oclif/plugin-update@^3.0.0": + version "3.0.0" + resolved "https://registry.npmjs.org/@oclif/plugin-update/-/plugin-update-3.0.0.tgz#dc51f1a42d7b80825ebc1ee5f14310a0545c6b8f" + integrity sha512-uWYTPxea4cDoOgDYxPhOisJCcoJHbbXFSM69iB9VkenAMerUjjq1VrlwWAIzLc45ciWk13uef4nBLy2S0ADtOg== + dependencies: + "@oclif/color" "^1.0.0" + "@oclif/core" "^1.3.0" + cross-spawn "^7.0.3" + debug "^4.3.1" + filesize "^6.1.0" + fs-extra "^9.0.1" + http-call "^5.3.0" + inquirer "^8.2.0" + lodash.throttle "^4.1.1" + log-chopper "^1.0.2" + semver "^7.3.5" + tar-fs "^2.1.1" + +"@oclif/plugin-version@^1.0.4": + version "1.0.4" + resolved "https://registry.npmjs.org/@oclif/plugin-version/-/plugin-version-1.0.4.tgz#5fe1bee4438e7950aac3c8fdeb56939726e90b17" + integrity sha512-V9TZQKV4Ql7q0YnLyiebu9RTVvafkgGKM17eqDWyxHF0+qhsze661zcobJBXXRc51ObXUtHUFXamtHoxImO7Tg== + dependencies: + "@oclif/core" "^1.1.1" + "@oclif/plugin-warn-if-update-available@^1.7.3": version "1.7.3" - resolved "https://registry.npmjs.org/@oclif/plugin-warn-if-update-available/-/plugin-warn-if-update-available-1.7.3.tgz" + resolved "https://registry.npmjs.org/@oclif/plugin-warn-if-update-available/-/plugin-warn-if-update-available-1.7.3.tgz#efe6676655fabbed2e90cc9e646e9da4c99bc8ae" integrity sha512-q8q0NIneVCwIAJzglUMsl3EbXR/H5aPDk6g+qs7uF0tToxe07SWSONoNaKPzViwRWvYChMPjL77/rXyW1HVn4A== dependencies: "@oclif/command" "^1.8.6" @@ -3890,9 +3998,22 @@ lodash "^4.17.21" semver "^7.3.2" +"@oclif/plugin-warn-if-update-available@^2.0.4": + version "2.0.4" + resolved "https://registry.npmjs.org/@oclif/plugin-warn-if-update-available/-/plugin-warn-if-update-available-2.0.4.tgz#3d509ca2394cccf65e6622be812d7be4065a60aa" + integrity sha512-9dprC1CWPjesg0Vf/rDSQH2tzJXhP1ow84cb2My1kj6e6ESulPKpctiCFSZ1WaCQFfq+crKhzlNoP/vRaXNUAg== + dependencies: + "@oclif/core" "^1.0.8" + chalk "^4.1.0" + debug "^4.1.0" + fs-extra "^9.0.1" + http-call "^5.2.2" + lodash "^4.17.21" + semver "^7.3.2" + "@oclif/screen@^1.0.4": version "1.0.4" - resolved "https://registry.npmjs.org/@oclif/screen/-/screen-1.0.4.tgz" + resolved "https://registry.npmjs.org/@oclif/screen/-/screen-1.0.4.tgz#b740f68609dfae8aa71c3a6cab15d816407ba493" integrity sha512-60CHpq+eqnTxLZQ4PGHYNwUX572hgpMHGPtTWMjdTMsAvlm69lZV/4ly6O3sAYkomo4NggGcomrDpBe34rxUqw== "@oclif/screen@^3.0.2": @@ -3900,7 +4021,7 @@ resolved "https://registry.npmjs.org/@oclif/screen/-/screen-3.0.2.tgz" integrity sha512-S/SF/XYJeevwIgHFmVDAFRUvM3m+OjhvCAYMk78ZJQCYCQ5wS7j+LTt1ZEv2jpEEGg2tx/F6TYYWxddNAYHrFQ== -"@oclif/test@^2.0.3": +"@oclif/test@^2": version "2.1.0" resolved "https://registry.npmjs.org/@oclif/test/-/test-2.1.0.tgz" integrity sha512-o+JTv3k28aMUxywJUlJY1/DORLqumoZFRII492phOmtXM16rD6Luy3z1qinT4BvEtPj2BzOPd2whr/VdYszaYw== @@ -3997,7 +4118,7 @@ node-fetch "^2.6.7" universal-user-agent "^6.0.0" -"@octokit/rest@^18.1.0": +"@octokit/rest@^18.0.6", "@octokit/rest@^18.1.0": version "18.12.0" resolved "https://registry.npmjs.org/@octokit/rest/-/rest-18.12.0.tgz" integrity sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q== @@ -4376,6 +4497,16 @@ buffer-layout "^1.2.0" dotenv "10.0.0" +"@solana/spl-token@^0.2.0": + version "0.2.0" + resolved "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.2.0.tgz#329bb6babb5de0f9c40035ddb1657f01a8347acd" + integrity sha512-RWcn31OXtdqIxmkzQfB2R+WpsJOVS6rKuvpxJFjvik2LyODd+WN58ZP3Rpjpro03fscGAkzlFuP3r42doRJgyQ== + dependencies: + "@solana/buffer-layout" "^4.0.0" + "@solana/buffer-layout-utils" "^0.2.0" + "@solana/web3.js" "^1.32.0" + start-server-and-test "^1.14.0" + "@solana/web3.js@1.33.0": version "1.33.0" resolved "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.33.0.tgz" @@ -4439,6 +4570,28 @@ superstruct "^0.14.2" tweetnacl "^1.0.0" +"@solana/web3.js@^1.33.0", "@solana/web3.js@^1.37.1": + version "1.43.6" + resolved "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.43.6.tgz#f18eb7f6fc86562aeaa527a25560a25405318dd2" + integrity sha512-F1Q7EOnLi5X+Ap5bAEi5PTwwXPZR+GTfIyOuWpWJfgm3GoawdP/x5lxJolDzzV5S99bNEU/rSTdxcW9EFzIiEw== + dependencies: + "@babel/runtime" "^7.12.5" + "@ethersproject/sha2" "^5.5.0" + "@solana/buffer-layout" "^4.0.0" + bigint-buffer "^1.1.5" + bn.js "^5.0.0" + borsh "^0.7.0" + bs58 "^4.0.1" + buffer "6.0.1" + fast-stable-stringify "^1.0.0" + jayson "^3.4.4" + js-sha3 "^0.8.0" + node-fetch "2" + rpc-websockets "^7.4.2" + secp256k1 "^4.0.2" + superstruct "^0.14.2" + tweetnacl "^1.0.0" + "@solana/web3.js@^1.42.0": version "1.42.0" resolved "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.42.0.tgz#296e4bbab1fbfc198b3e9c3d94016c3876eb6a2c" @@ -4461,6 +4614,28 @@ superstruct "^0.14.2" tweetnacl "^1.0.0" +"@solana/web3.js@^1.43.5": + version "1.43.5" + resolved "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.43.5.tgz#ab12bb6ab3fff0a08e8c7453b4fc4cda9f66df11" + integrity sha512-/PF4Fp+2jvCt9R3hYrf+tVUZXpPXZaHcwpaY/ytgdcswy8YiYf2snug52BJTCTlxwiXJipS4JpIo7rJJO0nN6w== + dependencies: + "@babel/runtime" "^7.12.5" + "@ethersproject/sha2" "^5.5.0" + "@solana/buffer-layout" "^4.0.0" + bigint-buffer "^1.1.5" + bn.js "^5.0.0" + borsh "^0.7.0" + bs58 "^4.0.1" + buffer "6.0.1" + fast-stable-stringify "^1.0.0" + jayson "^3.4.4" + js-sha3 "^0.8.0" + node-fetch "2" + rpc-websockets "^7.4.2" + secp256k1 "^4.0.2" + superstruct "^0.14.2" + tweetnacl "^1.0.0" + "@svgr/babel-plugin-add-jsx-attribute@^5.4.0": version "5.4.0" resolved "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-5.4.0.tgz" @@ -4680,6 +4855,33 @@ typedoc "^0.22.15" ws "^7.4.6" +"@switchboard-xyz/switchboardv2-cli@^0.1.25": + version "0.1.28" + resolved "https://registry.npmjs.org/@switchboard-xyz/switchboardv2-cli/-/switchboardv2-cli-0.1.28.tgz#a63388225a874e252a9868b6b3b291d1954b9327" + integrity sha512-Bi9vX08CJEfEM/TUFXY7rUUhP4DoALlqmiG6LHNHX7HsbaDq5t1cx1wVhEhK4FT9fnFjBqhu7FIvyBiiT+Q7Zg== + dependencies: + "@google-cloud/secret-manager" "^3.10.1" + "@oclif/command" "^1.8.16" + "@oclif/config" "^1.18.2" + "@oclif/parser" "^3.8.6" + "@oclif/plugin-autocomplete" "^1.2.0" + "@oclif/plugin-help" "^5.1.12" + "@oclif/plugin-update" "^1.5.0" + "@oclif/plugin-warn-if-update-available" "^1.7.3" + "@project-serum/anchor" "^0.24.2" + "@solana/spl-token" "^0.1.8" + "@solana/web3.js" "^1.42.0" + "@switchboard-xyz/sbv2-utils" "^0.1.19" + "@switchboard-xyz/switchboard-v2" "^0.0.108" + assert "^2.0.0" + big.js "^6.1.1" + bs58 "^5.0.0" + chalk "^4.1.2" + decimal.js "^10.3.1" + node-fetch "^2.6.6" + readline-sync "^1.4.10" + winston "^3.3.3" + "@szmarczak/http-timer@^1.1.2": version "1.1.2" resolved "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz" @@ -4692,6 +4894,11 @@ resolved "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== +"@tootallnate/once@2": + version "2.0.0" + resolved "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" + integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== + "@trysound/sax@0.2.0": version "0.2.0" resolved "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz" @@ -4766,7 +4973,7 @@ dependencies: "@types/node" "*" -"@types/chai@*", "@types/chai@^4.3.1": +"@types/chai@*", "@types/chai@^4", "@types/chai@^4.3.0", "@types/chai@^4.3.1": version "4.3.1" resolved "https://registry.npmjs.org/@types/chai/-/chai-4.3.1.tgz" integrity sha512-/zPMqDkzSZ8t3VtxOa4KPq7uzzW978M9Tvh+j7GHKuo6k6GTLxPJ4J5gE5cjfJ26pnXst0N5Hax8Sr0T2Mi9zQ== @@ -4807,6 +5014,11 @@ resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz" integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== +"@types/expect@^1.20.4": + version "1.20.4" + resolved "https://registry.npmjs.org/@types/expect/-/expect-1.20.4.tgz#8288e51737bf7e3ab5d7c77bfa695883745264e5" + integrity sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg== + "@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18", "@types/express-serve-static-core@^4.17.9": version "4.17.28" resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz" @@ -4878,7 +5090,12 @@ resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.182.tgz" integrity sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q== -"@types/long@^4.0.0", "@types/long@^4.0.1": +"@types/long@^4.0.0": + version "4.0.2" + resolved "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" + integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== + +"@types/long@^4.0.1": version "4.0.1" resolved "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz" integrity sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w== @@ -4905,30 +5122,35 @@ resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== -"@types/mocha@^5.2.7": - version "5.2.7" - resolved "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz" - integrity sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ== - "@types/mocha@^9.0.0", "@types/mocha@^9.1.0": version "9.1.1" resolved "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== -"@types/node@*", "@types/node@>=12.12.47", "@types/node@>=13.7.0", "@types/node@^17.0.23", "@types/node@^17.0.25", "@types/node@^17.0.5": +"@types/node@*", "@types/node@>=13.7.0", "@types/node@^17.0.23", "@types/node@^17.0.25", "@types/node@^17.0.5": version "17.0.27" resolved "https://registry.npmjs.org/@types/node/-/node-17.0.27.tgz" integrity sha512-4/Ke7bbWOasuT3kceBZFGakP1dYN2XFd8v2l9bqF2LNWrmeU07JLpp56aEeG6+Q3olqO5TvXpW0yaiYnZJ5CXg== +"@types/node@>=12.12.47": + version "17.0.41" + resolved "https://registry.npmjs.org/@types/node/-/node-17.0.41.tgz#1607b2fd3da014ae5d4d1b31bc792a39348dfb9b" + integrity sha512-xA6drNNeqb5YyV5fO3OAEsnXLfO7uF0whiOfPTz5AeDo8KeZFmODKnvwPymMNO8qE/an8pVY/O50tig2SQCrGw== + "@types/node@^12.12.54": version "12.20.49" resolved "https://registry.npmjs.org/@types/node/-/node-12.20.49.tgz" integrity sha512-5e6QNb9bkeh4Hni4ktLqUZuUqnGTX/kou2aZkXyxtuYaHXgBm+In1SHR9V+7kDzWzjB08KC2uqt2doDi7cuAAA== -"@types/node@^17.0.31": - version "17.0.31" - resolved "https://registry.npmjs.org/@types/node/-/node-17.0.31.tgz#a5bb84ecfa27eec5e1c802c6bbf8139bdb163a5d" - integrity sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q== +"@types/node@^15.6.1": + version "15.14.9" + resolved "https://registry.npmjs.org/@types/node/-/node-15.14.9.tgz#bc43c990c3c9be7281868bbc7b8fdd6e2b57adfa" + integrity sha512-qjd88DrCxupx/kJD5yQgZdcYKZKSIGBVDIBE1/LTGcNm3d2Np/jxojkdePDdfnBHJc5W7vSMpbJ1aB7p/Py69A== + +"@types/node@^16.9.4": + version "16.11.38" + resolved "https://registry.npmjs.org/@types/node/-/node-16.11.38.tgz#be0edd097b23eace6c471c525a74b3f98803017f" + integrity sha512-hjO/0K140An3GWDw2HJfq7gko3wWeznbjXgg+rzPdVzhe198hp4x2i1dgveAOEiFKd8sOilAxzoSJiVv5P/CUg== "@types/node@^17.0.35": version "17.0.35" @@ -5026,6 +5248,11 @@ "@types/scheduler" "*" csstype "^3.0.2" +"@types/readline-sync@^1.4.4": + version "1.4.4" + resolved "https://registry.npmjs.org/@types/readline-sync/-/readline-sync-1.4.4.tgz#8568292efe4ddd94d0ccee958b29cc3f4e0ea140" + integrity sha512-cFjVIoiamX7U6zkO2VPvXyTxbFDdiRo902IarJuPVxBhpDnXhwSaVE86ip+SCuyWBbEioKCkT4C88RNTxBM1Dw== + "@types/retry@*", "@types/retry@^0.12.0", "@types/retry@^0.12.1": version "0.12.1" resolved "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz" @@ -5045,7 +5272,7 @@ "@types/semver@^7.3.4": version "7.3.9" - resolved "https://registry.npmjs.org/@types/semver/-/semver-7.3.9.tgz" + resolved "https://registry.npmjs.org/@types/semver/-/semver-7.3.9.tgz#152c6c20a7688c30b967ec1841d31ace569863fc" integrity sha512-L/TMpyURfBkf+o/526Zb6kd/tchUP3iBDEPjqjb+U2MAJhVRxxrmr2fwpe08E7QsV7YLcpq0tUaQ9O9x97ZIxQ== "@types/serve-index@^1.9.1": @@ -5087,6 +5314,14 @@ resolved "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz" integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ== +"@types/vinyl@^2.0.4": + version "2.0.6" + resolved "https://registry.npmjs.org/@types/vinyl/-/vinyl-2.0.6.tgz#b2d134603557a7c3d2b5d3dc23863ea2b5eb29b0" + integrity sha512-ayJ0iOCDNHnKpKTgBG6Q6JOnHTj9zFta+3j2b8Ejza0e4cvRyMn0ZoLEmbPrTHe5YYRlDYPvPWVdV4cTaRyH7g== + dependencies: + "@types/expect" "^1.20.4" + "@types/node" "*" + "@types/ws@^7.4.4": version "7.4.7" resolved "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz" @@ -5101,7 +5336,7 @@ dependencies: "@types/node" "*" -"@typescript-eslint/eslint-plugin@^4.31.2": +"@typescript-eslint/eslint-plugin@^4.31.2", "@typescript-eslint/eslint-plugin@^4.33.0": version "4.33.0" resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz" integrity sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg== @@ -5142,7 +5377,7 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/parser@^4.31.2": +"@typescript-eslint/parser@^4.31.2", "@typescript-eslint/parser@^4.33.0": version "4.33.0" resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.33.0.tgz" integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA== @@ -5413,7 +5648,7 @@ abbrev@1, abbrev@~1.1.1: abort-controller@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz" + resolved "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== dependencies: event-target-shim "^5.0.0" @@ -5468,7 +5703,7 @@ agent-base@6, agent-base@^6.0.2: dependencies: debug "4" -agentkeepalive@^4.1.3: +agentkeepalive@^4.1.3, agentkeepalive@^4.2.1: version "4.2.1" resolved "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz" integrity sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA== @@ -5608,7 +5843,7 @@ ansi-regex@^3.0.0: ansi-regex@^4.1.0: version "4.1.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed" integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== ansi-regex@^5.0.1: @@ -5621,7 +5856,12 @@ ansi-regex@^6.0.1: resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz" integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== -ansi-styles@^3.2.1: +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA== + +ansi-styles@^3.0.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== @@ -5663,13 +5903,6 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -append-transform@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz" - integrity sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg== - dependencies: - default-require-extensions "^3.0.0" - aproba@^1.0.3: version "1.2.0" resolved "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz" @@ -5680,7 +5913,7 @@ aproba@^1.0.3: resolved "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz" integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== -archy@^1.0.0, archy@~1.0.0: +archy@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz" integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= @@ -5693,6 +5926,14 @@ are-we-there-yet@^2.0.0: delegates "^1.0.0" readable-stream "^3.6.0" +are-we-there-yet@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.0.tgz#ba20bd6b553e31d62fc8c31bd23d22b95734390d" + integrity sha512-0GWpv50YSOcLXaN6/FAKY3vfRbllXWV2xvfA/oKJF8pzFhWXPV+yjhJXDBbjscDYowv7Yw1A3uigpzn5iEGTyw== + dependencies: + delegates "^1.0.0" + readable-stream "^3.6.0" + are-we-there-yet@~1.1.2: version "1.1.7" resolved "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz" @@ -5779,7 +6020,7 @@ array.prototype.flat@^1.2.5: es-abstract "^1.19.2" es-shim-unscopables "^1.0.0" -arrify@^1.0.1: +arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz" integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= @@ -5870,6 +6111,21 @@ available-typed-arrays@^1.0.5: resolved "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== +aws-sdk@^2.1069.0: + version "2.1149.0" + resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1149.0.tgz#c7a4e10ca898341bd736ca9ace6cbf19387bc274" + integrity sha512-wNb3YMLhXoK4UkjXhGAWMjRdrXT/Zhv3KdgPmd7VWlr3nXMViLwVJEEYdVmALUdkzCefdzY1JUTRLMgCxtn9EA== + dependencies: + buffer "4.9.2" + events "1.1.1" + ieee754 "1.1.13" + jmespath "0.16.0" + querystring "0.2.0" + sax "1.2.1" + url "0.10.3" + uuid "8.0.0" + xml2js "0.4.19" + aws-sdk@^2.1116.0: version "2.1125.0" resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1125.0.tgz" @@ -5895,6 +6151,13 @@ aws4@^1.8.0: resolved "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== +axios@^0.21.1: + version "0.21.4" + resolved "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== + dependencies: + follow-redirects "^1.14.0" + axios@^0.25.0: version "0.25.0" resolved "https://registry.npmjs.org/axios/-/axios-0.25.0.tgz" @@ -6040,6 +6303,11 @@ big.js@^6.1.1: resolved "https://registry.npmjs.org/big.js/-/big.js-6.1.1.tgz" integrity sha512-1vObw81a8ylZO5ePrtMay0n018TcftpTA5HFKDaSuiUDBo8biRBtjIobw60OpwuvrGk+FsxKamqN4cnmj/eXdg== +big.js@^6.2.0: + version "6.2.0" + resolved "https://registry.npmjs.org/big.js/-/big.js-6.2.0.tgz#39c60822aecb0f34a1d79a90fe9908a0ddf45e1d" + integrity sha512-paIKvJiAaOYdLt6MfnvxkDo64lTOV257XYJyX3oJnJQocIclUn+48k6ZerH/c5FxWE6DGJu1TKDYis7tqHg9kg== + bigint-buffer@^1.1.5: version "1.1.5" resolved "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz" @@ -6064,11 +6332,28 @@ bin-links@^2.2.1: rimraf "^3.0.0" write-file-atomic "^3.0.3" +bin-links@^3.0.0: + version "3.0.1" + resolved "https://registry.npmjs.org/bin-links/-/bin-links-3.0.1.tgz#cc70ffb481988b22c527d3e6e454787876987a49" + integrity sha512-9vx+ypzVhASvHTS6K+YSGf7nwQdANoz7v6MTC0aCtYnOEZ87YvMf81aY737EZnGZdpbRM3sfWjO9oWkKmuIvyQ== + dependencies: + cmd-shim "^5.0.0" + mkdirp-infer-owner "^2.0.0" + npm-normalize-package-bin "^1.0.0" + read-cmd-shim "^3.0.0" + rimraf "^3.0.0" + write-file-atomic "^4.0.0" + binary-extensions@^2.0.0, binary-extensions@^2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== +binaryextensions@^4.15.0, binaryextensions@^4.16.0: + version "4.18.0" + resolved "https://registry.npmjs.org/binaryextensions/-/binaryextensions-4.18.0.tgz#22aeada2d14de062c60e8ca59a504a5636a76ceb" + integrity sha512-PQu3Kyv9dM4FnwB7XGj1+HucW+ShvJzJqjuw1JkKVs1mWdwOKVcRjOi+pV9X52A0tNvrPCsPkbFFQb+wE1EAXw== + bindings@^1.3.0: version "1.5.0" resolved "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz" @@ -6076,7 +6361,7 @@ bindings@^1.3.0: dependencies: file-uri-to-path "1.0.0" -bl@^4.0.3: +bl@^4.0.3, bl@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz" integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== @@ -6085,7 +6370,7 @@ bl@^4.0.3: inherits "^2.0.4" readable-stream "^3.4.0" -bluebird@^3.7.1: +bluebird@3.7.2, bluebird@^3.7.1: version "3.7.2" resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== @@ -6249,10 +6534,10 @@ bs58@^5.0.0: buffer-equal-constant-time@1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz" - integrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= + resolved "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" + integrity sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA== -buffer-from@^1.0.0: +buffer-from@^1.0.0, buffer-from@^1.1.0: version "1.1.2" resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== @@ -6356,6 +6641,30 @@ cacache@^15.0.3, cacache@^15.0.5, cacache@^15.2.0, cacache@^15.3.0: tar "^6.0.2" unique-filename "^1.1.1" +cacache@^16.1.0: + version "16.1.1" + resolved "https://registry.npmjs.org/cacache/-/cacache-16.1.1.tgz#4e79fb91d3efffe0630d5ad32db55cc1b870669c" + integrity sha512-VDKN+LHyCQXaaYZ7rA/qtkURU+/yYhviUdvqEv2LT6QPZU8jpyzEkEVAcKlKLt5dJ5BRp11ym8lo3NKLluEPLg== + dependencies: + "@npmcli/fs" "^2.1.0" + "@npmcli/move-file" "^2.0.0" + chownr "^2.0.0" + fs-minipass "^2.1.0" + glob "^8.0.1" + infer-owner "^1.0.4" + lru-cache "^7.7.1" + minipass "^3.1.6" + minipass-collect "^1.0.2" + minipass-flush "^1.0.5" + minipass-pipeline "^1.2.4" + mkdirp "^1.0.4" + p-map "^4.0.0" + promise-inflight "^1.0.1" + rimraf "^3.0.2" + ssri "^9.0.0" + tar "^6.1.11" + unique-filename "^1.1.1" + cacheable-request@^6.0.0: version "6.1.0" resolved "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz" @@ -6369,16 +6678,6 @@ cacheable-request@^6.0.0: normalize-url "^4.1.0" responselike "^1.0.2" -caching-transform@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz" - integrity sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA== - dependencies: - hasha "^5.0.0" - make-dir "^3.0.0" - package-hash "^4.0.0" - write-file-atomic "^3.0.0" - call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz" @@ -6414,7 +6713,7 @@ camelcase-keys@^6.2.2: map-obj "^4.0.0" quick-lru "^4.0.1" -camelcase@^5.0.0, camelcase@^5.3.1: +camelcase@^5.3.1: version "5.3.1" resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== @@ -6462,7 +6761,7 @@ ccount@^1.0.0, ccount@^1.0.3: resolved "https://registry.npmjs.org/ccount/-/ccount-1.1.0.tgz" integrity sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg== -chai@^4.3.6: +chai@^4, chai@^4.3.6: version "4.3.6" resolved "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz" integrity sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q== @@ -6475,7 +6774,7 @@ chai@^4.3.6: pathval "^1.1.1" type-detect "^4.0.5" -chalk@4, chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.2: +chalk@4, chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: version "4.1.2" resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -6483,6 +6782,17 @@ chalk@4, chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^1.0.0: + version "1.1.3" + resolved "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A== + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + chalk@^2.0.0, chalk@^2.4.1: version "2.4.2" resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" @@ -6494,7 +6804,7 @@ chalk@^2.0.0, chalk@^2.4.1: chalk@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz" + resolved "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== dependencies: ansi-styles "^4.1.0" @@ -6530,6 +6840,11 @@ check-error@^1.0.2: resolved "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz" integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= +check-more-types@2.24.0: + version "2.24.0" + resolved "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" + integrity sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA== + cheerio-select@^1.5.0: version "1.6.0" resolved "https://registry.npmjs.org/cheerio-select/-/cheerio-select-1.6.0.tgz" @@ -6576,6 +6891,11 @@ cheerio@^1.0.0-rc.10: parse5-htmlparser2-tree-adapter "^6.0.1" tslib "^2.2.0" +child_process@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/child_process/-/child_process-1.0.2.tgz#b1f7e7fc73d25e7fd1d455adc94e143830182b5a" + integrity sha512-Wmza/JzL0SiWz7kl6MhIKT5ceIlnFPJX+lwUGj7Clhy5MMldsSoJR0+uvRzOS5Kv45Mq7t1PoE8TsOA9bzvb6g== + chokidar@3.5.3, chokidar@^3.4.2, chokidar@^3.5.3: version "3.5.3" resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" @@ -6657,6 +6977,11 @@ clear-module@^4.1.2: parent-module "^2.0.0" resolve-from "^5.0.0" +cli-boxes@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" + integrity sha512-3Fo5wu8Ytle8q9iCzS4D2MWVL2X7JVWRiS1BnXbTFDhS9c/REkM9vd1AmabsoZoY5/dGi5TT9iKL8Kb6DeBRQg== + cli-boxes@^2.2.1: version "2.2.1" resolved "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz" @@ -6682,13 +7007,25 @@ cli-cursor@^3.1.0: dependencies: restore-cursor "^3.1.0" -cli-progress@^3.10.0, cli-progress@^3.4.0: +cli-progress@^3.10.0: version "3.10.0" resolved "https://registry.npmjs.org/cli-progress/-/cli-progress-3.10.0.tgz" integrity sha512-kLORQrhYCAtUPLZxqsAt2YJGOvRdt34+O6jl5cQGb7iF3dM55FQZlTR+rQyIK9JUcO9bBMwZsTlND+3dmFU2Cw== dependencies: string-width "^4.2.0" +cli-progress@^3.4.0: + version "3.11.1" + resolved "https://registry.npmjs.org/cli-progress/-/cli-progress-3.11.1.tgz#02afb11be9a123f2a302931beb087eafe3a0d971" + integrity sha512-TTMA2LHrYaZeNMcgZGO10oYqj9hvd03pltNtVbu4ddeyDTHlYV7gWxsFiuvaQlgwMBFCv1TukcjiODWFlb16tQ== + dependencies: + string-width "^4.2.3" + +cli-spinners@^2.5.0: + version "2.6.1" + resolved "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz#adc954ebe281c37a6319bfa401e6dd2488ffb70d" + integrity sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g== + cli-table3@^0.6.0, cli-table3@^0.6.1: version "0.6.2" resolved "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.2.tgz" @@ -6698,9 +7035,16 @@ cli-table3@^0.6.0, cli-table3@^0.6.1: optionalDependencies: "@colors/colors" "1.5.0" -cli-ux@5.6.7, cli-ux@^5.5.1: +cli-table@^0.3.1: + version "0.3.11" + resolved "https://registry.npmjs.org/cli-table/-/cli-table-0.3.11.tgz#ac69cdecbe81dccdba4889b9a18b7da312a9d3ee" + integrity sha512-IqLQi4lO0nIB4tcdTpN4LCB9FI3uqrJZK7RC515EnhZ6qBaglkIgICb1wjeAqpdoOabm1+SuQtkXIPdYC93jhQ== + dependencies: + colors "1.0.3" + +cli-ux@^5.5.1: version "5.6.7" - resolved "https://registry.npmjs.org/cli-ux/-/cli-ux-5.6.7.tgz" + resolved "https://registry.npmjs.org/cli-ux/-/cli-ux-5.6.7.tgz#32ef9e6cb2b457be834280cc799028a11c8235a8" integrity sha512-dsKAurMNyFDnO6X1TiiRNiVbL90XReLKcvIq4H777NMqXGBxBws23ag8ubCJE97vVZEgWG2eSUhsyLf63Jv8+g== dependencies: "@oclif/command" "^1.8.15" @@ -6735,15 +7079,6 @@ cli-width@^3.0.0: resolved "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz" integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== -cliui@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz" - integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^6.2.0" - cliui@^7.0.2: version "7.0.4" resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz" @@ -6753,6 +7088,11 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" +clone-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" + integrity sha512-KLLTJWrvwIP+OPfMn0x2PheDEP20RPUcGXj/ERegTgdmPEZylALQldygiqrPPu8P45uNuPs7ckmReLY6v/iA5g== + clone-deep@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz" @@ -6769,11 +7109,30 @@ clone-response@^1.0.2: dependencies: mimic-response "^1.0.0" +clone-stats@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" + integrity sha512-au6ydSpg6nsrigcZ4m8Bc9hxjeW+GJ8xh5G3BJCMt4WXe1H10UNaVOamqQTmrx1kjVuxAHIQSNU6hY4Nsn9/ag== + clone@^1.0.2: version "1.0.4" resolved "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz" integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= +clone@^2.1.1: + version "2.1.2" + resolved "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" + integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w== + +cloneable-readable@^1.0.0: + version "1.1.3" + resolved "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz#120a00cb053bfb63a222e709f9683ea2e11d8cec" + integrity sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ== + dependencies: + inherits "^2.0.1" + process-nextick-args "^2.0.0" + readable-stream "^2.3.5" + clsx@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz" @@ -6786,6 +7145,13 @@ cmd-shim@^4.0.1, cmd-shim@^4.1.0: dependencies: mkdirp-infer-owner "^2.0.0" +cmd-shim@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/cmd-shim/-/cmd-shim-5.0.0.tgz#8d0aaa1a6b0708630694c4dbde070ed94c707724" + integrity sha512-qkCtZ59BidfEwHltnJwkyVZn+XQojdAySM1D1gSeh11Z4pW1Kpolkyo53L5noc0nrxmIvyFwTmJRo4xs7FFLPw== + dependencies: + mkdirp-infer-owner "^2.0.0" + coa@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz" @@ -6838,20 +7204,20 @@ color-name@^1.0.0, color-name@~1.1.4: color-string@^1.6.0: version "1.9.1" - resolved "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz" + resolved "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz#4467f9146f036f855b764dfb5bf8582bf342c7a4" integrity sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg== dependencies: color-name "^1.0.0" simple-swizzle "^0.2.2" -color-support@^1.1.2: +color-support@^1.1.2, color-support@^1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== color@^3.1.3: version "3.2.1" - resolved "https://registry.npmjs.org/color/-/color-3.2.1.tgz" + resolved "https://registry.npmjs.org/color/-/color-3.2.1.tgz#3544dc198caf4490c3ecc9a790b54fe9ff45e164" integrity sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA== dependencies: color-convert "^1.9.3" @@ -6867,9 +7233,14 @@ colorette@^2.0.10: resolved "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz" integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g== +colors@1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" + integrity sha512-pFGrxThWcWQ2MsAz6RtgeWe4NK2kUE1WfsrvvlctdII745EW9I0yflqhe7++M5LEc7bV2c/9/5zc8sFcpL0Drw== + colorspace@1.1.x: version "1.1.4" - resolved "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz" + resolved "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz#8d442d1186152f60453bf8070cd66eb364e59243" integrity sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w== dependencies: color "^3.1.3" @@ -6908,6 +7279,11 @@ comma-separated-tokens@^1.0.0: resolved "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz" integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw== +commander@7.1.0: + version "7.1.0" + resolved "https://registry.npmjs.org/commander/-/commander-7.1.0.tgz#f2eaecf131f10e36e07d894698226e36ae0eb5ff" + integrity sha512-pRxBna3MJe6HKnBGsDyMv8ETbptw3axEdYHoqNh7gu5oDcew8fs0xnivZGm06Ogk8zGAJ9VX+OPEr2GXEQK4dg== + commander@^2.20.0, commander@^2.20.3: version "2.20.3" resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" @@ -6997,6 +7373,21 @@ concat-stream@^2.0.0: readable-stream "^3.0.2" typedarray "^0.0.6" +concurrently@^7.0.0: + version "7.2.1" + resolved "https://registry.npmjs.org/concurrently/-/concurrently-7.2.1.tgz#88b144060443403060aad46f837dd17451f7e55e" + integrity sha512-7cab/QyqipqghrVr9qZmoWbidu0nHsmxrpNqQ7r/67vfl1DWJElexehQnTH1p+87tDkihaAjM79xTZyBQh7HLw== + dependencies: + chalk "^4.1.0" + date-fns "^2.16.1" + lodash "^4.17.21" + rxjs "^6.6.3" + shell-quote "^1.7.3" + spawn-command "^0.0.2-1" + supports-color "^8.1.0" + tree-kill "^1.2.2" + yargs "^17.3.1" + config-chain@^1.1.12: version "1.1.13" resolved "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz" @@ -7587,11 +7978,21 @@ data-uri-to-buffer@^4.0.0: resolved "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz" integrity sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA== +date-fns@^2.16.1: + version "2.28.0" + resolved "https://registry.npmjs.org/date-fns/-/date-fns-2.28.0.tgz#9570d656f5fc13143e50c975a3b6bbeb46cd08b2" + integrity sha512-8d35hViGYx/QH0icHYCeLmsLmMUheMmTyV9Fcm6gvNwdw31yXXH+O85sOBJ+OLnLQMKZowvpKb6FgMIQjcpvQw== + dateformat@^3.0.0: version "3.0.3" resolved "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== +dateformat@^4.5.0: + version "4.6.3" + resolved "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz#556fa6497e5217fedb78821424f8a1c22fa3f4b5" + integrity sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA== + debug@2.6.9, debug@^2.6.0, debug@^2.6.9: version "2.6.9" resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" @@ -7599,13 +8000,20 @@ debug@2.6.9, debug@^2.6.0, debug@^2.6.9: dependencies: ms "2.0.0" -debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3: +debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: version "4.3.4" resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" +debug@4.3.2: + version "4.3.2" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== + dependencies: + ms "2.1.2" + debug@4.3.3: version "4.3.3" resolved "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz" @@ -7633,7 +8041,7 @@ decamelize-keys@^1.1.0: decamelize "^1.1.0" map-obj "^1.0.0" -decamelize@^1.1.0, decamelize@^1.2.0: +decamelize@^1.1.0: version "1.2.0" resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= @@ -7699,13 +8107,6 @@ default-gateway@^6.0.3: dependencies: execa "^5.0.0" -default-require-extensions@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz" - integrity sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg== - dependencies: - strip-bom "^4.0.0" - defaults@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz" @@ -7831,6 +8232,11 @@ diff@5.0.0, diff@^5.0.0: resolved "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz" integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== +diff@^3.1.0: + version "3.5.0" + resolved "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + diff@^4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" @@ -7992,14 +8398,14 @@ duplexer3@^0.1.4: resolved "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz" integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= -duplexer@^0.1.1, duplexer@^0.1.2: +duplexer@^0.1.1, duplexer@^0.1.2, duplexer@~0.1.1: version "0.1.2" resolved "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== duplexify@^4.0.0: version "4.1.2" - resolved "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz" + resolved "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz#18b4f8d28289132fa0b9573c898d9f903f81c7b0" integrity sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw== dependencies: end-of-stream "^1.4.1" @@ -8022,7 +8428,7 @@ ecc-jsbn@~0.1.1: ecdsa-sig-formatter@1.0.11, ecdsa-sig-formatter@^1.0.11: version "1.0.11" - resolved "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz" + resolved "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" integrity sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ== dependencies: safe-buffer "^5.0.1" @@ -8079,7 +8485,7 @@ emoticon@^3.2.0: enabled@2.0.x: version "2.0.0" - resolved "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz" + resolved "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz#f9dd92ec2d6f4bbc0d5d1e64e21d61cd4665e7c2" integrity sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ== encodeurl@~1.0.2: @@ -8087,7 +8493,7 @@ encodeurl@~1.0.2: resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz" integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= -encoding@^0.1.12: +encoding@^0.1.12, encoding@^0.1.13: version "0.1.13" resolved "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz" integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== @@ -8153,6 +8559,11 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +error@^10.4.0: + version "10.4.0" + resolved "https://registry.npmjs.org/error/-/error-10.4.0.tgz#6fcf0fd64bceb1e750f8ed9a3dd880f00e46a487" + integrity sha512-YxIFEJuhgcICugOUvRx5th0UM+ActZ9sjY0QJmeVwsQdvosZ7kYzc9QqS0Da3R5iUmgU5meGIxh0xBeZpMVeLw== + es-abstract@^1.17.2, es-abstract@^1.18.5, es-abstract@^1.19.1, es-abstract@^1.19.2: version "1.19.5" resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.5.tgz" @@ -8200,11 +8611,6 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" -es6-error@^4.0.1: - version "4.1.1" - resolved "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz" - integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== - es6-object-assign@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz" @@ -8255,7 +8661,7 @@ escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -escape-string-regexp@^1.0.5: +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= @@ -8268,6 +8674,15 @@ esdoc-inject-style-plugin@^1.0.0: cheerio "0.22.0" fs-extra "1.0.0" +eslint-config-airbnb-base@^14.2.1: + version "14.2.1" + resolved "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz#8a2eb38455dc5a312550193b319cdaeef042cd1e" + integrity sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA== + dependencies: + confusing-browser-globals "^1.0.10" + object.assign "^4.1.2" + object.entries "^1.1.2" + eslint-config-airbnb-base@^15.0.0: version "15.0.0" resolved "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz" @@ -8278,6 +8693,13 @@ eslint-config-airbnb-base@^15.0.0: object.entries "^1.1.5" semver "^6.3.0" +eslint-config-airbnb-typescript@^14.0.1: + version "14.0.2" + resolved "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-14.0.2.tgz#4dc1583b9eab671bb011dea7d4ff1fc0d88e6e09" + integrity sha512-oaVR63DqpRUiOOeSVxIzhD3FXbqJRH+7Lt9GCMsS9SKgrRW3XpZINN2FO4JEsnaHEGkktumd0AHE9K7KQNuXSQ== + dependencies: + eslint-config-airbnb-base "^14.2.1" + eslint-config-airbnb-typescript@^17.0.0: version "17.0.0" resolved "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-17.0.0.tgz" @@ -8372,7 +8794,7 @@ eslint-plugin-es@^3.0.0: eslint-utils "^2.0.0" regexpp "^3.0.0" -eslint-plugin-import@^2.25.3, eslint-plugin-import@^2.26.0: +eslint-plugin-import@^2.24.2, eslint-plugin-import@^2.25.3, eslint-plugin-import@^2.26.0: version "2.26.0" resolved "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz#f812dc47be4f2b72b478a021605a59fc6fe8b88b" integrity sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA== @@ -8436,6 +8858,27 @@ eslint-plugin-unicorn@^36.0.0: safe-regex "^2.1.1" semver "^7.3.5" +eslint-plugin-unicorn@^37.0.1: + version "37.0.1" + resolved "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-37.0.1.tgz#a2292dc302ffc0be1791e6ebbb4ae93242833f11" + integrity sha512-E1jq5u9ojnadisJcPi+hMXTGSiIzkIUMDvWsBudsCGXvKUB2aNSU2TcfyW2/jAS5A4ryBXfzxLykMxX1EdluSQ== + dependencies: + "@babel/helper-validator-identifier" "^7.14.9" + ci-info "^3.2.0" + clean-regexp "^1.0.0" + eslint-template-visitor "^2.3.2" + eslint-utils "^3.0.0" + esquery "^1.4.0" + indent-string "4" + is-builtin-module "^3.1.0" + lodash "^4.17.21" + pluralize "^8.0.0" + read-pkg-up "^7.0.1" + regexp-tree "^0.1.23" + safe-regex "^2.1.1" + semver "^7.3.5" + strip-indent "^3.0.0" + eslint-plugin-unicorn@^39.0.0: version "39.0.0" resolved "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-39.0.0.tgz" @@ -8513,7 +8956,7 @@ eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0: resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@^7.28.0: +eslint@^7.28.0, eslint@^7.32.0: version "7.32.0" resolved "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz" integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== @@ -8729,9 +9172,22 @@ eval@^0.1.8: "@types/node" "*" require-like ">= 0.1.1" +event-stream@=3.3.4: + version "3.3.4" + resolved "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" + integrity sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g== + dependencies: + duplexer "~0.1.1" + from "~0" + map-stream "~0.1.0" + pause-stream "0.0.11" + split "0.3" + stream-combiner "~0.0.4" + through "~2.3.1" + event-target-shim@^5.0.0: version "5.0.1" - resolved "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz" + resolved "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== eventemitter3@^4.0.0, eventemitter3@^4.0.4, eventemitter3@^4.0.7: @@ -8749,6 +9205,21 @@ events@^3.2.0: resolved "https://registry.npmjs.org/events/-/events-3.3.0.tgz" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== +execa@5.1.1, execa@^5.0.0: + version "5.1.1" + resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + execa@^0.10.0: version "0.10.0" resolved "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz" @@ -8762,19 +9233,19 @@ execa@^0.10.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^5.0.0: - version "5.1.1" - resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz" - integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== +execa@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" + integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" + cross-spawn "^7.0.0" + get-stream "^5.0.0" + human-signals "^1.1.1" is-stream "^2.0.0" merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" + npm-run-path "^4.0.0" + onetime "^5.1.0" + signal-exit "^3.0.2" strip-final-newline "^2.0.0" express@^4.17.3: @@ -8837,7 +9308,7 @@ external-editor@^3.0.3: extract-stack@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/extract-stack/-/extract-stack-2.0.0.tgz" + resolved "https://registry.npmjs.org/extract-stack/-/extract-stack-2.0.0.tgz#11367bc865bfcd9bc0db3123e5edb57786f11f9b" integrity sha512-AEo4zm+TenK7zQorGK1f9mJ8L14hnTDi2ZQPR+Mub1NX8zimka1mXpV5LpH8x9HoUmFSHZCfLHqWvp0Y4FxxzQ== extsprintf@1.3.0, extsprintf@^1.2.0: @@ -8900,6 +9371,13 @@ fast-levenshtein@^2.0.6: resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fast-levenshtein@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-3.0.0.tgz#37b899ae47e1090e40e3fd2318e4d5f0142ca912" + integrity sha512-hKKNajm46uNmTlhHSyZkmToAc56uZJwYq7yrciZjqOxnlfQwERDQJmHPUp7m1m9wx8vgOe8IaCKZ5Kv2k1DdCQ== + dependencies: + fastest-levenshtein "^1.0.7" + fast-stable-stringify@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz#5c5543462b22aeeefd36d05b34e51c78cb86d313" @@ -8907,7 +9385,7 @@ fast-stable-stringify@^1.0.0: fast-text-encoding@^1.0.0, fast-text-encoding@^1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz" + resolved "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz#ec02ac8e01ab8a319af182dae2681213cfe9ce53" integrity sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig== fast-url-parser@1.1.3: @@ -8917,7 +9395,7 @@ fast-url-parser@1.1.3: dependencies: punycode "^1.3.2" -fastest-levenshtein@^1.0.12: +fastest-levenshtein@^1.0.12, fastest-levenshtein@^1.0.7: version "1.0.12" resolved "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2" integrity sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow== @@ -8963,7 +9441,7 @@ fbjs@^3.0.0, fbjs@^3.0.1: fecha@^4.2.0: version "4.2.3" - resolved "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz" + resolved "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz#4d9ccdbc61e8629b259fdca67e65891448d569fd" integrity sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw== feed@^4.2.2: @@ -9050,7 +9528,7 @@ finalhandler@1.2.0: statuses "2.0.1" unpipe "~1.0.0" -find-cache-dir@^3.2.0, find-cache-dir@^3.3.1: +find-cache-dir@^3.3.1: version "3.3.2" resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz" integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== @@ -9094,6 +9572,14 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" +find-yarn-workspace-root2@1.2.16: + version "1.2.16" + resolved "https://registry.npmjs.org/find-yarn-workspace-root2/-/find-yarn-workspace-root2-1.2.16.tgz#60287009dd2f324f59646bdb4b7610a6b301c2a9" + integrity sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA== + dependencies: + micromatch "^4.0.2" + pkg-dir "^4.2.0" + find-yarn-workspace-root@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz" @@ -9108,6 +9594,13 @@ find@^0.3.0: dependencies: traverse-chain "~0.1.0" +first-chunk-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz#1bdecdb8e083c0664b91945581577a43a9f31d70" + integrity sha512-X8Z+b/0L4lToKYq+lwnKqi9X/Zek0NibLpsJgVsSxpoYq7JtiCtRb5HqKVEjEw/qAb/4AKKRLOwwKHlWNpm2Eg== + dependencies: + readable-stream "^2.0.2" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz" @@ -9136,7 +9629,7 @@ flux@^4.0.1: fn.name@1.x.x: version "1.1.0" - resolved "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz" + resolved "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== follow-redirects@^1.0.0, follow-redirects@^1.14.7: @@ -9144,19 +9637,16 @@ follow-redirects@^1.0.0, follow-redirects@^1.14.7: resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz" integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== +follow-redirects@^1.14.0: + version "1.15.1" + resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5" + integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA== + foreach@^2.0.5: version "2.0.5" resolved "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz" integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= -foreground-child@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz" - integrity sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA== - dependencies: - cross-spawn "^7.0.0" - signal-exit "^3.0.2" - forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz" @@ -9221,10 +9711,10 @@ fresh@0.5.2: resolved "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz" integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= -fromentries@^1.2.0: - version "1.3.2" - resolved "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz" - integrity sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg== +from@~0: + version "0.1.7" + resolved "https://registry.npmjs.org/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" + integrity sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g== fs-constants@^1.0.0: version "1.0.0" @@ -9336,6 +9826,20 @@ gauge@^3.0.0: strip-ansi "^6.0.1" wide-align "^1.1.2" +gauge@^4.0.3: + version "4.0.4" + resolved "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz#52ff0652f2bbf607a989793d53b751bef2328dce" + integrity sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg== + dependencies: + aproba "^1.0.3 || ^2.0.0" + color-support "^1.1.3" + console-control-strings "^1.1.0" + has-unicode "^2.0.1" + signal-exit "^3.0.7" + string-width "^4.2.3" + strip-ansi "^6.0.1" + wide-align "^1.1.5" + gauge@~2.7.3: version "2.7.4" resolved "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz" @@ -9352,7 +9856,7 @@ gauge@~2.7.3: gaxios@^4.0.0: version "4.3.3" - resolved "https://registry.npmjs.org/gaxios/-/gaxios-4.3.3.tgz" + resolved "https://registry.npmjs.org/gaxios/-/gaxios-4.3.3.tgz#d44bdefe52d34b6435cc41214fdb160b64abfc22" integrity sha512-gSaYYIO1Y3wUtdfHmjDUZ8LWaxJQpiavzbF5Kq53akSzvmVg0RfyOcFDbO1KJ/KCGRFz2qG+lS81F0nkr7cRJA== dependencies: abort-controller "^3.0.0" @@ -9363,7 +9867,7 @@ gaxios@^4.0.0: gcp-metadata@^4.2.0: version "4.3.1" - resolved "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.3.1.tgz" + resolved "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.3.1.tgz#fb205fe6a90fef2fd9c85e6ba06e5559ee1eefa9" integrity sha512-x850LS5N7V1F3UcV7PoupzGsyD6iVwTVvsh3tbXfkctZnBnjW5yu5z1/3k3SehF7TyoTIe78rJs02GMMy+LF+A== dependencies: gaxios "^4.0.0" @@ -9379,7 +9883,7 @@ gensync@^1.0.0-beta.1, gensync@^1.0.0-beta.2: resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== -get-caller-file@^2.0.1, get-caller-file@^2.0.5: +get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== @@ -9423,6 +9927,11 @@ get-port@^5.1.1: resolved "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz" integrity sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ== +get-stdin@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" + integrity sha512-F5aQMywwJ2n85s4hJPTT9RPxGmubonuB10MNYo17/xph174n2MIR33HRguhzVag10O/npM7SPk73LMZNP+FaWw== + get-stdin@^8.0.0: version "8.0.0" resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz" @@ -9440,7 +9949,7 @@ get-stream@^4.1.0: dependencies: pump "^3.0.0" -get-stream@^5.1.0: +get-stream@^5.0.0, get-stream@^5.1.0: version "5.2.0" resolved "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz" integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== @@ -9516,11 +10025,18 @@ gitconfiglocal@^1.0.0: dependencies: ini "^1.3.2" -github-slugger@^1.2.1, github-slugger@^1.4.0: +github-slugger@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/github-slugger/-/github-slugger-1.4.0.tgz" integrity sha512-w0dzqw/nt51xMVmlaV1+JRzN+oCa1KfcgGEWhxUG16wbdA+Xnt/yoFO8Z8x/V82ZcZ0wy6ln9QDup5avbhiDhQ== +github-username@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/github-username/-/github-username-6.0.0.tgz#d543eced7295102996cd8e4e19050ebdcbe60658" + integrity sha512-7TTrRjxblSI5l6adk9zd+cV5d6i1OrJSo3Vr9xdGqFLBQo0mz5P9eIfKCDJ7eekVGGFLbce0qbPSnktXV2BjDQ== + dependencies: + "@octokit/rest" "^18.0.6" + glob-parent@^5.1.1, glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" @@ -9552,6 +10068,17 @@ glob@7.2.0, glob@^7.0.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glo once "^1.3.0" path-is-absolute "^1.0.0" +glob@^8.0.1: + version "8.0.3" + resolved "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz#415c6eb2deed9e502c68fa44a272e6da6eeca42e" + integrity sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + global-dirs@^0.1.1: version "0.1.1" resolved "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz" @@ -9615,7 +10142,7 @@ globby@^10.0.1: merge2 "^1.2.3" slash "^3.0.0" -globby@^11.0.1, globby@^11.0.2, globby@^11.0.3, globby@^11.0.4, globby@^11.1.0: +globby@^11, globby@^11.0.1, globby@^11.0.2, globby@^11.0.3, globby@^11.0.4, globby@^11.1.0: version "11.1.0" resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== @@ -9641,7 +10168,7 @@ globby@^12.0.2: google-auth-library@^7.14.0: version "7.14.1" - resolved "https://registry.npmjs.org/google-auth-library/-/google-auth-library-7.14.1.tgz" + resolved "https://registry.npmjs.org/google-auth-library/-/google-auth-library-7.14.1.tgz#e3483034162f24cc71b95c8a55a210008826213c" integrity sha512-5Rk7iLNDFhFeBYc3s8l1CqzbEBcdhwR193RlD4vSNFajIcINKI8W8P0JLmBpwymHqqWbX34pJDQu39cSy/6RsA== dependencies: arrify "^2.0.0" @@ -9655,12 +10182,12 @@ google-auth-library@^7.14.0: lru-cache "^6.0.0" google-gax@^2.30.0: - version "2.30.2" - resolved "https://registry.npmjs.org/google-gax/-/google-gax-2.30.2.tgz" - integrity sha512-BCNCT26kb0iC52zj2SosyOZMhI5sVfXuul1h0Aw5uT9nGAbmS5eOvQ49ft53ft6XotDj11sUSDV6XESEiQqCqg== + version "2.30.5" + resolved "https://registry.npmjs.org/google-gax/-/google-gax-2.30.5.tgz#e836f984f3228900a8336f608c83d75f9cb73eff" + integrity sha512-Jey13YrAN2hfpozHzbtrwEfEHdStJh1GwaQ2+Akh1k0Tv/EuNVSuBtHZoKSBm5wBMvNsxTsEIZ/152NrYyZgxQ== dependencies: "@grpc/grpc-js" "~1.6.0" - "@grpc/proto-loader" "^0.6.1" + "@grpc/proto-loader" "^0.6.12" "@types/long" "^4.0.0" abort-controller "^3.0.0" duplexify "^4.0.0" @@ -9670,12 +10197,12 @@ google-gax@^2.30.0: node-fetch "^2.6.1" object-hash "^3.0.0" proto3-json-serializer "^0.1.8" - protobufjs "6.11.2" + protobufjs "6.11.3" retry-request "^4.0.0" google-p12-pem@^3.1.3: version "3.1.4" - resolved "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-3.1.4.tgz" + resolved "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-3.1.4.tgz#123f7b40da204de4ed1fbf2fd5be12c047fc8b3b" integrity sha512-HHuHmkLgwjdmVRngf5+gSmpkyaRI6QmOg77J8tkNBHhNEI62sGHyw4/+UkgyZEI7h84NbWprXDJ+sa3xOYFvTg== dependencies: node-forge "^1.3.1" @@ -9697,7 +10224,7 @@ got@^9.6.0: to-readable-stream "^1.0.0" url-parse-lax "^3.0.0" -graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.3, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.8, graceful-fs@^4.2.9: +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.5, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.3, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.8, graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -9712,6 +10239,11 @@ gray-matter@^4.0.3: section-matter "^1.0.0" strip-bom-string "^1.0.0" +grouped-queue@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/grouped-queue/-/grouped-queue-2.0.0.tgz#a2c6713f2171e45db2c300a3a9d7c119d694dac8" + integrity sha512-/PiFUa7WIsl48dUeCvhIHnwNmAAzlI/eHoJl0vu3nsFA366JleY7Ff8EVTplZu5kO0MIdZjKTTnzItL61ahbnw== + growl@1.10.5: version "1.10.5" resolved "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz" @@ -9719,7 +10251,7 @@ growl@1.10.5: gtoken@^5.0.4: version "5.3.2" - resolved "https://registry.npmjs.org/gtoken/-/gtoken-5.3.2.tgz" + resolved "https://registry.npmjs.org/gtoken/-/gtoken-5.3.2.tgz#deb7dc876abe002178e0515e383382ea9446d58f" integrity sha512-gkvEKREW7dXWF8NV8pVrKfW7WqReAmjjkMBh6lNCCGOM4ucS0r0YyXXl0r/9Yj8wcW/32ISkfc8h5mPTDbtifQ== dependencies: gaxios "^4.0.0" @@ -9768,6 +10300,13 @@ hard-rejection@^2.1.0: resolved "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz" integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg== + dependencies: + ansi-regex "^2.0.0" + has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz" @@ -9832,14 +10371,6 @@ hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" -hasha@^5.0.0: - version "5.2.2" - resolved "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz" - integrity sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ== - dependencies: - is-stream "^2.0.0" - type-fest "^0.8.0" - hast-to-hyperscript@^9.0.0: version "9.0.1" resolved "https://registry.npmjs.org/hast-to-hyperscript/-/hast-to-hyperscript-9.0.1.tgz" @@ -10003,11 +10534,6 @@ html-entities@^2.3.2: resolved "https://registry.npmjs.org/html-entities/-/html-entities-2.3.3.tgz" integrity sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA== -html-escaper@^2.0.0: - version "2.0.2" - resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz" - integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== - html-minifier-terser@^6.0.2, html-minifier-terser@^6.1.0: version "6.1.0" resolved "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz" @@ -10121,6 +10647,15 @@ http-proxy-agent@^4.0.1: agent-base "6" debug "4" +http-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" + integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== + dependencies: + "@tootallnate/once" "2" + agent-base "6" + debug "4" + http-proxy-middleware@^2.0.3: version "2.0.6" resolved "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz" @@ -10158,6 +10693,11 @@ https-proxy-agent@^5.0.0: agent-base "6" debug "4" +human-signals@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" + integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== + human-signals@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" @@ -10211,6 +10751,13 @@ ignore-walk@^3.0.3: dependencies: minimatch "^3.0.4" +ignore-walk@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/ignore-walk/-/ignore-walk-4.0.1.tgz#fc840e8346cf88a3a9380c5b17933cd8f4d39fa3" + integrity sha512-rzDQLaW4jQbh2YrOFlJdCtX8qgJTehFRYiUB2r1osqTeDzV/3+Jh8fz1oAPzUThf3iku8Ds4IDqawI5d8mUiQw== + dependencies: + minimatch "^3.0.4" + ignore@^4.0.6: version "4.0.6" resolved "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz" @@ -10339,6 +10886,27 @@ inquirer@^7.3.3: strip-ansi "^6.0.0" through "^2.3.6" +inquirer@^8.0.0, inquirer@^8.2.0: + version "8.2.4" + resolved "https://registry.npmjs.org/inquirer/-/inquirer-8.2.4.tgz#ddbfe86ca2f67649a67daa6f1051c128f684f0b4" + integrity sha512-nn4F01dxU8VeKfq192IjLsxu0/OmMZ4Lg3xKAns148rCaXP6ntAoEkVYZThWjwON8AlzdZZi6oqnhNbxUG9hVg== + dependencies: + ansi-escapes "^4.2.1" + chalk "^4.1.1" + cli-cursor "^3.1.0" + cli-width "^3.0.0" + external-editor "^3.0.3" + figures "^3.0.0" + lodash "^4.17.21" + mute-stream "0.0.8" + ora "^5.4.1" + run-async "^2.4.0" + rxjs "^7.5.5" + string-width "^4.1.0" + strip-ansi "^6.0.0" + through "^2.3.6" + wrap-ansi "^7.0.0" + internal-slot@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz" @@ -10408,7 +10976,7 @@ is-arrayish@^0.2.1: is-arrayish@^0.3.1: version "0.3.2" - resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz" + resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== is-bigint@^1.0.1: @@ -10542,6 +11110,11 @@ is-installed-globally@^0.4.0: global-dirs "^3.0.0" is-path-inside "^3.0.2" +is-interactive@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" + integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== + is-lambda@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz" @@ -10647,6 +11220,13 @@ is-root@^2.1.0: resolved "https://registry.npmjs.org/is-root/-/is-root-2.1.0.tgz" integrity sha512-AGOriNp96vNBd3HtU+RzFEc75FfR5ymiYv8E553I71SCeXBiMsVDUtdio1OEFvrPyLIQ9tVR5RxXIFe5PUFjMg== +is-scoped@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-scoped/-/is-scoped-2.1.0.tgz#fef0713772658bdf5bee418608267ddae6d3566d" + integrity sha512-Cv4OpPTHAK9kHYzkzCrof3VJh7H/PrG2MBUMvvJebaaUMbqhm0YAtXnvh0I3Hnj2tMZWwrRROWLSgfJrKqWmlQ== + dependencies: + scoped-regex "^2.0.0" + is-shared-array-buffer@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz" @@ -10663,7 +11243,7 @@ is-ssh@^1.3.0: is-stream-ended@^0.1.4: version "0.1.4" - resolved "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz" + resolved "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz#f50224e95e06bce0e356d440a4827cd35b267eda" integrity sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw== is-stream@^1.1.0: @@ -10718,6 +11298,11 @@ is-unicode-supported@^0.1.0: resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== +is-utf8@^0.2.0, is-utf8@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + integrity sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q== + is-weakref@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz" @@ -10730,11 +11315,6 @@ is-whitespace-character@^1.0.0: resolved "https://registry.npmjs.org/is-whitespace-character/-/is-whitespace-character-1.0.4.tgz" integrity sha512-SDweEzfIZM0SJV0EUga669UTKlmL0Pq8Lno0QDQsPnvECB3IM2aP0gdx5TrU0A01MAPfViaZiI2V1QMZLaKK5w== -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - is-word-character@^1.0.0: version "1.0.4" resolved "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.4.tgz" @@ -10762,6 +11342,11 @@ isarray@^1.0.0, isarray@~1.0.0: resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= +isbinaryfile@^4.0.8: + version "4.0.10" + resolved "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz#0c5b5e30c2557a2f06febd37b7322946aaee42b3" + integrity sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw== + isexe@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" @@ -10782,67 +11367,6 @@ isstream@~0.1.2: resolved "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.0.0-alpha.1: - version "3.2.0" - resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz" - integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== - -istanbul-lib-hook@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz" - integrity sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ== - dependencies: - append-transform "^2.0.0" - -istanbul-lib-instrument@^4.0.0: - version "4.0.3" - resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz" - integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== - dependencies: - "@babel/core" "^7.7.5" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.0.0" - semver "^6.3.0" - -istanbul-lib-processinfo@^2.0.2: - version "2.0.2" - resolved "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz" - integrity sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw== - dependencies: - archy "^1.0.0" - cross-spawn "^7.0.0" - istanbul-lib-coverage "^3.0.0-alpha.1" - make-dir "^3.0.0" - p-map "^3.0.0" - rimraf "^3.0.0" - uuid "^3.3.3" - -istanbul-lib-report@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz" - integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== - dependencies: - istanbul-lib-coverage "^3.0.0" - make-dir "^3.0.0" - supports-color "^7.1.0" - -istanbul-lib-source-maps@^4.0.0: - version "4.0.1" - resolved "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz" - integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== - dependencies: - debug "^4.1.1" - istanbul-lib-coverage "^3.0.0" - source-map "^0.6.1" - -istanbul-reports@^3.0.2: - version "3.1.4" - resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.4.tgz" - integrity sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw== - dependencies: - html-escaper "^2.0.0" - istanbul-lib-report "^3.0.0" - jake@^10.8.5: version "10.8.5" resolved "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz" @@ -10888,7 +11412,7 @@ jmespath@0.16.0: resolved "https://registry.npmjs.org/jmespath/-/jmespath-0.16.0.tgz" integrity sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw== -joi@^17.6.0: +joi@^17.4.0, joi@^17.6.0: version "17.6.0" resolved "https://registry.npmjs.org/joi/-/joi-17.6.0.tgz" integrity sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw== @@ -10921,7 +11445,7 @@ js-yaml@4.1.0, js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -js-yaml@^3.13.1, js-yaml@^3.14.1: +js-yaml@^3.13.0, js-yaml@^3.13.1, js-yaml@^3.14.1: version "3.14.1" resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== @@ -10946,7 +11470,7 @@ jsesc@~0.5.0: json-bigint@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz" + resolved "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz#ae547823ac0cad8398667f8cd9ef4730f5b01ff1" integrity sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ== dependencies: bignumber.js "^9.0.0" @@ -11061,14 +11585,24 @@ just-diff-apply@^3.0.0: resolved "https://registry.npmjs.org/just-diff-apply/-/just-diff-apply-3.1.2.tgz#710d8cda00c65dc4e692df50dbe9bac5581c2193" integrity sha512-TCa7ZdxCeq6q3Rgms2JCRHTCfWAETPZ8SzYUbkYF6KR3I03sN29DaOIC+xyWboIcMvjAsD5iG2u/RWzHD8XpgQ== +just-diff-apply@^5.2.0: + version "5.3.1" + resolved "https://registry.npmjs.org/just-diff-apply/-/just-diff-apply-5.3.1.tgz#30f40809ffed55ad76dccf73fa9b85a76964c867" + integrity sha512-dgFenZnMsc1xGNqgdtgnh7DK+Oy352CE3VZLbzcbQpsBs9iI2K3M0IRrdgREZ72eItTjbl0suRyvKRdVQa9GbA== + just-diff@^3.0.1: version "3.1.1" resolved "https://registry.npmjs.org/just-diff/-/just-diff-3.1.1.tgz" integrity sha512-sdMWKjRq8qWZEjDcVA6llnUT8RDEBIfOiGpYFPYa9u+2c39JCsejktSP7mj5eRid5EIvTzIpQ2kDOCw1Nq9BjQ== +just-diff@^5.0.1: + version "5.0.3" + resolved "https://registry.npmjs.org/just-diff/-/just-diff-5.0.3.tgz#4c9c514dec5526b25ab977590e3c39a0cf271554" + integrity sha512-a8p80xcpJ6sdurk5PxDKb4mav9MeKjA3zFKZpCWBIfvg8mznfnmb13MKZvlrwJ+Lhis0wM3uGAzE0ArhFHvIcg== + jwa@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz" + resolved "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz#a7e9c3f29dae94027ebcaf49975c9345593410fc" integrity sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA== dependencies: buffer-equal-constant-time "1.0.1" @@ -11077,7 +11611,7 @@ jwa@^2.0.0: jws@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz" + resolved "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz#2d4e8cf6a318ffaa12615e9dec7e86e6c97310f4" integrity sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg== dependencies: jwa "^2.0.0" @@ -11130,7 +11664,7 @@ klona@^2.0.5: kuler@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz" + resolved "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz#e2c570a3800388fb44407e851531c1d670b061b3" integrity sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A== latest-version@^5.1.0: @@ -11140,6 +11674,11 @@ latest-version@^5.1.0: dependencies: package-json "^6.3.0" +lazy-ass@1.6.0: + version "1.6.0" + resolved "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513" + integrity sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw== + lerna@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/lerna/-/lerna-4.0.0.tgz" @@ -11333,6 +11872,16 @@ load-script@^1.0.0: resolved "https://registry.npmjs.org/load-script/-/load-script-1.0.0.tgz" integrity sha1-BJGTngvuVkPuSUp+PaPSuscMbKQ= +load-yaml-file@^0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz#af854edaf2bea89346c07549122753c07372f64d" + integrity sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw== + dependencies: + graceful-fs "^4.1.5" + js-yaml "^3.13.0" + pify "^4.0.1" + strip-bom "^3.0.0" + loader-runner@^4.2.0: version "4.3.0" resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz" @@ -11399,8 +11948,8 @@ lodash.bind@^4.1.4: lodash.camelcase@^4.3.0: version "4.3.0" - resolved "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz" - integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY= + resolved "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== lodash.curry@^4.0.1: version "4.1.1" @@ -11427,11 +11976,6 @@ lodash.flatten@^4.2.0: resolved "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz" integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8= -lodash.flattendeep@^4.4.0: - version "4.4.0" - resolved "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz" - integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= - lodash.flow@^3.3.0: version "3.5.0" resolved "https://registry.npmjs.org/lodash.flow/-/lodash.flow-3.5.0.tgz" @@ -11507,6 +12051,11 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" +lodash.throttle@^4.1.1: + version "4.1.1" + resolved "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" + integrity sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ== + lodash.truncate@^4.4.2: version "4.4.2" resolved "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz" @@ -11517,7 +12066,7 @@ lodash.uniq@4.5.0, lodash.uniq@^4.5.0: resolved "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.13.1, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.7.0: +lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.7.0: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -11529,7 +12078,7 @@ log-chopper@^1.0.2: dependencies: byline "5.x" -log-symbols@4.1.0: +log-symbols@4.1.0, log-symbols@^4.0.0, log-symbols@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz" integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== @@ -11539,7 +12088,7 @@ log-symbols@4.1.0: logform@^2.3.2, logform@^2.4.0: version "2.4.0" - resolved "https://registry.npmjs.org/logform/-/logform-2.4.0.tgz" + resolved "https://registry.npmjs.org/logform/-/logform-2.4.0.tgz#131651715a17d50f09c2a2c1a524ff1a4164bcfe" integrity sha512-CPSJw4ftjf517EhXZGGvTHHkYobo7ZCc0kvwUoOYcjfR2UVrI66RHj8MCrfAdEitdmFqbu2BYdYs8FHHZSb6iw== dependencies: "@colors/colors" "1.5.0" @@ -11591,6 +12140,11 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +lru-cache@^7.7.1: + version "7.10.1" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-7.10.1.tgz#db577f42a94c168f676b638d15da8fb073448cab" + integrity sha512-BQuhQxPuRl79J5zSXRP+uNzPOyZw2oFI9JLRQ80XswSvg21KMKNtQza9eF42rfI/3Z40RvzBdXgziEkudzjo8A== + lunr@^2.3.9: version "2.3.9" resolved "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz" @@ -11616,6 +12170,28 @@ make-error@^1.1.1: resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== +make-fetch-happen@^10.0.1: + version "10.1.7" + resolved "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.7.tgz#b1402cb3c9fad92b380ff3a863cdae5414a42f76" + integrity sha512-J/2xa2+7zlIUKqfyXDCXFpH3ypxO4k3rgkZHPSZkyUYcBT/hM80M3oyKLM/9dVriZFiGeGGS2Ei+0v2zfhqj3Q== + dependencies: + agentkeepalive "^4.2.1" + cacache "^16.1.0" + http-cache-semantics "^4.1.0" + http-proxy-agent "^5.0.0" + https-proxy-agent "^5.0.0" + is-lambda "^1.0.1" + lru-cache "^7.7.1" + minipass "^3.1.6" + minipass-collect "^1.0.2" + minipass-fetch "^2.0.3" + minipass-flush "^1.0.5" + minipass-pipeline "^1.2.4" + negotiator "^0.6.3" + promise-retry "^2.0.1" + socks-proxy-agent "^7.0.0" + ssri "^9.0.0" + make-fetch-happen@^8.0.9: version "8.0.14" resolved "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-8.0.14.tgz" @@ -11669,6 +12245,11 @@ map-obj@^4.0.0: resolved "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== +map-stream@~0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" + integrity sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g== + markdown-escapes@^1.0.0: version "1.0.4" resolved "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.4.tgz" @@ -11732,6 +12313,32 @@ media-typer@0.3.0: resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz" integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= +"mem-fs-editor@^8.1.2 || ^9.0.0": + version "9.4.0" + resolved "https://registry.npmjs.org/mem-fs-editor/-/mem-fs-editor-9.4.0.tgz#0cc1cf61350e33c25fc364c97fb0551eb32b8c9b" + integrity sha512-HSSOLSVRrsDdui9I6i96dDtG+oAez/4EB2g4cjSrNhgNQ3M+L57/+22NuPdORSoxvOHjIg/xeOE+C0wwF91D2g== + dependencies: + binaryextensions "^4.16.0" + commondir "^1.0.1" + deep-extend "^0.6.0" + ejs "^3.1.6" + globby "^11.0.3" + isbinaryfile "^4.0.8" + minimatch "^3.0.4" + multimatch "^5.0.0" + normalize-path "^3.0.0" + textextensions "^5.13.0" + +"mem-fs@^1.2.0 || ^2.0.0": + version "2.2.1" + resolved "https://registry.npmjs.org/mem-fs/-/mem-fs-2.2.1.tgz#c87bc8a53fb17971b129d4bcd59a9149fb78c5b1" + integrity sha512-yiAivd4xFOH/WXlUi6v/nKopBh1QLzwjFi36NK88cGt/PRXI8WeBASqY+YSjIVWvQTx3hR8zHKDBMV6hWmglNA== + dependencies: + "@types/node" "^15.6.1" + "@types/vinyl" "^2.0.4" + vinyl "^2.0.1" + vinyl-file "^3.0.0" + memfs@^3.1.2, memfs@^3.4.1: version "3.4.1" resolved "https://registry.npmjs.org/memfs/-/memfs-3.4.1.tgz" @@ -11900,7 +12507,7 @@ minimist-options@4.1.0: is-plain-obj "^1.1.0" kind-of "^6.0.3" -minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1.2.6: +minimist@^1.1.0, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1.2.6: version "1.2.6" resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz" integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== @@ -11912,7 +12519,7 @@ minipass-collect@^1.0.2: dependencies: minipass "^3.0.0" -minipass-fetch@^1.3.0, minipass-fetch@^1.3.2: +minipass-fetch@^1.3.0, minipass-fetch@^1.3.2, minipass-fetch@^1.4.1: version "1.4.1" resolved "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz" integrity sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw== @@ -11923,6 +12530,17 @@ minipass-fetch@^1.3.0, minipass-fetch@^1.3.2: optionalDependencies: encoding "^0.1.12" +minipass-fetch@^2.0.3: + version "2.1.0" + resolved "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.0.tgz#ca1754a5f857a3be99a9271277246ac0b44c3ff8" + integrity sha512-H9U4UVBGXEyyWJnqYDCLp1PwD8XIkJ4akNHp1aGVI+2Ym7wQMlxDKi4IB4JbmyU+pl9pEs/cVrK6cOuvmbK4Sg== + dependencies: + minipass "^3.1.6" + minipass-sized "^1.0.3" + minizlib "^2.1.2" + optionalDependencies: + encoding "^0.1.13" + minipass-flush@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz" @@ -11960,7 +12578,7 @@ minipass@^2.6.0, minipass@^2.9.0: safe-buffer "^5.1.2" yallist "^3.0.0" -minipass@^3.0.0, minipass@^3.1.0, minipass@^3.1.1, minipass@^3.1.3: +minipass@^3.0.0, minipass@^3.1.0, minipass@^3.1.1, minipass@^3.1.3, minipass@^3.1.6: version "3.1.6" resolved "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz" integrity sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ== @@ -11974,7 +12592,7 @@ minizlib@^1.3.3: dependencies: minipass "^2.9.0" -minizlib@^2.0.0, minizlib@^2.1.1: +minizlib@^2.0.0, minizlib@^2.1.1, minizlib@^2.1.2: version "2.1.2" resolved "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz" integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== @@ -12008,7 +12626,7 @@ mkdirp@^0.5.1, mkdirp@^0.5.5, mkdirp@~0.5.1: dependencies: minimist "^1.2.6" -mocha@^9.1.1, mocha@^9.1.3, mocha@^9.2.2: +mocha@^9, mocha@^9.0.3, mocha@^9.1.1, mocha@^9.2.2: version "9.2.2" resolved "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz" integrity sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g== @@ -12129,7 +12747,7 @@ natural-orderby@^2.0.1, natural-orderby@^2.0.3: resolved "https://registry.npmjs.org/natural-orderby/-/natural-orderby-2.0.3.tgz" integrity sha512-p7KTHxU0CUrcOXe62Zfrb5Z13nLvPhSWR/so3kFulUQU0sgUll2Z0LwpsLN351eOOD+hRGu/F1g+6xDfPeD++Q== -negotiator@0.6.3, negotiator@^0.6.2: +negotiator@0.6.3, negotiator@^0.6.2, negotiator@^0.6.3: version "0.6.3" resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== @@ -12179,7 +12797,7 @@ node-emoji@^1.10.0: dependencies: lodash "^4.17.21" -node-fetch@2.6.7, node-fetch@^2.2.0, node-fetch@^2.6.1, node-fetch@^2.6.6, node-fetch@^2.6.7: +node-fetch@2, node-fetch@2.6.7, node-fetch@^2.2.0, node-fetch@^2.6.1, node-fetch@^2.6.6, node-fetch@^2.6.7: version "2.6.7" resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== @@ -12238,6 +12856,22 @@ node-gyp@^7.1.0, node-gyp@^7.1.2: tar "^6.0.2" which "^2.0.2" +node-gyp@^8.2.0: + version "8.4.1" + resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz#3d49308fc31f768180957d6b5746845fbd429937" + integrity sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w== + dependencies: + env-paths "^2.2.0" + glob "^7.1.4" + graceful-fs "^4.2.6" + make-fetch-happen "^9.1.0" + nopt "^5.0.0" + npmlog "^6.0.0" + rimraf "^3.0.2" + semver "^7.3.5" + tar "^6.1.2" + which "^2.0.2" + node-pagerduty@^1.3.6: version "1.3.6" resolved "https://registry.npmjs.org/node-pagerduty/-/node-pagerduty-1.3.6.tgz" @@ -12250,13 +12884,6 @@ node-pagerduty@^1.3.6: request "2.88.0" request-promise-native "1.0.5" -node-preload@^0.2.1: - version "0.2.1" - resolved "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz" - integrity sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ== - dependencies: - process-on-spawn "^1.0.0" - node-releases@^2.0.3: version "2.0.3" resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.3.tgz" @@ -12287,7 +12914,7 @@ normalize-package-data@^2.0.0, normalize-package-data@^2.3.2, normalize-package- semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-package-data@^3.0.0, normalize-package-data@^3.0.2: +normalize-package-data@^3.0.0, normalize-package-data@^3.0.2, normalize-package-data@^3.0.3: version "3.0.3" resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz" integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== @@ -12376,6 +13003,16 @@ npm-packlist@^2.1.4: npm-bundled "^1.1.1" npm-normalize-package-bin "^1.0.1" +npm-packlist@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/npm-packlist/-/npm-packlist-3.0.0.tgz#0370df5cfc2fcc8f79b8f42b37798dd9ee32c2a9" + integrity sha512-L/cbzmutAwII5glUcf2DBRNY/d0TFd4e/FnaZigJV6JD85RHZXJFGwCndjMWiiViiWSsWt3tiOLpI3ByTnIdFQ== + dependencies: + glob "^7.1.6" + ignore-walk "^4.0.1" + npm-bundled "^1.1.1" + npm-normalize-package-bin "^1.0.1" + npm-pick-manifest@^6.0.0, npm-pick-manifest@^6.1.0, npm-pick-manifest@^6.1.1: version "6.1.1" resolved "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-6.1.1.tgz" @@ -12405,6 +13042,18 @@ npm-registry-fetch@^11.0.0: minizlib "^2.0.0" npm-package-arg "^8.0.0" +npm-registry-fetch@^12.0.0, npm-registry-fetch@^12.0.1: + version "12.0.2" + resolved "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-12.0.2.tgz#ae583bb3c902a60dae43675b5e33b5b1f6159f1e" + integrity sha512-Df5QT3RaJnXYuOwtXBXS9BWs+tHH2olvkCLh6jcR/b/u3DvPMlp3J0TvvYwplPKxHMOwfg287PYih9QqaVFoKA== + dependencies: + make-fetch-happen "^10.0.1" + minipass "^3.1.6" + minipass-fetch "^1.4.1" + minipass-json-stream "^1.0.1" + minizlib "^2.1.2" + npm-package-arg "^8.1.5" + npm-registry-fetch@^9.0.0: version "9.0.0" resolved "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-9.0.0.tgz" @@ -12441,7 +13090,7 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" -npm-run-path@^4.0.1: +npm-run-path@^4.0.0, npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== @@ -12554,6 +13203,16 @@ npmlog@^5.0.1: gauge "^3.0.0" set-blocking "^2.0.0" +npmlog@^6.0.0: + version "6.0.2" + resolved "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz#c8166017a42f2dea92d6453168dd865186a70830" + integrity sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg== + dependencies: + are-we-there-yet "^3.0.0" + console-control-strings "^1.1.0" + gauge "^4.0.3" + set-blocking "^2.0.0" + nprogress@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz" @@ -12578,39 +13237,6 @@ number-is-nan@^1.0.0: resolved "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= -nyc@^15.1.0: - version "15.1.0" - resolved "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz" - integrity sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A== - dependencies: - "@istanbuljs/load-nyc-config" "^1.0.0" - "@istanbuljs/schema" "^0.1.2" - caching-transform "^4.0.0" - convert-source-map "^1.7.0" - decamelize "^1.2.0" - find-cache-dir "^3.2.0" - find-up "^4.1.0" - foreground-child "^2.0.0" - get-package-type "^0.1.0" - glob "^7.1.6" - istanbul-lib-coverage "^3.0.0" - istanbul-lib-hook "^3.0.0" - istanbul-lib-instrument "^4.0.0" - istanbul-lib-processinfo "^2.0.2" - istanbul-lib-report "^3.0.0" - istanbul-lib-source-maps "^4.0.0" - istanbul-reports "^3.0.2" - make-dir "^3.0.0" - node-preload "^0.2.1" - p-map "^3.0.0" - process-on-spawn "^1.0.0" - resolve-from "^5.0.0" - rimraf "^3.0.0" - signal-exit "^3.0.2" - spawn-wrap "^2.0.0" - test-exclude "^6.0.0" - yargs "^15.0.2" - oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz" @@ -12623,7 +13249,7 @@ object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: object-hash@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz" + resolved "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz#73f97f753e7baffc0e2cc9d6e079079744ac82e9" integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw== object-inspect@^1.12.0, object-inspect@^1.9.0: @@ -12659,7 +13285,7 @@ object.assign@^4.1.0, object.assign@^4.1.2: has-symbols "^1.0.1" object-keys "^1.1.1" -object.entries@^1.1.5: +object.entries@^1.1.2, object.entries@^1.1.5: version "1.1.5" resolved "https://registry.npmjs.org/object.entries/-/object.entries-1.1.5.tgz" integrity sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g== @@ -12691,6 +13317,30 @@ obuf@^1.0.0, obuf@^1.1.2: resolved "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz" integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg== +oclif@^3: + version "3.0.1" + resolved "https://registry.npmjs.org/oclif/-/oclif-3.0.1.tgz#f10bd702b4b2b22f849d57951882e0bd8aa9246c" + integrity sha512-DZZ53DFbDBai6doGTyVCkYWYBj9u+pXStZf8LMV5ttyr9vY9YL/d8kFpYk5OrUz8PuU81JU2Jo3ZV+4QzZFfug== + dependencies: + "@oclif/core" "^1.6.4" + "@oclif/plugin-help" "^5.1.12" + "@oclif/plugin-not-found" "^2.3.1" + "@oclif/plugin-warn-if-update-available" "^2.0.4" + aws-sdk "^2.1069.0" + concurrently "^7.0.0" + debug "^4.3.3" + find-yarn-workspace-root "^2.0.0" + fs-extra "^8.1" + github-slugger "^1.4.0" + lodash "^4.17.21" + normalize-package-data "^3.0.3" + qqjs "^0.3.11" + semver "^7.3.5" + tslib "^2.3.1" + yeoman-environment "^3.9.1" + yeoman-generator "^5.6.1" + yosay "^2.0.2" + on-finished@2.4.1: version "2.4.1" resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz" @@ -12712,7 +13362,7 @@ once@^1.3.0, once@^1.3.1, once@^1.4.0: one-time@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz" + resolved "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz#e06bc174aed214ed58edede573b433bbf827cb45" integrity sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g== dependencies: fn.name "1.x.x" @@ -12750,6 +13400,21 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" +ora@^5.4.1: + version "5.4.1" + resolved "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" + integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== + dependencies: + bl "^4.1.0" + chalk "^4.1.0" + cli-cursor "^3.1.0" + cli-spinners "^2.5.0" + is-interactive "^1.0.0" + is-unicode-supported "^0.1.0" + log-symbols "^4.1.0" + strip-ansi "^6.0.0" + wcwidth "^1.0.1" + os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz" @@ -12832,13 +13497,6 @@ p-map-series@^2.1.0: resolved "https://registry.npmjs.org/p-map-series/-/p-map-series-2.1.0.tgz" integrity sha512-RpYIIK1zXSNEOdwxcfe7FdvGcs7+y5n8rifMhMNWvaxRNMPINJHF5GDeuVxWqnfrcHPSCnp7Oo5yNXHId9Av2Q== -p-map@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz" - integrity sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ== - dependencies: - aggregate-error "^3.0.0" - p-map@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz" @@ -12879,6 +13537,14 @@ p-timeout@^3.2.0: dependencies: p-finally "^1.0.0" +p-transform@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/p-transform/-/p-transform-1.3.0.tgz#2da960ba92c6a56efbe75cbd1edf3ea7b3191049" + integrity sha512-UJKdSzgd3KOnXXAtqN5+/eeHcvTn1hBkesEmElVgvO/NAYcxAvmjzIGmnNd3Tb/gRAvMBdNRFD4qAWdHxY6QXg== + dependencies: + debug "^4.3.2" + p-queue "^6.6.2" + p-try@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz" @@ -12896,16 +13562,6 @@ p-waterfall@^2.1.1: dependencies: p-reduce "^2.0.0" -package-hash@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz" - integrity sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ== - dependencies: - graceful-fs "^4.1.15" - hasha "^5.0.0" - lodash.flattendeep "^4.4.0" - release-zalgo "^1.0.0" - package-json@^6.3.0: version "6.5.0" resolved "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz" @@ -12941,6 +13597,36 @@ pacote@^11.1.11, pacote@^11.2.6, pacote@^11.3.0, pacote@^11.3.1, pacote@^11.3.5: ssri "^8.0.1" tar "^6.1.0" +pacote@^12.0.0, pacote@^12.0.2: + version "12.0.3" + resolved "https://registry.npmjs.org/pacote/-/pacote-12.0.3.tgz#b6f25868deb810e7e0ddf001be88da2bcaca57c7" + integrity sha512-CdYEl03JDrRO3x18uHjBYA9TyoW8gy+ThVcypcDkxPtKlw76e4ejhYB6i9lJ+/cebbjpqPW/CijjqxwDTts8Ow== + dependencies: + "@npmcli/git" "^2.1.0" + "@npmcli/installed-package-contents" "^1.0.6" + "@npmcli/promise-spawn" "^1.2.0" + "@npmcli/run-script" "^2.0.0" + cacache "^15.0.5" + chownr "^2.0.0" + fs-minipass "^2.1.0" + infer-owner "^1.0.4" + minipass "^3.1.3" + mkdirp "^1.0.3" + npm-package-arg "^8.0.1" + npm-packlist "^3.0.0" + npm-pick-manifest "^6.0.0" + npm-registry-fetch "^12.0.0" + promise-retry "^2.0.1" + read-package-json-fast "^2.0.1" + rimraf "^3.0.2" + ssri "^8.0.1" + tar "^6.1.0" + +pad-component@0.0.1: + version "0.0.1" + resolved "https://registry.npmjs.org/pad-component/-/pad-component-0.0.1.tgz#ad1f22ce1bf0fdc0d6ddd908af17f351a404b8ac" + integrity sha512-8EKVBxCRSvLnsX1p2LlSFSH3c2/wuhY9/BXXWu8boL78FbVKqn2L5SpURt1x5iw6Gq8PTqJ7MdPoe5nCtX3I+g== + pako@^2.0.3: version "2.0.4" resolved "https://registry.npmjs.org/pako/-/pako-2.0.4.tgz" @@ -12977,6 +13663,15 @@ parse-conflict-json@^1.1.1: just-diff "^3.0.1" just-diff-apply "^3.0.0" +parse-conflict-json@^2.0.1: + version "2.0.2" + resolved "https://registry.npmjs.org/parse-conflict-json/-/parse-conflict-json-2.0.2.tgz#3d05bc8ffe07d39600dc6436c6aefe382033d323" + integrity sha512-jDbRGb00TAPFsKWCpZZOT93SxVP9nONOSgES3AevqRq/CHvavEBvKAjxX9p5Y5F0RZLxH9Ufd9+RwtCsa+lFDA== + dependencies: + json-parse-even-better-errors "^2.3.1" + just-diff "^5.0.1" + just-diff-apply "^5.2.0" + parse-entities@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz" @@ -13144,6 +13839,13 @@ pathval@^1.1.1: resolved "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz" integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== +pause-stream@0.0.11: + version "0.0.11" + resolved "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" + integrity sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A== + dependencies: + through "~2.3" + performance-now@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz" @@ -13526,6 +14228,16 @@ postcss@^8.4.12: picocolors "^1.0.0" source-map-js "^1.0.2" +preferred-pm@^3.0.3: + version "3.0.3" + resolved "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.0.3.tgz#1b6338000371e3edbce52ef2e4f65eb2e73586d6" + integrity sha512-+wZgbxNES/KlJs9q40F/1sfOd/j7f1O9JaHcW5Dsn3aUUOZg3L2bjpVUcKV2jvtElYfoTuQiNeMfQJ4kwUAhCQ== + dependencies: + find-up "^5.0.0" + find-yarn-workspace-root2 "1.2.16" + path-exists "^4.0.0" + which-pm "2.0.0" + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz" @@ -13545,14 +14257,19 @@ prettier-linter-helpers@^1.0.0: prettier-plugin-organize-imports@^2.3.4: version "2.3.4" - resolved "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-2.3.4.tgz" + resolved "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-2.3.4.tgz#65473861ae5ab7960439fff270a2258558fbe9ba" integrity sha512-R8o23sf5iVL/U71h9SFUdhdOEPsi3nm42FD/oDYIZ2PQa4TNWWuWecxln6jlIQzpZTDMUeO1NicJP6lLn2TtRw== -prettier@^2.5.0, prettier@^2.5.1: +prettier@^2.4.1, prettier@^2.5.1: version "2.6.2" resolved "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz" integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== +pretty-bytes@^5.3.0: + version "5.6.0" + resolved "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" + integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== + pretty-error@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/pretty-error/-/pretty-error-4.0.0.tgz" @@ -13581,18 +14298,11 @@ proc-log@^1.0.0: resolved "https://registry.npmjs.org/proc-log/-/proc-log-1.0.0.tgz#0d927307401f69ed79341e83a0b2c9a13395eb77" integrity sha512-aCk8AO51s+4JyuYGg3Q/a6gnrlDO09NpVWePtjp7xwphcoQ04x5WAfCyugcsbLooWcMJ87CLkD4+604IckEdhg== -process-nextick-args@~2.0.0: +process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -process-on-spawn@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz" - integrity sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg== - dependencies: - fromentries "^1.2.0" - progress@^2.0.0: version "2.0.3" resolved "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz" @@ -13670,13 +14380,32 @@ proto-list@~1.2.1: integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk= proto3-json-serializer@^0.1.8: - version "0.1.8" - resolved "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-0.1.8.tgz" - integrity sha512-ACilkB6s1U1gWnl5jtICpnDai4VCxmI9GFxuEaYdxtDG2oVI3sVFIUsvUZcQbJgtPM6p+zqKbjTKQZp6Y4FpQw== + version "0.1.9" + resolved "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-0.1.9.tgz#705ddb41b009dd3e6fcd8123edd72926abf65a34" + integrity sha512-A60IisqvnuI45qNRygJjrnNjX2TMdQGMY+57tR3nul3ZgO2zXkR9OGR8AXxJhkqx84g0FTnrfi3D5fWMSdANdQ== dependencies: protobufjs "^6.11.2" -protobufjs@6.11.2, protobufjs@^6.10.0, protobufjs@^6.10.2, protobufjs@^6.11.2: +protobufjs@6.11.3, protobufjs@^6.11.2, protobufjs@^6.11.3: + version "6.11.3" + resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74" + integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/long" "^4.0.1" + "@types/node" ">=13.7.0" + long "^4.0.0" + +protobufjs@^6.10.2: version "6.11.2" resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz" integrity sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw== @@ -13708,6 +14437,13 @@ proxy-addr@~2.0.7: forwarded "0.2.0" ipaddr.js "1.9.1" +ps-tree@1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/ps-tree/-/ps-tree-1.2.0.tgz#5e7425b89508736cdd4f2224d028f7bb3f722ebd" + integrity sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA== + dependencies: + event-stream "=3.3.4" + psl@^1.1.24, psl@^1.1.28: version "1.8.0" resolved "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz" @@ -13753,7 +14489,7 @@ q@^1.1.2, q@^1.5.1: resolved "https://registry.npmjs.org/q/-/q-1.5.1.tgz" integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= -qqjs@^0.3.10: +qqjs@^0.3.11: version "0.3.11" resolved "https://registry.npmjs.org/qqjs/-/qqjs-0.3.11.tgz" integrity sha512-pB2X5AduTl78J+xRSxQiEmga1jQV0j43jOPs/MTgTLApGFEOn6NgdE2dEjp7nvDtjkIOZbvFIojAiYUx6ep3zg== @@ -14070,6 +14806,11 @@ read-cmd-shim@^2.0.0: resolved "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-2.0.0.tgz" integrity sha512-HJpV9bQpkl6KwjxlJcBoqu9Ba0PQg8TqSNIOrulGt54a0uup0HtevreFHzYzkm0lpnleRdNBzXznKrgxglEHQw== +read-cmd-shim@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-3.0.0.tgz#62b8c638225c61e6cc607f8f4b779f3b8238f155" + integrity sha512-KQDVjGqhZk92PPNRj9ZEXEuqg8bUobSKRw+q0YQ3TKI5xkce7bUJobL4Z/OtiEbAAv70yEpYIXp4iQ9L8oPVog== + read-package-json-fast@^2.0.1, read-package-json-fast@^2.0.2, read-package-json-fast@^2.0.3: version "2.0.3" resolved "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz" @@ -14169,7 +14910,7 @@ readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stre string_decoder "^1.1.1" util-deprecate "^1.0.1" -readable-stream@^2.0.1, readable-stream@^2.0.6, readable-stream@~2.3.6: +readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.5, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -14206,7 +14947,7 @@ reading-time@^1.5.0: readline-sync@^1.4.10: version "1.4.10" - resolved "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz" + resolved "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz#41df7fbb4b6312d673011594145705bf56d8873b" integrity sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw== rechoir@^0.6.2: @@ -14344,13 +15085,6 @@ relateurl@^0.2.7: resolved "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz" integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= -release-zalgo@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz" - integrity sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA= - dependencies: - es6-error "^4.0.1" - remark-admonitions@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/remark-admonitions/-/remark-admonitions-1.2.1.tgz" @@ -14422,6 +15156,11 @@ remark-squeeze-paragraphs@4.0.0: dependencies: mdast-squeeze-paragraphs "^4.0.0" +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + renderkid@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/renderkid/-/renderkid-3.0.0.tgz" @@ -14438,6 +15177,11 @@ repeat-string@^1.0.0, repeat-string@^1.5.4, repeat-string@^1.6.1: resolved "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= +replace-ext@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz#2d6d996d04a15855d967443631dd5f77825b016a" + integrity sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw== + request-promise-core@1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz" @@ -14521,11 +15265,6 @@ require-from-string@^2.0.2: resolved "https://registry.npmjs.org/require-like/-/require-like-0.1.2.tgz" integrity sha1-rW8wwTvs15cBDEaK+ndcDAprR/o= -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - requires-port@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" @@ -14586,7 +15325,7 @@ restore-cursor@^3.1.0: retry-request@^4.0.0: version "4.2.2" - resolved "https://registry.npmjs.org/retry-request/-/retry-request-4.2.2.tgz" + resolved "https://registry.npmjs.org/retry-request/-/retry-request-4.2.2.tgz#b7d82210b6d2651ed249ba3497f07ea602f1a903" integrity sha512-xA93uxUD/rogV7BV59agW/JHPGXeREMWiZc9jhcwY4YdZ7QOtC7qbomYg0n4wyk2lJhggjvKvhNX8wln/Aldhg== dependencies: debug "^4.1.1" @@ -14649,7 +15388,7 @@ rtlcss@^3.5.0: postcss "^8.3.11" strip-json-comments "^3.1.1" -run-async@^2.4.0: +run-async@^2.0.0, run-async@^2.4.0: version "2.4.1" resolved "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz" integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== @@ -14661,14 +15400,14 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@^6.6.0: +rxjs@^6.6.0, rxjs@^6.6.3: version "6.6.7" resolved "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== dependencies: tslib "^1.9.0" -rxjs@^7.5.4: +rxjs@^7.1.0, rxjs@^7.5.4, rxjs@^7.5.5: version "7.5.5" resolved "https://registry.npmjs.org/rxjs/-/rxjs-7.5.5.tgz" integrity sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw== @@ -14694,7 +15433,7 @@ safe-regex@^2.1.1: safe-stable-stringify@^2.3.1: version "2.3.1" - resolved "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz" + resolved "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz#ab67cbe1fe7d40603ca641c5e765cb942d04fc73" integrity sha512-kYBSfT+troD9cDA85VDnHZ1rpHC50O0g1e6WlGHVCz/g+JS+9WKLj+XwFYyR8UbrZN8ll9HUpDAAddY58MGisg== "safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: @@ -14757,6 +15496,11 @@ schema-utils@^4.0.0: ajv-formats "^2.1.1" ajv-keywords "^5.0.0" +scoped-regex@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/scoped-regex/-/scoped-regex-2.1.0.tgz#7b9be845d81fd9d21d1ec97c61a0b7cf86d2015f" + integrity sha512-g3WxHrqSWCZHGHlSrF51VXFdjImhwvH8ZO/pryFH56Qi0cDsZfylQa/t0jCzVQFNbNvM00HfHjkDPEuarKDSWQ== + secp256k1@^4.0.2: version "4.0.3" resolved "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz" @@ -14808,7 +15552,7 @@ semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semve resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.6: +semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.6, semver@^7.3.7: version "7.3.7" resolved "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz" integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== @@ -14957,7 +15701,7 @@ shiki@^0.10.1: vscode-oniguruma "^1.6.1" vscode-textmate "5.2.0" -shx@^0.3.4: +shx@^0.3.3, shx@^0.3.4: version "0.3.4" resolved "https://registry.npmjs.org/shx/-/shx-0.3.4.tgz#74289230b4b663979167f94e1935901406e40f02" integrity sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g== @@ -14974,14 +15718,14 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: +signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== simple-swizzle@^0.2.2: version "0.2.2" - resolved "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz" + resolved "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" integrity sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo= dependencies: is-arrayish "^0.3.1" @@ -15074,6 +15818,15 @@ socks-proxy-agent@^6.0.0: debug "^4.3.3" socks "^2.6.2" +socks-proxy-agent@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz#dc069ecf34436621acb41e3efa66ca1b5fed15b6" + integrity sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww== + dependencies: + agent-base "^6.0.2" + debug "^4.3.3" + socks "^2.6.2" + socks@^2.3.3, socks@^2.6.2: version "2.6.2" resolved "https://registry.npmjs.org/socks/-/socks-2.6.2.tgz" @@ -15094,7 +15847,7 @@ sort-keys@^2.0.0: dependencies: is-plain-obj "^1.0.0" -sort-keys@^4.0.0: +sort-keys@^4.0.0, sort-keys@^4.2.0: version "4.2.0" resolved "https://registry.npmjs.org/sort-keys/-/sort-keys-4.2.0.tgz" integrity sha512-aUYIEU/UviqPgc8mHR6IW1EGxkAXpeRETYcrzg8cLAvUPZcpAlleSXHV2mY7G12GphSH6Gzv+4MMVSSkbdteHg== @@ -15111,7 +15864,7 @@ source-map-js@^1.0.2: resolved "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== -source-map-support@~0.5.20: +source-map-support@^0.5.6, source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== @@ -15141,17 +15894,10 @@ space-separated-tokens@^1.0.0: resolved "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz" integrity sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA== -spawn-wrap@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz" - integrity sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg== - dependencies: - foreground-child "^2.0.0" - is-windows "^1.0.2" - make-dir "^3.0.0" - rimraf "^3.0.0" - signal-exit "^3.0.2" - which "^2.0.1" +spawn-command@^0.0.2-1: + version "0.0.2-1" + resolved "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" + integrity sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A= spdx-correct@^3.0.0: version "3.1.1" @@ -15214,6 +15960,13 @@ split2@^3.0.0: dependencies: readable-stream "^3.0.0" +split@0.3: + version "0.3.3" + resolved "https://registry.npmjs.org/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" + integrity sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8= + dependencies: + through "2" + split@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/split/-/split-1.0.1.tgz" @@ -15248,6 +16001,13 @@ ssri@^8.0.0, ssri@^8.0.1: dependencies: minipass "^3.1.1" +ssri@^9.0.0: + version "9.0.1" + resolved "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz#544d4c357a8d7b71a19700074b6883fcb4eae057" + integrity sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q== + dependencies: + minipass "^3.1.1" + stable@^0.1.8: version "0.1.8" resolved "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz" @@ -15255,9 +16015,22 @@ stable@^0.1.8: stack-trace@0.0.x: version "0.0.10" - resolved "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz" + resolved "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= +start-server-and-test@^1.14.0: + version "1.14.0" + resolved "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-1.14.0.tgz#c57f04f73eac15dd51733b551d775b40837fdde3" + integrity sha512-on5ELuxO2K0t8EmNj9MtVlFqwBMxfWOhu4U7uZD1xccVpFlOQKR93CSe0u98iQzfNxRyaNTb/CdadbNllplTsw== + dependencies: + bluebird "3.7.2" + check-more-types "2.24.0" + debug "4.3.2" + execa "5.1.1" + lazy-ass "1.6.0" + ps-tree "1.2.0" + wait-on "6.0.0" + state-toggle@^1.0.0: version "1.0.3" resolved "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.3.tgz" @@ -15291,9 +16064,16 @@ stealthy-require@^1.1.0: resolved "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz" integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= +stream-combiner@~0.0.4: + version "0.0.4" + resolved "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" + integrity sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ= + dependencies: + duplexer "~0.1.1" + stream-shift@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz" + resolved "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== strict-uri-encode@^2.0.0: @@ -15405,7 +16185,7 @@ strip-ansi@^4.0.0: strip-ansi@^5.2.0: version "5.2.0" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== dependencies: ansi-regex "^4.1.0" @@ -15424,11 +16204,33 @@ strip-ansi@^7.0.1: dependencies: ansi-regex "^6.0.1" +strip-bom-buf@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/strip-bom-buf/-/strip-bom-buf-1.0.0.tgz#1cb45aaf57530f4caf86c7f75179d2c9a51dd572" + integrity sha1-HLRar1dTD0yvhsf3UXnSyaUd1XI= + dependencies: + is-utf8 "^0.2.1" + +strip-bom-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz#f87db5ef2613f6968aa545abfe1ec728b6a829ca" + integrity sha1-+H217yYT9paKpUWr/h7HKLaoKco= + dependencies: + first-chunk-stream "^2.0.0" + strip-bom "^2.0.0" + strip-bom-string@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz" integrity sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI= +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= + dependencies: + is-utf8 "^0.2.0" + strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz" @@ -15520,6 +16322,11 @@ supports-color@8.1.1, supports-color@^8.0.0, supports-color@^8.1.0, supports-col dependencies: has-flag "^4.0.0" +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + supports-color@^5.3.0, supports-color@^5.4.0: version "5.5.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" @@ -15595,6 +16402,14 @@ table@^6.0.9: string-width "^4.2.3" strip-ansi "^6.0.1" +taketalk@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/taketalk/-/taketalk-1.0.0.tgz#b4d4f0deed206ae7df775b129ea2ca6de52f26dd" + integrity sha1-tNTw3u0gauffd1sSnqLKbeUvJt0= + dependencies: + get-stdin "^4.0.1" + minimist "^1.1.0" + tapable@^1.0.0: version "1.1.3" resolved "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz" @@ -15639,7 +16454,7 @@ tar@^4.4.12: safe-buffer "^5.2.1" yallist "^3.1.1" -tar@^6.0.2, tar@^6.1.0, tar@^6.1.11: +tar@^6.0.2, tar@^6.1.0, tar@^6.1.11, tar@^6.1.2: version "6.1.11" resolved "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz" integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== @@ -15688,15 +16503,6 @@ terser@^5.10.0, terser@^5.7.2: source-map "~0.8.0-beta.0" source-map-support "~0.5.20" -test-exclude@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz" - integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== - dependencies: - "@istanbuljs/schema" "^0.1.2" - glob "^7.1.4" - minimatch "^3.0.4" - text-encoding-utf-8@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz" @@ -15709,7 +16515,7 @@ text-extensions@^1.0.0: text-hex@1.0.x: version "1.0.0" - resolved "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz" + resolved "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz#69dc9c1b17446ee79a92bf5b884bb4b9127506f5" integrity sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg== text-table@^0.2.0, text-table@~0.2.0: @@ -15717,6 +16523,11 @@ text-table@^0.2.0, text-table@~0.2.0: resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= +textextensions@^5.12.0, textextensions@^5.13.0: + version "5.15.0" + resolved "https://registry.npmjs.org/textextensions/-/textextensions-5.15.0.tgz#4bb3296ad6fc111cf4b39c589dd028d8aaaf7060" + integrity sha512-MeqZRHLuaGamUXGuVn2ivtU3LA3mLCCIO5kUGoohTCoGmCBg/+8yPhWVX9WSl9telvVd8erftjFk9Fwb2dD6rw== + thenify-all@^1.0.0: version "1.6.0" resolved "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz" @@ -15746,7 +16557,7 @@ through2@^4.0.0: dependencies: readable-stream "3" -through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: +through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@~2.3, through@~2.3.1: version "2.3.8" resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= @@ -15862,6 +16673,11 @@ traverse-chain@~0.1.0: resolved "https://registry.npmjs.org/traverse-chain/-/traverse-chain-0.1.0.tgz" integrity sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE= +tree-kill@^1.2.2: + version "1.2.2" + resolved "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" + integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== + treeverse@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/treeverse/-/treeverse-1.0.4.tgz#a6b0ebf98a1bca6846ddc7ecbc900df08cb9cd5f" @@ -15884,7 +16700,7 @@ trim@0.0.1: triple-beam@^1.3.0: version "1.3.0" - resolved "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz" + resolved "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz#a595214c7298db8339eeeee083e4d10bd8cb8dd9" integrity sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw== trough@^1.0.0: @@ -15892,6 +16708,15 @@ trough@^1.0.0: resolved "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz" integrity sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA== +ts-mocha@^9.0.2: + version "9.0.2" + resolved "https://registry.npmjs.org/ts-mocha/-/ts-mocha-9.0.2.tgz#c1ef0248874d04a0f26dd9bd8d88e617a8d82ab1" + integrity sha512-WyQjvnzwrrubl0JT7EC1yWmNpcsU3fOuBFfdps30zbmFBgKniSaSOyZMZx+Wq7kytUs5CY+pEbSYEbGfIKnXTw== + dependencies: + ts-node "7.0.1" + optionalDependencies: + tsconfig-paths "^3.5.0" + ts-morph@^13.0.3: version "13.0.3" resolved "https://registry.npmjs.org/ts-morph/-/ts-morph-13.0.3.tgz#c0c51d1273ae2edb46d76f65161eb9d763444c1d" @@ -15900,7 +16725,40 @@ ts-morph@^13.0.3: "@ts-morph/common" "~0.12.3" code-block-writer "^11.0.0" -ts-node@^10.4.0, ts-node@^10.7.0: +ts-node@7.0.1: + version "7.0.1" + resolved "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz#9562dc2d1e6d248d24bc55f773e3f614337d9baf" + integrity sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw== + dependencies: + arrify "^1.0.0" + buffer-from "^1.1.0" + diff "^3.1.0" + make-error "^1.1.1" + minimist "^1.2.0" + mkdirp "^0.5.1" + source-map-support "^0.5.6" + yn "^2.0.0" + +ts-node@^10.2.1, ts-node@^10.4.0: + version "10.8.1" + resolved "https://registry.npmjs.org/ts-node/-/ts-node-10.8.1.tgz#ea2bd3459011b52699d7e88daa55a45a1af4f066" + integrity sha512-Wwsnao4DQoJsN034wePSg5nZiw4YKXf56mPIAeD6wVmiv+RytNSWqc2f3fKvcUoV+Yn2+yocD71VOfQHbmVX4g== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + +ts-node@^10.7.0: version "10.7.0" resolved "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz" integrity sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A== @@ -15919,7 +16777,7 @@ ts-node@^10.4.0, ts-node@^10.7.0: v8-compile-cache-lib "^3.0.0" yn "3.1.1" -tsconfig-paths@^3.14.1: +tsconfig-paths@^3.14.1, tsconfig-paths@^3.5.0: version "3.14.1" resolved "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz" integrity sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ== @@ -16010,7 +16868,7 @@ type-fest@^0.6.0: resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz" integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== -type-fest@^0.8.0, type-fest@^0.8.1: +type-fest@^0.8.1: version "0.8.1" resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== @@ -16051,11 +16909,16 @@ typedoc@^0.22.13, typedoc@^0.22.15: minimatch "^5.0.1" shiki "^0.10.1" -typescript@^4.2.4, typescript@^4.3.2, typescript@^4.3.5, typescript@^4.4.4, typescript@^4.6.3: +typescript@^4.2.4, typescript@^4.3.2, typescript@^4.3.5, typescript@^4.6.3: version "4.6.3" resolved "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz" integrity sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw== +typescript@^4.4.3: + version "4.7.3" + resolved "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d" + integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA== + ua-parser-js@^0.7.30: version "0.7.31" resolved "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz" @@ -16263,6 +17126,11 @@ unquote@~1.1.1: resolved "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz" integrity sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ= +untildify@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b" + integrity sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw== + upath@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz" @@ -16397,17 +17265,17 @@ uuid@3.3.2, uuid@^3.3.2: resolved "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== -uuid@^3.3.3: - version "3.4.0" - resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== +uuid@8.0.0: + version "8.0.0" + resolved "https://registry.npmjs.org/uuid/-/uuid-8.0.0.tgz#bc6ccf91b5ff0ac07bbcdbf1c7c4e150db4dbb6c" + integrity sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw== uuid@^8.3.2: version "8.3.2" resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -v8-compile-cache-lib@^3.0.0: +v8-compile-cache-lib@^3.0.0, v8-compile-cache-lib@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== @@ -16474,6 +17342,29 @@ vfile@^4.0.0: unist-util-stringify-position "^2.0.0" vfile-message "^2.0.0" +vinyl-file@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/vinyl-file/-/vinyl-file-3.0.0.tgz#b104d9e4409ffa325faadd520642d0a3b488b365" + integrity sha1-sQTZ5ECf+jJfqt1SBkLQo7SIs2U= + dependencies: + graceful-fs "^4.1.2" + pify "^2.3.0" + strip-bom-buf "^1.0.0" + strip-bom-stream "^2.0.0" + vinyl "^2.0.1" + +vinyl@^2.0.1: + version "2.2.1" + resolved "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz#23cfb8bbab5ece3803aa2c0a1eb28af7cbba1974" + integrity sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw== + dependencies: + clone "^2.1.1" + clone-buffer "^1.0.0" + clone-stats "^1.0.0" + cloneable-readable "^1.0.0" + remove-trailing-separator "^1.0.1" + replace-ext "^1.0.0" + vscode-languageserver-textdocument@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.4.tgz" @@ -16494,6 +17385,17 @@ vscode-uri@^3.0.3: resolved "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.3.tgz" integrity sha512-EcswR2S8bpR7fD0YPeS7r2xXExrScVMxg4MedACaWHEtx9ftCF/qHG1xGkolzTPcEmjTavCQgbVzHUIdTMzFGA== +wait-on@6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/wait-on/-/wait-on-6.0.0.tgz#7e9bf8e3d7fe2daecbb7a570ac8ca41e9311c7e7" + integrity sha512-tnUJr9p5r+bEYXPUdRseolmz5XqJTTj98JgOsfBn7Oz2dxfE2g3zw1jE+Mo8lopM3j3et/Mq1yW7kKX6qw7RVw== + dependencies: + axios "^0.21.1" + joi "^17.4.0" + lodash "^4.17.21" + minimist "^1.2.5" + rxjs "^7.1.0" + wait-on@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/wait-on/-/wait-on-6.0.1.tgz" @@ -16525,7 +17427,7 @@ wbuf@^1.1.0, wbuf@^1.7.3: dependencies: minimalistic-assert "^1.0.0" -wcwidth@^1.0.0: +wcwidth@^1.0.0, wcwidth@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz" integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= @@ -16729,10 +17631,13 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" -which-module@^2.0.0: +which-pm@2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + resolved "https://registry.npmjs.org/which-pm/-/which-pm-2.0.0.tgz#8245609ecfe64bf751d0eef2f376d83bf1ddb7ae" + integrity sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w== + dependencies: + load-yaml-file "^0.2.0" + path-exists "^4.0.0" which-typed-array@^1.1.2: version "1.1.7" @@ -16760,7 +17665,7 @@ which@^1.2.9, which@^1.3.1: dependencies: isexe "^2.0.0" -wide-align@^1.1.0, wide-align@^1.1.2: +wide-align@^1.1.0, wide-align@^1.1.2, wide-align@^1.1.5: version "1.1.5" resolved "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz" integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== @@ -16788,7 +17693,7 @@ wildcard@^2.0.0: winston-transport@^4.5.0: version "4.5.0" - resolved "https://registry.npmjs.org/winston-transport/-/winston-transport-4.5.0.tgz" + resolved "https://registry.npmjs.org/winston-transport/-/winston-transport-4.5.0.tgz#6e7b0dd04d393171ed5e4e4905db265f7ab384fa" integrity sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q== dependencies: logform "^2.3.2" @@ -16797,7 +17702,7 @@ winston-transport@^4.5.0: winston@^3.3.3: version "3.7.2" - resolved "https://registry.npmjs.org/winston/-/winston-3.7.2.tgz" + resolved "https://registry.npmjs.org/winston/-/winston-3.7.2.tgz#95b4eeddbec902b3db1424932ac634f887c400b1" integrity sha512-QziIqtojHBoyzUOdQvQiar1DH0Xp9nF1A1y7NVy2DGEsz82SBDtOalS0ulTRGVT14xPX3WRWkCsdcJKqNflKng== dependencies: "@dabh/diagnostics" "^2.0.2" @@ -16826,9 +17731,17 @@ workerpool@6.2.0: resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz" integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi@^6.2.0: version "6.2.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== dependencies: ansi-styles "^4.0.0" @@ -16877,6 +17790,14 @@ write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" +write-file-atomic@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.1.tgz#9faa33a964c1c85ff6f849b80b42a88c2c537c8f" + integrity sha512-nSKUxgAbyioruk6hU87QzVbY279oYT6uiwgDoujth2ju4mJ+TZau7SQBhtbTmUyuNYTuXnSyRn66FV0+eCgcrQ== + dependencies: + imurmurhash "^0.1.4" + signal-exit "^3.0.7" + write-json-file@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz" @@ -16955,11 +17876,6 @@ xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1: resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== -y18n@^4.0.0: - version "4.0.3" - resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz" - integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== - y18n@^5.0.5: version "5.0.8" resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" @@ -16985,14 +17901,6 @@ yargs-parser@20.2.4, yargs-parser@^20.2.2, yargs-parser@^20.2.3: resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz" integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== -yargs-parser@^18.1.2: - version "18.1.3" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz" - integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs-parser@^21.0.0: version "21.0.1" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz" @@ -17021,23 +17929,6 @@ yargs@16.2.0, yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^15.0.2: - version "15.4.1" - resolved "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz" - integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== - dependencies: - cliui "^6.0.0" - decamelize "^1.2.0" - find-up "^4.1.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^4.2.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^18.1.2" - yargs@^17.0.1: version "17.4.1" resolved "https://registry.npmjs.org/yargs/-/yargs-17.4.1.tgz" @@ -17051,21 +17942,114 @@ yargs@^17.0.1: y18n "^5.0.5" yargs-parser "^21.0.0" +yargs@^17.3.1: + version "17.5.1" + resolved "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz#e109900cab6fcb7fd44b1d8249166feb0b36e58e" + integrity sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.0.0" + yarn@^1.22.17: version "1.22.18" resolved "https://registry.npmjs.org/yarn/-/yarn-1.22.18.tgz" integrity sha512-oFffv6Jp2+BTUBItzx1Z0dpikTX+raRdqupfqzeMKnoh7WD6RuPAxcqDkMUy9vafJkrB0YaV708znpuMhEBKGQ== +yeoman-environment@^3.9.1: + version "3.9.1" + resolved "https://registry.npmjs.org/yeoman-environment/-/yeoman-environment-3.9.1.tgz#21912bdee4b1d302a5c25a7d31338fa092ea7116" + integrity sha512-IdRnbQt/DSOSnao0oD9c+or1X2UrL+fx9eC0O7Lq/MGZV68nhv9k77MqG+hEAySPSlyCpocVlhfQwV62hczk5Q== + dependencies: + "@npmcli/arborist" "^4.0.4" + are-we-there-yet "^2.0.0" + arrify "^2.0.1" + binaryextensions "^4.15.0" + chalk "^4.1.0" + cli-table "^0.3.1" + commander "7.1.0" + dateformat "^4.5.0" + debug "^4.1.1" + diff "^5.0.0" + error "^10.4.0" + escape-string-regexp "^4.0.0" + execa "^5.0.0" + find-up "^5.0.0" + globby "^11.0.1" + grouped-queue "^2.0.0" + inquirer "^8.0.0" + is-scoped "^2.1.0" + lodash "^4.17.10" + log-symbols "^4.0.0" + mem-fs "^1.2.0 || ^2.0.0" + mem-fs-editor "^8.1.2 || ^9.0.0" + minimatch "^3.0.4" + npmlog "^5.0.1" + p-queue "^6.6.2" + p-transform "^1.3.0" + pacote "^12.0.2" + preferred-pm "^3.0.3" + pretty-bytes "^5.3.0" + semver "^7.1.3" + slash "^3.0.0" + strip-ansi "^6.0.0" + text-table "^0.2.0" + textextensions "^5.12.0" + untildify "^4.0.0" + +yeoman-generator@^5.6.1: + version "5.6.1" + resolved "https://registry.npmjs.org/yeoman-generator/-/yeoman-generator-5.6.1.tgz#850fd266a5ab26d9d1cb9c46ad646f06eade4a1d" + integrity sha512-XllgFvmDEwoPMq2rKtL4/N52WlINJW6a3I3XtlCrMb3/dqO5dW0nPNgR0L3IIUIdf9y1EHb1ZFMs2Qp3ZEEFxg== + dependencies: + chalk "^4.1.0" + dargs "^7.0.0" + debug "^4.1.1" + execa "^4.1.0" + github-username "^6.0.0" + lodash "^4.17.11" + minimist "^1.2.5" + read-pkg-up "^7.0.1" + run-async "^2.0.0" + semver "^7.2.1" + shelljs "^0.8.5" + sort-keys "^4.2.0" + text-table "^0.2.0" + yn@3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz" integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== +yn@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" + integrity sha1-5a2ryKz0CPY4X8dklWhMiOavaJo= + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== +yosay@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/yosay/-/yosay-2.0.2.tgz#a7017e764cd88d64a1ae64812201de5b157adf6d" + integrity sha512-avX6nz2esp7IMXGag4gu6OyQBsMh/SEn+ZybGu3yKPlOTE6z9qJrzG/0X5vCq/e0rPFy0CUYCze0G5hL310ibA== + dependencies: + ansi-regex "^2.0.0" + ansi-styles "^3.0.0" + chalk "^1.0.0" + cli-boxes "^1.0.0" + pad-component "0.0.1" + string-width "^2.0.0" + strip-ansi "^3.0.0" + taketalk "^1.0.0" + wrap-ansi "^2.0.0" + zwitch@^1.0.0: version "1.0.5" resolved "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz"