Skip to content

Commit 919a7af

Browse files
authored
Merge branch 'sdk-47' into ft-jl-provider
2 parents 13f5887 + e3e45c6 commit 919a7af

39 files changed

+5883
-16
lines changed

ts/esbuild.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const baseConfig = (config) => ({
1111
'src/sdk/nodejs/createProviderSDK.ts',
1212
'src/sdk/nodejs/createChainNodeSDK.ts',
1313
'src/auth/certificates/index.ts',
14+
'src/sdl/index.ts',
1415
],
1516
bundle: true,
1617
sourcemap: true,

ts/eslint.config.mjs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ export default tsLint.config(
2323
{
2424
rules: {
2525
"@typescript-eslint/consistent-type-imports": [
26-
"error",
27-
{
28-
prefer: "type-imports",
29-
fixStyle: "separate-type-imports"
30-
}
31-
]
26+
"error",
27+
{
28+
prefer: "type-imports",
29+
fixStyle: "separate-type-imports"
30+
}
31+
],
32+
'@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '^_$' }],
3233
}
3334
},
3435
{
@@ -61,7 +62,7 @@ export default tsLint.config(
6162
],
6263
rules: {
6364
'import/no-unresolved': 'off',
64-
'import/extensions': ['error','ignorePackages']
65+
'import/extensions': ['error','ignorePackages'],
6566
}
6667
},
6768
);

ts/package-lock.json

Lines changed: 79 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ts/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
"import": "./dist/nodejs/esm/createProviderSDK.js",
2727
"require": "./dist/nodejs/cjs/createProviderSDK.js",
2828
"types": "./dist/types/sdk/nodejs/createProviderSDK.d.ts"
29+
},
30+
"./sdl": {
31+
"import": "./dist/nodejs/esm/sdl/index.js",
32+
"require": "./dist/nodejs/cjs/sdl/index.js",
33+
"types": "./dist/types/sdl/index.d.ts"
2934
}
3035
},
3136
"files": [
@@ -60,6 +65,8 @@
6065
"@cosmjs/math": "^0.33.1",
6166
"@cosmjs/proto-signing": "^0.33.1",
6267
"@cosmjs/stargate": "^0.33.1",
68+
"js-yaml": "^4.1.0",
69+
"json-stable-stringify": "^1.3.0",
6370
"jsrsasign": "^11.1.0"
6471
},
6572
"devDependencies": {
@@ -69,12 +76,16 @@
6976
"@faker-js/faker": "^9.7.0",
7077
"@jest/globals": "^29.7.0",
7178
"@stylistic/eslint-plugin": "^4.0.1",
79+
"@types/dot-object": "^2.1.6",
80+
"@types/js-yaml": "^4.0.5",
7281
"@types/jsrsasign": "^10.5.15",
82+
"dot-object": "^2.1.5",
7383
"esbuild": "^0.25.2",
7484
"eslint": "^9.24.0",
7585
"eslint-plugin-import": "^2.31.0",
7686
"eslint-plugin-simple-import-sort": "^12.1.1",
7787
"husky": "^9.1.7",
88+
"immutability-helper": "^3.1.1",
7889
"jest": "^29.7.0",
7990
"lint-staged": "^15.4.3",
8091
"sort-json": "^2.0.1",

ts/src/auth/certificates/CertificateManager.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, expect, it } from "@jest/globals";
33

44
import { CertificateManager, dateToStr, strToDate } from "./CertificateManager.ts";
55

6-
describe("CertificateManager", () => {
6+
describe(CertificateManager.name, () => {
77
const generateAddress = () => `akash1${faker.string.alpha({ length: 38 })}`;
88
const ONE_DAY = 1000 * 60 * 60 * 24;
99

@@ -66,7 +66,7 @@ describe("CertificateManager", () => {
6666
});
6767
});
6868

69-
describe("prototype.strToDate", () => {
69+
describe("strToDate", () => {
7070
it("should convert string to date", () => {
7171
const date = strToDate("240507122350Z");
7272

@@ -75,7 +75,7 @@ describe("CertificateManager", () => {
7575
});
7676
});
7777

78-
describe("prototype.dateToStr", () => {
78+
describe("dateToStr", () => {
7979
it("should convert date to string", () => {
8080
const date = new Date("2024-05-07T12:23:50.000Z");
8181
const str = dateToStr(date);

ts/src/network/config.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import type { NetworkId } from "./types.ts";
2+
3+
/**
4+
* The network ID for the mainnet environment.
5+
*/
6+
export const MAINNET_ID = "mainnet" satisfies NetworkId;
7+
8+
/**
9+
* The network ID for the sandbox environment.
10+
*/
11+
export const SANDBOX_ID = "sandbox" satisfies NetworkId;
12+
13+
/**
14+
* The network ID for the testnet environment.
15+
*/
16+
export const TESTNET_ID = "testnet" satisfies NetworkId;
17+
18+
/**
19+
* A mapping of network IDs to their respective USDC IBC denominations.
20+
*/
21+
export const USDC_IBC_DENOMS: Record<NetworkId, string> = {
22+
[MAINNET_ID]: "ibc/170C677610AC31DF0904FFE09CD3B5C657492170E7E52372E48756B71E56F2F1",
23+
[SANDBOX_ID]: "ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D84",
24+
[TESTNET_ID]: "",
25+
};
26+
27+
/**
28+
* The denomination for the AKT token.
29+
*/
30+
export const AKT_DENOM = "uakt";

ts/src/network/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export type NetworkId = "mainnet" | "sandbox" | "testnet";

0 commit comments

Comments
 (0)