@rabby-wallet/gnosis-sdk 1.4.8-alpha-4 → 1.4.8-alpha-6

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.
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { AxiosAdapter } from "axios";
3
3
  import { Contract, providers } from "ethers";
4
4
  import { TransactionOptions, TransactionResult, SafeSignature, SafeTransaction, SafeTransactionDataPartial } from "@safe-global/types-kit";
5
5
  import { EthSafeMessage, EthSafeTransaction } from "@safe-global/protocol-kit";
6
- import SafeApiKit, { GetSafeMessageListOptions, SafeMessage as ApiKitSafeMessage } from "@safe-global/api-kit";
6
+ import SafeApiKit, { type GetSafeMessageListOptions, type SafeMessage as ApiKitSafeMessage } from "@safe-global/api-kit";
7
7
  import RequestProvider, { SafeInfo, SafeOpenApiService } from "./api";
8
8
  declare class Safe {
9
9
  contract: Contract;
@@ -84,4 +84,4 @@ declare class Safe {
84
84
  }
85
85
  export default Safe;
86
86
  export type BasicSafeInfo = Awaited<ReturnType<Safe["getBasicSafeInfo"]>>;
87
- export { ApiKitSafeMessage as SafeMessage };
87
+ export type { ApiKitSafeMessage as SafeMessage };
package/dist/utils.js CHANGED
@@ -88,11 +88,11 @@ export async function estimateTxGas(safeAddress, safeContract, provider, to, val
88
88
  export async function standardizeSafeTransactionData(safeAddress, safeContract, provider, tx, network, version) {
89
89
  const standardizedTxs = {
90
90
  to: tx.to,
91
- value: tx.value,
92
- data: tx.data,
91
+ value: `${tx.value ?? "0"}`,
92
+ data: tx.data || "0x",
93
93
  operation: tx.operation ?? OperationType.Call,
94
- baseGas: tx.baseGas ?? "0",
95
- gasPrice: tx.gasPrice ?? "0",
94
+ baseGas: `${tx.baseGas ?? "0"}`,
95
+ gasPrice: `${tx.gasPrice ?? "0"}`,
96
96
  gasToken: tx.gasToken || ZERO_ADDRESS,
97
97
  refundReceiver: tx.refundReceiver || ZERO_ADDRESS,
98
98
  nonce: tx.nonce ?? (await safeContract.nonce()).toNumber(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/gnosis-sdk",
3
- "version": "1.4.8-alpha-4",
3
+ "version": "1.4.8-alpha-6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -12,8 +12,8 @@ import {
12
12
  import { EthSafeMessage, EthSafeTransaction } from "@safe-global/protocol-kit";
13
13
  import { calculateSafeMessageHash } from "@safe-global/protocol-kit/dist/src/utils";
14
14
  import SafeApiKit, {
15
- GetSafeMessageListOptions,
16
- SafeMessage as ApiKitSafeMessage,
15
+ type GetSafeMessageListOptions,
16
+ type SafeMessage as ApiKitSafeMessage,
17
17
  } from "@safe-global/api-kit";
18
18
  // import { getTransactionServiceUrl } from "@safe-global/api-kit/dist/src/utils/config";
19
19
  import { getSafeSingletonDeployment } from "@safe-global/safe-deployments";
@@ -456,4 +456,4 @@ export default Safe;
456
456
 
457
457
  export type BasicSafeInfo = Awaited<ReturnType<Safe["getBasicSafeInfo"]>>;
458
458
 
459
- export { ApiKitSafeMessage as SafeMessage };
459
+ export type { ApiKitSafeMessage as SafeMessage };
package/src/utils.ts CHANGED
@@ -121,13 +121,13 @@ export async function standardizeSafeTransactionData(
121
121
  network: string,
122
122
  version: string
123
123
  ): Promise<SafeTransactionData> {
124
- const standardizedTxs = {
124
+ const standardizedTxs: Omit<SafeTransactionData, "safeTxGas"> = {
125
125
  to: tx.to,
126
- value: tx.value,
127
- data: tx.data,
126
+ value: `${tx.value ?? "0"}`,
127
+ data: tx.data || "0x",
128
128
  operation: tx.operation ?? OperationType.Call,
129
- baseGas: tx.baseGas ?? "0",
130
- gasPrice: tx.gasPrice ?? "0",
129
+ baseGas: `${tx.baseGas ?? "0"}`,
130
+ gasPrice: `${tx.gasPrice ?? "0"}`,
131
131
  gasToken: tx.gasToken || ZERO_ADDRESS,
132
132
  refundReceiver: tx.refundReceiver || ZERO_ADDRESS,
133
133
  nonce: tx.nonce ?? (await safeContract.nonce()).toNumber(),