{"_id":"@chainapsis/ts-amino","_rev":"2-e3199a75a2aa39c0c807a0b203d6c3d8","name":"@chainapsis/ts-amino","dist-tags":{"latest":"0.0.1-alpha.4"},"versions":{"0.0.1-alpha.3":{"name":"@chainapsis/ts-amino","version":"0.0.1-alpha.3","description":"javascript/typescript version amino","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"mocha -r ts-node/register src/**/*.spec.ts","lint":"tslint -c tslint.json -p tsconfig.json","lint-fix":"tslint -c tslint.json -p tsconfig.json --fix","prettier":"find ./src -type f | xargs prettier --check","prettier-write":"find ./src -type f | xargs prettier --write"},"pre-commit":["lint","prettier"],"author":{"name":"Thunnini"},"license":"Apache-2.0","dependencies":{"big-integer":"^1.6.43","buffer":"^5.2.1","sha.js":"^2.4.11"},"devDependencies":{"@types/mocha":"^5.2.6","@types/node":"^11.13.2","@types/sha.js":"^2.4.0","mocha":"^6.1.4","pre-commit":"^1.2.2","prettier":"^1.17.1","ts-node":"^8.1.0","tslint":"^5.15.0","tslint-config-prettier":"^1.18.0","tslint-plugin-prettier":"^2.0.1","typescript":"^3.4.2"},"gitHead":"3f1f108f3f47b703ef00ddcd7256e3716c2e475d","_id":"@chainapsis/ts-amino@0.0.1-alpha.3","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"chainapsis","email":"tony@chainapsis.com"},"dist":{"integrity":"sha512-h/rh1XnD9kDy3tZ9/5B4hdsKAnuVGzylnsV6BU7zYwVj8Xljpq1I11soS1x5tFH2FG9e0f4gmfqlBsqsxPipHg==","shasum":"b3f9ce836eeb2ac052f867290c15e5e4d6fc1c2e","tarball":"https://registry.npmjs.org/@chainapsis/ts-amino/-/ts-amino-0.0.1-alpha.3.tgz","fileCount":61,"unpackedSize":208648,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUOEPCRA9TVsSAnZWagAANDkP/iZiRqmHYIJouaSxYfLh\n6Y/109HbY+usF9L42RQ9+Sd0xUoF2I2QI7vbfTTRr5ckLmKfQOm4kpFz7OTz\nagBjurnIcaFoHzIGMqk1VCHNkjiGqYy0mwhJMbv+lqMZzhOjan2GxV6mcrYF\nu9O7MiRQVlxSM0WIJzDA0gSJ5VM5VYzC0WhYPD7AJW2YK1ylA92ah3BXtylX\ntQgDsaVXMGIE0+e0Vyz8YNgJC+Gmxo4Ewr3iHGzDxVov3ttG+zuiOTYz/j+Y\n7mFQ6B1FdyrWdpvrWf5L6e/6XYwzPSonlEWsqionJ4OVwwVKZv05MZ60IsLJ\nCvYjOMnTXm15jpFrd2Zoz47A2BZ/x9C2hVd1yO3FL0NECTa61qMI3ssJfNuw\nqg+ZhTslGvREjPD0/4awH5LPv1UGqlgOZZZGdYMDlSB4SnAFpQFMWRS8tv2H\n/oYkKpEdpeDnS9ktURP5efWh6/4cdJaz5kIJ+PZxbYzNQzAVHAx+vr8Sbgb8\niVqPIfEMtMcCAbDZSTnFjbZV1n0/hiFC6cQBA1RcevOVv//ymhfR0eoegR7j\nJur9ithYgfcT2by2olkQOXBfrkCVjeRg4vLGMTEEQMfZggZIpxI3WlFrldfG\nMajhtXNGOaDHNgjgF9VbYceRj/8zH+bCWZbBcC5+kWvoSK9ZMint3SypfEZN\nBNPT\r\n=KOVa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCx365Dk7y7vkRaCujgS+L7eVmcm8/LneJsdXj2iK5lbAIgWv7EXyBgxwojKAN4g00DtRnHqMS9Wzdn5tF2z2wiNac="}]},"maintainers":[{"name":"chainapsis","email":"tony@chainapsis.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-amino_0.0.1-alpha.3_1599136014992_0.8641919355819623"},"_hasShrinkwrap":false},"0.0.1-alpha.4":{"name":"@chainapsis/ts-amino","version":"0.0.1-alpha.4","description":"javascript/typescript version amino","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"mocha -r ts-node/register src/**/*.spec.ts","lint":"tslint -c tslint.json -p tsconfig.json","lint-fix":"tslint -c tslint.json -p tsconfig.json --fix","prettier":"find ./src -type f | xargs prettier --check","prettier-write":"find ./src -type f | xargs prettier --write"},"pre-commit":["lint","prettier"],"author":{"name":"Thunnini"},"license":"Apache-2.0","dependencies":{"big-integer":"^1.6.43","buffer":"^5.2.1","sha.js":"^2.4.11"},"devDependencies":{"@types/mocha":"^5.2.6","@types/node":"^11.13.2","@types/sha.js":"^2.4.0","mocha":"^6.1.4","pre-commit":"^1.2.2","prettier":"^1.17.1","ts-node":"^8.1.0","tslint":"^5.15.0","tslint-config-prettier":"^1.18.0","tslint-plugin-prettier":"^2.0.1","typescript":"^3.4.2"},"gitHead":"ad63ed9058eebdf9f83b0fe35c6cdc989d457a97","_id":"@chainapsis/ts-amino@0.0.1-alpha.4","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"chainapsis","email":"tony@chainapsis.com"},"dist":{"integrity":"sha512-ZNwgIc88udwguLdG+/XT5uMLt68kI93ZDW0cNTVd1XxoXpxYaKGy2MN44Xug5eB6AJPC4eDPl7Y+qfakbZ8QKw==","shasum":"48c9cd2f61972418a944b094751e469de179a93e","tarball":"https://registry.npmjs.org/@chainapsis/ts-amino/-/ts-amino-0.0.1-alpha.4.tgz","fileCount":61,"unpackedSize":208624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZgWHCRA9TVsSAnZWagAAbMUP/0ER4NLu+VFqlWHuHllW\nfbPgWR6wG63iajnOanYTe7hktuHrnStDVkWOT6W9Y1WnOwBKoKaZXVV2V+95\nqrpQuuNRjWXu4kzimDBd8ai0JlIhqgBhbqe0WDTZu7otZsIeOwQ+exkR+S4Y\nioTwt2IsDYKCtKDER9Po1KGr8rz1UnBeQ7sGditPU6Hr0wF05IoGdaE2LsBU\n7UItIH6+GaUOxFEdKbiiCFUXhco9MEujdbx+BUOMoJAW6LugHjNEFoATNvAX\nQQET5aybzUWwNJs7G/zL0zRFYod0NgDwoRuW0Uq0RSR05OFJmmzpYZ22y1Je\nMVpFL3PUC8XOw8BEdMe6p857sVHUCi4brg5eaSD2m7kVWOvJTXwVAPROHM8u\nJaKMokvlN9Bn8DJokN/LBhsOKyesxylaRNlpUOREYhsj1Ixjr2inmBmUdmRK\npNiIYMqiyJy9lPJ6beYkkjbGPp9xtlDO3eA3CUZcxB6USa4fryrb83n15ntu\nJFuwqcHVt0W/e2GxlWlwG0wlbHIvT1WrPDsZ9C7Xa2BDWPZYW34/OBJyA8LC\nuRccYpH8LX+pqDnUrQfnSdRAzIqb+iRbT8DFSk0jN0os2Ae+qQBpmEe0raFK\n8f1/lj08OLq+3BxL0fi3o0imyNF12M0eclTdzvprOzWIDNWpLyt66HSeZEwk\nqaS4\r\n=ywse\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH0yxWBkEiZuc4pXUGrtk2lWL7VABLX4b7a7OyC948JoAiAfwLYPTNrwsXetI7PSr7ANtpuQFBAkpNDzEVGfd96S0A=="}]},"maintainers":[{"name":"chainapsis","email":"tony@chainapsis.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-amino_0.0.1-alpha.4_1600521606413_0.6507104080404913"},"_hasShrinkwrap":false}},"time":{"created":"2020-09-03T12:26:54.946Z","0.0.1-alpha.3":"2020-09-03T12:26:55.125Z","modified":"2022-04-04T22:26:20.919Z","0.0.1-alpha.4":"2020-09-19T13:20:06.569Z"},"maintainers":[{"name":"chainapsis","email":"tony@chainapsis.com"}],"description":"javascript/typescript version amino","author":{"name":"Thunnini"},"license":"Apache-2.0","readme":"### Description\nThis software implements typescript(javascript) bindings for the Amino encoding protocol.\n\nAmino is an object encoding specification. It is a subset of Proto3 with\nan extension for interface support.  See the [Proto3 spec](https://developers.google.com/protocol-buffers/docs/proto3)\nfor more information on Proto3, which Amino is largely compatible with (but not with Proto2).\n\nThe goal of the Amino encoding protocol is to bring parity into logic objects\nand persistence objects.\n\n*But  now this is very early stage, so the immediate goal is to be fully compatible with [go-amino](https://github.com/tendermint/go-amino) to use for [Cosmos-sdk](https://github.com/cosmos/cosmos-sdk).*\n\n### Featurs\n- [x] Support basic encoding binary/json\n- [ ] Support basic decoding binary/json\n- [x] Support (u)int64 with [BigInteger.js](https://github.com/peterolson/BigInteger.js) as [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) polyfill\n- [ ] Encode/decode Time type\n- [x] Support decorator for ES7 (You need to use babel or typescript) \n\n### Decorator\nMore  details and documents will be available  soon\n```typescript\nimport  {  Amino,  Type  }  from  \"ts-amino\";\nconst { Field,  Concrete,  DefineStruct } =  Amino;\nimport  bigInteger  from  \"big-integer\";\n\n@Concrete(\"cosmos-sdk/MsgSend\")\n@DefineStruct()\nclass  MsgSend {\n  @Field.Defined(0, {\n    jsonName:  \"from_address\"\n  })\n  public fromAddress:  AccAddress;\n\n  @Field.Defined(1, {\n    jsonName:  \"to_address\"\n  })\n  public toAddress:  AccAddress;\n\n  @Field.Slice(\n    2,\n    { type:  Type.Defined },\n    {\n      jsonName:  \"amount\"\n    }\n  )\n  public amount:  Coin[];\n\n  constructor(fromAddress:  AccAddress, toAddress:  AccAddress, amount:  Coin[]) {\n    super();\n    this.fromAddress  = fromAddress;\n    this.toAddress  = toAddress;\n    this.amount  = amount;\n  }\n\n  public  getSigners():  AccAddress[] {\n    return [this.fromAddress];\n  }\n}\n\n@DefineType()\nclass  AccAddress {\n  @Field.Array(0, { type:  Type.Uint8 })\n  private address:  Uint8Array;\n\n  constructor(address:  Uint8Array) {\n    this.address  = address\n  }\n\n  public  marshalJSON():  Uint8Array {\n    return  Buffer.from(`\"${this.toBech32()}\"`, \"utf8\");\n  }\n}\n\n@DefineStruct()\nclass  Coin {\n  @Field.String(0)\n  public denom:  string;\n\n  @Field.Defined(1)\n  public amount:  Int;\n\n  constructor(denom:  string, amount:  Int) {\n    this.denom  = denom;\n    this.amount  = amount;\n  }\n}\n\n@DefineStruct()\nclass  Int {\n  private int:  bigInteger.BigInteger;\n  \n  constructor(\n    int:  bigInteger.BigInteger,\n  ) {\n    this.int  =  int;\n  }\n\n  @Method.AminoMarshaler({ type:  Type.String })\n  public  marshalAmino():  string {\n    return  this.int.toString(10);\n  }\n}\n```\n","readmeFilename":"Readme.md"}