Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integration.anchorPlatformTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
- run: yarn install
- run: yarn test:anchorplatform:ci
2 changes: 1 addition & 1 deletion .github/workflows/integration.recoveryTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
@stellar/typescript-wallet-sdk/test/docker/docker-compose.yml up -d
- uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
- run: yarn install
- run: yarn build
- run: yarn test:recovery:ci
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npmPublishSdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
registry-url: https://registry.npmjs.org/
- run: yarn install
- run: yarn build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npmPublishSdkBeta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
registry-url: https://registry.npmjs.org/
- run: yarn install
- run: yarn build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npmPublishSdkKM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
registry-url: https://registry.npmjs.org/
- run: yarn install
- run: yarn build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npmPublishSdkKMBeta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
registry-url: https://registry.npmjs.org/
- run: yarn install
- run: yarn build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npmPublishSdkSoroban.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
registry-url: https://registry.npmjs.org/
- run: yarn install
- run: yarn build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npmPublishSdkSorobanBeta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
registry-url: https://registry.npmjs.org/
- run: yarn install
- run: yarn build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/playwrightTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
- run: yarn install
- run: yarn build
- run: yarn test:e2e:ci
2 changes: 1 addition & 1 deletion .github/workflows/runTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
- run: yarn install
- run: yarn build
- run: yarn test:ci
4 changes: 2 additions & 2 deletions @stellar/typescript-wallet-sdk-km/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@stellar/typescript-wallet-sdk-km",
"version": "1.10.0",
"engines": {
"node": ">=18"
"node": ">=20"
},
"browser": "./lib/bundle_browser.js",
"main": "./lib/bundle.js",
Expand Down Expand Up @@ -38,7 +38,7 @@
"@stablelib/base64": "^2.0.0",
"@stablelib/utf8": "^2.0.0",
"@stellar/freighter-api": "^2.0.0",
"@stellar/stellar-sdk": "13.0.0-beta.1",
"@stellar/stellar-sdk": "14.5.0",
"@trezor/connect-plugin-stellar": "^9.0.2",
"bignumber.js": "^9.1.2",
"scrypt-async": "^2.0.1",
Expand Down
11 changes: 4 additions & 7 deletions @stellar/typescript-wallet-sdk-km/test/keyManager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -918,8 +918,7 @@ describe("fetchAuthToken", () => {
expect("This test failed: transaction didn't cause error").toBe(null);
} catch (e) {
expect(e.toString()).toMatch(
`InvalidChallengeError: The transaction` +
` sequence number should be zero`,
`The transaction sequence number should be zero`,
);
}
});
Expand Down Expand Up @@ -1116,7 +1115,7 @@ describe("fetchAuthToken", () => {
expect("This test failed: transaction didn't cause error").toBe(null);
} catch (e) {
expect(e.toString()).toMatch(
`InvalidChallengeError: Transaction not signed by server`,
`Transaction not signed by server`,
);
}
});
Expand Down Expand Up @@ -1311,8 +1310,7 @@ describe("fetchAuthToken", () => {
expect("This test failed: transaction didn't cause error").toBe(null);
} catch (e) {
expect(e.toString()).toMatch(
`InvalidChallengeError: 'web_auth_domain' operation ` +
`value does not match www.stellar.org`,
`'web_auth_domain' operation value does not match www.stellar.org`,
);
}
});
Expand Down Expand Up @@ -1413,8 +1411,7 @@ describe("fetchAuthToken", () => {
expect("This test failed: transaction didn't cause error").toBe(null);
} catch (e) {
expect(e.toString()).toMatch(
`InvalidChallengeError: The transaction source account` +
` is not equal to the server's account`,
`The transaction source account is not equal to the server's account`,
);
}
});
Expand Down
4 changes: 2 additions & 2 deletions @stellar/typescript-wallet-sdk-soroban/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@stellar/typescript-wallet-sdk-soroban",
"version": "1.10.0",
"engines": {
"node": ">=18"
"node": ">=20"
},
"browser": "./lib/bundle_browser.js",
"main": "./lib/bundle.js",
Expand All @@ -28,7 +28,7 @@
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@stellar/stellar-sdk": "13.0.0-beta.1"
"@stellar/stellar-sdk": "14.5.0"
},
"scripts": {
"prepare": "husky install",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Address, Asset, StrKey, xdr } from "@stellar/stellar-sdk";
import { Address, Asset, xdr } from "@stellar/stellar-sdk";

import { InvocationArgs } from "Types";

Expand Down Expand Up @@ -33,9 +33,9 @@ export const getInvocationArgs = (
// sorobanAuthorizedFunctionTypeContractFn
case 0: {
const _invocation = fn.contractFn();
const contractId = StrKey.encodeContract(
_invocation.contractAddress().contractId(),
);
const contractId = Address.fromScAddress(
_invocation.contractAddress(),
).toString();
const fnName = _invocation.functionName().toString();
const args = _invocation.args();
return { fnName, contractId, args, type: "invoke" };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Operation, StrKey, scValToNative, xdr } from "@stellar/stellar-sdk";
import { Address, Operation, StrKey, scValToNative, xdr } from "@stellar/stellar-sdk";

import {
ArgsForTokenInvocation,
Expand Down Expand Up @@ -62,9 +62,9 @@ export const getTokenInvocationArgs = (
return null;
}

const contractId = StrKey.encodeContract(
invokedContract.contractAddress().contractId(),
);
const contractId = Address.fromScAddress(
invokedContract.contractAddress(),
).toString();
const fnName = invokedContract
.functionName()
.toString() as SorobanTokenInterface;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StrKey, scValToNative, xdr } from "@stellar/stellar-sdk";
import { Address, StrKey, scValToNative, xdr } from "@stellar/stellar-sdk";

/* eslint-disable jsdoc/require-returns-type */
/**
Expand Down Expand Up @@ -30,7 +30,7 @@ export const scValByType = (scVal: xdr.ScVal) => {
if (addressType.name === "scAddressTypeAccount") {
return StrKey.encodeEd25519PublicKey(address.accountId().ed25519());
}
return StrKey.encodeContract(address.contractId());
return Address.fromScAddress(address).toString();
}

case xdr.ScValType.scvBool(): {
Expand Down
4 changes: 2 additions & 2 deletions @stellar/typescript-wallet-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@stellar/typescript-wallet-sdk",
"version": "1.10.0",
"engines": {
"node": ">=18"
"node": ">=20"
},
"browser": "./lib/bundle_browser.js",
"main": "./lib/bundle.js",
Expand Down Expand Up @@ -47,7 +47,7 @@
"dependencies": {
"@stablelib/base64": "^2.0.0",
"@stablelib/utf8": "^2.0.0",
"@stellar/stellar-sdk": "13.0.0-beta.1",
"@stellar/stellar-sdk": "14.5.0",
"axios": "^1.4.0",
"base64url": "^3.0.1",
"https-browserify": "^1.0.0",
Expand Down
4 changes: 4 additions & 0 deletions @stellar/typescript-wallet-sdk/src/walletSdk/Anchor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Customer, Sep12 } from "../Customer";
import {
ServerRequestFailedError,
KYCServerNotFoundError,
MissingSigningKeyError,
} from "../Exceptions";
import { Sep6, Transfer } from "./Sep6";
import { Interactive, Sep24 } from "./Sep24";
Expand Down Expand Up @@ -104,6 +105,9 @@ export class Anchor {
*/
async sep10(): Promise<Sep10> {
const tomlInfo = await this.sep1();
if (!tomlInfo.signingKey) {
throw new MissingSigningKeyError();
}
return new Sep10({
cfg: this.cfg,
webAuthEndpoint: tomlInfo.webAuthEndpoint,
Expand Down
Loading