mirror of https://github.com/certusone/oyster.git
feat: bridge
This commit is contained in:
parent
bb27547446
commit
3f2ced7ef4
|
@ -160,13 +160,17 @@ export const useCurrencyLeg = (mintAddress: string) => {
|
||||||
const bridgeId = programIds().wormhole.pubkey;
|
const bridgeId = programIds().wormhole.pubkey;
|
||||||
const bridgeAuthority = await bridgeAuthorityKey(bridgeId);
|
const bridgeAuthority = await bridgeAuthorityKey(bridgeId);
|
||||||
|
|
||||||
wrappedAssetMintKey(bridgeId, bridgeAuthority, {
|
const mint = await wrappedAssetMintKey(bridgeId, bridgeAuthority, {
|
||||||
decimals: Math.min(9, info.decimals),
|
decimals: Math.min(9, info.decimals),
|
||||||
address: info.assetAddress,
|
address: info.assetAddress,
|
||||||
chain: info.chainID
|
chain: info.chainID
|
||||||
})
|
});
|
||||||
|
|
||||||
|
console.log(mint.toBase58());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(info);
|
||||||
|
|
||||||
setInfo(info);
|
setInfo(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import * as BufferLayout from 'buffer-layout';
|
import * as BufferLayout from 'buffer-layout';
|
||||||
|
|
||||||
/// ForeignAddress u8 - 32
|
|
||||||
|
|
||||||
// 420
|
// 420
|
||||||
export const GuardianSetLayout: typeof BufferLayout.Structure = BufferLayout.struct(
|
export const GuardianSetLayout: typeof BufferLayout.Structure = BufferLayout.struct(
|
||||||
[
|
[
|
||||||
|
|
|
@ -1,15 +1,6 @@
|
||||||
// 1340 - SigState - (VerifySignatures - parameter 4)
|
// 1340 - SigState - (VerifySignatures - parameter 4)
|
||||||
// export const NOP = 0;
|
// export const NOP = 0;
|
||||||
|
|
||||||
// pub struct SignatureState {
|
|
||||||
// /// signatures of validators
|
|
||||||
// pub signatures: [[u8; 65]; MAX_LEN_GUARDIAN_KEYS],
|
|
||||||
|
|
||||||
// /// hash of the data
|
|
||||||
// pub hash: [u8; 32],
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
import * as BufferLayout from 'buffer-layout';
|
import * as BufferLayout from 'buffer-layout';
|
||||||
|
|
||||||
// 1184 TransferOutProposal
|
// 1184 TransferOutProposal
|
||||||
|
|
|
@ -1,14 +1,4 @@
|
||||||
import {
|
import { programIds, sendTransaction } from '@oyster/common';
|
||||||
programIds,
|
|
||||||
getMultipleAccounts,
|
|
||||||
sendTransaction,
|
|
||||||
cache,
|
|
||||||
TokenAccountParser,
|
|
||||||
ParsedAccount,
|
|
||||||
formatAmount,
|
|
||||||
createAssociatedTokenAccountInstruction,
|
|
||||||
toLamports,
|
|
||||||
} from '@oyster/common';
|
|
||||||
import { WalletAdapter } from '@solana/wallet-base';
|
import { WalletAdapter } from '@solana/wallet-base';
|
||||||
import { ethers } from 'ethers';
|
import { ethers } from 'ethers';
|
||||||
import { WormholeFactory } from '../../../contracts/WormholeFactory';
|
import { WormholeFactory } from '../../../contracts/WormholeFactory';
|
||||||
|
|
|
@ -5,7 +5,6 @@ import {
|
||||||
cache,
|
cache,
|
||||||
TokenAccountParser,
|
TokenAccountParser,
|
||||||
ParsedAccount,
|
ParsedAccount,
|
||||||
formatAmount,
|
|
||||||
createAssociatedTokenAccountInstruction,
|
createAssociatedTokenAccountInstruction,
|
||||||
} from '@oyster/common';
|
} from '@oyster/common';
|
||||||
import { ethers } from 'ethers';
|
import { ethers } from 'ethers';
|
||||||
|
@ -140,7 +139,7 @@ export const toSolana = async (
|
||||||
step: counter++,
|
step: counter++,
|
||||||
});
|
});
|
||||||
|
|
||||||
const { txid } = await sendTransaction(
|
await sendTransaction(
|
||||||
connection,
|
connection,
|
||||||
wallet,
|
wallet,
|
||||||
instructions,
|
instructions,
|
||||||
|
|
Loading…
Reference in New Issue