We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a205230 commit 91baf27Copy full SHA for 91baf27
solana/ts/sdk/ntt.ts
@@ -283,16 +283,15 @@ export class SolanaNtt<N extends Network, C extends SolanaChains>
283
contracts: Contracts & { ntt: Ntt.Contracts },
284
sender?: AccountAddress<SolanaChains>
285
): Promise<IdlVersion> {
286
- // TODO: what? the try catch doesn't seem to work. it's not catching the error
287
try {
288
- return NTT.getVersion(
+ return await NTT.getVersion(
289
connection,
290
new PublicKey(contracts.ntt.manager!),
291
sender ? new SolanaAddress(sender).unwrap() : undefined
292
);
293
} catch (e) {
+ // This might happen if e.g. the program is not deployed yet.
294
const version = "2.0.0"
295
- console.error(`Failed to get NTT version. Defaulting to ${version}`);
296
return version;
297
}
298
0 commit comments