@xoxno/sdk-js 1.0.42 → 1.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +12 -14
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -23,11 +23,9 @@ export const getSdk = cache(() => {
23
23
  import { getSdk } from './get-sdk'
24
24
 
25
25
  async function main() {
26
- const sdk = getSdk()
27
-
28
26
  /* Calling public endpoints ✅ */
29
27
 
30
- const trendingCollections = await sdk.collection.query({
28
+ const trendingCollections = await getSdk().collection.query({
31
29
  filter: {
32
30
  top: 10,
33
31
  orderBy: ['statistics.tradeData.weekEgldVolume desc'],
@@ -39,8 +37,8 @@ async function main() {
39
37
 
40
38
  console.log(trendingCollections.resources) // CollectionProfileDoc[]
41
39
 
42
- const collectionProfile = await sdk.collection
43
- .collection('BOOGAS-afc98d')
40
+ const collectionProfile = await getSdk()
41
+ .collection.collection('BOOGAS-afc98d')
44
42
  .profile()
45
43
 
46
44
  console.log(collectionProfile.description) // string
@@ -106,8 +104,6 @@ import { getSdk } from './get-sdk'
106
104
  import { NativeAuthClient } from './native-auth'
107
105
 
108
106
  async function main() {
109
- const sdk = getSdk()
110
-
111
107
  const provider = ExtensionProvider.getInstance()
112
108
 
113
109
  await provider.init()
@@ -128,7 +124,7 @@ async function main() {
128
124
  signature,
129
125
  })
130
126
 
131
- const { access_token, expires } = await sdk.user.login.POST({
127
+ const { access_token, expires } = await getSdk().user.login.POST({
132
128
  body: {
133
129
  loginToken,
134
130
  signature,
@@ -145,12 +141,14 @@ async function main() {
145
141
 
146
142
  // from now on you can call protected endpoints on behalf of `address`
147
143
 
148
- const newUserProfile = await sdk.user.address(address).profile.PATCH({
149
- body: {
150
- description: 'XOXNO SDK rocks!',
151
- },
152
- auth: access_token,
153
- })
144
+ const newUserProfile = await getSdk()
145
+ .user.address(address)
146
+ .profile.PATCH({
147
+ body: {
148
+ description: 'XOXNO SDK rocks!',
149
+ },
150
+ auth: access_token,
151
+ })
154
152
 
155
153
  console.log(newUserProfile.description) // XOXNO SDK rocks!
156
154
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xoxno/sdk-js",
3
- "version": "1.0.42",
3
+ "version": "1.0.43",
4
4
  "description": "The SDK to interact with the XOXNO Protocol!",
5
5
  "type": "module",
6
6
  "exports": {