Skip to content

Commit

Permalink
begin vault
Browse files Browse the repository at this point in the history
  • Loading branch information
BitHighlander committed Dec 30, 2024
1 parent 98e9d84 commit b896929
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/keepkey-sdk-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"mkdirp": "^1.0.4",
"promise.any": "^2.0.5",
"protobufjs": "^7.2.3",
"sqlite": "^5.1.1",
"sqlite3": "^5.1.7"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/keepkey-sdk-server/src/controllers/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Route,
Security,
Tags,
// @ts-ignore
} from '@tsoa/runtime';

import { ApiController } from '../auth';
Expand Down
52 changes: 52 additions & 0 deletions packages/keepkey-sdk-server/src/controllers/vault.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import {
// Body,
Middlewares,
OperationId,
Post,
Response,
Route,
Security,
Tags,
// @ts-ignore
} from '@tsoa/runtime';

import { ApiController } from '../auth';
import { extra } from '../middlewares';

interface Pubkey {
id?: number;
master?: string;
address?: string;
pubkey: string;
scriptType: string;
type?: string;
path?: string;
icon?: string;
pathMaster?: string;
context?: string;
contextType?: string;
networks?: string[];
}

@Route('/vault')
@Tags('vault')
@Security('apiKey')
@Middlewares(extra)
@Response(400, 'Bad request')
@Response(500, 'Error processing request')
export class VaultController extends ApiController {

/**
* @summary Retrieve all public keys
*/
@Post('getVaults')
@OperationId('getVaults')
public async getVaults(): Promise<Pubkey[]> {
try {

return [];
} catch (error: any) {
throw new Error(`Failed to retrieve pubkeys: ${error.message}`);
}
}
}
2 changes: 2 additions & 0 deletions packages/keepkey-sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class KeepKeySdk {
readonly raw: apis.RawApi
readonly utxo: apis.UTXOApi
readonly storage: apis.StorageApi
readonly vault: apis.VaultApi
readonly system: apis.SystemApi & {
readonly debug: apis.DebugApi
readonly info: apis.InfoApi
Expand All @@ -29,6 +30,7 @@ export class KeepKeySdk {
this.auth = new apis.AuthApi(configuration)
this.utxo = new apis.UTXOApi(configuration)
this.storage = new apis.StorageApi(configuration)
this.vault = new apis.VaultApi(configuration)
this.bnb = new apis.BNBApi(configuration)
this.cosmos = new apis.CosmosApi(configuration)
this.osmosis = new apis.OsmosisApi(configuration)
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19836,6 +19836,7 @@ __metadata:
promise.any: "npm:^2.0.5"
protobufjs: "npm:^7.2.3"
rimraf: "npm:^3.0.2"
sqlite: "npm:^5.1.1"
sqlite3: "npm:^5.1.7"
tsoa: "npm:^4.1.3"
typescript: "npm:^4.7.0"
Expand Down Expand Up @@ -25640,6 +25641,13 @@ __metadata:
languageName: node
linkType: hard

"sqlite@npm:^5.1.1":
version: 5.1.1
resolution: "sqlite@npm:5.1.1"
checksum: 10/0b61164e73507672703dde83c70fd99627bf75b11bd2a70cf1573c2ea9c52d229365991412ada18daf470dc329694a4f831788a776f9374539a38892c3e6a23f
languageName: node
linkType: hard

"sshpk@npm:^1.7.0":
version: 1.17.0
resolution: "sshpk@npm:1.17.0"
Expand Down

0 comments on commit b896929

Please sign in to comment.