com.github.DNAProject.core.scripts.WasmScriptBuilder Maven / Gradle / Ivy
The newest version!
package com.github.DNAProject.core.scripts;
import com.github.DNAProject.common.Address;
import com.github.DNAProject.common.Helper;
import com.github.DNAProject.sdk.exception.SDKRuntimeException;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Arrays;
import java.util.List;
public class WasmScriptBuilder implements AutoCloseable{
private ByteArrayOutputStream ms;
private static BigInteger maxInt128 = new BigInteger("2").pow(127).subtract(BigInteger.ONE);
private static BigInteger minInt128 = new BigInteger("2").pow(127).negate();
WasmScriptBuilder() {
this.ms = new ByteArrayOutputStream();
}
@Override
public void close() {
try {
ms.close();
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
void reset() {
ms.reset();
}
public static byte[] createWasmInvokeCode(String contractHash, String method, List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy