@interchainjs/injective
Version:
29 lines (28 loc) • 982 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createInjectiveEthConfig = createInjectiveEthConfig;
const types_1 = require("@interchainjs/types");
/**
* Creates a wallet configuration for Injective with Ethereum-style address derivation
* @param passphrase - Optional passphrase for key derivation
* @returns Wallet configuration object
*/
function createInjectiveEthConfig(derivations = [], passphrase) {
const addrDerivation = derivations.length > 0 ? derivations : [{ hdPath: types_1.HDPath.eth().toString(), prefix: 'inj' }];
return {
privateKeyConfig: {
algo: 'secp256k1',
passphrase
},
publicKeyConfig: {
compressed: true // Use compressed keys for Cosmos-compatible signing
},
addressConfig: {
strategy: 'injective-eth'
},
derivations: addrDerivation,
message: {
hash: 'keccak256'
}
};
}