Skip to content

Commit

Permalink
Feature/upgrade sdk p21 (#1327) (#1328)
Browse files Browse the repository at this point in the history
* use single quotes

* default to sdk 12.1.0

* update sdk-next and contract spec api

* add new verified token
  • Loading branch information
piyalbasu authored Jun 18, 2024
1 parent 8a203e8 commit 5814dc2
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 32 deletions.
4 changes: 2 additions & 2 deletions @shared/api/helpers/soroban.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
xdr,
ScInt,
SorobanRpc,
ContractSpec,
contract,
} from "stellar-sdk";
import { XdrReader } from "@stellar/js-xdr";

Expand Down Expand Up @@ -109,7 +109,7 @@ export const parseWasmXdr = async (xdrContents: string) => {
do {
specs.push(xdr.ScSpecEntry.read(reader));
} while (!reader.eof);
const contractSpec = new ContractSpec(specs);
const contractSpec = new contract.Spec(specs);
return contractSpec.jsonSchema();
};

Expand Down
4 changes: 2 additions & 2 deletions @shared/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"@stellar/js-xdr": "^3.1.1",
"bignumber.js": "^9.1.1",
"prettier": "^2.0.5",
"stellar-sdk": "yarn:stellar-sdk@^11.3.0",
"stellar-sdk-next": "yarn:stellar-sdk@12.0.0-rc.2",
"stellar-sdk": "yarn:stellar-sdk@^12.1.0",
"stellar-sdk-next": "yarn:stellar-sdk@12.1.0",
"typescript": "~3.7.2",
"webextension-polyfill": "^0.10.0"
},
Expand Down
4 changes: 2 additions & 2 deletions @shared/constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"prettier": "@stellar/prettier-config",
"version": "1.0.0",
"dependencies": {
"stellar-sdk": "yarn:stellar-sdk@^11.3.0",
"stellar-sdk-next": "yarn:stellar-sdk@12.0.0-rc.2",
"stellar-sdk": "yarn:stellar-sdk@^12.1.0",
"stellar-sdk-next": "yarn:stellar-sdk@12.1.0",
"typescript": "~3.7.2"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions @shared/helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"version": "1.0.0",
"dependencies": {
"bignumber.js": "^9.1.1",
"stellar-sdk": "yarn:stellar-sdk@^11.3.0",
"stellar-sdk-next": "yarn:stellar-sdk@12.0.0-rc.2",
"stellar-sdk": "yarn:stellar-sdk@^12.1.0",
"stellar-sdk-next": "yarn:stellar-sdk@12.1.0",
"typescript": "~3.7.2"
},
"devDependencies": {
Expand Down
7 changes: 1 addition & 6 deletions @shared/helpers/stellar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,12 @@ import {
BASE_RESERVE,
BASE_RESERVE_MIN_COUNT,
NetworkDetails,
FUTURENET_NETWORK_DETAILS,
TESTNET_NETWORK_DETAILS,
} from "@shared/constants/stellar";

export const CUSTOM_NETWORK = "STANDALONE";

export const isNextSdk = (networkPassphrase: string) =>
[
FUTURENET_NETWORK_DETAILS.networkPassphrase,
TESTNET_NETWORK_DETAILS.networkPassphrase,
].includes(networkPassphrase);
[""].includes(networkPassphrase);

export const getSdk = (networkPassphrase: string) =>
isNextSdk(networkPassphrase) ? StellarSdkNext : StellarSdk;
Expand Down
2 changes: 1 addition & 1 deletion extension/e2e-tests/addAsset.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test("Adding Soroban verified token", async ({ page, extensionId }) => {
// USDC: The verification status of this contract is subject to change.
// taken from: https://api.stellar.expert/explorer/testnet/asset-list/top50
const verifiedToken =
"CAQCFVLOBK5GIULPNZRGATJJMIZL5BSP7X5YJVMGCPTUEPFM4AVSRCJU";
"CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA";

test.slow();
await loginToTestAccount({ page, extensionId });
Expand Down
6 changes: 3 additions & 3 deletions extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
"ses": "^0.18.5",
"stellar-hd-wallet": "^0.0.10",
"stellar-identicon-js": "^1.0.0",
"stellar-sdk": "yarn:stellar-sdk@^11.3.0",
"stellar-sdk-next": "yarn:stellar-sdk@12.0.0-rc.2",
"stellar-sdk": "yarn:stellar-sdk@^12.1.0",
"stellar-sdk-next": "yarn:stellar-sdk@12.1.0",
"svg-url-loader": "^5.0.0",
"tsconfig-paths-webpack-plugin": "^3.2.0",
"tslib": "2.0.0",
Expand Down Expand Up @@ -111,4 +111,4 @@
"stellar-sdk>stellar-base>sodium-native": false
}
}
}
}
59 changes: 45 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1745,7 +1745,7 @@
"@docusaurus/theme-search-algolia" "2.4.1"
"@docusaurus/types" "2.4.1"

"@docusaurus/[email protected]", "react-loadable@npm:@docusaurus/[email protected]":
"@docusaurus/[email protected]":
version "5.5.2"
resolved "https://registry.yarnpkg.com/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz#81aae0db81ecafbdaee3651f12804580868fa6ce"
integrity sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ==
Expand Down Expand Up @@ -3078,7 +3078,7 @@
resolved "https://registry.yarnpkg.com/@stellar/prettier-config/-/prettier-config-1.2.0.tgz#b27c411e0c4c63b2d76332c239084e682c37468f"
integrity sha512-oL9qJ7+7aWnImpbcldroQrvtMCZ9yx4JL/tmDZ860RpBQd2ahkc8bX6/k2ehFK8gpb9ltYu4mtU49wufUuYhGg==

"@stellar/stellar-base@11.1.0", "@stellar/stellar-base@^11.0.1":
"@stellar/stellar-base@^11.0.1":
version "11.1.0"
resolved "https://registry.yarnpkg.com/@stellar/stellar-base/-/stellar-base-11.1.0.tgz#4b561776cb102a87828379cd1ac5d3ce96db4fb3"
integrity sha512-nMg7QSpFqCZFq3Je/lG12+DY18y01QHRNyCxvjM8i4myS9tPRMDq7zqGcd215BGbCJxenckiOW45YJjQjzdcMQ==
Expand All @@ -3092,6 +3092,20 @@
optionalDependencies:
sodium-native "^4.1.1"

"@stellar/stellar-base@^12.0.1":
version "12.0.1"
resolved "https://registry.yarnpkg.com/@stellar/stellar-base/-/stellar-base-12.0.1.tgz#3fae34e8f787eb47cc7f58a0dea014e7b70724a7"
integrity sha512-g6c27MNsDgEdUmoNQJn7zCWoCY50WHt0OIIOq3PhWaJRtUaT++qs1Jpb8+1bny2GmhtfRGOfPUFSyQBuHT9Mvg==
dependencies:
"@stellar/js-xdr" "^3.1.1"
base32.js "^0.1.0"
bignumber.js "^9.1.2"
buffer "^6.0.3"
sha.js "^2.3.6"
tweetnacl "^1.0.3"
optionalDependencies:
sodium-native "^4.1.1"

"@stellar/stellar-sdk@^11.1.0":
version "11.3.0"
resolved "https://registry.yarnpkg.com/@stellar/stellar-sdk/-/stellar-sdk-11.3.0.tgz#7cb010651846a07e1853e0fe30e430ece4da340b"
Expand Down Expand Up @@ -4807,6 +4821,15 @@ axios@^1.6.8:
form-data "^4.0.0"
proxy-from-env "^1.1.0"

axios@^1.7.2:
version "1.7.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.2.tgz#b625db8a7051fbea61c35a3cbb3a1daa7b9c7621"
integrity sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==
dependencies:
follow-redirects "^1.15.6"
form-data "^4.0.0"
proxy-from-env "^1.1.0"

axobject-query@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-3.2.1.tgz#39c378a6e3b06ca679f29138151e45b2b32da62a"
Expand Down Expand Up @@ -13145,6 +13168,14 @@ react-loadable-ssr-addon-v5-slorber@^1.0.1:
dependencies:
"@babel/runtime" "^7.10.3"

"react-loadable@npm:@docusaurus/[email protected]":
version "5.5.2"
resolved "https://registry.yarnpkg.com/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz#81aae0db81ecafbdaee3651f12804580868fa6ce"
integrity sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ==
dependencies:
"@types/react" "*"
prop-types "^15.6.2"

react-native@*:
version "0.74.1"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.74.1.tgz#8f5f59636242eb1b90ff675d9fcc7f5b8b1c9913"
Expand Down Expand Up @@ -14562,26 +14593,26 @@ stellar-identicon-js@^1.0.0:
dependencies:
html-webpack-plugin "^3.2.0"

"stellar-sdk-next@yarn:stellar-sdk@12.0.0-rc.2":
version "12.0.0-rc.2"
resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-12.0.0-rc.2.tgz#a6e2608fcb52acf87dbfc50ddb33a6fb8bcacbac"
integrity sha512-agda7+I8CRTArhxID4FgEz5c85/Vpqn40P9Xq8D88zSyu4mj0g+dR5j8TVQGBfeKhap2zqLKiQQb/U73ocIJNg==
"stellar-sdk-next@yarn:stellar-sdk@12.1.0":
version "12.1.0"
resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-12.1.0.tgz#5c484641de1e69719d80b70d4b998241f4977d8e"
integrity sha512-cunPIlSoIDB4OWDBpXSBd0ZH+cj7mVnbk+XLvCzplcMDG8nK/tpO5YH5Z2P/4B9JZigBXcXC7YHeHtB4dQvc9g==
dependencies:
"@stellar/stellar-base" "11.1.0"
axios "^1.6.8"
"@stellar/stellar-base" "^12.0.1"
axios "^1.7.2"
bignumber.js "^9.1.2"
eventsource "^2.0.2"
randombytes "^2.1.0"
toml "^3.0.0"
urijs "^1.19.1"

"stellar-sdk@yarn:stellar-sdk@^11.3.0":
version "11.3.0"
resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-11.3.0.tgz#385105eac694bb469ec3924e79e796d5766ba7cd"
integrity sha512-xOp2zpQm5TIbgJi7wJhAmJh+Uy0ew5GbGtj1kZv6HEWHgSvW95xYMxGaw6MWM9r2YPUSQySboE6JwDc9jdx53A==
"stellar-sdk@yarn:stellar-sdk@^12.1.0":
version "12.1.0"
resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-12.1.0.tgz#5c484641de1e69719d80b70d4b998241f4977d8e"
integrity sha512-cunPIlSoIDB4OWDBpXSBd0ZH+cj7mVnbk+XLvCzplcMDG8nK/tpO5YH5Z2P/4B9JZigBXcXC7YHeHtB4dQvc9g==
dependencies:
"@stellar/stellar-base" "^11.0.1"
axios "^1.6.8"
"@stellar/stellar-base" "^12.0.1"
axios "^1.7.2"
bignumber.js "^9.1.2"
eventsource "^2.0.2"
randombytes "^2.1.0"
Expand Down

0 comments on commit 5814dc2

Please sign in to comment.