Skip to content

Commit

Permalink
Rename Build5OtrAddress to SoonaverseOtrAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
Boldizsar Mezei committed Feb 21, 2024
1 parent c0db2dc commit e8bbe09
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 21 deletions.
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

0 comments on commit e8bbe09

Please sign in to comment.