Skip to content

Commit 10ba7ce

Browse files
update docs
1 parent 65f1e5c commit 10ba7ce

8 files changed

Lines changed: 62 additions & 31 deletions

File tree

docs/getting-started.mdx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,25 +82,22 @@ Please note that this example uses the `SERVICES_API_URL` environment variable.
8282

8383
As a test initial request, you can use a request to the location service by IP address. It does not require authorization.
8484

85-
To begin with, you should download the generated client for this service, unpack it and copy it to the `src/services` folder.
86-
87-
// link to file that can be downloaded
88-
Client for location service
85+
To begin with, you should install or download the [generated client](https://buf.build/linq/linq/sdks) for this service.
8986

9087
Below is an example of using a client to call the necessary methods on the service, in this case to obtain information about the current location and a flag that indicates whether access is allowed or not.
9188

9289
```typescript
9390
// Import response type
94-
import { Access } from "./services/system/v1alpha1/restrictions";
91+
import { Access } from "@buf/linq_linq.grpc_web/linq/geo/restrictions/v2/restrictions";
9592
// Import service client for connecting to the backend
96-
import { RestrictionsServiceClient } from "./services/system/v1alpha1/restrictions.client";
93+
import { RestrictionsServiceClient } from "@buf/linq_linq.grpc_web/linq/geo/restrictions/v2/restrictions.client";
9794
// Import special helpers for building transport and auth
9895
import { getAuthorization, getTransport } from "./utils/transport";
9996

10097
export const accessChecker = async (): Promise<Access> => {
10198
// creates service instance using transport as a parameter
10299
const service = new RestrictionsServiceClient(getTransport());
103-
100+
104101
const access = await service.isAccessAllowed({});
105102
// in case authorization needed, use the next way of doing request
106103
// auth token - token, which backend gives for user oprations
@@ -116,8 +113,8 @@ accessChecker().then((access: Access) => {
116113
});
117114
```
118115

119-
116+
{/*
120117
An example application for checking a location is attached below as an archive.
121118
122-
link to file
123-
src=".gitbook/assets/integration-sdk-example.zip"
119+
link to file
120+
src=".gitbook/assets/integration-sdk-example.zip" */}

docs/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Integration through the application includes the following modules:
1515
* [Authentication](modules/auth "Registration and authorization in services")
1616
* [Location Checks](modules/location-checks.md "Check the location by IP address and more precise way using coordinates")
1717
* [Money Operations](modules/money "All cash related operations, including transfers and custom rewards")
18-
* [Play Mechanics](modules/play "Playing related actions, like tournaments starting and players joining")
18+
<!-- * [Play Mechanics](modules/play "Playing related actions, like tournaments starting and players joining") -->
1919

2020
For integration, the gRPC procedure call protocol is used together with Protocol Buffers.
2121

@@ -48,4 +48,4 @@ After integrating the solution, the user will have access to the following optio
4848
* top up your internal game account using a card or Apple Pay
4949
* transfer funds from your wallet account to your game account
5050
* use money from your account to participate in a tournament (or other in-game purchases)
51-
* withdraw money to your wallet for subsequent payment to an account or card
51+
* withdraw money to your wallet for subsequent payment to an account or card
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ To use the tournament management API, follow these steps:
5151
#### Initiate a Session
5252

5353
```typescript
54-
const remoteSession = await sessionService.initiate({
54+
const remoteSession = await sessionService.initiate({
5555
title: "High Stakes",
5656
seats: 5,
5757
entry: 250, // 2.5$
@@ -63,7 +63,7 @@ To use the tournament management API, follow these steps:
6363
```
6464

6565
#### Join a Player
66-
66+
6767
```typescript
6868
const remotePlayer = await playerService.join({
6969
session: tournament.remote,
@@ -79,7 +79,7 @@ To use the tournament management API, follow these steps:
7979
```
8080

8181
#### Complete the Session
82-
82+
8383
```typescript
8484
//...
8585
positions.push(new Position({

docs/modules/location-checks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Checking the location using the user's coordinates is carried out to ensure the
1515

1616
## IP verification
1717

18-
To check access over IP, the `RestrictionsService` service is used, which provides the `isAccessAllowed` method
18+
To check access over IP, the [RestrictionsService](https://buf.build/linq/linq/docs/main:linq.geo.restrictions.v2#linq.geo.restrictions.v2.RestrictionsService) service is used, which provides the [IsAccessAllowed](https://buf.build/linq/linq/docs/main:linq.geo.restrictions.v2#linq.geo.restrictions.v2.RestrictionsService.IsAccessAllowed) method
1919

2020
<!-- ### List of countries and regions where transactions are restricted
2121
@@ -44,4 +44,4 @@ const payload = await service.getAvoidedRegions({
4444

4545
## Check by GEO
4646

47-
To check access to operations based on user coordinates, the LocationService service and the isOperationAllowed method are used.
47+
To check access to operations based on user coordinates, the [LocationService](https://buf.build/linq/linq/docs/main:linq.geo.operations.v1#linq.geo.operations.v1.LocationService) service and the [IsOperationAllowed](https://buf.build/linq/linq/docs/main:linq.geo.operations.v1#linq.geo.operations.v1.LocationService.isOperationAllowed) method are used.
File renamed without changes.

docs/modules/money-operations/money-operations.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,40 @@ const walletBalance = accounts.response.accounts.filter((v) => v.currency == "LN
4040
const gamingBalance = accounts.response.accounts.filter((v) => v.currency == "GSC").pop()?.balance || 0;
4141
```
4242

43-
### Withdrawal of funds
43+
### Deposit user game account
44+
45+
To add money to user game account use [AccountsService#PutMoney](https://buf.build/linq/linq/docs/main:linq.money.accounts.v1#linq.money.accounts.v1.AccountsService.PutMoney) method
46+
47+
```typescript
48+
const accountsService = new AccountsServiceClient(getTransport());
49+
50+
await accountsService.putMoney({
51+
idempotencyKey: 'ik-123',
52+
amount: 500,
53+
reason: 'Tournament reward',
54+
extra: { tournament_id: 't1' },
55+
}, getAuthorization(authToken));
56+
57+
```
58+
59+
### Withdraw user game account
60+
61+
To withdraw money from user game account use [AccountsService#GetMoney](https://buf.build/linq/linq/docs/main:linq.money.accounts.v1#linq.money.accounts.v1.AccountsService.GetMoney) method
62+
63+
```typescript
64+
const accountsService = new AccountsServiceClient(getTransport());
65+
66+
await accountsService.getMoney({
67+
idempotencyKey: 'ik-124',
68+
amount: 500,
69+
reason: 'Tournament entry fee',
70+
extra: { tournament_id: 't1' },
71+
}, getAuthorization(authToken));
72+
73+
```
74+
75+
76+
<!-- ### Withdrawal of funds
4477
4578
Withdrawal of funds from the account is carried out using a separate method, but in fact this operation generates an order, which is subsequently available in the transaction history.
4679
@@ -54,7 +87,7 @@ Similar to the process of withdrawing funds, funds are also credited to a specif
5487
5588
```
5689
// Some code
57-
```
90+
``` -->
5891

5992
## Payment Transactions
6093

@@ -156,7 +189,7 @@ To get updated with the lates usage examples, please check relevant documentatio
156189
### Brazil Pix payment
157190
To make the payment Pix code should be generated and displayed to the user.
158191

159-
To generate Pix code user's full name and email are required. They should be passed to us with help of [AuthUserService#SaveGameUser](https://buf.build/linq/linq/docs/main:linq.auth.user.v1#linq.auth.user.v1.AuthUserService.SaveGameUser) method. If the data won't be passed [NativePaymentsService#GetPixPaymentData](https://buf.build/linq/linq/docs/main:linq.money.payments.v1#linq.money.payments.v1.NativePaymentsService.GetPixPaymentData) request will be failed.
192+
For anonymous users to generate Pix code user's full name and email are required. They should be passed to us with help of [AuthUserService#SaveGameUser](https://buf.build/linq/linq/docs/main:linq.auth.user.v1#linq.auth.user.v1.AuthUserService.SaveGameUser) method if not passed previously.
160193

161194
To create Pix order call [PaymentsService#CreatePixOrder](https://buf.build/linq/linq/docs/main:linq.money.payments.v1#linq.money.payments.v1.PaymentsService.CreatePixOrder). It accepts optional [params](https://buf.build/linq/linq/docs/main:linq.money.payments.v1#linq.money.payments.v1.PixRequest) - tax_id and address. Tax id is Brazilian CPF number (ask if validation rules are required). Address - country is 2-letter code of Brazil (BR), region is 2-letter code of Brazilian state (ask if list of states with their full names are required).
162195

docusaurus.config.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ const config: Config = {
6666
label: 'Auth & Login',
6767
},
6868
{
69-
to: '/modules/location-checks',
69+
to: '/modules/money',
7070
position: 'left',
71-
label: 'Locations',
71+
label: 'Money',
7272
},
7373
{
74-
to: '/modules/money',
74+
to: '/modules/location-checks',
7575
position: 'left',
76-
label: 'Money',
76+
label: 'Locations',
7777
},
7878
// {
7979
// to: 'modules/authentication',
@@ -116,10 +116,10 @@ const config: Config = {
116116
label: 'Money Operations',
117117
to: '/modules/money',
118118
},
119-
{
120-
label: 'Play Mechanics',
121-
to: '/modules/play',
122-
},
119+
// {
120+
// label: 'Play Mechanics',
121+
// to: '/modules/play',
122+
// },
123123
{
124124
label: 'Location Checks',
125125
to: '/modules/location-checks',
@@ -139,7 +139,7 @@ const config: Config = {
139139
},
140140
{
141141
label: 'GitHub',
142-
href: 'https://github.com/linkgg/docs',
142+
href: 'https://github.com/linqgg/docs',
143143
},
144144
],
145145
},
@@ -152,7 +152,7 @@ const config: Config = {
152152
},
153153
{
154154
label: 'App Store',
155-
href: 'https://apps.apple.com/us/developer/galactica-games/id1680876974',
155+
href: 'https://apps.apple.com/us/app/linq-wallet/id6447305486',
156156
},
157157
],
158158
},

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,6 @@
4444
},
4545
"engines": {
4646
"node": ">=18.0"
47-
}
47+
},
48+
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
4849
}

0 commit comments

Comments
 (0)