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

Rename Build5OtrAddress to SoonaverseOtrAddress #2821

Merged
merged 1 commit into from
Feb 21, 2024
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
4 changes: 2 additions & 2 deletions packages/sdk/examples/auction/otr/create.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Dataset, Network } from '@build-5/interfaces';
import { Build5, Build5OtrAddress, SoonaverseApiKey, https, otr } from '@build-5/sdk';
import { Build5, SoonaverseOtrAddress, SoonaverseApiKey, https, otr } from '@build-5/sdk';

async function main() {
const origin = Build5.TEST;
// @ts-ignore
const otrAddress = Build5OtrAddress[origin];
const otrAddress = SoonaverseOtrAddress[origin];

try {
// To create a generic auction we send an otr request with the needed params
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/examples/nft/otr/bulk_purchase.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Dataset } from '@build-5/interfaces';
import { Build5, Build5OtrAddress, otr } from '@build-5/sdk';
import { Build5, SoonaverseOtrAddress, otr } from '@build-5/sdk';

const collectionId = 'build5nftcollectionid';
const nftIds = ['build5nftid1', 'build5nftid2'];

const origin = Build5.TEST;
// @ts-ignore
const otrAddress = Build5OtrAddress[origin];
const otrAddress = SoonaverseOtrAddress[origin];

async function main() {
const otrRequest = otr(otrAddress)
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/examples/nft/otr/purchase.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Dataset } from '@build-5/interfaces';
import { Build5, Build5OtrAddress, https, otr, SoonaverseApiKey } from '@build-5/sdk';
import { Build5, SoonaverseOtrAddress, https, otr, SoonaverseApiKey } from '@build-5/sdk';

const collectionId = 'build5collectionid1';
const nftId = 'build5nftid1';

const origin = Build5.TEST;
// @ts-ignore
const otrAddress = Build5OtrAddress[origin];
const otrAddress = SoonaverseOtrAddress[origin];

async function main() {
const otrRequest = otr(otrAddress)
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/examples/nft/otr/transfer.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Dataset } from '@build-5/interfaces';
import { Build5, Build5OtrAddress, otr } from '@build-5/sdk';
import { Build5, SoonaverseOtrAddress, otr } from '@build-5/sdk';

const origin = Build5.TEST;
// @ts-ignore
const otrAddress = Build5OtrAddress[origin];
const otrAddress = SoonaverseOtrAddress[origin];

async function main() {
const otrRequest = otr(otrAddress)
Expand Down
6 changes: 3 additions & 3 deletions packages/sdk/examples/stamp/otr/create.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Dataset } from '@build-5/interfaces';
import { Build5, Build5OtrAddress, otr } from '@build-5/sdk';
import { Build5, SoonaverseOtrAddress, otr } from '@build-5/sdk';

async function main() {
const origin = Build5.TEST;
// @ts-ignore
const otrAddress = Build5OtrAddress[origin];
const otrAddress = SoonaverseOtrAddress[origin];

console.log('Create stamp under your project...');
try {
const otrRequest = await otr(otrAddress)
const otrRequest = otr(otrAddress)
.dataset(Dataset.STAMP)
.stamp({ uri: 'https://www.africau.edu/images/default/sample.pdf' });

Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/examples/swap/otr/create.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Dataset } from '@build-5/interfaces';
import { Build5, Build5OtrAddress, otr } from '@build-5/sdk';
import { Build5, SoonaverseOtrAddress, otr } from '@build-5/sdk';

async function main() {
const origin = Build5.TEST;
// @ts-ignore
const otrAddress = Build5OtrAddress[origin];
const otrAddress = SoonaverseOtrAddress[origin];

console.log('Create swap. Set network, recipient and asks.');
console.log('Asks can be base token, native tokens and nfts');
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/examples/token/otr/trade.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Dataset } from '@build-5/interfaces';
import { otr } from '@build-5/sdk';
import { otr, SoonaverseOtrAddress } from '@build-5/sdk';

async function main() {
// @ts-ignore
const otrAddress = Build5OtrAddress[origin];
const otrAddress = SoonaverseOtrAddress[origin];

try {
const otrRequestBuy = await otr(otrAddress).dataset(Dataset.TOKEN).buyToken({
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { Build5, SoonaverseApiKey, https } from './https';
export { Build5OtrAddress, otr } from './otr';
export { SoonaverseOtrAddress, otr } from './otr';
7 changes: 4 additions & 3 deletions packages/sdk/src/otr/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { OtrWrapper } from './otr';

export const otr = (otrAddress: string = Build5OtrAddress.SHIMMER) => new OtrWrapper(otrAddress);
export const otr = (otrAddress: string = SoonaverseOtrAddress.SHIMMER) =>
new OtrWrapper(otrAddress);

/**
* Build.5 OTR Addresses per chain.
* Soonaverse OTR Addresses per chain.
*/
export enum Build5OtrAddress {
export enum SoonaverseOtrAddress {
IOTA = 'iota1qpwxxaw6fw8zeezefyqf0y7hnrpkcmfa4afc67ywfkpp3gwj0ttzcexhvan',
SHIMMER = 'smr1qp0248uakdvfrhyr58yk5lswhnt033vrhst2j4c77laepdv2rk0psgh4t4x',
TEST = 'rms1qp29ma9mugkrlaq9e60pmdray4sn2zjpet4vyk86cezm0jqpdwuhv68j3vh',
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/test/otr/otr.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Dataset } from '@build-5/interfaces';
import * as build5 from '../../src';
import { SoonaverseApiKey, Build5 } from '../../src/https';
import { Build5OtrAddress } from '../../src/otr';
import { SoonaverseOtrAddress } from '../../src/otr';

describe('', () => {
it('Deep link test', async () => {
const otrAddress = Build5OtrAddress.TEST;
const otrAddress = SoonaverseOtrAddress.TEST;
const request = build5.otr(otrAddress).dataset(Dataset.MEMBER).validateAddress();

const deeplink = request.getFireflyDeepLink();
Expand Down