Skip to content

itamarco/spark-ordernet-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a58347a · May 9, 2021

History

40 Commits
Feb 11, 2021
May 9, 2021
Nov 28, 2020
Nov 28, 2020
May 3, 2021
Dec 2, 2020
Mar 1, 2021
May 3, 2021
Nov 27, 2020
May 9, 2021
Dec 9, 2020
Feb 11, 2021

Repository files navigation

spark-ordernet-client

npm version CI npm publish

Simple REST client for Spark-Ordernet API

Tested with

  • sparknesua.ordernet.co.il
  • sparkpsagot.ordernet.co.il

Usage

import SparkClient from './spark-client';

const client = new SparkClient({
    sparkHost: 'https://sparkpsagot.ordernet.co.il',
    userId: '<your account id>', 
    password: '<yorr password>',
    
    //Optional
    accountKey: '<your account key e.g. ACC_060-030002>',
    logger: '<default is console>', 
});

Authenticate once

await client.auth();

Optional - Get accountKey

const accountKey: string = await client.getAccountKey();
client.setSparkAccountKey(accountKey);

Get transactions

const transactions = await client.getTransactions(new Date(2018,1,1));

// transactions = 
[
    {
        Account: '***',
        Date: '2019-05-04T00:00:00',
        Bno_Number: 5760130,
        Ref: 995036,
        Sug_Bno: '10',
        Bno_Name: '7חברה לישראלאגח',
        Nv: 953.2,
        Action: 'הפקדה',
        Balance: 0,
        Comission: 0,
        Price: 130.1,
        NetCredit: 0,
        NetDebit: 0
    },
    ...
]

Get holdings

const holdings = await client.getHoldings();

// holdings = 
[
    {
        Sug: '0',
        ID: '031692',
        BNO: 5121835,
        BS_BNO: '0',
        SYMBOL_NAM: 'HRL TEL-B60',
        BNO_NAME: '60 הראל תל בונד',
        SUG_ID: '10',
        SUG_BNO: '5',
        LAST_OP: '9',
        mm: 'קניה',
        PRC: 112.89,
        PRC_CHNG: '0',
        SUG_CUR: '1',
        PR_MATACH: '1',
        HON_RASHUM: 0,
        NV: 21232,
        COST: 23998.06,
        VL: 23968.8,
        EXT_MARGIN: 14381.28,
        REQ_MARGIN: 23998.06,
        SugBno: 'Kranot',
        ...
    },
    ...
]

About

Simple REST client for Spark-Ordernet API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published