@reyaxyz/sdk 0.81.1 → 0.82.0

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.
@@ -37,8 +37,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.signAndBroadcastTransaction = void 0;
40
- var config_1 = require("../../../sdk/src/config");
41
40
  var common_1 = require("@reyaxyz/common");
41
+ var config_1 = require("../config");
42
42
  function signAndBroadcastTransaction(signer, data, value, chainId, targetContract, metadata) {
43
43
  return __awaiter(this, void 0, void 0, function () {
44
44
  var contractAddress, transactionModuleClient, _a, txHash, accountId, error_1;
@@ -1 +1 @@
1
- {"version":3,"file":"signAndBroadcastTransaction.js","sourceRoot":"/","sources":["services/signAndBroadcastTransaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAGiC;AACjC,0CAAwE;AAExE,SAAsB,2BAA2B,CAC/C,MAA8B,EAC9B,IAAY,EACZ,KAAa,EACb,OAAe,EACf,cAAqC,EACrC,QAAsC;;;;;;oBAEhC,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAY,CAAC,CAAC,QAAQ,CAC1D,cAA8B,CAC/B;wBACC,CAAC,CAAC,IAAA,mBAAU,EAAC,OAAO,EAAE,cAA8B,CAAC;wBACrD,CAAC,CAAC,cAAc,CAAC;oBAEnB,sEAAsE;oBACtE,iEAAiE;oBACjE,qBAAM,IAAA,oBAAW,EAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,EAAA;;oBAF/D,sEAAsE;oBACtE,iEAAiE;oBACjE,SAA+D,CAAC;;;;oBAExD,uBAAuB,GAAG,IAAA,mCAA0B,GAAE,CAAC;oBAE3D,qBAAM,uBAAuB,CAAC,kBAAkB,CAC9C,EAAE,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,EACnC,eAAe,EACf,QAAQ,CACT,EAAA;;oBALG,KACJ,SAIC,EALK,MAAM,YAAA,EAAE,SAAS,eAAA;oBAOzB,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;oBAC/C,CAAC;oBACD,sBAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,WAAA,EAAE,EAAC;;;oBAEnC,OAAO,CAAC,IAAI,CAAC,OAAK,CAAC,CAAC;oBACpB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;;;;;CAElD;AAlCD,kEAkCC","sourcesContent":["import { JsonRpcSigner, Signer } from 'ethers';\nimport {\n BroadcastTransactionMetadata,\n getTransactionModuleClient,\n} from '../../../sdk/src/config';\nimport { ContractType, getAddress, estimateGas } from '@reyaxyz/common';\n\nexport async function signAndBroadcastTransaction(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n metadata: BroadcastTransactionMetadata,\n): Promise<{ hash: string; accountId?: string }> {\n const contractAddress = Object.values(ContractType).includes(\n targetContract as ContractType,\n )\n ? getAddress(chainId, targetContract as ContractType)\n : targetContract;\n\n // used to catch error in advance since gelato is slow in failing down\n // on reya chain usually takes around 100ms, should be monitored!\n await estimateGas(signer, data, value, chainId, targetContract);\n try {\n const transactionModuleClient = getTransactionModuleClient();\n const { txHash, accountId } =\n await transactionModuleClient.executeTransaction(\n { to: contractAddress, data: data },\n contractAddress,\n metadata,\n );\n\n if (!txHash) {\n throw new Error('Error sending transaction');\n }\n return { hash: txHash, accountId };\n } catch (error) {\n console.warn(error);\n throw new Error('Transaction Execution Error');\n }\n}\n"]}
1
+ {"version":3,"file":"signAndBroadcastTransaction.js","sourceRoot":"/","sources":["services/signAndBroadcastTransaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAAwE;AACxE,oCAGmB;AAEnB,SAAsB,2BAA2B,CAC/C,MAA8B,EAC9B,IAAY,EACZ,KAAa,EACb,OAAe,EACf,cAAqC,EACrC,QAAsC;;;;;;oBAEhC,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAY,CAAC,CAAC,QAAQ,CAC1D,cAA8B,CAC/B;wBACC,CAAC,CAAC,IAAA,mBAAU,EAAC,OAAO,EAAE,cAA8B,CAAC;wBACrD,CAAC,CAAC,cAAc,CAAC;oBAEnB,sEAAsE;oBACtE,iEAAiE;oBACjE,qBAAM,IAAA,oBAAW,EAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,EAAA;;oBAF/D,sEAAsE;oBACtE,iEAAiE;oBACjE,SAA+D,CAAC;;;;oBAExD,uBAAuB,GAAG,IAAA,mCAA0B,GAAE,CAAC;oBAE3D,qBAAM,uBAAuB,CAAC,kBAAkB,CAC9C,EAAE,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,EACnC,eAAe,EACf,QAAQ,CACT,EAAA;;oBALG,KACJ,SAIC,EALK,MAAM,YAAA,EAAE,SAAS,eAAA;oBAOzB,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;oBAC/C,CAAC;oBACD,sBAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,WAAA,EAAE,EAAC;;;oBAEnC,OAAO,CAAC,IAAI,CAAC,OAAK,CAAC,CAAC;oBACpB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;;;;;CAElD;AAlCD,kEAkCC","sourcesContent":["import { JsonRpcSigner, Signer } from 'ethers';\nimport { ContractType, getAddress, estimateGas } from '@reyaxyz/common';\nimport {\n BroadcastTransactionMetadata,\n getTransactionModuleClient,\n} from '../config';\n\nexport async function signAndBroadcastTransaction(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n metadata: BroadcastTransactionMetadata,\n): Promise<{ hash: string; accountId?: string }> {\n const contractAddress = Object.values(ContractType).includes(\n targetContract as ContractType,\n )\n ? getAddress(chainId, targetContract as ContractType)\n : targetContract;\n\n // used to catch error in advance since gelato is slow in failing down\n // on reya chain usually takes around 100ms, should be monitored!\n await estimateGas(signer, data, value, chainId, targetContract);\n try {\n const transactionModuleClient = getTransactionModuleClient();\n const { txHash, accountId } =\n await transactionModuleClient.executeTransaction(\n { to: contractAddress, data: data },\n contractAddress,\n metadata,\n );\n\n if (!txHash) {\n throw new Error('Error sending transaction');\n }\n return { hash: txHash, accountId };\n } catch (error) {\n console.warn(error);\n throw new Error('Transaction Execution Error');\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { JsonRpcSigner, Signer } from 'ethers';
2
- import { BroadcastTransactionMetadata } from '../../../sdk/src/config';
3
2
  import { ContractType } from '@reyaxyz/common';
3
+ import { BroadcastTransactionMetadata } from '../config';
4
4
  export declare function signAndBroadcastTransaction(signer: Signer | JsonRpcSigner, data: string, value: string, chainId: number, targetContract: ContractType | string, metadata: BroadcastTransactionMetadata): Promise<{
5
5
  hash: string;
6
6
  accountId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"signAndBroadcastTransaction.d.ts","sourceRoot":"/","sources":["services/signAndBroadcastTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EACL,4BAA4B,EAE7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAA2B,MAAM,iBAAiB,CAAC;AAExE,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,MAAM,GAAG,aAAa,EAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,YAAY,GAAG,MAAM,EACrC,QAAQ,EAAE,4BAA4B,GACrC,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA2B/C"}
1
+ {"version":3,"file":"signAndBroadcastTransaction.d.ts","sourceRoot":"/","sources":["services/signAndBroadcastTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,YAAY,EAA2B,MAAM,iBAAiB,CAAC;AACxE,OAAO,EACL,4BAA4B,EAE7B,MAAM,WAAW,CAAC;AAEnB,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,MAAM,GAAG,aAAa,EAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,YAAY,GAAG,MAAM,EACrC,QAAQ,EAAE,4BAA4B,GACrC,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA2B/C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/sdk",
3
- "version": "0.81.1",
3
+ "version": "0.82.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -34,5 +34,5 @@
34
34
  "ethers": "6.9.0"
35
35
  },
36
36
  "packageManager": "pnpm@8.3.1",
37
- "gitHead": "1b09eb5acff607fbe420ec85268b96f15df390f3"
37
+ "gitHead": "28a6b77492a70b0ec0290b8e94a9212f6385a75f"
38
38
  }
@@ -1,9 +1,9 @@
1
1
  import { JsonRpcSigner, Signer } from 'ethers';
2
+ import { ContractType, getAddress, estimateGas } from '@reyaxyz/common';
2
3
  import {
3
4
  BroadcastTransactionMetadata,
4
5
  getTransactionModuleClient,
5
- } from '../../../sdk/src/config';
6
- import { ContractType, getAddress, estimateGas } from '@reyaxyz/common';
6
+ } from '../config';
7
7
 
8
8
  export async function signAndBroadcastTransaction(
9
9
  signer: Signer | JsonRpcSigner,