Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/curvy-owls-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@layerzerolabs/oft-solana-example": patch
---

update metadata script supports token2022
5 changes: 5 additions & 0 deletions .changeset/giant-schools-matter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@layerzerolabs/oft-solana-example": patch
---

update Solana OFT debug script to state when default confirmations is used
5 changes: 5 additions & 0 deletions .changeset/quiet-wolves-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@layerzerolabs/oft-solana-example": patch
---

fix: remove spurious warning when running lz:oft:solana:create before deployment file exists
8 changes: 4 additions & 4 deletions examples/oft-hyperliquid/pnpm-lock.yaml

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

24 changes: 16 additions & 8 deletions examples/oft-solana/tasks/solana/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,14 @@ function printOAppReceiveConfigs(
// Print each property in the object
DebugLogger.keyValue(`${oAppReceiveConfigIndexesToKeys[i]}`, '', 2)
for (const [propKey, propVal] of Object.entries(item)) {
const valueDisplay =
(propKey === 'requiredDVNs' || propKey === 'optionalDVNs') && Array.isArray(propVal)
? formatDvnAddresses(propVal as string[], metadata, chainKey)
: String(propVal)
let valueDisplay: string
if ((propKey === 'requiredDVNs' || propKey === 'optionalDVNs') && Array.isArray(propVal)) {
valueDisplay = formatDvnAddresses(propVal as string[], metadata, chainKey)
} else if (propKey === 'confirmations' && String(propVal) === '0') {
valueDisplay = '0 (Use Pathway Defaults)'
} else {
valueDisplay = String(propVal)
}
DebugLogger.keyValue(`${propKey}`, valueDisplay, 3)
}
} else {
Expand Down Expand Up @@ -427,10 +431,14 @@ function printOAppSendConfigs(
if (typeof item === 'object' && item !== null) {
DebugLogger.keyValue(`${sendOappConfigIndexesToKeys[i]}`, '', 2)
for (const [propKey, propVal] of Object.entries(item)) {
const valueDisplay =
(propKey === 'requiredDVNs' || propKey === 'optionalDVNs') && Array.isArray(propVal)
? formatDvnAddresses(propVal as string[], metadata, chainKey)
: String(propVal)
let valueDisplay: string
if ((propKey === 'requiredDVNs' || propKey === 'optionalDVNs') && Array.isArray(propVal)) {
valueDisplay = formatDvnAddresses(propVal as string[], metadata, chainKey)
} else if (propKey === 'confirmations' && String(propVal) === '0') {
valueDisplay = '0 (Use Pathway Defaults)'
} else {
valueDisplay = String(propVal)
}
DebugLogger.keyValue(`${propKey}`, valueDisplay, 3)
}
} else {
Expand Down
9 changes: 6 additions & 3 deletions examples/oft-solana/tasks/solana/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ export const getSolanaDeployment = (
const filePath = path.join(outputDir, 'OFT.json') // Note: if you have multiple deployments, change this filename to refer to the desired deployment file

if (!existsSync(filePath)) {
DebugLogger.printWarning(KnownWarnings.SOLANA_DEPLOYMENT_NOT_FOUND)
throw new Error(`Could not find Solana deployment file for eid ${eid} at: ${filePath}`)
}

Expand All @@ -167,10 +166,14 @@ export const getSolanaDeployment = (

/**
* Safely load the OFT store PDA for a given Solana endpoint.
* Logs a warning if the deployment file is missing or malformed,
* and returns null so consumers can decide how to proceed.
* Returns null silently if deployment file doesn't exist (expected during create).
* Logs a warning only if the file exists but is malformed.
*/
export const getOftStoreAddress = (eid: EndpointId): string | null => {
const filePath = path.join('deployments', endpointIdToNetwork(eid), 'OFT.json')
if (!existsSync(filePath)) {
return null
}
try {
const { oftStore } = getSolanaDeployment(eid)
if (!oftStore) {
Expand Down
Loading