diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dacea598..1db573570 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,14 +3,17 @@ A breaking change will get clearly marked in this log. -## Unreleased - -### Fixed -* The `SorobanRpc.Server.getEvents` method now correctly parses responses without a `contractId` field set. The `events[i].contractId` field on an event is now optional, omitted if there was no ID for the event (e.g. system events; ([#883](https://github.com/stellar/js-stellar-sdk/pull/883))). +## [v11.0.0](https://github.com/stellar/js-stellar-sdk/compare/v10.2.1...v11.0.0) ### Breaking Changes + +* The package has been renamed to `@stellar/stellar-sdk`. +* The new minimum supported version is Node 18. * The `PaymentCallBuilder` was incorrectly indicating that it would return a collection of `Payment` records, while [in reality](https://developers.stellar.org/api/horizon/resources/list-all-payments) it can return a handful of "payment-like" records ([#885](https://github.com/stellar/js-stellar-sdk/pull/885)). +### Fixed +* The `SorobanRpc.Server.getEvents` method now correctly parses responses without a `contractId` field set. The `events[i].contractId` field on an event is now optional, omitted if there was no ID for the event (e.g. system events; ([#883](https://github.com/stellar/js-stellar-sdk/pull/883))). + ## [v11.0.0-beta.6](https://github.com/stellar/js-stellar-sdk/compare/v11.0.0-beta.5...v11.0.0-beta.6) diff --git a/package.json b/package.json index cf3f78266..7fe804c52 100644 --- a/package.json +++ b/package.json @@ -146,7 +146,7 @@ "bignumber.js": "^9.1.2", "eventsource": "^2.0.2", "randombytes": "^2.1.0", - "stellar-base": "git+https://github.com/stellar/js-stellar-base#master", + "@stellar/stellar-base": "10.0.0", "toml": "^3.0.0", "urijs": "^1.19.1" } diff --git a/src/browser.ts b/src/browser.ts index 03027026b..6befec18d 100644 --- a/src/browser.ts +++ b/src/browser.ts @@ -1,7 +1,7 @@ /* tslint:disable:no-var-requires */ export * from "./index"; -export * as StellarBase from "stellar-base"; +export * as StellarBase from "@stellar/stellar-base"; import axios from "axios"; // idk why axios is weird export { axios }; diff --git a/src/contract_spec.ts b/src/contract_spec.ts index eb48559b8..b4e0b2289 100644 --- a/src/contract_spec.ts +++ b/src/contract_spec.ts @@ -5,7 +5,7 @@ import { XdrLargeInt, scValToBigInt, xdr -} from 'stellar-base'; +} from '@stellar/stellar-base'; export interface Union { tag: string; diff --git a/src/federation/server.ts b/src/federation/server.ts index a262aa29a..06d88fc87 100644 --- a/src/federation/server.ts +++ b/src/federation/server.ts @@ -1,5 +1,5 @@ import axios from "axios"; -import { StrKey } from "stellar-base"; +import { StrKey } from "@stellar/stellar-base"; import URI from "urijs"; import { Config } from "../config"; diff --git a/src/horizon/account_call_builder.ts b/src/horizon/account_call_builder.ts index 6d9dc5f5a..06997053a 100644 --- a/src/horizon/account_call_builder.ts +++ b/src/horizon/account_call_builder.ts @@ -1,4 +1,4 @@ -import { Asset } from "stellar-base"; +import { Asset } from "@stellar/stellar-base"; import { CallBuilder } from "./call_builder"; import { ServerApi } from "./server_api"; diff --git a/src/horizon/account_response.ts b/src/horizon/account_response.ts index 1cff48f17..376e9a197 100644 --- a/src/horizon/account_response.ts +++ b/src/horizon/account_response.ts @@ -1,6 +1,6 @@ /* tslint:disable:variable-name */ -import { Account as BaseAccount } from "stellar-base"; +import { Account as BaseAccount } from "@stellar/stellar-base"; import { HorizonApi } from "./horizon_api"; import { ServerApi } from "./server_api"; diff --git a/src/horizon/claimable_balances_call_builder.ts b/src/horizon/claimable_balances_call_builder.ts index d02c1aaa5..bf515702a 100644 --- a/src/horizon/claimable_balances_call_builder.ts +++ b/src/horizon/claimable_balances_call_builder.ts @@ -1,4 +1,4 @@ -import { Asset } from "stellar-base"; +import { Asset } from "@stellar/stellar-base"; import { CallBuilder } from "./call_builder"; import { ServerApi } from "./server_api"; diff --git a/src/horizon/horizon_api.ts b/src/horizon/horizon_api.ts index d6e50780f..f98f6a37f 100644 --- a/src/horizon/horizon_api.ts +++ b/src/horizon/horizon_api.ts @@ -1,4 +1,4 @@ -import { AssetType, MemoType } from "stellar-base"; +import { AssetType, MemoType } from "@stellar/stellar-base"; /* tslint:disable-next-line:no-namespace */ export namespace HorizonApi { diff --git a/src/horizon/liquidity_pool_call_builder.ts b/src/horizon/liquidity_pool_call_builder.ts index 2762e903b..f6c24b1f5 100644 --- a/src/horizon/liquidity_pool_call_builder.ts +++ b/src/horizon/liquidity_pool_call_builder.ts @@ -1,4 +1,4 @@ -import { Asset } from "stellar-base"; +import { Asset } from "@stellar/stellar-base"; import { CallBuilder } from "./call_builder"; import { ServerApi } from "./server_api"; diff --git a/src/horizon/offer_call_builder.ts b/src/horizon/offer_call_builder.ts index 9079ad18e..4d40b1a4b 100644 --- a/src/horizon/offer_call_builder.ts +++ b/src/horizon/offer_call_builder.ts @@ -1,4 +1,4 @@ -import { Asset } from "stellar-base"; +import { Asset } from "@stellar/stellar-base"; import { CallBuilder } from "./call_builder"; import { ServerApi } from "./server_api"; diff --git a/src/horizon/orderbook_call_builder.ts b/src/horizon/orderbook_call_builder.ts index 52c8c4915..0eb0bd72c 100644 --- a/src/horizon/orderbook_call_builder.ts +++ b/src/horizon/orderbook_call_builder.ts @@ -1,4 +1,4 @@ -import { Asset } from "stellar-base"; +import { Asset } from "@stellar/stellar-base"; import { CallBuilder } from "./call_builder"; import { ServerApi } from "./server_api"; diff --git a/src/horizon/path_call_builder.ts b/src/horizon/path_call_builder.ts index d216731e1..4999e07d8 100644 --- a/src/horizon/path_call_builder.ts +++ b/src/horizon/path_call_builder.ts @@ -1,4 +1,4 @@ -import { Asset } from "stellar-base"; +import { Asset } from "@stellar/stellar-base"; import { CallBuilder } from "./call_builder"; import { ServerApi } from "./server_api"; diff --git a/src/horizon/server.ts b/src/horizon/server.ts index c75fd0753..48c92106d 100644 --- a/src/horizon/server.ts +++ b/src/horizon/server.ts @@ -7,7 +7,7 @@ import { StrKey, Transaction, xdr, -} from "stellar-base"; +} from "@stellar/stellar-base"; import URI from "urijs"; import { CallBuilder } from "./call_builder"; diff --git a/src/horizon/server_api.ts b/src/horizon/server_api.ts index f0a58f85a..d169e0d51 100644 --- a/src/horizon/server_api.ts +++ b/src/horizon/server_api.ts @@ -1,4 +1,4 @@ -import { Asset } from "stellar-base"; +import { Asset } from "@stellar/stellar-base"; import { Omit } from "utility-types"; import { HorizonApi } from "./horizon_api"; diff --git a/src/horizon/strict_receive_path_call_builder.ts b/src/horizon/strict_receive_path_call_builder.ts index 3f1c41abc..b44876780 100644 --- a/src/horizon/strict_receive_path_call_builder.ts +++ b/src/horizon/strict_receive_path_call_builder.ts @@ -1,4 +1,4 @@ -import { Asset } from "stellar-base"; +import { Asset } from "@stellar/stellar-base"; import { CallBuilder } from "./call_builder"; import { ServerApi } from "./server_api"; diff --git a/src/horizon/strict_send_path_call_builder.ts b/src/horizon/strict_send_path_call_builder.ts index 989d9289e..da840374b 100644 --- a/src/horizon/strict_send_path_call_builder.ts +++ b/src/horizon/strict_send_path_call_builder.ts @@ -1,4 +1,4 @@ -import { Asset } from "stellar-base"; +import { Asset } from "@stellar/stellar-base"; import { CallBuilder } from "./call_builder"; import { ServerApi } from "./server_api"; diff --git a/src/horizon/trade_aggregation_call_builder.ts b/src/horizon/trade_aggregation_call_builder.ts index b35fad91e..8dfff4f69 100644 --- a/src/horizon/trade_aggregation_call_builder.ts +++ b/src/horizon/trade_aggregation_call_builder.ts @@ -1,5 +1,5 @@ /* tslint:disable: variable-name */ -import { Asset } from "stellar-base"; +import { Asset } from "@stellar/stellar-base"; import { CallBuilder } from "./call_builder"; import { BadRequestError } from "../errors"; import { HorizonApi } from "./horizon_api"; diff --git a/src/horizon/trades_call_builder.ts b/src/horizon/trades_call_builder.ts index b1bd8e218..8c601454d 100644 --- a/src/horizon/trades_call_builder.ts +++ b/src/horizon/trades_call_builder.ts @@ -1,4 +1,4 @@ -import { Asset } from "stellar-base"; +import { Asset } from "@stellar/stellar-base"; import { CallBuilder } from "./call_builder"; import { ServerApi } from "./server_api"; diff --git a/src/horizon/types/assets.ts b/src/horizon/types/assets.ts index 1ea450d25..76708718c 100644 --- a/src/horizon/types/assets.ts +++ b/src/horizon/types/assets.ts @@ -1,4 +1,4 @@ -import { AssetType } from "stellar-base"; +import { AssetType } from "@stellar/stellar-base"; import { HorizonApi } from "./../horizon_api"; export interface AssetRecord extends HorizonApi.BaseResponse { diff --git a/src/horizon/types/offer.ts b/src/horizon/types/offer.ts index 6aaf4c5fd..9a0de5000 100644 --- a/src/horizon/types/offer.ts +++ b/src/horizon/types/offer.ts @@ -1,4 +1,4 @@ -import { AssetType } from "stellar-base"; +import { AssetType } from "@stellar/stellar-base"; import { HorizonApi } from "./../horizon_api"; export interface OfferAsset { diff --git a/src/index.ts b/src/index.ts index 28750e1f7..9cfea4015 100644 --- a/src/index.ts +++ b/src/index.ts @@ -21,6 +21,6 @@ export * as SorobanRpc from './soroban'; export { ContractSpec } from './contract_spec'; // expose classes and functions from stellar-base -export * from 'stellar-base'; +export * from '@stellar/stellar-base'; export default module.exports; diff --git a/src/soroban/api.ts b/src/soroban/api.ts index 6e034e910..5b3236fea 100644 --- a/src/soroban/api.ts +++ b/src/soroban/api.ts @@ -1,4 +1,4 @@ -import { AssetType, Contract, SorobanDataBuilder, xdr } from 'stellar-base'; +import { AssetType, Contract, SorobanDataBuilder, xdr } from '@stellar/stellar-base'; /* tslint:disable-next-line:no-namespace */ /** @namespace Api */ diff --git a/src/soroban/browser.ts b/src/soroban/browser.ts index bbd6932ff..a5ce47b04 100644 --- a/src/soroban/browser.ts +++ b/src/soroban/browser.ts @@ -1,7 +1,7 @@ /* tslint:disable:no-var-requires */ export * from './index'; -export * as StellarBase from 'stellar-base'; +export * as StellarBase from '@stellar/stellar-base'; import axios from 'axios'; // idk why axios is weird export { axios }; diff --git a/src/soroban/parsers.ts b/src/soroban/parsers.ts index 7a38101a9..d20ec14a0 100644 --- a/src/soroban/parsers.ts +++ b/src/soroban/parsers.ts @@ -1,4 +1,4 @@ -import { xdr, Contract, SorobanDataBuilder } from 'stellar-base'; +import { xdr, Contract, SorobanDataBuilder } from '@stellar/stellar-base'; import { Api } from './api'; export function parseRawSendTransaction( diff --git a/src/soroban/server.ts b/src/soroban/server.ts index 7d6d3c05c..34c291d00 100644 --- a/src/soroban/server.ts +++ b/src/soroban/server.ts @@ -9,7 +9,7 @@ import { Keypair, Transaction, xdr -} from 'stellar-base'; +} from '@stellar/stellar-base'; import AxiosClient from './axios'; import { Api as FriendbotApi } from '../friendbot'; diff --git a/src/soroban/transaction.ts b/src/soroban/transaction.ts index 6a962b793..c75f333b4 100644 --- a/src/soroban/transaction.ts +++ b/src/soroban/transaction.ts @@ -3,7 +3,7 @@ import { Operation, Transaction, TransactionBuilder -} from 'stellar-base'; +} from '@stellar/stellar-base'; import { Api } from './api'; import { parseRawSimulation } from './parsers'; diff --git a/src/stellartoml/index.ts b/src/stellartoml/index.ts index 651f01298..ba0c965bf 100644 --- a/src/stellartoml/index.ts +++ b/src/stellartoml/index.ts @@ -1,6 +1,6 @@ import axios from "axios"; import toml from "toml"; -import { Networks } from "stellar-base"; +import { Networks } from "@stellar/stellar-base"; import { Config } from "../config"; diff --git a/src/utils.ts b/src/utils.ts index 88edd34e7..3186a51ff 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,4 +1,4 @@ -import { Transaction } from "stellar-base"; +import { Transaction } from "@stellar/stellar-base"; export class Utils { /** diff --git a/src/webauth/utils.ts b/src/webauth/utils.ts index a23820162..3e6d13c73 100644 --- a/src/webauth/utils.ts +++ b/src/webauth/utils.ts @@ -11,7 +11,7 @@ import { TimeoutInfinite, Transaction, TransactionBuilder, -} from "stellar-base"; +} from "@stellar/stellar-base"; import { Utils } from "../utils"; import { InvalidChallengeError } from "./errors"; diff --git a/test/unit/contract_spec.js b/test/unit/contract_spec.js index b73e03b38..a16fbd30f 100644 --- a/test/unit/contract_spec.js +++ b/test/unit/contract_spec.js @@ -6,239 +6,251 @@ const publicKey = "GCBVOLOM32I7OD5TWZQCIXCXML3TK56MDY7ZMTAILIBQHHKPCVU42XYW"; const addr = Address.fromString(publicKey); let SPEC; before(() => { - SPEC = new ContractSpec(spec); + SPEC = new ContractSpec(spec); }); it("throws if no entries", () => { - expect(() => new ContractSpec([])).to.throw(/Contract spec must have at least one entry/i); + expect(() => new ContractSpec([])).to.throw( + /Contract spec must have at least one entry/i, + ); }); describe("Can round trip custom types", function () { - function getResultType(funcName) { - let fn = SPEC.findEntry(funcName).value(); - if (!(fn instanceof xdr.ScSpecFunctionV0)) { - throw new Error("Not a function"); - } - if (fn.outputs().length === 0) { - return xdr.ScSpecTypeDef.scSpecTypeVoid(); - } - return fn.outputs()[0]; + function getResultType(funcName) { + let fn = SPEC.findEntry(funcName).value(); + if (!(fn instanceof xdr.ScSpecFunctionV0)) { + throw new Error("Not a function"); } - function roundtrip(funcName, input, typeName) { - let type = getResultType(funcName); - let ty = typeName ?? funcName; - let obj = {}; - obj[ty] = input; - let scVal = SPEC.funcArgsToScVals(funcName, obj)[0]; - let result = SPEC.scValToNative(scVal, type); - expect(result).deep.equal(input); + if (fn.outputs().length === 0) { + return xdr.ScSpecTypeDef.scSpecTypeVoid(); } - it("u32", () => { - roundtrip("u32_", 1); + return fn.outputs()[0]; + } + function roundtrip(funcName, input, typeName) { + let type = getResultType(funcName); + let ty = typeName ?? funcName; + let obj = {}; + obj[ty] = input; + let scVal = SPEC.funcArgsToScVals(funcName, obj)[0]; + let result = SPEC.scValToNative(scVal, type); + expect(result).deep.equal(input); + } + it("u32", () => { + roundtrip("u32_", 1); + }); + it("i32", () => { + roundtrip("i32_", -1); + }); + it("i64", () => { + roundtrip("i64_", 1n); + }); + it("strukt", () => { + roundtrip("strukt", { a: 0, b: true, c: "hello" }); + }); + describe("simple", () => { + it("first", () => { + const simple = { tag: "First", values: undefined }; + roundtrip("simple", simple); }); - it("i32", () => { - roundtrip("i32_", -1); + it("simple second", () => { + const simple = { tag: "Second", values: undefined }; + roundtrip("simple", simple); }); - it("i64", () => { - roundtrip("i64_", 1n); + it("simple third", () => { + const simple = { tag: "Third", values: undefined }; + roundtrip("simple", simple); }); - it("strukt", () => { - roundtrip("strukt", { a: 0, b: true, c: "hello" }); - }); - describe("simple", () => { - it("first", () => { - const simple = { tag: "First", values: undefined }; - roundtrip("simple", simple); - }); - it("simple second", () => { - const simple = { tag: "Second", values: undefined }; - roundtrip("simple", simple); - }); - it("simple third", () => { - const simple = { tag: "Third", values: undefined }; - roundtrip("simple", simple); - }); - }); - describe("complex", () => { - it("struct", () => { - const complex = { - tag: "Struct", - values: [{ a: 0, b: true, c: "hello" }], - }; - roundtrip("complex", complex); - }); - it("tuple", () => { - const complex = { - tag: "Tuple", - values: [ - [ - { a: 0, b: true, c: "hello" }, - { tag: "First", values: undefined }, - ], - ], - }; - roundtrip("complex", complex); - }); - it("enum", () => { - const complex = { - tag: "Enum", - values: [{ tag: "First", values: undefined }], - }; - roundtrip("complex", complex); - }); - it("asset", () => { - const complex = { tag: "Asset", values: [addr, 1n] }; - roundtrip("complex", complex); - }); - it("void", () => { - const complex = { tag: "Void", values: undefined }; - roundtrip("complex", complex); - }); - }); - it("addresse", () => { - roundtrip("addresse", addr); - }); - it("bytes", () => { - const bytes = Buffer.from("hello"); - roundtrip("bytes", bytes); - }); - it("bytes_n", () => { - const bytes_n = Buffer.from("123456789"); // what's the correct way to construct bytes_n? - roundtrip("bytes_n", bytes_n); - }); - it("card", () => { - const card = 11; - roundtrip("card", card); - }); - it("boolean", () => { - roundtrip("boolean", true); - }); - it("not", () => { - roundtrip("boolean", false); - }); - it("i128", () => { - roundtrip("i128", -1n); - }); - it("u128", () => { - roundtrip("u128", 1n); - }); - it("map", () => { - const map = new Map(); - map.set(1, true); - map.set(2, false); - roundtrip("map", map); - map.set(3, "hahaha"); - expect(() => roundtrip("map", map)).to.throw(/invalid type scSpecTypeBool specified for string value/i); - }); - it("vec", () => { - const vec = [1, 2, 3]; - roundtrip("vec", vec); + }); + describe("complex", () => { + it("struct", () => { + const complex = { + tag: "Struct", + values: [{ a: 0, b: true, c: "hello" }], + }; + roundtrip("complex", complex); }); it("tuple", () => { - const tuple = ["hello", 1]; - roundtrip("tuple", tuple); - }); - it("option", () => { - roundtrip("option", 1); - roundtrip("option", undefined); - }); - it("u256", () => { - roundtrip("u256", 1n); - expect(() => roundtrip("u256", -1n)).to.throw(/expected a positive value, got: -1/i); + const complex = { + tag: "Tuple", + values: [ + [ + { a: 0, b: true, c: "hello" }, + { tag: "First", values: undefined }, + ], + ], + }; + roundtrip("complex", complex); }); - it("i256", () => { - roundtrip("i256", -1n); + it("enum", () => { + const complex = { + tag: "Enum", + values: [{ tag: "First", values: undefined }], + }; + roundtrip("complex", complex); }); - it("string", () => { - roundtrip("string", "hello"); + it("asset", () => { + const complex = { tag: "Asset", values: [addr, 1n] }; + roundtrip("complex", complex); }); - it("tuple_strukt", () => { - const arg = [ - { a: 0, b: true, c: "hello" }, - { tag: "First", values: undefined }, - ]; - roundtrip("tuple_strukt", arg); + it("void", () => { + const complex = { tag: "Void", values: undefined }; + roundtrip("complex", complex); }); + }); + it("addresse", () => { + roundtrip("addresse", addr); + }); + it("bytes", () => { + const bytes = Buffer.from("hello"); + roundtrip("bytes", bytes); + }); + it("bytes_n", () => { + const bytes_n = Buffer.from("123456789"); // what's the correct way to construct bytes_n? + roundtrip("bytes_n", bytes_n); + }); + it("card", () => { + const card = 11; + roundtrip("card", card); + }); + it("boolean", () => { + roundtrip("boolean", true); + }); + it("not", () => { + roundtrip("boolean", false); + }); + it("i128", () => { + roundtrip("i128", -1n); + }); + it("u128", () => { + roundtrip("u128", 1n); + }); + it("map", () => { + const map = new Map(); + map.set(1, true); + map.set(2, false); + roundtrip("map", map); + map.set(3, "hahaha"); + expect(() => roundtrip("map", map)).to.throw( + /invalid type scSpecTypeBool specified for string value/i, + ); + }); + it("vec", () => { + const vec = [1, 2, 3]; + roundtrip("vec", vec); + }); + it("tuple", () => { + const tuple = ["hello", 1]; + roundtrip("tuple", tuple); + }); + it("option", () => { + roundtrip("option", 1); + roundtrip("option", undefined); + }); + it("u256", () => { + roundtrip("u256", 1n); + expect(() => roundtrip("u256", -1n)).to.throw( + /expected a positive value, got: -1/i, + ); + }); + it("i256", () => { + roundtrip("i256", -1n); + }); + it("string", () => { + roundtrip("string", "hello"); + }); + it("tuple_strukt", () => { + const arg = [ + { a: 0, b: true, c: "hello" }, + { tag: "First", values: undefined }, + ]; + roundtrip("tuple_strukt", arg); + }); }); describe("parsing and building ScVals", function () { - it("Can parse entries", function () { - let spec = new ContractSpec([GIGA_MAP, func]); - let fn = spec.findEntry("giga_map"); - let gigaMap = spec.findEntry("GigaMap"); - expect(gigaMap).deep.equal(GIGA_MAP); - expect(fn).deep.equal(func); - }); + it("Can parse entries", function () { + let spec = new ContractSpec([GIGA_MAP, func]); + let fn = spec.findEntry("giga_map"); + let gigaMap = spec.findEntry("GigaMap"); + expect(gigaMap).deep.equal(GIGA_MAP); + expect(fn).deep.equal(func); + }); }); -export const GIGA_MAP = xdr.ScSpecEntry.scSpecEntryUdtStructV0(new xdr.ScSpecUdtStructV0({ +export const GIGA_MAP = xdr.ScSpecEntry.scSpecEntryUdtStructV0( + new xdr.ScSpecUdtStructV0({ doc: "This is a kitchen sink of all the types", lib: "", name: "GigaMap", fields: [ - new xdr.ScSpecUdtStructFieldV0({ - doc: "", - name: "bool", - type: xdr.ScSpecTypeDef.scSpecTypeBool(), - }), - new xdr.ScSpecUdtStructFieldV0({ - doc: "", - name: "i128", - type: xdr.ScSpecTypeDef.scSpecTypeI128(), - }), - new xdr.ScSpecUdtStructFieldV0({ - doc: "", - name: "u128", - type: xdr.ScSpecTypeDef.scSpecTypeU128(), - }), - new xdr.ScSpecUdtStructFieldV0({ - doc: "", - name: "i256", - type: xdr.ScSpecTypeDef.scSpecTypeI256(), - }), - new xdr.ScSpecUdtStructFieldV0({ - doc: "", - name: "u256", - type: xdr.ScSpecTypeDef.scSpecTypeU256(), - }), - new xdr.ScSpecUdtStructFieldV0({ - doc: "", - name: "i32", - type: xdr.ScSpecTypeDef.scSpecTypeI32(), - }), - new xdr.ScSpecUdtStructFieldV0({ - doc: "", - name: "u32", - type: xdr.ScSpecTypeDef.scSpecTypeU32(), - }), - new xdr.ScSpecUdtStructFieldV0({ - doc: "", - name: "i64", - type: xdr.ScSpecTypeDef.scSpecTypeI64(), - }), - new xdr.ScSpecUdtStructFieldV0({ - doc: "", - name: "u64", - type: xdr.ScSpecTypeDef.scSpecTypeU64(), - }), - new xdr.ScSpecUdtStructFieldV0({ - doc: "", - name: "symbol", - type: xdr.ScSpecTypeDef.scSpecTypeSymbol(), - }), - new xdr.ScSpecUdtStructFieldV0({ - doc: "", - name: "string", - type: xdr.ScSpecTypeDef.scSpecTypeString(), - }), + new xdr.ScSpecUdtStructFieldV0({ + doc: "", + name: "bool", + type: xdr.ScSpecTypeDef.scSpecTypeBool(), + }), + new xdr.ScSpecUdtStructFieldV0({ + doc: "", + name: "i128", + type: xdr.ScSpecTypeDef.scSpecTypeI128(), + }), + new xdr.ScSpecUdtStructFieldV0({ + doc: "", + name: "u128", + type: xdr.ScSpecTypeDef.scSpecTypeU128(), + }), + new xdr.ScSpecUdtStructFieldV0({ + doc: "", + name: "i256", + type: xdr.ScSpecTypeDef.scSpecTypeI256(), + }), + new xdr.ScSpecUdtStructFieldV0({ + doc: "", + name: "u256", + type: xdr.ScSpecTypeDef.scSpecTypeU256(), + }), + new xdr.ScSpecUdtStructFieldV0({ + doc: "", + name: "i32", + type: xdr.ScSpecTypeDef.scSpecTypeI32(), + }), + new xdr.ScSpecUdtStructFieldV0({ + doc: "", + name: "u32", + type: xdr.ScSpecTypeDef.scSpecTypeU32(), + }), + new xdr.ScSpecUdtStructFieldV0({ + doc: "", + name: "i64", + type: xdr.ScSpecTypeDef.scSpecTypeI64(), + }), + new xdr.ScSpecUdtStructFieldV0({ + doc: "", + name: "u64", + type: xdr.ScSpecTypeDef.scSpecTypeU64(), + }), + new xdr.ScSpecUdtStructFieldV0({ + doc: "", + name: "symbol", + type: xdr.ScSpecTypeDef.scSpecTypeSymbol(), + }), + new xdr.ScSpecUdtStructFieldV0({ + doc: "", + name: "string", + type: xdr.ScSpecTypeDef.scSpecTypeString(), + }), ], -})); -const GIGA_MAP_TYPE = xdr.ScSpecTypeDef.scSpecTypeUdt(new xdr.ScSpecTypeUdt({ name: "GigaMap" })); -let func = xdr.ScSpecEntry.scSpecEntryFunctionV0(new xdr.ScSpecFunctionV0({ + }), +); +const GIGA_MAP_TYPE = xdr.ScSpecTypeDef.scSpecTypeUdt( + new xdr.ScSpecTypeUdt({ name: "GigaMap" }), +); +let func = xdr.ScSpecEntry.scSpecEntryFunctionV0( + new xdr.ScSpecFunctionV0({ doc: "Kitchen Sink", name: "giga_map", inputs: [ - new xdr.ScSpecFunctionInputV0({ - doc: "", - name: "giga_map", - type: GIGA_MAP_TYPE, - }), + new xdr.ScSpecFunctionInputV0({ + doc: "", + name: "giga_map", + type: GIGA_MAP_TYPE, + }), ], outputs: [GIGA_MAP_TYPE], -})); + }), +); diff --git a/yarn.lock b/yarn.lock index f4d38b2b7..76c92dd06 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1370,6 +1370,20 @@ resolved "https://registry.yarnpkg.com/@stellar/js-xdr/-/js-xdr-3.0.1.tgz#d500f1e1332210cd56e0ef95e44c54506d9f48f3" integrity sha512-dp5Eh7Nr1YjiIeqpdkj2cQYxfoPudDAH3ck8MWggp48Htw66Z/hUssNYUQG/OftLjEmHT90Z/dtey2Y77DOxIw== +"@stellar/stellar-base@10.0.0": + version "10.0.0" + resolved "https://registry.yarnpkg.com/@stellar/stellar-base/-/stellar-base-10.0.0.tgz#b9ef7e84e644d06ec08b8ba88ad6b38da7b80494" + integrity sha512-zHlGzWefiB2gkt13l+I8Dvo2k7+n6+vxizay4lDEc5si0zjSZbCUUzMIdVIQ86dao7+TvZ3aNw8CdncOWLDu2A== + dependencies: + "@stellar/js-xdr" "^3.0.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.0.1" + "@stellar/tsconfig@^1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@stellar/tsconfig/-/tsconfig-1.0.2.tgz#18e9b1a1d6076e116bb405d11fc034401155292d" @@ -6668,19 +6682,6 @@ statuses@~1.5.0: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== -"stellar-base@git+https://github.com/stellar/js-stellar-base#master": - version "10.0.0" - resolved "git+https://github.com/stellar/js-stellar-base#cf370f4e627e2b0e296ceceaebd0164dede396bd" - dependencies: - "@stellar/js-xdr" "^3.0.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.0.1" - stream-browserify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-3.0.0.tgz#22b0a2850cdf6503e73085da1fc7b7d0c2122f2f"