@bloque/sdk 0.0.24 → 0.0.25
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.
- package/README.md +32 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ This SDK is compatible with multiple JavaScript runtimes:
|
|
|
32
32
|
- **TypeScript First**: Built with TypeScript for complete type safety
|
|
33
33
|
- **Modular Architecture**: Import only what you need - accounts, identity, compliance, or organizations
|
|
34
34
|
- **Multi-Runtime**: Works seamlessly across Node.js, Bun, Deno, browsers, and React Native
|
|
35
|
-
- **Account Management**: Create and manage virtual cards, virtual accounts, and Bancolombia accounts
|
|
35
|
+
- **Account Management**: Create and manage virtual cards, virtual accounts, Polygon wallets, and Bancolombia accounts
|
|
36
36
|
- **Identity System**: Register individual users (KYC) and businesses (KYB) with multi-method authentication
|
|
37
37
|
- **Compliance Ready**: Built-in KYC/KYB verification workflows
|
|
38
38
|
- **Transfer System**: Transfer funds between accounts with multiple asset support
|
|
@@ -261,6 +261,34 @@ await session.accounts.virtual.freeze(account.urn);
|
|
|
261
261
|
await session.accounts.virtual.disable(account.urn);
|
|
262
262
|
```
|
|
263
263
|
|
|
264
|
+
### Polygon Wallets
|
|
265
|
+
|
|
266
|
+
Cryptocurrency wallets on the Polygon network for Web3 transactions:
|
|
267
|
+
|
|
268
|
+
```typescript
|
|
269
|
+
// Create a Polygon wallet (no additional input required)
|
|
270
|
+
const wallet = await session.accounts.polygon.create({
|
|
271
|
+
metadata: {
|
|
272
|
+
purpose: 'web3-transactions',
|
|
273
|
+
project: 'my-dapp',
|
|
274
|
+
},
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
console.log('Wallet address:', wallet.address);
|
|
278
|
+
console.log('Network:', wallet.network); // "polygon"
|
|
279
|
+
|
|
280
|
+
// Update metadata
|
|
281
|
+
await session.accounts.polygon.updateMetadata({
|
|
282
|
+
urn: wallet.urn,
|
|
283
|
+
metadata: { environment: 'production' },
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
// Manage account state
|
|
287
|
+
await session.accounts.polygon.activate(wallet.urn);
|
|
288
|
+
await session.accounts.polygon.freeze(wallet.urn);
|
|
289
|
+
await session.accounts.polygon.disable(wallet.urn);
|
|
290
|
+
```
|
|
291
|
+
|
|
264
292
|
### Bancolombia Accounts
|
|
265
293
|
|
|
266
294
|
Colombian virtual accounts with unique reference code system:
|
|
@@ -567,6 +595,8 @@ import type {
|
|
|
567
595
|
CreateCardParams,
|
|
568
596
|
VirtualAccount,
|
|
569
597
|
CreateVirtualAccountParams,
|
|
598
|
+
PolygonAccount,
|
|
599
|
+
CreatePolygonAccountParams,
|
|
570
600
|
TransferParams,
|
|
571
601
|
TransferResult,
|
|
572
602
|
} from '@bloque/sdk';
|
|
@@ -609,6 +639,7 @@ import type {
|
|
|
609
639
|
BloqueSDKConfig,
|
|
610
640
|
CardAccount,
|
|
611
641
|
VirtualAccount,
|
|
642
|
+
PolygonAccount,
|
|
612
643
|
BancolombiaAccount,
|
|
613
644
|
} from '@bloque/sdk';
|
|
614
645
|
```
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,t)=>{for(var i in t)__webpack_require__.o(t,i)&&!__webpack_require__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{SDK:()=>SDK});const sdk_accounts_namespaceObject=require("@bloque/sdk-accounts"),sdk_compliance_namespaceObject=require("@bloque/sdk-compliance"),sdk_core_namespaceObject=require("@bloque/sdk-core"),sdk_identity_namespaceObject=require("@bloque/sdk-identity"),sdk_orgs_namespaceObject=require("@bloque/sdk-orgs");class SDK{httpClient;identity;constructor(e){this.httpClient=new sdk_core_namespaceObject.HttpClient(e),this.identity=new sdk_identity_namespaceObject.IdentityClient(this.httpClient)}buildClients(){return{accounts:new sdk_accounts_namespaceObject.AccountsClient(this.httpClient),compliance:new sdk_compliance_namespaceObject.ComplianceClient(this.httpClient),identity:this.identity,orgs:new sdk_orgs_namespaceObject.OrgsClient(this.httpClient)}}getApiKey(){let{auth:e}=this.httpClient;return"apiKey"===e.type?e.apiKey:""}buildUrn(e){let t=this.httpClient.origin;if(!t)throw Error("Origin is required to build a urn");return`did:bloque:${t}:${e}`}async register(e,t){t.extraContext||(t.extraContext={});let i=this.buildUrn(e),r=this.httpClient.origin,_=await this.identity.origins.register(i,r,{assertionResult:{alias:
|
|
1
|
+
"use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,t)=>{for(var i in t)__webpack_require__.o(t,i)&&!__webpack_require__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{SDK:()=>SDK});const sdk_accounts_namespaceObject=require("@bloque/sdk-accounts"),sdk_compliance_namespaceObject=require("@bloque/sdk-compliance"),sdk_core_namespaceObject=require("@bloque/sdk-core"),sdk_identity_namespaceObject=require("@bloque/sdk-identity"),sdk_orgs_namespaceObject=require("@bloque/sdk-orgs");class SDK{httpClient;identity;constructor(e){this.httpClient=new sdk_core_namespaceObject.HttpClient(e),this.identity=new sdk_identity_namespaceObject.IdentityClient(this.httpClient)}buildClients(){return{accounts:new sdk_accounts_namespaceObject.AccountsClient(this.httpClient),compliance:new sdk_compliance_namespaceObject.ComplianceClient(this.httpClient),identity:this.identity,orgs:new sdk_orgs_namespaceObject.OrgsClient(this.httpClient)}}getApiKey(){let{auth:e}=this.httpClient;return"apiKey"===e.type?e.apiKey:""}buildUrn(e){let t=this.httpClient.origin;if(!t)throw Error("Origin is required to build a urn");return`did:bloque:${t}:${e}`}async register(e,t){t.extraContext||(t.extraContext={});let i=this.buildUrn(e),r=this.httpClient.origin,_=await this.identity.origins.register(i,r,{assertionResult:{alias:e,challengeType:"API_KEY",value:{apiKey:this.getApiKey(),alias:e}},...t});return this.httpClient.setAccessToken(_.accessToken),this.httpClient.setUrn(i),this.buildClients()}async connect(e){let t=this.buildUrn(e),i=this.httpClient.origin,r=await this.httpClient.request({path:`/api/origins/${i}/connect`,method:"POST",body:{assertion_result:{challengeType:"API_KEY",value:{api_key:this.getApiKey(),alias:e}},extra_context:{}}});return this.httpClient.setAccessToken(r.result.access_token),this.httpClient.setUrn(t),this.buildClients()}}for(var __rspack_i in exports.SDK=__webpack_exports__.SDK,__webpack_exports__)-1===["SDK"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AccountsClient as t}from"@bloque/sdk-accounts";import{ComplianceClient as e}from"@bloque/sdk-compliance";import{HttpClient as i}from"@bloque/sdk-core";import{IdentityClient as n}from"@bloque/sdk-identity";import{OrgsClient as s}from"@bloque/sdk-orgs";class r{httpClient;identity;constructor(t){this.httpClient=new i(t),this.identity=new n(this.httpClient)}buildClients(){return{accounts:new t(this.httpClient),compliance:new e(this.httpClient),identity:this.identity,orgs:new s(this.httpClient)}}getApiKey(){let{auth:t}=this.httpClient;return"apiKey"===t.type?t.apiKey:""}buildUrn(t){let e=this.httpClient.origin;if(!e)throw Error("Origin is required to build a urn");return`did:bloque:${e}:${t}`}async register(t,e){e.extraContext||(e.extraContext={});let i=this.buildUrn(t),n=this.httpClient.origin,s=await this.identity.origins.register(i,n,{assertionResult:{alias:
|
|
1
|
+
import{AccountsClient as t}from"@bloque/sdk-accounts";import{ComplianceClient as e}from"@bloque/sdk-compliance";import{HttpClient as i}from"@bloque/sdk-core";import{IdentityClient as n}from"@bloque/sdk-identity";import{OrgsClient as s}from"@bloque/sdk-orgs";class r{httpClient;identity;constructor(t){this.httpClient=new i(t),this.identity=new n(this.httpClient)}buildClients(){return{accounts:new t(this.httpClient),compliance:new e(this.httpClient),identity:this.identity,orgs:new s(this.httpClient)}}getApiKey(){let{auth:t}=this.httpClient;return"apiKey"===t.type?t.apiKey:""}buildUrn(t){let e=this.httpClient.origin;if(!e)throw Error("Origin is required to build a urn");return`did:bloque:${e}:${t}`}async register(t,e){e.extraContext||(e.extraContext={});let i=this.buildUrn(t),n=this.httpClient.origin,s=await this.identity.origins.register(i,n,{assertionResult:{alias:t,challengeType:"API_KEY",value:{apiKey:this.getApiKey(),alias:t}},...e});return this.httpClient.setAccessToken(s.accessToken),this.httpClient.setUrn(i),this.buildClients()}async connect(t){let e=this.buildUrn(t),i=this.httpClient.origin,n=await this.httpClient.request({path:`/api/origins/${i}/connect`,method:"POST",body:{assertion_result:{challengeType:"API_KEY",value:{api_key:this.getApiKey(),alias:t}},extra_context:{}}});return this.httpClient.setAccessToken(n.result.access_token),this.httpClient.setUrn(e),this.buildClients()}}export{r as SDK};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloque/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"description": "Official Bloque SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
"node": ">=22"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@bloque/sdk-accounts": "0.0.
|
|
67
|
-
"@bloque/sdk-compliance": "0.0.
|
|
68
|
-
"@bloque/sdk-core": "0.0.
|
|
69
|
-
"@bloque/sdk-identity": "0.0.
|
|
70
|
-
"@bloque/sdk-orgs": "0.0.
|
|
66
|
+
"@bloque/sdk-accounts": "0.0.25",
|
|
67
|
+
"@bloque/sdk-compliance": "0.0.25",
|
|
68
|
+
"@bloque/sdk-core": "0.0.25",
|
|
69
|
+
"@bloque/sdk-identity": "0.0.25",
|
|
70
|
+
"@bloque/sdk-orgs": "0.0.25"
|
|
71
71
|
}
|
|
72
72
|
}
|