Skip to content

Commit

Permalink
Fixed waitTransactionTreeExecution method
Browse files Browse the repository at this point in the history
  • Loading branch information
oable committed Feb 4, 2025
1 parent 818adae commit 09ded9f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@neonevm/solana-sign",
"description": "Javascript Library for Execute Neon transactions with Solana's signature",
"version": "0.1.3",
"version": "0.1.4",
"private": true,
"workspaces": [
"packages/*"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@neonevm/solana-sign",
"version": "0.1.3",
"version": "0.1.4",
"description": "Core API for the @neonevm/solana-signer project",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.mjs",
Expand Down
7 changes: 4 additions & 3 deletions packages/core/src/api/neon-proxy-rpc.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class NeonProxyRpcApi {
while (duration > Date.now() - start) {
const { result } = await this.getScheduledTreeAccount(address, nonce);
const { transactions } = result;
if (transactions.length > 0) {
if (result?.activeStatus) {
for (const tx of transactions) {
const index = trx.findIndex(i => i.transactionHash === tx.transactionHash);
if (index === -1) {
Expand All @@ -102,8 +102,9 @@ export class NeonProxyRpcApi {
trx[index] = tx;
}
}
} else {
return trx;
if (['Success', 'Empty', 'Failed'].includes(result.activeStatus)) {
return trx;
}
}
await delay(delayTimeout);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/models/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export interface TransactionTreeResponse {
transactions: ScheduledTransactionStatusResponse[];
}

export type TransactionStatus = 'NotStarted' | 'InProgress' | 'Success' | 'Empty' | string;
export type TransactionStatus = 'NotStarted' | 'InProgress' | 'Success' | 'Empty' | 'Failed' | string;

export interface ScheduledTransactionStatusResponse {
status: TransactionStatus;
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/neon/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import { bufferConcat, hexToBuffer, NeonChainId, numberToBuffer, toBytes16LE, to
* callData: "0xCallData",
* chainId: 245022927,
* gasLimit: 50000,
* maxFeePerGas: 1100000002,
* maxPriorityFeePerGas: 1100000001
* maxFeePerGas: 1250000001,
* maxPriorityFeePerGas: 1250000000
* });
* ```
*/
Expand All @@ -43,8 +43,8 @@ export class ScheduledTransaction {
value: '0x',
chainId: toBeHex(NeonChainId.testnetSol),
gasLimit: toBeHex(5e4),
maxFeePerGas: toBeHex(1100000002),
maxPriorityFeePerGas: toBeHex(1100000001)
maxFeePerGas: toBeHex(1250000001),
maxPriorityFeePerGas: toBeHex(1250000000)
};

/**
Expand Down

0 comments on commit 09ded9f

Please sign in to comment.