Search…
Managed Transactions
AWS for public blockchain transactions
See full API documentation here.
Quickly broadcast transactions on behalf of your users to one of our supported public blockchain networks without having to buy or hold cryptocurrency or tokens.
TypeScript
1
import { bookieClientFactory, identClientFactory } from 'provide-js';
2
3
const appId = '<provide app id>'; // the app id
4
const appAccessToken = '<signed jwt>'; // application token
5
6
// initialize ident instance for the application
7
const ident = identClientFactory(accessToken);
8
9
// create a virtual application user
10
const virtualUser = await ident.createUser({
11
application_id: appId,
12
email: `joe.user.${new Date().getTime()}@example.com`,
13
first_name: 'Joe',
14
last_name: 'User',
15
})
16
17
console.log(virtualUser.id); // associate this id with your local user
18
19
const userAccessToken = (await ident.createToken({
20
application_id: appId,
21
user_id: virtualUser.id,
22
scope: 'offline_access',
23
})).accessToken!;
24
25
// the refresh token is also returned here and should also be persisted
26
// and used to create future access tokens...
27
28
// initialize bookie (api.providepayments.com) instance for the user
29
const bookie = bookieClientFactory(userAccessToken);
30
31
// create a payment for the user...
32
const payment = await bookie.createPayment({
33
data: '0x',
34
network: 'ropsten',
35
});
Copied!
Last modified 3mo ago
Copy link