Skip to content
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
37 changes: 6 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/TBC20/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"printWidth": 100,
"semi": false,
"singleQuote": true,
"trailingComma": "none"
"trailingComma": "all"
}
2 changes: 1 addition & 1 deletion packages/TBC20/src/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class TokenHelper implements ITBC20 {
publicKey: string,
amount: number,
name: string,
symbol: string
symbol: string,
): Promise<string | undefined> {
const args = [publicKey, amount, name, symbol]
const token = await this.computer.new(Token, args, this.mod)
Expand Down
2 changes: 1 addition & 1 deletion packages/TBC20/test/token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe('Token', async () => {
const { tx, effect } = await receiver.encodeCall({
target: token2,
property: 'transfer',
args: [sender.getPublicKey()]
args: [sender.getPublicKey()],
})
await receiver.broadcast(tx)

Expand Down
2 changes: 1 addition & 1 deletion packages/TBC721/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"printWidth": 100,
"semi": false,
"singleQuote": true,
"trailingComma": "none"
"trailingComma": "all"
}
4 changes: 2 additions & 2 deletions packages/chat/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"printWidth": 100,
"semi": false,
"singleQuote": false,
"trailingComma": "none"
"singleQuote": true,
"trailingComma": "all"
}
2 changes: 1 addition & 1 deletion packages/chess-app-server/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"printWidth": 100,
"semi": false,
"singleQuote": true,
"trailingComma": "none"
"trailingComma": "all"
}
4 changes: 2 additions & 2 deletions packages/chess-app/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"printWidth": 100,
"semi": false,
"singleQuote": false,
"trailingComma": "none"
"singleQuote": true,
"trailingComma": "all"
}
4 changes: 2 additions & 2 deletions packages/components/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"printWidth": 100,
"semi": false,
"singleQuote": false,
"trailingComma": "none"
"singleQuote": true,
"trailingComma": "all"
}
4 changes: 2 additions & 2 deletions packages/explorer/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"printWidth": 100,
"semi": false,
"singleQuote": false,
"trailingComma": "none"
"singleQuote": true,
"trailingComma": "all"
}
20 changes: 10 additions & 10 deletions packages/lib/dist/bc-lib.browser.min.mjs

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions packages/lib/dist/bc-lib.commonjs.min.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/lib/dist/bc-lib.main.es.mjs

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions packages/lib/dist/bc-lib.module.es.mjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/nft/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"printWidth": 100,
"semi": false,
"singleQuote": false,
"trailingComma": "none"
"singleQuote": true,
"trailingComma": "all"
}
2 changes: 1 addition & 1 deletion packages/nodejs-template/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"printWidth": 100,
"semi": false,
"singleQuote": true,
"trailingComma": "none"
"trailingComma": "all"
}
2 changes: 1 addition & 1 deletion packages/swap/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"printWidth": 100,
"semi": false,
"singleQuote": true,
"trailingComma": "none"
"trailingComma": "all"
}
2 changes: 1 addition & 1 deletion packages/swap/build/src/ord-sale.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class OrdSaleHelper {
sighashType: SIGHASH_SINGLE | SIGHASH_ANYONECANPAY,
inputIndex: 2,
fund: false,
mod: this.mod
mod: this.mod,
});
}
static checkSaleTx() {
Expand Down
2 changes: 1 addition & 1 deletion packages/swap/build/src/payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class PaymentHelper {
const exp = `new Payment(${amount})`;
return this.computer.encode({
exp,
mod: this.mod
mod: this.mod,
});
}
async getPayment(paymentTxId) {
Expand Down
2 changes: 1 addition & 1 deletion packages/swap/build/src/sale.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class SaleHelper {
sighashType,
inputIndex: 0,
fund: false,
mod: this.mod
mod: this.mod,
});
}
async isSaleTx(tx) {
Expand Down
4 changes: 2 additions & 2 deletions packages/swap/build/src/static-swap.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class StaticSwapHelper {
return this.computer.encode({
exp: `StaticSwap.exec(a, b)`,
env: { a: a._rev, b: b._rev },
mod: this.mod
mod: this.mod,
});
}
async checkSwapTx(tx, pubKeyA, pubKeyB) {
Expand All @@ -28,7 +28,7 @@ export class StaticSwapHelper {
throw new Error('Unexpected expression');
if (mod !== this.mod)
throw new Error('Unexpected module specifier');
const { effect: { res: r, env: e } } = await this.computer.encode({ exp, env, mod });
const { effect: { res: r, env: e }, } = await this.computer.encode({ exp, env, mod });
if (r !== undefined)
throw new Error('Unexpected result');
if (Object.keys(e).toString() !== 'a,b')
Expand Down
4 changes: 2 additions & 2 deletions packages/swap/build/src/swap.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class SwapHelper {
return this.computer.encode({
exp: `new Swap(a, b)`,
env: { a: a._rev, b: b._rev },
mod: this.mod
mod: this.mod,
});
}
async checkSwapTx(tx, pubKeyA, pubKeyB) {
Expand All @@ -29,7 +29,7 @@ export class SwapHelper {
throw new Error('Unexpected expression');
if (mod !== this.mod)
throw new Error('Unexpected module specifier');
const { effect: { res: r, env: e } } = await this.computer.encode({ exp, env, mod });
const { effect: { res: r, env: e }, } = await this.computer.encode({ exp, env, mod });
if (r === undefined)
throw new Error('Unexpected result');
if (Object.keys(e).toString() !== 'a,b')
Expand Down
4 changes: 2 additions & 2 deletions packages/swap/build/src/tx-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ export class TxWrapperHelper {
return this.computer.encode({
exp,
exclude,
mod: this.mod
mod: this.mod,
});
}
async addSaleTx(txWrapperTxId, tx) {
const { res: txWrapper } = (await this.computer.sync(txWrapperTxId));
return this.computer.encode({
exp: `txWrapper.addSaleTx("${tx.serialize()}")`,
exclude: tx.getInRevs(),
env: { txWrapper: txWrapper._rev }
env: { txWrapper: txWrapper._rev },
});
}
async decodeTx(txWrapperTxId) {
Expand Down
4 changes: 2 additions & 2 deletions packages/swap/build/src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const getMockedRev = () => `mock:${'0'.repeat(64)}:${Math.floor(Math.rand
export const RLTC = {
network: 'regtest',
chain: 'LTC',
url: 'http://localhost:1031'
url: 'http://localhost:1031',
};
const isString = (x) => typeof x === 'string';
const isNumber = (x) => typeof x === 'number';
Expand All @@ -12,5 +12,5 @@ export const meta = {
_rev: isString,
_root: isString,
_owners: isArray,
_amount: isNumber
_amount: isNumber,
};
4 changes: 2 additions & 2 deletions packages/swap/src/ord-sale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class OrdSaleHelper {
sighashType: SIGHASH_SINGLE | SIGHASH_ANYONECANPAY,
inputIndex: 2,
fund: false,
mod: this.mod
mod: this.mod,
})
}

Expand All @@ -54,7 +54,7 @@ export class OrdSaleHelper {
b1: Payment,
b2: Payment,
payment: Payment,
scriptPubKey: Buffer
scriptPubKey: Buffer,
) {
const [b1TxId, b1Index] = b1._rev.split(':')
tx.updateInput(0, { txId: b1TxId, index: parseInt(b1Index, 10) })
Expand Down
2 changes: 1 addition & 1 deletion packages/swap/src/payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class PaymentHelper {
const exp = `new Payment(${amount})`
return this.computer.encode({
exp,
mod: this.mod
mod: this.mod,
})
}

Expand Down
2 changes: 1 addition & 1 deletion packages/swap/src/sale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class SaleHelper {
sighashType,
inputIndex: 0,
fund: false,
mod: this.mod
mod: this.mod,
})
}

Expand Down
4 changes: 2 additions & 2 deletions packages/swap/src/static-swap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class StaticSwapHelper {
return this.computer.encode({
exp: `StaticSwap.exec(a, b)`,
env: { a: a._rev, b: b._rev },
mod: this.mod
mod: this.mod,
})
}

Expand All @@ -38,7 +38,7 @@ export class StaticSwapHelper {
if (mod !== this.mod) throw new Error('Unexpected module specifier')

const {
effect: { res: r, env: e }
effect: { res: r, env: e },
} = await this.computer.encode({ exp, env, mod })

if (r !== undefined) throw new Error('Unexpected result')
Expand Down
4 changes: 2 additions & 2 deletions packages/swap/src/swap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class SwapHelper {
return this.computer.encode({
exp: `new Swap(a, b)`,
env: { a: a._rev, b: b._rev },
mod: this.mod
mod: this.mod,
})
}

Expand All @@ -40,7 +40,7 @@ export class SwapHelper {
if (mod !== this.mod) throw new Error('Unexpected module specifier')

const {
effect: { res: r, env: e }
effect: { res: r, env: e },
} = await this.computer.encode({ exp, env, mod })

if (r === undefined) throw new Error('Unexpected result')
Expand Down
4 changes: 2 additions & 2 deletions packages/swap/src/tx-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class TxWrapperHelper {
return this.computer.encode({
exp,
exclude,
mod: this.mod
mod: this.mod,
})
}

Expand All @@ -45,7 +45,7 @@ export class TxWrapperHelper {
return this.computer.encode({
exp: `txWrapper.addSaleTx("${tx.serialize()}")`,
exclude: tx.getInRevs(),
env: { txWrapper: txWrapper._rev }
env: { txWrapper: txWrapper._rev },
})
}

Expand Down
4 changes: 2 additions & 2 deletions packages/swap/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const RLTC: {
} = {
network: 'regtest',
chain: 'LTC',
url: 'http://localhost:1031'
url: 'http://localhost:1031',
}

const isString = (x: any) => typeof x === 'string'
Expand All @@ -19,5 +19,5 @@ export const meta = {
_rev: isString,
_root: isString,
_owners: isArray,
_amount: isNumber
_amount: isNumber,
}
4 changes: 2 additions & 2 deletions packages/swap/test/ord-sale.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('Ord Sale', () => {
// eslint-disable-next-line no-bitwise
sighashType: SIGHASH_SINGLE | SIGHASH_ANYONECANPAY,
inputIndex: 2,
fund: false
fund: false,
})

// Buyer creates a payment object with the asking price
Expand Down Expand Up @@ -193,7 +193,7 @@ describe('Ord Sale', () => {
_rev: _.isString,
_root: _.isString,
_owners: [buyer.getPublicKey()],
_amount: nftPrice
_amount: nftPrice,
})
})

Expand Down
Loading