Skip to content

feat: example script for on prem wallet creation #6229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

mtexeira-simtlix
Copy link
Contributor

TICKET: WP-4630

Description: An example on how to create an on-prem wallet

});

const coin = 'tbtc';
const passphrase = 'new on-prem wallet';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable passphrase.

Copilot Autofix

AI 15 days ago

To fix the issue, the unused variable passphrase should be removed from the code. This involves:

  1. Deleting the declaration of passphrase on line 19.
  2. Ensuring that no other parts of the code depend on passphrase (which is already the case here).

This change will not affect the functionality of the code, as passphrase is not used anywhere.


Suggested changeset 1
examples/ts/on-prem-wallet-creation.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/examples/ts/on-prem-wallet-creation.ts b/examples/ts/on-prem-wallet-creation.ts
--- a/examples/ts/on-prem-wallet-creation.ts
+++ b/examples/ts/on-prem-wallet-creation.ts
@@ -18,3 +18,2 @@
 const coin = 'tbtc';
-const passphrase = 'new on-prem wallet';
 const enterprise = '66632c6b42b03d265a939048beaaee55';
EOF
@@ -18,3 +18,2 @@
const coin = 'tbtc';
const passphrase = 'new on-prem wallet';
const enterprise = '66632c6b42b03d265a939048beaaee55';
Copilot is powered by AI and may make mistakes. Always verify output.
}

// TODO: delete this
function encryptPrvKeysKMS({ userKey, backupKey, passphrase }) {

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused function encryptPrvKeysKMS.

Copilot Autofix

AI 15 days ago

To fix the issue, we will remove the unused function encryptPrvKeysKMS entirely from the code. This includes deleting the function definition and any associated comments. This change will not affect the functionality of the code, as the function is not being used anywhere.


Suggested changeset 1
examples/ts/on-prem-wallet-creation.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/examples/ts/on-prem-wallet-creation.ts b/examples/ts/on-prem-wallet-creation.ts
--- a/examples/ts/on-prem-wallet-creation.ts
+++ b/examples/ts/on-prem-wallet-creation.ts
@@ -72,11 +72,3 @@
 
-// TODO: delete this
-function encryptPrvKeysKMS({ userKey, backupKey, passphrase }) {
-  // This function simulated the key encryption process with an external KMS service.
-  // Since it's an example, we're gonna use the encrypt utility from the SDK.
-  return {
-    userPrv: bitgo.encrypt({ password: passphrase, input: userKey }),
-    backupPrv: bitgo.encrypt({ password: passphrase, input: backupKey }),
-  };
-}
+// Removed unused function encryptPrvKeysKMS
 
EOF
@@ -72,11 +72,3 @@

// TODO: delete this
function encryptPrvKeysKMS({ userKey, backupKey, passphrase }) {
// This function simulated the key encryption process with an external KMS service.
// Since it's an example, we're gonna use the encrypt utility from the SDK.
return {
userPrv: bitgo.encrypt({ password: passphrase, input: userKey }),
backupPrv: bitgo.encrypt({ password: passphrase, input: backupKey }),
};
}
// Removed unused function encryptPrvKeysKMS

Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant