Skip to content

Commit

Permalink
Merge pull request #14 from opening-line/0.10.0.4_capable
Browse files Browse the repository at this point in the history
chore: 🤖 0.10.0.4 capable
  • Loading branch information
daoka authored Jan 5, 2021
2 parents bb37df5 + 2886003 commit 46928f6
Show file tree
Hide file tree
Showing 10 changed files with 174 additions and 83 deletions.
6 changes: 4 additions & 2 deletions examples/AnnounceCreateApostille.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ const account = Account.createFromPrivateKey(ownerKey, networkType);

const apiEndpoint = 'https://sym-test.opening-line.jp:3001';
const generationHash = '6C1B92391CCB41C96478471C2634C111D9E989DECD66130C0430B5B8D20117CD';
const feeMultiplier = 100;
const feeMultiplier = 1000;
const repositoryFactory = new RepositoryFactoryHttp(
apiEndpoint,
{ generationHash, networkType }
);
const epochAdjustment = 1573430400;

const apostilleTransaction = ApostilleTransaction.createFromData(
data,
Expand All @@ -26,7 +27,8 @@ const apostilleTransaction = ApostilleTransaction.createFromData(
networkType,
generationHash,
feeMultiplier,
apiEndpoint
apiEndpoint,
epochAdjustment,
);

apostilleTransaction.singedTransactionAndAnnounceType().then((info) => {
Expand Down
8 changes: 5 additions & 3 deletions examples/AnnounceUpdateApostille.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const networkType = NetworkType.TEST_NET;

const data = 'Hello World!!';

const apostilleAccountKey = 'D9CCB105BDD459432EC7E0A36195F764B210A4ED3BBEEB32BA87D9435C239C09';
const apostilleAccountKey = 'DABCF0362900EE64F17187EAEDF43793EF48F6796846B7595F7F6E7E77A6F001';
const apostilleAccount = Account.createFromPrivateKey(apostilleAccountKey, networkType);

const ownerKey = '3E04C96EBAE99124A1D388B05EBD007AA06CB917E09CA08F5859B3ADC49A148D';
Expand All @@ -19,7 +19,8 @@ const repositoryFactory = new RepositoryFactoryHttp(
apiEndpoint,
{ generationHash, networkType }
);
const feeMultiplier = 100;
const feeMultiplier = 1000;
const epochAdjustment = 1573430400;

const apostilleTx = ApostilleTransaction.updateFromData(
data,
Expand All @@ -29,7 +30,8 @@ const apostilleTx = ApostilleTransaction.updateFromData(
networkType,
generationHash,
feeMultiplier,
apiEndpoint
apiEndpoint,
epochAdjustment,
);

apostilleTx.singedTransactionAndAnnounceType().then((info) => {
Expand Down
11 changes: 7 additions & 4 deletions examples/ApostilleAssignOwners.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-console */
import { NetworkType, Account, RepositoryFactoryHttp, Address, HashLockTransaction, Deadline, NetworkCurrencyPublic, UInt64, TransactionService } from 'symbol-sdk';
import { NetworkType, Account, RepositoryFactoryHttp, Address, HashLockTransaction, Deadline, UInt64, TransactionService, Currency } from 'symbol-sdk';
import { IApostilleOptions, ApostilleTransaction } from '../src/model';
import { HashingType } from '../src/utils/hash';

Expand All @@ -15,7 +15,9 @@ const owner2 = Address.createFromRawAddress('TBCCZ3HXPZLPQBEY6LZ2A3NE6WL5DHKZOMW

const apiEndpoint = 'https://sym-test.opening-line.jp:3001';
const generationHash = '6C1B92391CCB41C96478471C2634C111D9E989DECD66130C0430B5B8D20117CD';
const feeMultiplier = 400;
const feeMultiplier = 1000;
const epochAdjustment = 1573430400;

const repositoryFactory = new RepositoryFactoryHttp(
apiEndpoint,
{ generationHash, networkType }
Expand All @@ -40,15 +42,16 @@ const apostilleTransaction = ApostilleTransaction.createFromData(
generationHash,
feeMultiplier,
apiEndpoint,
epochAdjustment,
option
);

apostilleTransaction.singedTransactionAndAnnounceType().then((info) => {
const signedTx = info.signedTransaction;
console.log(signedTx.hash);
const hashLockTx = HashLockTransaction.create(
Deadline.create(),
NetworkCurrencyPublic.createRelative(10),
Deadline.create(epochAdjustment),
Currency.PUBLIC.createRelative(10),
UInt64.fromUint(480),
signedTx,
networkType,
Expand Down
5 changes: 4 additions & 1 deletion examples/ApostilleWithMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ const account = Account.createFromPrivateKey(singerKey, networkType);

const apiEndpoint = 'https://sym-test.opening-line.jp:3001';
const generationHash = '6C1B92391CCB41C96478471C2634C111D9E989DECD66130C0430B5B8D20117CD';
const feeMultiplier = 100;
const feeMultiplier = 1000;
const epochAdjustment = 1573430400;

const repositoryFactory = new RepositoryFactoryHttp(
apiEndpoint,
{ generationHash, networkType }
Expand All @@ -37,6 +39,7 @@ const apostilleTransaction = ApostilleTransaction.createFromData(
generationHash,
feeMultiplier,
apiEndpoint,
epochAdjustment,
option
);

Expand Down
2 changes: 1 addition & 1 deletion examples/AuditApostille.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { AuditService } from '../src/service';

const data = 'Hello World!';
const txHash = 'E4736F00707FC818A606274CACF03C32BA6F437CFE55551BC6CF00C920B8DA9C';
const txHash = 'CC0987CA2939DF9DB3C9A7A951DDE86B695FD7F09DF68EB6A152616D5DF202F4';
const apiEndpoint = 'https://sym-test.opening-line.jp:3001';

AuditService.audit(data, txHash, apiEndpoint).then((result) => {
Expand Down
Loading

0 comments on commit 46928f6

Please sign in to comment.