Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine Horizon and Soroban JS SDKs into a single repository #850

Closed
Shaptic opened this issue Jul 18, 2023 · 0 comments · Fixed by #860
Closed

Combine Horizon and Soroban JS SDKs into a single repository #850

Shaptic opened this issue Jul 18, 2023 · 0 comments · Fixed by #860

Comments

@Shaptic
Copy link
Contributor

Shaptic commented Jul 18, 2023

As part of the march to testnet, we should unify the stellar/js-soroban-client and stellar/js-stellar-sdk repositories as follows:

  • Both will share the latest stellar-base version for Soroban (as of this writing, this is v10.0.0-soroban.4)
  • RPC code will live under the SorobanRPC namespace
  • Horizon code will live under the new Horizon namespace
  • Shared code (e.g. TransactionBuilder and friends) will be merged and live together

Previously, users would have the following scripts for separate Horizon / Soroban usage. Note that it's perfectly fine to synchronously submit a Soroban-shaped transaction to Horizon's POST /tx, you will just get a different response schema.

import StellarSdk from 'stellar-sdk';
import * as SorobanClient from 'soroban-client';

const horizon = StellarSdk.Server('https://horizon.stellar.org');
const rpc = SorobanClient.Server('https://rpc-futurenet.stellar.org');

const hzTx = StellarSdk.TransactionBuilder(...).build();
const soroTx = SorobanClient.TransactionBuilder(...).build();

horizon.submitTransaction(hzTx);
rpc.sendTransaction(soroTx);

Now, we will have

import { Horizon, SorobanRPC, TransactionBuilder } from 'stellar-sdk';

const horizon = Horizon.Server('https://horizon.stellar.org');
const rpc = SorobanRPC.Server('https://rpc-futurenet.stellar.org');

const anyTx = TransactionBuilder(...).build();

// two ways to submit, but **different responses**
horizon.submitTransaction(anyTx);
rpc.sendTransaction(anyTx);

Alternatively, they can do

import StellarSdk from 'stellar-sdk';

const horizon = StellarSdk.Horizon.Server('https://horizon.stellar.org');
const rpc = StellarSdk.SorobanRPC.Server('https://rpc-futurenet.stellar.org');

const anyTx = StellarSdk.TransactionBuilder(...).build();
// etc...

if they insist on using the default import method.

@Shaptic Shaptic converted this from a draft issue Jul 18, 2023
@Shaptic Shaptic moved this from Next Sprint Proposal to In Progress in Platform Scrum Jul 18, 2023
@Shaptic Shaptic self-assigned this Jul 18, 2023
@Shaptic Shaptic added this to the Soroban Testnet Release milestone Jul 18, 2023
@Shaptic Shaptic moved this from In Progress to Current Sprint in Platform Scrum Jul 26, 2023
@Shaptic Shaptic moved this from Current Sprint to In Progress in Platform Scrum Aug 7, 2023
@Shaptic Shaptic linked a pull request Aug 15, 2023 that will close this issue
@mollykarcher mollykarcher removed this from the Soroban Testnet Release milestone Sep 13, 2023
@mollykarcher mollykarcher added this to the Soroban Pubnet Release milestone Sep 26, 2023
@Shaptic Shaptic moved this from In Progress to Needs Review in Platform Scrum Oct 2, 2023
@Shaptic Shaptic moved this from Needs Review to In Progress in Platform Scrum Oct 2, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Platform Scrum Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment