@vleap/warps-adapter-fastset 0.1.0-beta.42 → 0.1.0-beta.44
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.js +30 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1401,12 +1401,23 @@ var FastsetClient = class {
|
|
|
1401
1401
|
this.proxyUrl = proxyUrl;
|
|
1402
1402
|
}
|
|
1403
1403
|
async request(url, method, params) {
|
|
1404
|
-
const
|
|
1404
|
+
const requestId = id++;
|
|
1405
|
+
const request = this.buildJsonRpcRequest(requestId, method, params);
|
|
1405
1406
|
const headers = { "Content-Type": "application/json" };
|
|
1406
1407
|
const body = this.jsonSerialize(request);
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1408
|
+
try {
|
|
1409
|
+
const response = await fetch(url, { method: "POST", headers, body });
|
|
1410
|
+
if (!response.ok) {
|
|
1411
|
+
return { jsonrpc: "2.0", id: requestId, error: { code: response.status, message: response.statusText } };
|
|
1412
|
+
}
|
|
1413
|
+
try {
|
|
1414
|
+
return await response.json();
|
|
1415
|
+
} catch {
|
|
1416
|
+
return { jsonrpc: "2.0", id: requestId, error: { code: -32700, message: "Parse error" } };
|
|
1417
|
+
}
|
|
1418
|
+
} catch {
|
|
1419
|
+
return { jsonrpc: "2.0", id: requestId, error: { code: -32603, message: "Internal error" } };
|
|
1420
|
+
}
|
|
1410
1421
|
}
|
|
1411
1422
|
buildJsonRpcRequest(id2, method, params) {
|
|
1412
1423
|
return { jsonrpc: "2.0", id: id2, method, params };
|
|
@@ -1850,7 +1861,8 @@ var WarpFastsetOutput = class {
|
|
|
1850
1861
|
values: { string: stringValues, native: rawValues, mapped: {} },
|
|
1851
1862
|
output: {},
|
|
1852
1863
|
messages: {},
|
|
1853
|
-
destination: null
|
|
1864
|
+
destination: null,
|
|
1865
|
+
resolvedInputs: []
|
|
1854
1866
|
};
|
|
1855
1867
|
}
|
|
1856
1868
|
async extractQueryOutput(warp, typedValues, actionIndex, inputs) {
|
|
@@ -2935,10 +2947,19 @@ var WarpFastsetWallet = class {
|
|
|
2935
2947
|
}
|
|
2936
2948
|
getPublicKey() {
|
|
2937
2949
|
const privateKey = getWarpWalletPrivateKeyFromConfig(this.config, this.chain.name);
|
|
2938
|
-
if (
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2950
|
+
if (privateKey) {
|
|
2951
|
+
const privateKeyBytes = hexToUint8Array(privateKey);
|
|
2952
|
+
const publicKey = ed25519_exports.getPublicKey(privateKeyBytes);
|
|
2953
|
+
return uint8ArrayToHex(publicKey);
|
|
2954
|
+
}
|
|
2955
|
+
const address = getWarpWalletAddressFromConfig3(this.config, this.chain.name);
|
|
2956
|
+
if (!address) return null;
|
|
2957
|
+
try {
|
|
2958
|
+
const addressBytes = FastsetClient.decodeBech32Address(address);
|
|
2959
|
+
return uint8ArrayToHex(addressBytes);
|
|
2960
|
+
} catch {
|
|
2961
|
+
return null;
|
|
2962
|
+
}
|
|
2942
2963
|
}
|
|
2943
2964
|
};
|
|
2944
2965
|
|