Skip to content

Commit

Permalink
Merge pull request #87 from XLabs/fix/anchor-imports
Browse files Browse the repository at this point in the history
Bump price oracle sdk package version and fix anchor imports
  • Loading branch information
scnale authored Oct 29, 2024
2 parents 316883f + 301c8af commit 07db282
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 22 deletions.
8 changes: 4 additions & 4 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ supportedArchitectures:
- current
- darwin
- linux
libc:
- current
- glibc
- musl
2 changes: 1 addition & 1 deletion sdk/solana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@wormhole-foundation/sdk-definitions": "^0.12.0",
"@wormhole-foundation/sdk-solana": "^0.12.0",
"@wormhole-foundation/sdk-solana-tokenbridge": "^0.12.0",
"@xlabs/solana-price-oracle-sdk": "0.0.13",
"@xlabs/solana-price-oracle-sdk": "0.0.14",
"borsh": "^2.0.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions sdk/solana/tbrv3/bpf-loader-upgradeable.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import anchor from '@coral-xyz/anchor';
import { Connection, PublicKey, TransactionInstruction } from '@solana/web3.js';
import { CustomConversion, Layout, layout, Network } from '@wormhole-foundation/sdk-base';
//import { programDataLayout } from '@wormhole-foundation/sdk-solana/utils/utils/';
import { throwError } from 'common-arbitrary-token-transfer';
import { BN } from "@xlabs/solana-price-oracle-sdk";

export class BpfLoaderUpgradeableProgram {
static id = new PublicKey('BPFLoaderUpgradeab1e11111111111111111111111');
Expand Down Expand Up @@ -32,7 +32,7 @@ export class BpfLoaderUpgradeableProgram {
const upgradeAuthority = data.upgradeAuthority.isSome ? data.upgradeAuthority.value : undefined;

return {
slot: new anchor.BN(data.slot.toString()),
slot: new BN(data.slot.toString()),
upgradeAuthority,
};
}
Expand Down
12 changes: 2 additions & 10 deletions sdk/solana/tbrv3/token-bridge-relayer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import anchor from '@coral-xyz/anchor';
import * as anchor from '@coral-xyz/anchor';
import { Program } from '@coral-xyz/anchor';
import {
PublicKey,
Expand Down Expand Up @@ -27,7 +27,7 @@ import {
getCompleteTransferNativeWithPayloadCpiAccounts,
getCompleteTransferWrappedWithPayloadCpiAccounts,
} from '@wormhole-foundation/sdk-solana-tokenbridge';
import { SolanaPriceOracle } from '@xlabs/solana-price-oracle-sdk';
import { SolanaPriceOracle, bigintToBn, bnToBigint } from '@xlabs/solana-price-oracle-sdk';
import { deserializeTbrV3Message, VaaMessage, throwError } from 'common-arbitrary-token-transfer';
import { BpfLoaderUpgradeableProgram } from './bpf-loader-upgradeable.js';

Expand Down Expand Up @@ -1045,11 +1045,3 @@ function patchAddress(idl: any, address?: PublicKey) {

return idl;
}

export function bnToBigint(n: anchor.BN): bigint {
return BigInt(`0x${n.toString('hex')}`);
}

export function bigintToBn(n: bigint): anchor.BN {
return new anchor.BN(`${n.toString(16)}`, 'hex');
}
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1856,24 +1856,24 @@ __metadata:
"@wormhole-foundation/sdk-definitions": "npm:^0.12.0"
"@wormhole-foundation/sdk-solana": "npm:^0.12.0"
"@wormhole-foundation/sdk-solana-tokenbridge": "npm:^0.12.0"
"@xlabs/solana-price-oracle-sdk": "npm:0.0.13"
"@xlabs/solana-price-oracle-sdk": "npm:0.0.14"
borsh: "npm:^2.0.0"
tsup: "npm:^8.3.0"
tsx: "npm:4.19.1"
typescript: "npm:5.6.3"
languageName: unknown
linkType: soft

"@xlabs/solana-price-oracle-sdk@npm:0.0.13":
version: 0.0.13
resolution: "@xlabs/solana-price-oracle-sdk@npm:0.0.13::__archiveUrl=https%3A%2F%2Fnpm.pkg.github.com%2Fdownload%2F%40xlabs%2Fsolana-price-oracle-sdk%2F0.0.13%2F5ec1c24cb2ba1d21918cf81da41de9b0fa4293e4"
"@xlabs/solana-price-oracle-sdk@npm:0.0.14":
version: 0.0.14
resolution: "@xlabs/solana-price-oracle-sdk@npm:0.0.14::__archiveUrl=https%3A%2F%2Fnpm.pkg.github.com%2Fdownload%2F%40xlabs%2Fsolana-price-oracle-sdk%2F0.0.14%2F30109786217046880003ced1cef34eda8337c43f"
dependencies:
"@coral-xyz/anchor": "npm:^0.30.1"
"@solana/web3.js": "npm:^1.95.2"
"@wormhole-foundation/sdk-base": "npm:^0.11"
"@wormhole-foundation/sdk-definitions": "npm:^0.11"
"@wormhole-foundation/sdk-solana": "npm:^0.11"
checksum: 10c0/88b0eebb3568856d92ba7377b9d1c63d5027b30ee1393c965ce710d0d2261a13129ed8042b23fb1517a688c15cecdc5cc4f000e7f8e61781a3117083d6cde28f
checksum: 10c0/1e2e4624ed993cba46c1a715d850d8824135e7c66b8f51432a0be757dd9e7146e6851ff652481ad5ea2a4f5302a32259694b10c45460d291ae7cc02ed0a1fc61
languageName: node
linkType: hard

Expand Down

0 comments on commit 07db282

Please sign in to comment.