Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@chainapsis/ts-amino
Advanced tools
This software implements typescript(javascript) bindings for the Amino encoding protocol.
Amino is an object encoding specification. It is a subset of Proto3 with an extension for interface support. See the Proto3 spec for more information on Proto3, which Amino is largely compatible with (but not with Proto2).
The goal of the Amino encoding protocol is to bring parity into logic objects and persistence objects.
But now this is very early stage, so the immediate goal is to be fully compatible with go-amino to use for Cosmos-sdk.
More details and documents will be available soon
import { Amino, Type } from "ts-amino";
const { Field, Concrete, DefineStruct } = Amino;
import bigInteger from "big-integer";
@Concrete("cosmos-sdk/MsgSend")
@DefineStruct()
class MsgSend {
@Field.Defined(0, {
jsonName: "from_address"
})
public fromAddress: AccAddress;
@Field.Defined(1, {
jsonName: "to_address"
})
public toAddress: AccAddress;
@Field.Slice(
2,
{ type: Type.Defined },
{
jsonName: "amount"
}
)
public amount: Coin[];
constructor(fromAddress: AccAddress, toAddress: AccAddress, amount: Coin[]) {
super();
this.fromAddress = fromAddress;
this.toAddress = toAddress;
this.amount = amount;
}
public getSigners(): AccAddress[] {
return [this.fromAddress];
}
}
@DefineType()
class AccAddress {
@Field.Array(0, { type: Type.Uint8 })
private address: Uint8Array;
constructor(address: Uint8Array) {
this.address = address
}
public marshalJSON(): Uint8Array {
return Buffer.from(`"${this.toBech32()}"`, "utf8");
}
}
@DefineStruct()
class Coin {
@Field.String(0)
public denom: string;
@Field.Defined(1)
public amount: Int;
constructor(denom: string, amount: Int) {
this.denom = denom;
this.amount = amount;
}
}
@DefineStruct()
class Int {
private int: bigInteger.BigInteger;
constructor(
int: bigInteger.BigInteger,
) {
this.int = int;
}
@Method.AminoMarshaler({ type: Type.String })
public marshalAmino(): string {
return this.int.toString(10);
}
}
FAQs
javascript/typescript version amino
We found that @chainapsis/ts-amino demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.