@vleap/warps-adapter-fastset 0.1.0-alpha.36 → 0.1.0-alpha.37
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 +17 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1723,7 +1723,7 @@ var WarpFastsetExplorer = class {
|
|
|
1723
1723
|
}
|
|
1724
1724
|
};
|
|
1725
1725
|
|
|
1726
|
-
// src/
|
|
1726
|
+
// src/WarpFastsetOutput.ts
|
|
1727
1727
|
var import_warps4 = require("@vleap/warps");
|
|
1728
1728
|
|
|
1729
1729
|
// src/WarpFastsetSerializer.ts
|
|
@@ -1836,8 +1836,8 @@ var WarpFastsetSerializer = class {
|
|
|
1836
1836
|
}
|
|
1837
1837
|
};
|
|
1838
1838
|
|
|
1839
|
-
// src/
|
|
1840
|
-
var
|
|
1839
|
+
// src/WarpFastsetOutput.ts
|
|
1840
|
+
var WarpFastsetOutput = class {
|
|
1841
1841
|
constructor(config, chain2) {
|
|
1842
1842
|
this.config = config;
|
|
1843
1843
|
this.chain = chain2;
|
|
@@ -1851,7 +1851,7 @@ var WarpFastsetResults = class {
|
|
|
1851
1851
|
const rawValues = [transactionHash, blockNumber, timestamp];
|
|
1852
1852
|
const stringValues = rawValues.map((v) => String(v));
|
|
1853
1853
|
return {
|
|
1854
|
-
success,
|
|
1854
|
+
status: success ? "success" : "error",
|
|
1855
1855
|
warp,
|
|
1856
1856
|
action: 0,
|
|
1857
1857
|
user: (0, import_warps4.getWarpWalletAddressFromConfig)(this.config, this.chain.name),
|
|
@@ -1859,16 +1859,16 @@ var WarpFastsetResults = class {
|
|
|
1859
1859
|
tx,
|
|
1860
1860
|
next: null,
|
|
1861
1861
|
values: { string: stringValues, native: rawValues },
|
|
1862
|
-
|
|
1862
|
+
output: {},
|
|
1863
1863
|
messages: {}
|
|
1864
1864
|
};
|
|
1865
1865
|
}
|
|
1866
|
-
async
|
|
1866
|
+
async extractQueryOutput(warp, typedValues, actionIndex, inputs) {
|
|
1867
1867
|
const stringValues = typedValues.map((t) => this.serializer.typedToString(t));
|
|
1868
1868
|
const nativeValues = typedValues.map((t) => this.serializer.typedToNative(t)[1]);
|
|
1869
1869
|
const values = { string: stringValues, native: nativeValues };
|
|
1870
|
-
let
|
|
1871
|
-
if (!warp.
|
|
1870
|
+
let output = {};
|
|
1871
|
+
if (!warp.output) return { values, output };
|
|
1872
1872
|
const getNestedValue = (path) => {
|
|
1873
1873
|
const match = path.match(/^out\[(\d+)\]$/);
|
|
1874
1874
|
if (match) {
|
|
@@ -1884,25 +1884,25 @@ var WarpFastsetResults = class {
|
|
|
1884
1884
|
}
|
|
1885
1885
|
return value;
|
|
1886
1886
|
};
|
|
1887
|
-
for (const [key, path] of Object.entries(warp.
|
|
1887
|
+
for (const [key, path] of Object.entries(warp.output)) {
|
|
1888
1888
|
if (path.startsWith(import_warps4.WarpConstants.Transform.Prefix)) continue;
|
|
1889
|
-
const currentActionIndex = (0, import_warps4.
|
|
1889
|
+
const currentActionIndex = (0, import_warps4.parseOutputOutIndex)(path);
|
|
1890
1890
|
if (currentActionIndex !== null && currentActionIndex !== actionIndex) {
|
|
1891
|
-
|
|
1891
|
+
output[key] = null;
|
|
1892
1892
|
continue;
|
|
1893
1893
|
}
|
|
1894
1894
|
if (path.startsWith("out.") || path === "out" || path.startsWith("out[")) {
|
|
1895
1895
|
const value = getNestedValue(path);
|
|
1896
|
-
|
|
1896
|
+
output[key] = value || null;
|
|
1897
1897
|
} else {
|
|
1898
|
-
|
|
1898
|
+
output[key] = path;
|
|
1899
1899
|
}
|
|
1900
1900
|
}
|
|
1901
1901
|
return {
|
|
1902
1902
|
values,
|
|
1903
|
-
|
|
1903
|
+
output: await (0, import_warps4.evaluateOutputCommon)(
|
|
1904
1904
|
warp,
|
|
1905
|
-
|
|
1905
|
+
output,
|
|
1906
1906
|
actionIndex,
|
|
1907
1907
|
inputs,
|
|
1908
1908
|
this.serializer.coreSerializer,
|
|
@@ -2918,7 +2918,7 @@ var WarpFastsetWallet = class {
|
|
|
2918
2918
|
}
|
|
2919
2919
|
async sendTransaction(tx) {
|
|
2920
2920
|
const { signature, ...transactionWithoutSignature } = tx;
|
|
2921
|
-
const _cert = await this.client.submitTransaction(transactionWithoutSignature, signature);
|
|
2921
|
+
const _cert = await this.client.submitTransaction(transactionWithoutSignature, signature ?? null);
|
|
2922
2922
|
return "TODO";
|
|
2923
2923
|
}
|
|
2924
2924
|
async sendTransactions(txs) {
|
|
@@ -2960,7 +2960,7 @@ function createFastsetAdapter(chainName, chainInfos) {
|
|
|
2960
2960
|
chainInfo,
|
|
2961
2961
|
builder: () => fallback.builder(),
|
|
2962
2962
|
executor: new WarpFastsetExecutor(config, chainInfo),
|
|
2963
|
-
|
|
2963
|
+
output: new WarpFastsetOutput(config, chainInfo),
|
|
2964
2964
|
serializer: new WarpFastsetSerializer(),
|
|
2965
2965
|
registry: fallback.registry,
|
|
2966
2966
|
explorer: new WarpFastsetExplorer(chainInfo, config),
|