Create A Wallet
These steps outline a repeatable process for creating a new BENJI wallet. Franklin Templeton will create a wallet for you, so you will not need to come into this process with your own wallet.
Prerequisites
$env:BENJI_ACCESS_TOKENis already set- you know your
networkId - you know your
productId - you know your
institutionEntityId
Step 1: Generate a wallet signing keypair
This creates the Ed25519 keypair used for wallet intent signing. Save the private key somewhere secure after creation.
$keyPair = @'
import { generateKeyPairSync } from "crypto";
const { publicKey, privateKey } = generateKeyPairSync("ed25519");
process.stdout.write(JSON.stringify({
pubKey: publicKey.export({ type: "spki", format: "der" }).toString("base64"),
priKey: privateKey.export({ type: "pkcs8", format: "der" }).toString("base64")
}));
'@ | node --input-type=module - | ConvertFrom-Json
$pubKey = $keyPair.pubKey
$priKey = $keyPair.priKey
Step 2: Set your wallet inputs
$networkId = "YOUR_NETWORK_ID" # Example: STR
$productId = "YOUR_PRODUCT_ID"
$institutionEntityId = "YOUR_INSTITUTION_ENTITY_ID"
$walletName = "YOUR_WALLET_NAME"
$signingKeyName = "InitialKey"
Step 3: Run walletCreate
$body = @{
query = @'
mutation (
$networkId: String!,
$productId: ID!,
$walletName: String!,
$institutionEntityId: ID!,
$signingKeyName: String!,
$signingKey: String!
) {
walletCreate(
institutionInput: {
networkId: $networkId
productId: $productId
walletName: $walletName
institutionEntityId: $institutionEntityId
signingKey: {
signingKeyScheme: SUMMARY_ED25519
signingKeyName: $signingKeyName
signingKey: $signingKey
}
}
) {
walletId
walletAddress
}
}
'@
variables = @{
networkId = $networkId
productId = $productId
walletName = $walletName
institutionEntityId = $institutionEntityId
signingKeyName = $signingKeyName
signingKey = $pubKey
}
} | ConvertTo-Json -Depth 10
Invoke-RestMethod `
-Uri "https://api-uat.frk.com/tf/platform/bve/graphql" `
-Method POST `
-Headers @{ Authorization = "Bearer $env:BENJI_ACCESS_TOKEN" } `
-ContentType "application/json" `
-Body $body | ConvertTo-Json -Depth 10
Save these outputs
After the call succeeds, keep:
walletIdwalletAddress- the generated
$priKey
You will need the wallet signing private key later for transaction intent signing.