@credenza3/partner-sdk 0.0.1-beta.0 → 0.0.1
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.
|
@@ -5,3 +5,4 @@ export declare function findEvmContracts(params?: {
|
|
|
5
5
|
chain_id?: number;
|
|
6
6
|
}): Promise<string[]>;
|
|
7
7
|
export declare function deployEvmContract(name: string, chainId: number, ownerAddresses: string[]): Promise<unknown>;
|
|
8
|
+
export declare function sendEvmMetaTransaction(unsignedSerializedMetaTx: string): Promise<unknown>;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getAvailableEvmContracts = getAvailableEvmContracts;
|
|
4
4
|
exports.findEvmContracts = findEvmContracts;
|
|
5
5
|
exports.deployEvmContract = deployEvmContract;
|
|
6
|
+
exports.sendEvmMetaTransaction = sendEvmMetaTransaction;
|
|
6
7
|
const credentials_1 = require("../../lib/credentials");
|
|
7
8
|
const evm_1 = require("../../evm");
|
|
8
9
|
const logging_1 = require("../../lib/logging");
|
|
@@ -78,3 +79,19 @@ async function deployEvmContract(name, chainId, ownerAddresses) {
|
|
|
78
79
|
});
|
|
79
80
|
});
|
|
80
81
|
}
|
|
82
|
+
async function sendEvmMetaTransaction(unsignedSerializedMetaTx) {
|
|
83
|
+
const socket = await (0, evm_2.getWsConnection)();
|
|
84
|
+
return new Promise((resolve, reject) => {
|
|
85
|
+
socket.emit('contracts/forward_transaction/client', {
|
|
86
|
+
payload: {
|
|
87
|
+
unsigned_serialized_meta_tx: unsignedSerializedMetaTx,
|
|
88
|
+
},
|
|
89
|
+
}, (data) => {
|
|
90
|
+
if (data.error) {
|
|
91
|
+
return reject(new Error(data.error.message));
|
|
92
|
+
}
|
|
93
|
+
(0, logging_1.log)(sendEvmMetaTransaction.name, `meta tx sent`, data);
|
|
94
|
+
resolve(data.payload);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@credenza3/partner-sdk",
|
|
3
|
-
"version": "0.0.1
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"description": "Credenza partner sdk",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -39,16 +39,20 @@
|
|
|
39
39
|
"socket.io-client": "^4.7.5"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"
|
|
42
|
+
"@eslint/eslintrc": "^3.1.0",
|
|
43
|
+
"@eslint/js": "^9.10.0",
|
|
44
|
+
"@types/node": "^22.5.4",
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^8.5.0",
|
|
46
|
+
"@typescript-eslint/parser": "^8.5.0",
|
|
47
|
+
"eslint": "9.10.0",
|
|
45
48
|
"eslint-config-prettier": "^9.1.0",
|
|
46
49
|
"eslint-plugin-prettier": "^5.2.1",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
50
|
+
"globals": "^15.9.0",
|
|
51
|
+
"husky": "^9.1.6",
|
|
52
|
+
"lint-staged": "^15.2.10",
|
|
49
53
|
"prettier": "^3.3.3",
|
|
50
54
|
"tsc-alias": "^1.8.10",
|
|
51
|
-
"typescript": "^5.
|
|
55
|
+
"typescript": "^5.6.2"
|
|
52
56
|
},
|
|
53
57
|
"scripts": {
|
|
54
58
|
"build": "tsc && tsc-alias",
|