Skip to content

Commit

Permalink
Merge pull request #33 from switchboard-xyz/update
Browse files Browse the repository at this point in the history
update
  • Loading branch information
jessupjn authored Jun 5, 2024
2 parents dcf4587 + e9c9e1d commit 3da5bce
Show file tree
Hide file tree
Showing 272 changed files with 8,679 additions and 13,640 deletions.
280 changes: 141 additions & 139 deletions cli/README.md

Large diffs are not rendered by default.

216 changes: 110 additions & 106 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@switchboard-xyz/cli",
"version": "3.3.12",
"version": "3.3.39",
"description": "command line tool to interact with switchboard",
"keywords": [
"oclif"
Expand Down Expand Up @@ -32,16 +32,113 @@
"lint": "pnpm exec eslint src/**/*.ts",
"prepack": "pnpm lint && pnpm build && pnpm exec oclif manifest && pnpm exec oclif readme",
"postpack": "pnpm exec shx rm -f oclif.manifest.json",
"test": "pnpm exec mocha --forbid-only \"test/**/*.test.ts\"",
"test:old": "pnpm exec mocha --forbid-only \"test/**/*.test.ts\"",
"uprev:sb": "pnpm add @switchboard-xyz/aptos.js@latest @switchboard-xyz/solana.js@latest",
"version": "pnpm exec oclif readme && git add README.md",
"watch": "pnpm exec tsc --watch"
},
"oclif": {
"additionalHelpFlags": [
"-h"
],
"bin": "sb",
"commands": "./dist/commands",
"dirname": "@switchboard-xyz/cli",
"macos": {
"identifier": "com.switchboard.cli"
},
"plugins": [
"@oclif/plugin-update",
"@oclif/plugin-help",
"@oclif/plugin-version",
"@oclif/plugin-warn-if-update-available"
],
"topicSeparator": " ",
"topics": {
"aptos": {
"description": "interact with switchboard on Aptos"
},
"aptos:aggregator": {
"description": "interact with a switchboard aggregator account"
},
"aptos:crank": {
"description": "interact with a switchboard crank account"
},
"aptos:job": {
"description": "interact with a switchboard job account"
},
"aptos:lease": {
"description": "interact with a switchboard lease account"
},
"aptos:oracle": {
"description": "interact with a switchboard oracle account"
},
"aptos:print": {
"description": "find and print a switchboard account by public key"
},
"aptos:queue": {
"description": "interact with a switchboard oracle queue account"
},
"config": {
"description": "manage the CLI configuration variables"
},
"job": {
"description": "test a switchboard job definition"
},
"oracle": {
"description": "fetch oracle logs for a given cluster"
},
"solana": {
"description": "interact with switchboard on Solana"
},
"solana:aggregator": {
"description": "interact with a switchboard aggregator account"
},
"solana:crank": {
"description": "interact with a switchboard crank account"
},
"solana:job": {
"description": "interact with a switchboard job account"
},
"solana:lease": {
"description": "interact with a switchboard lease account"
},
"solana:oracle": {
"description": "interact with a switchboard oracle account"
},
"solana:print": {
"description": "find and print a switchboard account by public key for a given cluster"
},
"solana:queue": {
"description": "interact with a switchboard oracle queue account"
}
},
"update": {
"node": {
"version": "16.14.2"
},
"s3": {
"bucket": "sb-cli",
"templates": {
"target": {
"manifest": "tarballs/<%- bin %>/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- platform %>-<%- arch %>",
"unversioned": "tarballs/<%- bin %>/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %>-<%- platform %>-<%- arch %><%- ext %>",
"versioned": "tarballs/<%- bin %>/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %>-v<%- version %>/<%- bin %>-v<%- version %>-<%- platform %>-<%- arch %><%- ext %>"
},
"vanilla": {
"manifest": "tarballs/<%- bin %>/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %>version",
"unversioned": "tarballs/<%- bin %>/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %><%- ext %>",
"versioned": "tarballs/<%- bin %>/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %>-v<%- version %>/<%- bin %>-v<%- version %><%- ext %>"
}
}
}
}
},
"dependencies": {
"@aws-sdk/client-secrets-manager": "^3.154.0",
"@aws-sdk/credential-providers": "^3.157.0",
"@coral-xyz/anchor": "^0.28.0",
"@coral-xyz/borsh": "^0.28.0",
"@coral-xyz/anchor": "^0.29.0",
"@coral-xyz/borsh": "^0.29.0",
"@google-cloud/secret-manager": "^3.10.1",
"@ledgerhq/hw-app-solana": "^7.0.2",
"@ledgerhq/hw-transport-node-hid-singleton": "^6.28.5",
Expand All @@ -52,14 +149,16 @@
"@oclif/plugin-update": "^3.1.32",
"@oclif/plugin-version": "^1.3.8",
"@oclif/plugin-warn-if-update-available": "^2.0.48",
"@solana/spl-token": "^0.3.8",
"@solana/web3.js": "^1.78.3",
"@switchboard-xyz/common": "^2.3.9",
"@switchboard-xyz/solana.js": "^3.1.2",
"@switchboard-xyz/oracle": "^2.1.13",
"@solana/spl-token": "^0.3.11",
"@solana/web3.js": "^1.89.0",
"@switchboard-xyz/common": "^2.3.23",
"@switchboard-xyz/solana.js": "^3.2.5",
"@switchboard-xyz/oracle": "^2.1.14",
"@switchboard-xyz/function-simulator": "^1.0.2",
"@switchboard-xyz/evm.js": "^3.12.36",
"@switchboard-xyz/aptos.js": "^2.6.11",
"@switchboard-xyz/starknet.js": "^1.0.1",
"@switchboard-xyz/on-demand": "^1.0.53",
"@terascope/fetch-github-release": "^0.8.7",
"aptos": "^1.11.0",
"async-csp": "^0.5.0",
Expand All @@ -78,7 +177,9 @@
"oclif": "^3.11.3",
"protobufjs": "^7.1.2",
"set-interval-async": "^3.0.3",
"starknet": "^5.24.3",
"toml": "^3.0.0",
"tweetnacl": "^1.0.3",
"winston": "^3.8.1",
"yaml": "^2.1.1"
},
Expand Down Expand Up @@ -112,102 +213,5 @@
},
"engines": {
"node": ">=12.0.0"
},
"oclif": {
"additionalHelpFlags": [
"-h"
],
"commands": "./dist/commands",
"bin": "sb",
"dirname": "@switchboard-xyz/cli",
"topicSeparator": " ",
"macos": {
"identifier": "com.switchboard.cli"
},
"plugins": [
"@oclif/plugin-update",
"@oclif/plugin-help",
"@oclif/plugin-version",
"@oclif/plugin-warn-if-update-available"
],
"update": {
"s3": {
"bucket": "sb-cli",
"templates": {
"target": {
"unversioned": "tarballs/<%- bin %>/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %>-<%- platform %>-<%- arch %><%- ext %>",
"versioned": "tarballs/<%- bin %>/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %>-v<%- version %>/<%- bin %>-v<%- version %>-<%- platform %>-<%- arch %><%- ext %>",
"manifest": "tarballs/<%- bin %>/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- platform %>-<%- arch %>"
},
"vanilla": {
"unversioned": "tarballs/<%- bin %>/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %><%- ext %>",
"versioned": "tarballs/<%- bin %>/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %>-v<%- version %>/<%- bin %>-v<%- version %><%- ext %>",
"manifest": "tarballs/<%- bin %>/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %>version"
}
}
},
"node": {
"version": "16.14.2"
}
},
"topics": {
"config": {
"description": "manage the CLI configuration variables"
},
"job": {
"description": "test a switchboard job definition"
},
"oracle": {
"description": "fetch oracle logs for a given cluster"
},
"solana": {
"description": "interact with switchboard on Solana"
},
"solana:aggregator": {
"description": "interact with a switchboard aggregator account"
},
"solana:lease": {
"description": "interact with a switchboard lease account"
},
"solana:crank": {
"description": "interact with a switchboard crank account"
},
"solana:queue": {
"description": "interact with a switchboard oracle queue account"
},
"solana:job": {
"description": "interact with a switchboard job account"
},
"solana:oracle": {
"description": "interact with a switchboard oracle account"
},
"solana:print": {
"description": "find and print a switchboard account by public key for a given cluster"
},
"aptos": {
"description": "interact with switchboard on Aptos"
},
"aptos:aggregator": {
"description": "interact with a switchboard aggregator account"
},
"aptos:lease": {
"description": "interact with a switchboard lease account"
},
"aptos:crank": {
"description": "interact with a switchboard crank account"
},
"aptos:queue": {
"description": "interact with a switchboard oracle queue account"
},
"aptos:job": {
"description": "interact with a switchboard job account"
},
"aptos:oracle": {
"description": "interact with a switchboard oracle account"
},
"aptos:print": {
"description": "find and print a switchboard account by public key"
}
}
}
}
1 change: 1 addition & 0 deletions cli/src/BaseCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export abstract class CliBaseCommand extends Command {
verbose: Flags.boolean({
char: "v",
description: "log everything",
default: false,
}),
silent: Flags.boolean({
char: "s",
Expand Down
4 changes: 2 additions & 2 deletions cli/src/OutputFileBaseCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CliBaseCommand } from "./BaseCommand";
import * as anchor from "@coral-xyz/anchor";
import { Flags } from "@oclif/core";
import type { Input } from "@oclif/parser";
import { SwitchboardDecimal } from "@switchboard-xyz/common";
import { BN, SwitchboardDecimal } from "@switchboard-xyz/common";
import { Big } from "@switchboard-xyz/common";
import fs from "fs";
import path from "path";
Expand Down Expand Up @@ -89,7 +89,7 @@ export abstract class OutputFileBaseCommand extends CliBaseCommand {
return value.toString();
}

if (anchor.BN.isBN(value)) {
if (BN.isBN(value)) {
return value.toString(10);
}

Expand Down
45 changes: 25 additions & 20 deletions cli/src/commands/sol-sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,38 @@ export default class SandboxCommand extends BaseCommand {
async run() {
const { args, flags } = await this.parse(SandboxCommand);

const [functionAccount, functionState] = await FunctionAccount.load(
this.program,
"33wNREhMu5vKrcx7qPtw8KHvndRv5d1UiwWkyi8DfyJS"
console.log(
"Attestation Program ID",
this.program.attestationProgramId.toBase58()
);

const functionAccountInfo =
await this.program.provider.connection.getAccountInfo(
functionAccount.publicKey
);
// const [functionAccount, functionState] = await FunctionAccount.load(
// this.program,
// "33wNREhMu5vKrcx7qPtw8KHvndRv5d1UiwWkyi8DfyJS"
// );

const functionAccountData = functionAccountInfo?.data ?? Buffer.from("");
// const functionAccountInfo =
// await this.program.provider.connection.getAccountInfo(
// functionAccount.publicKey
// );

console.log(`SIZE\n${functionAccountData.length}\n`);
// const functionAccountData = functionAccountInfo?.data ?? Buffer.from("");

console.log(
`FUNCTION ACCOUNT DATA\n[${new Uint8Array(functionAccountData)}]\n`
);
// console.log(`SIZE\n${functionAccountData.length}\n`);

console.log(
`FUNCTION ACCOUNT HEX\n0x${functionAccountData.toString("hex")}\n`
);
// console.log(
// `FUNCTION ACCOUNT DATA\n[${new Uint8Array(functionAccountData)}]\n`
// );

console.log(
`FUNCTION ACCOUNT HEX (NO DISC)\n0x${functionAccountData
.slice(8)
.toString("hex")}\n`
);
// console.log(
// `FUNCTION ACCOUNT HEX\n0x${functionAccountData.toString("hex")}\n`
// );

// console.log(
// `FUNCTION ACCOUNT HEX (NO DISC)\n0x${functionAccountData
// .slice(8)
// .toString("hex")}\n`
// );
}

async catch(error: any) {
Expand Down
Loading

0 comments on commit 3da5bce

Please sign in to comment.