Giter VIP home page Giter VIP logo

tsjs-xpx-chain-sdk's Introduction

TypeScript logo

License

The official ProximaX Blockchain SDK for TypeScript and JavaScript, available for browsers, mobile applications and NodeJS, to work with the ProximaX Sirius Blockchain

Build with NodeJS 18

New Transaction version

New transaction signing with different derivation scheme will be introducted later. For old transaction of not yet upgraded Sirius Chain, please use version v0.10.x.

You can take a look at the wiki.

TODO: update CHANGELOG.md

Requirements

NodeJS

  • NodeJS 18.X.X

Installation

npm install tsjs-xpx-chain-sdk

Documentation and Getting Started

Contributing

This project is developed and maintained by ProximaX. Contributions are welcome and appreciated. You can find tsjs-xpx-chain-sdk on GitHub; Feel free to start an issue or create a pull request. Check CONTRIBUTING before start.

To get the full description of the available classes and their functions, check the [SDK reference][sdk-ref].

Getting help

Use the following available resources to get help:

Contributing

This project is developed and maintained by ProximaX. Contributions are welcome and appreciated. You can find tsjs-xpx-chain-sdk on GitHub.

Feel free to start an issue or create a pull request. Check CONTRIBUTING before start.

License

Copyright (c) 2019-2023 ProximaX Licensed under the Apache License 2.0

Copyright (c) 2018-2019 NEM Licensed under the Apache License 2.0

Acknowledgments

tsjs-xpx-chain-sdk's People

Contributors

44uk avatar aizaiz avatar aleixmorgadas avatar avanaur avatar decentraliser avatar dependabot[bot] avatar devyin7 avatar dgarcia360 avatar dl-nice avatar evias avatar guillemsole avatar jontey avatar jorisadri avatar khawarizmus avatar melvz avatar otsybizov avatar rg911 avatar sateetje avatar shinneng avatar slackve avatar sleepyowl14 avatar thomas-tran avatar yaaccount avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tsjs-xpx-chain-sdk's Issues

Wrong tx sizes reported from tx classes

Note that calculation inside internal builders are correct, since all txs are announced/confirmed correctly.
TODO: refactor - use just one place for tx size calculation

Add support for new api routes.

"config" and "upgrade" api routes has been added. Add support for it to the sdk (checkout new swagger.yaml from js-xpx-chain-rest repo).

report multisig cosignatory added (opt-in) through partialAdded websocket callback

@melvz complained about cosigners not being notified over partialAdded websocket listener when they are added to the msig account.

It seems the message is already present on the partialAdded websocket channel, but it is filtered out and not returned to the (soon to be) cosignatory listener.

It should be possible to change Listener.ts not to filter that out and return it instead.

Websocket BlockInfo

When using websocket, newBlock() returns undefined for numTransactions, when it should return a number.

Validate address

Can I use SDK library to validate an unused address?
I try to use "getAccountInfo" but I can not found it if this address wasn't used.

ModifyMetadataTransaction Issue

const mosaicId = new MosaicId([123123,123123]);
const modification = new MetadataModification(
MetadataModificationType.ADD,
"key",
"value"
);
const tx = ModifyMetadataTransaction.createWithMosaicId(
NetworkType.TEST_NET,
Deadline.create(),
mosaicId,
[modification],
new UInt64([0,0])
)
JSON.stringify(tx);

I created a transaction like above and issue was happen. It's seem to be unimplemented ModifyMetadataTransaction in file SerializeTransactionToJSON.

The library could not compile for strict typescript from version >4.9.5

  1. Error during build
    RemoveExchangeOfferTransaction.ts:77:12
    MosaicDefinitionTransaction.ts:131:12
    ModifyMultisigAccountTransaction.ts:132:12
    ExchangeOfferTransaction.ts:77:12
    AccountAddressRestrictionModificationTransaction.ts:111:12
    error TS2742: The inferred type of 'toJSON' cannot be named without a reference to '.pnpm/github.com+proximax-storage+tsjs-xpx-chain-sdk@81ef420/node_modules/tsjs-xpx-chain-sdk'. This is likely not portable. A type annotation is necessary.

  2. Steps to reproduce the problem.

  • Reference tsjs-xpx-chain-sdk#next to other project
  • Set declaration = true in the tsconfig.json
    "compilerOptions": {
    ...
    "declaration": true,
    ... }
  • Execute command pnpm/npm run build
  • Unable to build project
  1. Specifications like the version of the project, operating system, or hardware.
    NodeJS: 18+
    Typescript: >4.9.5

Regression: circular dependency introduced with #62

$ cat visibility.js
const sdk = require('tsjs-xpx-chain-sdk');

sdk.AggregateTransaction.createComplete(
sdk.Deadline.create(),
[],
sdk.NetworkType.MAIN_NET,
[]);

$ node visibility.js
...visibility.js:3
sdk.AggregateTransaction.createComplete(
^

TypeError: Cannot read property 'createComplete' of undefined
at Object. (.../visibility.js:3:26)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
at internal/main/run_main_module.js:17:11

Can not install use: npm install tsjs-xpx-catapult-sdk

  1. I install this sdk by: npm install tsjs-xpx-catapult-sdk, have error:
npm ERR! code ENOVERSIONS
npm ERR! No valid versions available for tsjs-xpx-catapult-sdk

npm ERR! A complete log of this run can be found in:
npm ERR!     home/.npm/_logs/2019-06-05T09_34_57_889Z-debug.log
  1. And I try to install use: npm install https://github.com/proximax-storage/tsjs-xpx-catapult-sdk.git but have same error above
  2. When i check version in www.npmjs.com, it not exist.

Please help me, Thanks.

Change to alternative libraries of request

  • request is having UnhandledPromiseRejection in the library, which will give headache to user of newer version of NodeJS
  • request is deprecated for some time, it is better to change to another library

Add possibility to append signatures to signed aggregate complete transaction.

Now there is the possibility to:

  1. Alice creates the aggregate complete transaction (without other signatures)
  2. Alice sends only payload to Others
  3. each Other signs the payload and sends signature back to Alice
  4. Alice gathers all the cosignatures, creates the aggregate complete transaction again, signs it and announces
    A->B, B->A
    A->C, C->A
    A->D, D->A
    A->announce

If we support appending additional signatures to the signed aggregate complete transaction, also following would be possible:

  1. Alice creates and signs the aggregate complete transaction (without other signatures)
  2. Alice sends the whole transaction to the next in the chain
  3. each chain member receives the partially signed transaction, appends own signature
  4. last chain member announces fully signed aggregate complete transaction
    A->B
    B->C,
    C->D,
    D->announce

update both CHANGELOG.md and README.md

  1. Expected behavior and actual behavior.

  2. Steps to reproduce the problem.

  3. Specifications like the version of the project, operating system, or hardware.

missing export of AccountRestrictionTransaction helper class

var transaction = _tsjsXpxChainSdk.AccountRestrictionTransaction.createAddressRestrictionModificationTransaction(_tsjsXpxChainSdk.Deadline.create(), _tsjsXpxChainSdk.RestrictionType.AllowAddress, [allowedAddresses], _tsjsXpxChainSdk.NetworkType.TEST_NET);
^

TypeError: Cannot read property 'createAddressRestrictionModificationTransaction' of undefined
at Command.callback (D:/Projects/doc-api/modules/restriction/RestrictWallet.js:76:63)
at normal_reply (D:\xxxxxx\node_modules\redis\index.js:726:21)
at RedisClient.return_reply (D:\xxxxxx\node_modules\redis\index.js:824:9)
at JavascriptRedisParser.returnReply (D:\xxxxxx\node_modules\redis\index.js:192:18)
at JavascriptRedisParser.execute (D:\xxxxxx\node_modules\redis-parser\lib\parser.js:574:12)
at Socket. (D:\xxxxxx\node_modules\redis\index.js:274:27)
at Socket.emit (events.js:198:13)
at Socket.EventEmitter.emit (domain.js:448:20)
at addChunk (_stream_readable.js:287:12)
at readableAddChunk (_stream_readable.js:268:11)
[nodemon] app crashed - waiting for file changes before starting...

taken from here: https://bcdocs.xpxsirius.io/docs/guides/account-restriction/preventing-spam-attacks/

fix travis build

there is wrong path for js-xpx-chain-library dependency in package-lock.json

Missing MODIFY_ACCOUNT_METADATA in CreateTransactionFromPayload.js

Problem: One of our InnerTransactions have a ModifyMetadataTransaction and using AggregateComplete and sign and recreate the transaction, it returns an transaction type not implemented yet.

Findings: I checked the dist/src/infrastructure/transaction/CreateTransactionFromPayload.js and in the CreateTransaction() function the switch-case does not have the MODIFY_ACCOUNT_METADATA.

Steps to reproduce the problem:
Do an aggregate complete transaction and use metadata modification as one of the inner transactions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.