celo-org / developer-tooling

🛠️ SDKs and CLI for interacting with Celo
Apache License 2.0
10 stars 6 forks source link

replace wallet packages #318

Open aaronmgdr opened 1 month ago

aaronmgdr commented 1 month ago

the wallet packages will be replaced.

we can use https://github.com/valora-inc/viem-account-hsm-gcp as a guide

basis will be viem toAccount

aaronmgdr commented 1 month ago

interface idea

import { awsHsmToAccount } from '@celo/viem-account/aws-hsm'
import { azureHsmToAccount } from '@celo/viem-account/azure-hsm'

import { ledgerToAccount } from '@celo/viem-account/ledger'

import TransportNodeHid from '@ledgerhq/hw-transport-node-hid'

const awsAccount = await awsHsmToAccount({
   azureKeyVaultName:
    'projects/your-aws-project/locations/global/keyRings/your-keyring/cryptoKeys/your-hsm/cryptoKeyVersions/1',
})

const transport = await TransportNodeHid.open('')

const ledgerAccount = ledgerToAccount({
  transport: transport,
  baseDerivationPath?: string,
  ledgerAddressValidation?: AddressValidation,
})
nicolasbrugneaux commented 10 hours ago

Will start with wallet-ledger this week