@chainrails/sdk 0.0.17 → 0.0.19

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.
@@ -1,45 +1,50 @@
1
1
  import o from "ky";
2
2
  var p = /* @__PURE__ */ ((t) => (t.ARBITRUM = "ARBITRUM_MAINNET", t.ARBITRUM_TESTNET = "ARBITRUM_TESTNET", t.AVALANCHE = "AVALANCHE_MAINNET", t.AVALANCHE_TESTNET = "AVALANCHE_TESTNET", t.BASE = "BASE_MAINNET", t.BASE_TESTNET = "BASE_TESTNET", t.BSC = "BSC_MAINNET", t.ETHEREUM = "ETHEREUM_MAINNET", t.ETHEREUM_TESTNET = "ETHEREUM_TESTNET", t.STARKNET = "STARKNET_MAINNET", t))(p || {}), c = /* @__PURE__ */ ((t) => (t.USDC = "USDC", t))(c || {}), i = /* @__PURE__ */ ((t) => (t.PRODUCTION = "production", t.STAGING = "staging", t))(i || {});
3
- class a {
3
+ class s {
4
4
  constructor({ api_key: e, env: r }) {
5
5
  this.api_key = e, this.jwt = "", this.env = r ?? i.PRODUCTION;
6
6
  }
7
7
  static config(e) {
8
- if (!a.app) {
8
+ if (!s.app) {
9
9
  if (!e)
10
10
  throw new Error("Please provide an api_key");
11
- a.app = new a(e);
11
+ s.app = new s(e);
12
12
  }
13
- return e && (a.app.api_key = e.api_key, e.env !== void 0 && (a.app.env = e.env), this.updateJWT(), setInterval(this.updateJWT.bind(this), 1500 * 1e3)), a.app;
13
+ return e && (s.app.api_key = e.api_key, e.env !== void 0 && (s.app.env = e.env), this.updateJWT(), setInterval(this.updateJWT.bind(this), 1500 * 1e3)), s.app;
14
14
  }
15
15
  static async updateJWT() {
16
16
  try {
17
- const e = await (await fetch(this.getBaseUrl() + "/client/api-keys/session-token", {
17
+ const e = await fetch(this.getBaseUrl() + "/client/api-keys/session-token", {
18
+ headers: {
19
+ Authorization: `Bearer ${s.app.api_key}`
20
+ },
18
21
  body: JSON.stringify({
19
- apiKey: a.app.api_key
22
+ apiKey: s.app.api_key
20
23
  })
21
- })).json();
22
- this.app.jwt = e.token;
24
+ });
25
+ console.log(e, this.getBaseUrl() + "/client/api-keys/session-token");
26
+ const r = await e.json();
27
+ console.log(r), this.app.jwt = r.token;
23
28
  } catch {
24
29
  }
25
30
  }
26
31
  static getApiKey() {
27
- if (!a.app)
32
+ if (!s.app)
28
33
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
29
- return a.app.api_key;
34
+ return s.app.api_key;
30
35
  }
31
36
  static getSessionKey() {
32
- return a.app.jwt;
37
+ return s.app.jwt;
33
38
  }
34
39
  static getEnv() {
35
- if (!a.app)
40
+ if (!s.app)
36
41
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
37
- return a.app.env;
42
+ return s.app.env;
38
43
  }
39
44
  static getBaseUrl() {
40
- if (!a.app)
45
+ if (!s.app)
41
46
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
42
- switch (a.app.env) {
47
+ switch (s.app.env) {
43
48
  case "production":
44
49
  return "https://api.chainrails.io/api/v1";
45
50
  case "staging":
@@ -52,15 +57,15 @@ class a {
52
57
  let n = null;
53
58
  function u() {
54
59
  n = o.create({
55
- prefixUrl: a.getBaseUrl(),
60
+ prefixUrl: s.getBaseUrl(),
56
61
  headers: {
57
62
  "Content-Type": "application/json"
58
63
  },
59
64
  hooks: {
60
65
  beforeRequest: [
61
66
  (t) => {
62
- const e = a.getSessionKey();
63
- t.headers.set("Authorization", `Bearer ${e}`);
67
+ const e = s.getSessionKey();
68
+ console.log({ Chainrails: s }, s.getApiKey(), s.getSessionKey()), t.headers.set("Authorization", `Bearer ${e}`);
64
69
  }
65
70
  ],
66
71
  afterResponse: [(t, e, r) => r]
@@ -70,81 +75,81 @@ function u() {
70
75
  }
71
76
  });
72
77
  }
73
- function s() {
78
+ function a() {
74
79
  return n || u(), n;
75
80
  }
76
81
  class g {
77
82
  async getById(e) {
78
- return await s().get("intents/" + e).json();
83
+ return await a().get("intents/" + e).json();
79
84
  }
80
85
  async getForSender(e) {
81
- return await s().get("intents/user/" + e).json();
86
+ return await a().get("intents/user/" + e).json();
82
87
  }
83
88
  async getForAddress(e) {
84
- return await s().get("intents/address/" + e).json();
89
+ return await a().get("intents/address/" + e).json();
85
90
  }
86
91
  async getAll(e) {
87
- return await s().get("intents", { searchParams: e }).json();
92
+ return await a().get("intents", { searchParams: e }).json();
88
93
  }
89
94
  async create(e) {
90
- return await s().post("intents", { json: e }).json();
95
+ return await a().post("intents", { json: e }).json();
91
96
  }
92
97
  async update(e, r) {
93
- return await s().post("intents", { json: r }).json();
98
+ return await a().post("intents", { json: r }).json();
94
99
  }
95
100
  async triggerProcessing(e) {
96
- return await s().post(`intents/${e}/trigger-processing`).json();
101
+ return await a().post(`intents/${e}/trigger-processing`).json();
97
102
  }
98
103
  }
99
104
  class l {
100
105
  async getFromSpecificBridge(e) {
101
- return await s().get("quotes/single", { searchParams: e }).json();
106
+ return await a().get("quotes/single", { searchParams: e }).json();
102
107
  }
103
108
  async getFromAllBridges(e) {
104
- return await s().get("quotes/multiple", { searchParams: e }).json();
109
+ return await a().get("quotes/multiple", { searchParams: e }).json();
105
110
  }
106
111
  async getBestAcrossBridges(e) {
107
- return await s().get("quotes/best", { searchParams: e }).json();
112
+ return await a().get("quotes/best", { searchParams: e }).json();
108
113
  }
109
114
  async getAll(e) {
110
- return await s().get("quotes/multi-source", { searchParams: e }).json();
115
+ return await a().get("quotes/multi-source", { searchParams: e }).json();
111
116
  }
112
117
  }
113
- class T {
118
+ class E {
114
119
  async getOptimalRoutes(e) {
115
- return await s().get("router/optimal-route", { searchParams: e }).json();
120
+ return await a().get("router/optimal-route", { searchParams: e }).json();
116
121
  }
117
122
  async getAllSupportedBridges() {
118
- return await s().get("router/supported-bridges/all").json();
123
+ return await a().get("router/supported-bridges/all").json();
119
124
  }
120
125
  async getSupportedBridges(e) {
121
- return await s().get("router/supported-bridges/route", { searchParams: e }).json();
126
+ return await a().get("router/supported-bridges/route", { searchParams: e }).json();
122
127
  }
123
128
  async getSupportedRoutes(e, r) {
124
- return await s().get("router/supported-bridges/bridge/" + e, { searchParams: r }).json();
129
+ return await a().get("router/supported-bridges/bridge/" + e, { searchParams: r }).json();
125
130
  }
126
131
  }
127
- class h {
132
+ class T {
128
133
  async getSupported(e) {
129
- return await s().get("chains", { searchParams: e }).json();
134
+ return await a().get("chains", { searchParams: e }).json();
130
135
  }
131
136
  }
132
- class E {
137
+ class h {
133
138
  async getClientInfo() {
134
- return await s().get("client/auth/client-info").json();
139
+ return await a().get("client/auth/client-info").json();
135
140
  }
136
141
  }
137
- const y = {
138
- router: new T(),
142
+ const d = {
143
+ router: new E(),
139
144
  quotes: new l(),
140
145
  intents: new g(),
141
- chains: new h(),
142
- client: new E()
146
+ chains: new T(),
147
+ client: new h()
143
148
  };
144
149
  export {
145
- a as Chainrails,
150
+ s as Chainrails,
146
151
  p as chains,
147
- y as crapi,
152
+ d as crapi,
148
153
  i as environment,
149
154
  c as tokens
150
155
  };
@@ -1,45 +1,50 @@
1
1
  import o from "ky";
2
2
  var p = /* @__PURE__ */ ((t) => (t.ARBITRUM = "ARBITRUM_MAINNET", t.ARBITRUM_TESTNET = "ARBITRUM_TESTNET", t.AVALANCHE = "AVALANCHE_MAINNET", t.AVALANCHE_TESTNET = "AVALANCHE_TESTNET", t.BASE = "BASE_MAINNET", t.BASE_TESTNET = "BASE_TESTNET", t.BSC = "BSC_MAINNET", t.ETHEREUM = "ETHEREUM_MAINNET", t.ETHEREUM_TESTNET = "ETHEREUM_TESTNET", t.STARKNET = "STARKNET_MAINNET", t))(p || {}), c = /* @__PURE__ */ ((t) => (t.USDC = "USDC", t))(c || {}), i = /* @__PURE__ */ ((t) => (t.PRODUCTION = "production", t.STAGING = "staging", t))(i || {});
3
- class a {
3
+ class s {
4
4
  constructor({ api_key: e, env: r }) {
5
5
  this.api_key = e, this.jwt = "", this.env = r ?? i.PRODUCTION;
6
6
  }
7
7
  static config(e) {
8
- if (!a.app) {
8
+ if (!s.app) {
9
9
  if (!e)
10
10
  throw new Error("Please provide an api_key");
11
- a.app = new a(e);
11
+ s.app = new s(e);
12
12
  }
13
- return e && (a.app.api_key = e.api_key, e.env !== void 0 && (a.app.env = e.env), this.updateJWT(), setInterval(this.updateJWT.bind(this), 1500 * 1e3)), a.app;
13
+ return e && (s.app.api_key = e.api_key, e.env !== void 0 && (s.app.env = e.env), this.updateJWT(), setInterval(this.updateJWT.bind(this), 1500 * 1e3)), s.app;
14
14
  }
15
15
  static async updateJWT() {
16
16
  try {
17
- const e = await (await fetch(this.getBaseUrl() + "/client/api-keys/session-token", {
17
+ const e = await fetch(this.getBaseUrl() + "/client/api-keys/session-token", {
18
+ headers: {
19
+ Authorization: `Bearer ${s.app.api_key}`
20
+ },
18
21
  body: JSON.stringify({
19
- apiKey: a.app.api_key
22
+ apiKey: s.app.api_key
20
23
  })
21
- })).json();
22
- this.app.jwt = e.token;
24
+ });
25
+ console.log(e, this.getBaseUrl() + "/client/api-keys/session-token");
26
+ const r = await e.json();
27
+ console.log(r), this.app.jwt = r.token;
23
28
  } catch {
24
29
  }
25
30
  }
26
31
  static getApiKey() {
27
- if (!a.app)
32
+ if (!s.app)
28
33
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
29
- return a.app.api_key;
34
+ return s.app.api_key;
30
35
  }
31
36
  static getSessionKey() {
32
- return a.app.jwt;
37
+ return s.app.jwt;
33
38
  }
34
39
  static getEnv() {
35
- if (!a.app)
40
+ if (!s.app)
36
41
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
37
- return a.app.env;
42
+ return s.app.env;
38
43
  }
39
44
  static getBaseUrl() {
40
- if (!a.app)
45
+ if (!s.app)
41
46
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
42
- switch (a.app.env) {
47
+ switch (s.app.env) {
43
48
  case "production":
44
49
  return "https://api.chainrails.io/api/v1";
45
50
  case "staging":
@@ -52,15 +57,15 @@ class a {
52
57
  let n = null;
53
58
  function u() {
54
59
  n = o.create({
55
- prefixUrl: a.getBaseUrl(),
60
+ prefixUrl: s.getBaseUrl(),
56
61
  headers: {
57
62
  "Content-Type": "application/json"
58
63
  },
59
64
  hooks: {
60
65
  beforeRequest: [
61
66
  (t) => {
62
- const e = a.getSessionKey();
63
- t.headers.set("Authorization", `Bearer ${e}`);
67
+ const e = s.getSessionKey();
68
+ console.log({ Chainrails: s }, s.getApiKey(), s.getSessionKey()), t.headers.set("Authorization", `Bearer ${e}`);
64
69
  }
65
70
  ],
66
71
  afterResponse: [(t, e, r) => r]
@@ -70,81 +75,81 @@ function u() {
70
75
  }
71
76
  });
72
77
  }
73
- function s() {
78
+ function a() {
74
79
  return n || u(), n;
75
80
  }
76
81
  class g {
77
82
  async getById(e) {
78
- return await s().get("intents/" + e).json();
83
+ return await a().get("intents/" + e).json();
79
84
  }
80
85
  async getForSender(e) {
81
- return await s().get("intents/user/" + e).json();
86
+ return await a().get("intents/user/" + e).json();
82
87
  }
83
88
  async getForAddress(e) {
84
- return await s().get("intents/address/" + e).json();
89
+ return await a().get("intents/address/" + e).json();
85
90
  }
86
91
  async getAll(e) {
87
- return await s().get("intents", { searchParams: e }).json();
92
+ return await a().get("intents", { searchParams: e }).json();
88
93
  }
89
94
  async create(e) {
90
- return await s().post("intents", { json: e }).json();
95
+ return await a().post("intents", { json: e }).json();
91
96
  }
92
97
  async update(e, r) {
93
- return await s().post("intents", { json: r }).json();
98
+ return await a().post("intents", { json: r }).json();
94
99
  }
95
100
  async triggerProcessing(e) {
96
- return await s().post(`intents/${e}/trigger-processing`).json();
101
+ return await a().post(`intents/${e}/trigger-processing`).json();
97
102
  }
98
103
  }
99
104
  class l {
100
105
  async getFromSpecificBridge(e) {
101
- return await s().get("quotes/single", { searchParams: e }).json();
106
+ return await a().get("quotes/single", { searchParams: e }).json();
102
107
  }
103
108
  async getFromAllBridges(e) {
104
- return await s().get("quotes/multiple", { searchParams: e }).json();
109
+ return await a().get("quotes/multiple", { searchParams: e }).json();
105
110
  }
106
111
  async getBestAcrossBridges(e) {
107
- return await s().get("quotes/best", { searchParams: e }).json();
112
+ return await a().get("quotes/best", { searchParams: e }).json();
108
113
  }
109
114
  async getAll(e) {
110
- return await s().get("quotes/multi-source", { searchParams: e }).json();
115
+ return await a().get("quotes/multi-source", { searchParams: e }).json();
111
116
  }
112
117
  }
113
- class T {
118
+ class E {
114
119
  async getOptimalRoutes(e) {
115
- return await s().get("router/optimal-route", { searchParams: e }).json();
120
+ return await a().get("router/optimal-route", { searchParams: e }).json();
116
121
  }
117
122
  async getAllSupportedBridges() {
118
- return await s().get("router/supported-bridges/all").json();
123
+ return await a().get("router/supported-bridges/all").json();
119
124
  }
120
125
  async getSupportedBridges(e) {
121
- return await s().get("router/supported-bridges/route", { searchParams: e }).json();
126
+ return await a().get("router/supported-bridges/route", { searchParams: e }).json();
122
127
  }
123
128
  async getSupportedRoutes(e, r) {
124
- return await s().get("router/supported-bridges/bridge/" + e, { searchParams: r }).json();
129
+ return await a().get("router/supported-bridges/bridge/" + e, { searchParams: r }).json();
125
130
  }
126
131
  }
127
- class h {
132
+ class T {
128
133
  async getSupported(e) {
129
- return await s().get("chains", { searchParams: e }).json();
134
+ return await a().get("chains", { searchParams: e }).json();
130
135
  }
131
136
  }
132
- class E {
137
+ class h {
133
138
  async getClientInfo() {
134
- return await s().get("client/auth/client-info").json();
139
+ return await a().get("client/auth/client-info").json();
135
140
  }
136
141
  }
137
- const y = {
138
- router: new T(),
142
+ const d = {
143
+ router: new E(),
139
144
  quotes: new l(),
140
145
  intents: new g(),
141
- chains: new h(),
142
- client: new E()
146
+ chains: new T(),
147
+ client: new h()
143
148
  };
144
149
  export {
145
- a as Chainrails,
150
+ s as Chainrails,
146
151
  p as chains,
147
- y as crapi,
152
+ d as crapi,
148
153
  i as environment,
149
154
  c as tokens
150
155
  };
@@ -1 +1 @@
1
- (function(n,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("ky")):typeof define=="function"&&define.amd?define(["exports","ky"],i):(n=typeof globalThis<"u"?globalThis:n||self,i(n.Chainrails={},n.Ky))})(this,(function(n,i){"use strict";var p=(t=>(t.ARBITRUM="ARBITRUM_MAINNET",t.ARBITRUM_TESTNET="ARBITRUM_TESTNET",t.AVALANCHE="AVALANCHE_MAINNET",t.AVALANCHE_TESTNET="AVALANCHE_TESTNET",t.BASE="BASE_MAINNET",t.BASE_TESTNET="BASE_TESTNET",t.BSC="BSC_MAINNET",t.ETHEREUM="ETHEREUM_MAINNET",t.ETHEREUM_TESTNET="ETHEREUM_TESTNET",t.STARKNET="STARKNET_MAINNET",t))(p||{}),u=(t=>(t.USDC="USDC",t))(u||{}),o=(t=>(t.PRODUCTION="production",t.STAGING="staging",t))(o||{});class s{constructor({api_key:e,env:r}){this.api_key=e,this.jwt="",this.env=r??o.PRODUCTION}static config(e){if(!s.app){if(!e)throw new Error("Please provide an api_key");s.app=new s(e)}return e&&(s.app.api_key=e.api_key,e.env!==void 0&&(s.app.env=e.env),this.updateJWT(),setInterval(this.updateJWT.bind(this),1500*1e3)),s.app}static async updateJWT(){try{const e=await(await fetch(this.getBaseUrl()+"/client/api-keys/session-token",{body:JSON.stringify({apiKey:s.app.api_key})})).json();this.app.jwt=e.token}catch{}}static getApiKey(){if(!s.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return s.app.api_key}static getSessionKey(){return s.app.jwt}static getEnv(){if(!s.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return s.app.env}static getBaseUrl(){if(!s.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");switch(s.app.env){case"production":return"https://api.chainrails.io/api/v1";case"staging":return"https://dev.chainrails.io/api/v1";default:return"https://api.chainrails.io/api/v1"}}}let c=null;function g(){c=i.create({prefixUrl:s.getBaseUrl(),headers:{"Content-Type":"application/json"},hooks:{beforeRequest:[t=>{const e=s.getSessionKey();t.headers.set("Authorization",`Bearer ${e}`)}],afterResponse:[(t,e,r)=>r]},retry:{limit:2}})}function a(){return c||g(),c}class l{async getById(e){return await a().get("intents/"+e).json()}async getForSender(e){return await a().get("intents/user/"+e).json()}async getForAddress(e){return await a().get("intents/address/"+e).json()}async getAll(e){return await a().get("intents",{searchParams:e}).json()}async create(e){return await a().post("intents",{json:e}).json()}async update(e,r){return await a().post("intents",{json:r}).json()}async triggerProcessing(e){return await a().post(`intents/${e}/trigger-processing`).json()}}class T{async getFromSpecificBridge(e){return await a().get("quotes/single",{searchParams:e}).json()}async getFromAllBridges(e){return await a().get("quotes/multiple",{searchParams:e}).json()}async getBestAcrossBridges(e){return await a().get("quotes/best",{searchParams:e}).json()}async getAll(e){return await a().get("quotes/multi-source",{searchParams:e}).json()}}class d{async getOptimalRoutes(e){return await a().get("router/optimal-route",{searchParams:e}).json()}async getAllSupportedBridges(){return await a().get("router/supported-bridges/all").json()}async getSupportedBridges(e){return await a().get("router/supported-bridges/route",{searchParams:e}).json()}async getSupportedRoutes(e,r){return await a().get("router/supported-bridges/bridge/"+e,{searchParams:r}).json()}}class h{async getSupported(e){return await a().get("chains",{searchParams:e}).json()}}class y{async getClientInfo(){return await a().get("client/auth/client-info").json()}}const E={router:new d,quotes:new T,intents:new l,chains:new h,client:new y};n.Chainrails=s,n.chains=p,n.crapi=E,n.environment=o,n.tokens=u,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(a,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("ky")):typeof define=="function"&&define.amd?define(["exports","ky"],r):(a=typeof globalThis<"u"?globalThis:a||self,r(a.Chainrails={},a.Ky))})(this,(function(a,r){"use strict";var p=(t=>(t.ARBITRUM="ARBITRUM_MAINNET",t.ARBITRUM_TESTNET="ARBITRUM_TESTNET",t.AVALANCHE="AVALANCHE_MAINNET",t.AVALANCHE_TESTNET="AVALANCHE_TESTNET",t.BASE="BASE_MAINNET",t.BASE_TESTNET="BASE_TESTNET",t.BSC="BSC_MAINNET",t.ETHEREUM="ETHEREUM_MAINNET",t.ETHEREUM_TESTNET="ETHEREUM_TESTNET",t.STARKNET="STARKNET_MAINNET",t))(p||{}),u=(t=>(t.USDC="USDC",t))(u||{}),o=(t=>(t.PRODUCTION="production",t.STAGING="staging",t))(o||{});class s{constructor({api_key:e,env:i}){this.api_key=e,this.jwt="",this.env=i??o.PRODUCTION}static config(e){if(!s.app){if(!e)throw new Error("Please provide an api_key");s.app=new s(e)}return e&&(s.app.api_key=e.api_key,e.env!==void 0&&(s.app.env=e.env),this.updateJWT(),setInterval(this.updateJWT.bind(this),1500*1e3)),s.app}static async updateJWT(){try{const e=await fetch(this.getBaseUrl()+"/client/api-keys/session-token",{headers:{Authorization:`Bearer ${s.app.api_key}`},body:JSON.stringify({apiKey:s.app.api_key})});console.log(e,this.getBaseUrl()+"/client/api-keys/session-token");const i=await e.json();console.log(i),this.app.jwt=i.token}catch{}}static getApiKey(){if(!s.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return s.app.api_key}static getSessionKey(){return s.app.jwt}static getEnv(){if(!s.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return s.app.env}static getBaseUrl(){if(!s.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");switch(s.app.env){case"production":return"https://api.chainrails.io/api/v1";case"staging":return"https://dev.chainrails.io/api/v1";default:return"https://api.chainrails.io/api/v1"}}}let c=null;function l(){c=r.create({prefixUrl:s.getBaseUrl(),headers:{"Content-Type":"application/json"},hooks:{beforeRequest:[t=>{const e=s.getSessionKey();console.log({Chainrails:s},s.getApiKey(),s.getSessionKey()),t.headers.set("Authorization",`Bearer ${e}`)}],afterResponse:[(t,e,i)=>i]},retry:{limit:2}})}function n(){return c||l(),c}class g{async getById(e){return await n().get("intents/"+e).json()}async getForSender(e){return await n().get("intents/user/"+e).json()}async getForAddress(e){return await n().get("intents/address/"+e).json()}async getAll(e){return await n().get("intents",{searchParams:e}).json()}async create(e){return await n().post("intents",{json:e}).json()}async update(e,i){return await n().post("intents",{json:i}).json()}async triggerProcessing(e){return await n().post(`intents/${e}/trigger-processing`).json()}}class h{async getFromSpecificBridge(e){return await n().get("quotes/single",{searchParams:e}).json()}async getFromAllBridges(e){return await n().get("quotes/multiple",{searchParams:e}).json()}async getBestAcrossBridges(e){return await n().get("quotes/best",{searchParams:e}).json()}async getAll(e){return await n().get("quotes/multi-source",{searchParams:e}).json()}}class T{async getOptimalRoutes(e){return await n().get("router/optimal-route",{searchParams:e}).json()}async getAllSupportedBridges(){return await n().get("router/supported-bridges/all").json()}async getSupportedBridges(e){return await n().get("router/supported-bridges/route",{searchParams:e}).json()}async getSupportedRoutes(e,i){return await n().get("router/supported-bridges/bridge/"+e,{searchParams:i}).json()}}class d{async getSupported(e){return await n().get("chains",{searchParams:e}).json()}}class E{async getClientInfo(){return await n().get("client/auth/client-info").json()}}const y={router:new T,quotes:new h,intents:new g,chains:new d,client:new E};a.Chainrails=s,a.chains=p,a.crapi=y,a.environment=o,a.tokens=u,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}));
@@ -1 +1 @@
1
- {"version":3,"file":"req.d.ts","sourceRoot":"","sources":["../../src/req.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAGpB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,cAAc,EAAE,OAAO,CAAC;KACzB;CACF;AAED,QAAA,IAAI,GAAG,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,IAAW,CAAC;AAEpD,wBAAgB,UAAU,SAmBzB;AAED,wBAAgB,SAAS,4BAKxB;AAED,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"req.d.ts","sourceRoot":"","sources":["../../src/req.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAGpB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,cAAc,EAAE,OAAO,CAAC;KACzB;CACF;AAED,QAAA,IAAI,GAAG,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,IAAW,CAAC;AAEpD,wBAAgB,UAAU,SAoBzB;AAED,wBAAgB,SAAS,4BAKxB;AAED,eAAe,GAAG,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chainrails/sdk",
3
3
  "sideEffects": false,
4
- "version": "0.0.17",
4
+ "version": "0.0.19",
5
5
  "main": "./dist/chainrails-sdk.umd.js",
6
6
  "module": "./dist/chainrails-sdk.es.mjs",
7
7
  "license": "MIT",
@@ -35,7 +35,7 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@chainrails/common": "^0.0.10",
38
+ "@chainrails/common": "^0.0.11",
39
39
  "ky": "^1.14.0"
40
40
  },
41
41
  "devDependencies": {