Algorand mainnet deploy (#1434)
* algorand mainnet deploy * Changes to sdk/js * Update sdk changlog Co-authored-by: Bruce Riley <briley@jumptrading.com>
This commit is contained in:
parent
b583708e53
commit
eae0b51d37
|
@ -641,7 +641,6 @@ func runNode(cmd *cobra.Command, args []string) {
|
|||
logger.Fatal("Please specify --terra2Contract")
|
||||
}
|
||||
|
||||
if *testnetMode {
|
||||
if *algorandIndexerRPC == "" {
|
||||
logger.Fatal("Please specify --algorandIndexerRPC")
|
||||
}
|
||||
|
@ -658,6 +657,7 @@ func runNode(cmd *cobra.Command, args []string) {
|
|||
logger.Fatal("Please specify --algorandAppID")
|
||||
}
|
||||
|
||||
if *testnetMode {
|
||||
if *pythnetContract == "" {
|
||||
logger.Fatal("Please specify --pythnetContract")
|
||||
}
|
||||
|
@ -816,9 +816,7 @@ func runNode(cmd *cobra.Command, args []string) {
|
|||
chainObsvReqC[vaa.ChainIDPolygon] = make(chan *gossipv1.ObservationRequest)
|
||||
chainObsvReqC[vaa.ChainIDAvalanche] = make(chan *gossipv1.ObservationRequest)
|
||||
chainObsvReqC[vaa.ChainIDOasis] = make(chan *gossipv1.ObservationRequest)
|
||||
if *testnetMode || *unsafeDevMode {
|
||||
chainObsvReqC[vaa.ChainIDAlgorand] = make(chan *gossipv1.ObservationRequest)
|
||||
}
|
||||
if *nearRPC != "" {
|
||||
chainObsvReqC[vaa.ChainIDNear] = make(chan *gossipv1.ObservationRequest)
|
||||
}
|
||||
|
|
|
@ -106,6 +106,7 @@ var knownTokenbridgeEmitters = map[vaa.ChainID]string{
|
|||
vaa.ChainIDPolygon: "0000000000000000000000005a58505a96d1dbf8df91cb21b54419fc36e93fde",
|
||||
vaa.ChainIDAvalanche: "0000000000000000000000000e082f06ff657d94310cb8ce8b0d9a04541d8052",
|
||||
vaa.ChainIDOasis: "0000000000000000000000005848c791e09901b40a9ef749f2a6735b418d7564",
|
||||
vaa.ChainIDAlgorand: "25e716e0618d9f38b603a97cc42db659069c0f5185230e5e61679fa876191ec4",
|
||||
vaa.ChainIDAurora: "00000000000000000000000051b5123a7b0F9b2bA265f9c4C8de7D78D52f510F",
|
||||
vaa.ChainIDFantom: "0000000000000000000000007C9Fc5741288cDFdD83CeB07f3ea7e22618D79D2",
|
||||
vaa.ChainIDKarura: "000000000000000000000000ae9d7fe007b3327AA64A32824Aaac52C42a6E624",
|
||||
|
|
|
@ -12,6 +12,7 @@ func chainList() []chainConfigEntry {
|
|||
return []chainConfigEntry{
|
||||
chainConfigEntry{emitterChainID: vaa.ChainIDTerra, dailyLimit: 500000},
|
||||
chainConfigEntry{emitterChainID: vaa.ChainIDOasis, dailyLimit: 500000},
|
||||
chainConfigEntry{emitterChainID: vaa.ChainIDAlgorand, dailyLimit: 500000},
|
||||
chainConfigEntry{emitterChainID: vaa.ChainIDAurora, dailyLimit: 500000},
|
||||
chainConfigEntry{emitterChainID: vaa.ChainIDFantom, dailyLimit: 500000},
|
||||
chainConfigEntry{emitterChainID: vaa.ChainIDKarura, dailyLimit: 500000},
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
# Changelog
|
||||
|
||||
## 0.6.2
|
||||
|
||||
### Added
|
||||
|
||||
Algorand mainnet support
|
||||
|
||||
Updated consts.ts file
|
||||
Exported signSendAndConfirmAlgorand()
|
||||
|
||||
## 0.6.1
|
||||
|
||||
### Added
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@certusone/wormhole-sdk",
|
||||
"version": "0.6.1",
|
||||
"version": "0.6.2",
|
||||
"description": "SDK for interacting with Wormhole",
|
||||
"homepage": "https://wormholenetwork.com",
|
||||
"main": "./lib/cjs/index.js",
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
// Algorand.ts
|
||||
|
||||
import algosdk, {
|
||||
Account,
|
||||
Algodv2,
|
||||
assignGroupID,
|
||||
bigIntToBytes,
|
||||
decodeAddress,
|
||||
encodeAddress,
|
||||
|
@ -14,6 +16,7 @@ import algosdk, {
|
|||
OnApplicationComplete,
|
||||
signLogicSigTransaction,
|
||||
Transaction,
|
||||
waitForConfirmation,
|
||||
} from "algosdk";
|
||||
|
||||
import abi from "algosdk";
|
||||
|
@ -963,3 +966,26 @@ export function hexToNativeAssetBigIntAlgorand(s: string): bigint {
|
|||
export function hexToNativeAssetStringAlgorand(s: string): string {
|
||||
return BigNumber.from(hexToUint8Array(s)).toString();
|
||||
}
|
||||
|
||||
export async function signSendAndConfirmAlgorand(
|
||||
algodClient: Algodv2,
|
||||
txs: TransactionSignerPair[],
|
||||
wallet: Account
|
||||
) {
|
||||
assignGroupID(txs.map((tx) => tx.tx));
|
||||
const signedTxns: Uint8Array[] = [];
|
||||
for (const tx of txs) {
|
||||
if (tx.signer) {
|
||||
signedTxns.push(await tx.signer.signTxn(tx.tx));
|
||||
} else {
|
||||
signedTxns.push(tx.tx.signTxn(wallet.sk));
|
||||
}
|
||||
}
|
||||
await algodClient.sendRawTransaction(signedTxns).do();
|
||||
const result = await waitForConfirmation(
|
||||
algodClient,
|
||||
txs[txs.length - 1].tx.txID(),
|
||||
4
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -117,8 +117,8 @@ const MAINNET = {
|
|||
nft_bridge: "0x04952D522Ff217f40B5Ef3cbF659EcA7b952a6c1",
|
||||
},
|
||||
algorand: {
|
||||
core: undefined,
|
||||
token_bridge: undefined,
|
||||
core: "836919128",
|
||||
token_bridge: "836919282",
|
||||
nft_bridge: undefined,
|
||||
},
|
||||
aurora: {
|
||||
|
|
Loading…
Reference in New Issue