@metaplex-foundation/umi-web3js-adapters
Version:
A helper package to transform web3.js types to and from umi types
11 lines (8 loc) • 361 B
text/typescript
import { PublicKey } from '@metaplex-foundation/umi';
import { PublicKey as Web3JsPublicKey } from '@solana/web3.js';
export function fromWeb3JsPublicKey(publicKey: Web3JsPublicKey): PublicKey {
return publicKey.toBase58() as PublicKey;
}
export function toWeb3JsPublicKey(publicKey: PublicKey): Web3JsPublicKey {
return new Web3JsPublicKey(publicKey);
}