Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide example for eos-transit-anchorlink-provider #51

Open
Novusphere opened this issue Jul 2, 2020 · 3 comments
Open

Provide example for eos-transit-anchorlink-provider #51

Novusphere opened this issue Jul 2, 2020 · 3 comments

Comments

@Novusphere
Copy link

Novusphere commented Jul 2, 2020

It's unclear without looking at code that you need to provide a "session id" to anchor's constructor when setting up the access context's wallet providers. Nor does anchor() throw any errors if you don't specify the session id. You just get an obscure error if you don't.

e.g.

        walletProviders: [
            anchor(`discussions`),
            scatter()
        ]
@NatPDeveloper
Copy link

I am seeing

./node_modules/anchor-link/lib/link.js
Module parse failed: Unexpected token (100:12)
You may need an appropriate loader to handle this file type.
|         // generate unique callback url
|         let request = await esr.SigningRequest.create({
|             ...args,
|             chainId: this.chainId,
|             broadcast: false,

With

import anchorlink from 'eos-transit-anchorlink-provider';


const appName = 'My Dapp';

const walContext = initDefaultAccessContext({
	appName,
	network: {
		host: 'eos.greymass.com',
		port: 443,
		protocol: 'https',
		chainId: 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906'
	},
	// walletProviders: [ scatter() ]
	walletProviders: [ 
		scatter(),
		ledger({exchangeTimeout : 30000, transport: 'TransportWebBLE', name: 'Ledger Nano S BLE', shortName: 'Ledger Nano S BLE', id: 'ledgerble' }),
		ledger({exchangeTimeout : 30000, transport: 'TransportU2F', name: 'Ledger Nano S U2F', shortName: 'Ledger Nano S U2F', id: 'ledgeru2f' }),
		ledger({exchangeTimeout : 30000, transport: 'TransportWebAuthn', name: 'Ledger Nano S WebAuthn', shortName: 'Ledger Nano S WebAuthn', id: 'ledgeruwebauthn' }),
		ledger({exchangeTimeout : 30000, transport: 'TransportWebusb', name: 'Ledger Nano S Web USB', shortName: 'Ledger Nano S Web USB', id: 'ledgeruwebusb' }),
		anchorlink(Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)) 
	]
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@NatPDeveloper and others