0

I am using scatterjs cdn.

<script src="https://cdn.scattercdn.com/file/scatter-cdn/js/latest/scatterjs-core.min.js"></script>

I thought I can use scatterjs by only importing simple javascript without node.js but it isn't working. Does anyone know an example using scatter.js without node.js?

Or is it not possible?

0

Scatter design to work with frontend. Check out demo application of scatter with eosjs SDK but it's depreciated and for newest example, contract telegram scatter developer channel.

https://github.com/EOSEssentials/Scatter-Demos

https://t.me/ScatterDevelopers

| improve this answer | |
0

You can use the following files to set up scatter without node,

<script src="https://cdn.scattercdn.com/file/scatter-cdn/js/latest/scatterjs-core.min.js"></script>

<script src="https://cdn.scattercdn.com/file/scatter-cdn/js/latest/scatterjs-plugin-eosjs2.min.js"></script>

and below script for simple javascript, to connect to scatter.

const network = ScatterJS.Network.fromJson({
            blockchain: 'eos',
            chainId: 'e70aaab8997e1dfce58fbfac80cbbb8fecec7b99cf982a9444273cbc64c41473',
            host: 'jungle2.cryptolions.io',
            port: 80,
            protocol: 'http'
        });
        var scatter;

    ScatterJS.plugins(new ScatterEOS());

    try {
        ScatterJS.scatter.connect(contract).then(connected => {
            // User does not have Scatter Desktop, Mobile or Classic installed.
            if (!connected) return console.log("Issue Connecting");

            scatter = ScatterJS.scatter;

            const requiredFields = {
                accounts: [network]
            };

            scatter.getIdentity(requiredFields).then(() => {
                _account = scatter.identity.accounts.find(
                    x => x.blockchain === "eos"
                )
            })
            .catch(error => {
                console.log(error);
            })

            window.ScatterJS = null;
        });
    }
    catch (error) {}

You can also find code example on github

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.