@ember-finance/sdk 2.5.0-pre.7 → 2.5.0-pre.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { Signer as SuiSigner } from "@firefly-exchange/library-sui";
2
- import { SuiJsonRpcClient as SuiClient } from "@mysten/sui/jsonRpc";
2
+ import { BaseClient as SuiClient } from "@mysten/sui/client";
3
3
  import { Signer as EvmSigner, Provider as EvmProvider } from "ethers";
4
4
  import { ISuiDeployment } from "./sui-vaults/interfaces/index.js";
5
5
  import { TxBuilder as SuiTxBuilder } from "./sui-vaults/on-chain-calls/index.js";
@@ -146,6 +146,14 @@ export interface ITransactionCall {
146
146
  export interface IEvmCallOptions {
147
147
  /** If true, simulates the transaction without sending */
148
148
  dryRun?: boolean;
149
+ /**
150
+ * Override `from` address for the dry-run eth_call. When omitted the RPC
151
+ * defaults to `0x0`, which trips `onlyOperator` / `onlyOwner` / `onlyAdmin`
152
+ * modifiers before the simulated function body runs. Set to the wallet
153
+ * that would sign the real tx so the modifier passes and the dry-run
154
+ * exercises the actual code path. Ignored unless `dryRun` is `true`.
155
+ */
156
+ dryRunFrom?: string;
149
157
  /** If true, returns the transaction call object without executing */
150
158
  returnTxCall?: boolean;
151
159
  /** If true, waits for the transaction to be mined and returns receipt with events */
@@ -134,9 +134,12 @@ export class EVMOnChainCalls {
134
134
  throw new Error("Provider required for dry run");
135
135
  }
136
136
  try {
137
+ // `from` defaults to 0x0, which fails onlyOperator/onlyOwner modifiers before
138
+ // the simulated body runs. Callers pass `dryRunFrom` to exercise those paths.
137
139
  const resultData = await this.provider.call({
138
140
  to: encodedTx.to,
139
- data: encodedTx.data
141
+ data: encodedTx.data,
142
+ from: options?.dryRunFrom
140
143
  });
141
144
  // Decode the result if possible
142
145
  let result;
@@ -1,4 +1,4 @@
1
- import { SuiJsonRpcClient as SuiClient } from "@mysten/sui/jsonRpc";
1
+ import { BaseClient as SuiClient } from "@mysten/sui/client";
2
2
  import { OnChainCalls } from "./onchain-calls.js";
3
3
  import { ISuiDeployment, IVaultOptionalParams } from "../interfaces/index.js";
4
4
  import { OnChainCallResponse, Signer, SuiAddress, SuiTransactionBlockResponseOptions } from "@firefly-exchange/library-sui";
@@ -1,4 +1,4 @@
1
- import { SuiJsonRpcClient as SuiClient } from "@mysten/sui/jsonRpc";
1
+ import { BaseClient as SuiClient } from "@mysten/sui/client";
2
2
  import { FeeMultiplierTier, InstantWithdrawQuote } from "../../atomic/instant-withdraw.js";
3
3
  /**
4
4
  * Read-only views + instant-withdraw quotes for the Sui Atomic Liquidity Vault (BET-4111).
@@ -1,4 +1,4 @@
1
- import { SuiJsonRpcClient as SuiClient } from "@mysten/sui/jsonRpc";
1
+ import { BaseClient as SuiClient } from "@mysten/sui/client";
2
2
  import { DryRunTransactionBlockResponse, OnChainCallResponse, Signer, SuiTransactionBlockResponse, SuiTransactionBlockResponseOptions, TransactionBlock } from "@firefly-exchange/library-sui";
3
3
  import { Address } from "@firefly-exchange/library-sui";
4
4
  import { SuiDeploymentParser } from "../utils/deployment-parser.js";
@@ -1,4 +1,4 @@
1
- import { SuiJsonRpcClient as SuiClient } from "@mysten/sui/jsonRpc";
1
+ import { BaseClient as SuiClient } from "@mysten/sui/client";
2
2
  import { OnChainCalls } from "./onchain-calls.js";
3
3
  import { ISuiDeployment, IVaultOptionalParams } from "../interfaces/index.js";
4
4
  import { OnChainCallResponse, Signer, SuiAddress, SuiTransactionBlockResponseOptions } from "@firefly-exchange/library-sui";
@@ -1,4 +1,4 @@
1
- import { SuiJsonRpcClient as SuiClient } from "@mysten/sui/jsonRpc";
1
+ import { BaseClient as SuiClient } from "@mysten/sui/client";
2
2
  import { OnChainCalls } from "./onchain-calls.js";
3
3
  import { ISuiDeployment, IVaultOptionalParams } from "../interfaces/index.js";
4
4
  import { OnChainCallResponse, Signer, SuiAddress, SuiTransactionBlockResponseOptions, NumStr } from "@firefly-exchange/library-sui";
@@ -1,4 +1,4 @@
1
- import { SuiJsonRpcClient as SuiClient } from "@mysten/sui/jsonRpc";
1
+ import { BaseClient as SuiClient } from "@mysten/sui/client";
2
2
  import { OnChainCalls } from "./onchain-calls.js";
3
3
  import { ISuiDeployment, IVaultOptionalParams } from "../interfaces/index.js";
4
4
  import { NumStr } from "@firefly-exchange/library-sui";
@@ -1,3 +1,3 @@
1
- import { SuiJsonRpcClient as SuiClient } from "@mysten/sui/jsonRpc";
1
+ import { BaseClient as SuiClient } from "@mysten/sui/client";
2
2
  import { TransactionBlock } from "@firefly-exchange/library-sui";
3
3
  export declare const getTxBytes: (tx: TransactionBlock, client: SuiClient) => Promise<string>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ember-finance/sdk",
3
3
  "description": "Ember Protocol SDK",
4
- "version": "2.5.0-pre.7",
4
+ "version": "2.5.0-pre.9",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
7
7
  "main": "./dist/index.js",