@injectivelabs/sdk-ts 1.15.39 → 1.15.41

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.
@@ -139,6 +139,12 @@ class TxGrpcApi {
139
139
  try {
140
140
  const response = await txService.BroadcastTx(broadcastTxRequest, this.metadata);
141
141
  const txResponse = response.txResponse;
142
+ if (!txResponse) {
143
+ throw new exceptions_1.GrpcUnaryRequestException(new Error(`The transaction has failed to be broadcasted`), {
144
+ context: 'TxGrpcApi.broadcast',
145
+ contextModule: 'broadcast',
146
+ });
147
+ }
142
148
  if (txResponse.code !== 0) {
143
149
  throw new exceptions_1.TransactionException(new Error(txResponse.rawLog), {
144
150
  contextCode: txResponse.code,
@@ -152,6 +158,9 @@ class TxGrpcApi {
152
158
  if (e instanceof exceptions_1.TransactionException) {
153
159
  throw e;
154
160
  }
161
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
162
+ throw e;
163
+ }
155
164
  throw new exceptions_1.TransactionException(new Error(e));
156
165
  }
157
166
  }
@@ -121,6 +121,12 @@ class TxRestApi {
121
121
  .toNumber();
122
122
  try {
123
123
  const { tx_response: txResponse } = await this.broadcastTx(tx, tx_rest_client_js_1.BroadcastMode.Sync);
124
+ if (!txResponse) {
125
+ throw new exceptions_1.HttpRequestException(new Error('The transaction has failed to be broadcasted'), {
126
+ context: 'TxRestApi.broadcast',
127
+ contextModule: 'broadcast',
128
+ });
129
+ }
124
130
  if (txResponse.code !== 0) {
125
131
  throw new exceptions_1.TransactionException(new Error(txResponse.raw_log), {
126
132
  contextCode: txResponse.code,
@@ -133,6 +133,12 @@ export class TxGrpcApi {
133
133
  try {
134
134
  const response = await txService.BroadcastTx(broadcastTxRequest, this.metadata);
135
135
  const txResponse = response.txResponse;
136
+ if (!txResponse) {
137
+ throw new GrpcUnaryRequestException(new Error(`The transaction has failed to be broadcasted`), {
138
+ context: 'TxGrpcApi.broadcast',
139
+ contextModule: 'broadcast',
140
+ });
141
+ }
136
142
  if (txResponse.code !== 0) {
137
143
  throw new TransactionException(new Error(txResponse.rawLog), {
138
144
  contextCode: txResponse.code,
@@ -146,6 +152,9 @@ export class TxGrpcApi {
146
152
  if (e instanceof TransactionException) {
147
153
  throw e;
148
154
  }
155
+ if (e instanceof GrpcUnaryRequestException) {
156
+ throw e;
157
+ }
149
158
  throw new TransactionException(new Error(e));
150
159
  }
151
160
  }
@@ -115,6 +115,12 @@ export class TxRestApi {
115
115
  .toNumber();
116
116
  try {
117
117
  const { tx_response: txResponse } = await this.broadcastTx(tx, BroadcastMode.Sync);
118
+ if (!txResponse) {
119
+ throw new HttpRequestException(new Error('The transaction has failed to be broadcasted'), {
120
+ context: 'TxRestApi.broadcast',
121
+ contextModule: 'broadcast',
122
+ });
123
+ }
118
124
  if (txResponse.code !== 0) {
119
125
  throw new TransactionException(new Error(txResponse.raw_log), {
120
126
  contextCode: txResponse.code,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@injectivelabs/sdk-ts",
3
3
  "description": "SDK in TypeScript for building Injective applications in a browser, node, and react native environment.",
4
- "version": "1.15.39",
4
+ "version": "1.15.41",
5
5
  "sideEffects": false,
6
6
  "license": "Apache-2.0",
7
7
  "author": {
@@ -123,16 +123,16 @@
123
123
  "@cosmjs/stargate": "^0.33.0",
124
124
  "@injectivelabs/abacus-proto-ts": "1.14.0",
125
125
  "@injectivelabs/core-proto-ts": "1.15.0",
126
- "@injectivelabs/exceptions": "^1.15.36",
126
+ "@injectivelabs/exceptions": "^1.15.38",
127
127
  "@injectivelabs/grpc-web": "^0.0.1",
128
128
  "@injectivelabs/grpc-web-node-http-transport": "^0.0.2",
129
129
  "@injectivelabs/grpc-web-react-native-transport": "^0.0.2",
130
130
  "@injectivelabs/indexer-proto-ts": "1.13.14",
131
131
  "@injectivelabs/mito-proto-ts": "1.13.2",
132
- "@injectivelabs/networks": "^1.15.37",
132
+ "@injectivelabs/networks": "^1.15.39",
133
133
  "@injectivelabs/olp-proto-ts": "1.13.4",
134
- "@injectivelabs/ts-types": "^1.15.37",
135
- "@injectivelabs/utils": "^1.15.37",
134
+ "@injectivelabs/ts-types": "^1.15.39",
135
+ "@injectivelabs/utils": "^1.15.39",
136
136
  "@metamask/eth-sig-util": "^8.2.0",
137
137
  "@noble/curves": "^1.8.1",
138
138
  "@noble/hashes": "^1.7.1",
@@ -151,7 +151,7 @@
151
151
  "shx": "^0.3.4",
152
152
  "snakecase-keys": "^5.4.1"
153
153
  },
154
- "gitHead": "a361beb638480dc874881d175b4d40329706abd2",
154
+ "gitHead": "df725078e865f07678eaad5084324929a8a75d41",
155
155
  "typedoc": {
156
156
  "entryPoint": "./src/index.ts",
157
157
  "readmeFile": "./README.md",