Skip to content

Commit

Permalink
Merge branch 'master' into rel/latest
Browse files Browse the repository at this point in the history
  • Loading branch information
alebusse committed Jun 21, 2024
2 parents 8c90ec6 + fde27b2 commit 325451f
Show file tree
Hide file tree
Showing 17 changed files with 223 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ COPY --from=builder /tmp/bitgo/modules/blake2b /var/modules/blake2b/
COPY --from=builder /tmp/bitgo/modules/blake2b-wasm /var/modules/blake2b-wasm/
COPY --from=builder /tmp/bitgo/modules/bitgo /var/modules/bitgo/
COPY --from=builder /tmp/bitgo/modules/abstract-utxo /var/modules/abstract-utxo/
COPY --from=builder /tmp/bitgo/modules/abstract-lightning /var/modules/abstract-lightning/
COPY --from=builder /tmp/bitgo/modules/blockapis /var/modules/blockapis/
COPY --from=builder /tmp/bitgo/modules/sdk-api /var/modules/sdk-api/
COPY --from=builder /tmp/bitgo/modules/unspents /var/modules/unspents/
Expand Down Expand Up @@ -115,6 +116,7 @@ cd /var/modules/blake2b && yarn link && \
cd /var/modules/blake2b-wasm && yarn link && \
cd /var/modules/bitgo && yarn link && \
cd /var/modules/abstract-utxo && yarn link && \
cd /var/modules/abstract-lightning && yarn link && \
cd /var/modules/blockapis && yarn link && \
cd /var/modules/sdk-api && yarn link && \
cd /var/modules/unspents && yarn link && \
Expand Down Expand Up @@ -185,6 +187,7 @@ RUN cd /var/bitgo-express && \
yarn link @bitgo/blake2b-wasm && \
yarn link bitgo && \
yarn link @bitgo/abstract-utxo && \
yarn link @bitgo/abstract-lightning && \
yarn link @bitgo/blockapis && \
yarn link @bitgo/sdk-api && \
yarn link @bitgo/unspents && \
Expand Down Expand Up @@ -244,9 +247,9 @@ RUN cd /var/bitgo-express && \
#LINK_END

#LABEL_START
LABEL created="Thu, 20 Jun 2024 20:34:47 GMT"
LABEL version=10.0.2
LABEL git_hash=a727c5989fe0b63e5c71dd2c3d8ebd04c41dcff3
LABEL created="Thu, 20 Jun 2024 08:36:08 GMT"
LABEL version=10.0.1
LABEL git_hash=43ca8bc9facbe84d6dbf8cd6dc25da59a35aaf03
#LABEL_END

USER node
Expand Down
5 changes: 5 additions & 0 deletions modules/abstract-lightning/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.idea
public
dist

3 changes: 3 additions & 0 deletions modules/abstract-lightning/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
.idea/
dist/
8 changes: 8 additions & 0 deletions modules/abstract-lightning/.mocharc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require: 'ts-node/register'
timeout: '60000'
reporter: 'min'
reporter-option:
- 'cdn=true'
- 'json=false'
exit: true
spec: ['test/unit/**/*.ts']
14 changes: 14 additions & 0 deletions modules/abstract-lightning/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
!dist/
dist/test/
dist/tsconfig.tsbuildinfo
.idea/
.prettierrc.yml
tsconfig.json
src/
test/
scripts/
.nyc_output
CODEOWNERS
node_modules/
.prettierignore
.mocharc.js
2 changes: 2 additions & 0 deletions modules/abstract-lightning/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.nyc_output/
dist/
3 changes: 3 additions & 0 deletions modules/abstract-lightning/.prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
printWidth: 120
singleQuote: true
trailingComma: 'es5'
1 change: 1 addition & 0 deletions modules/abstract-lightning/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# BitGo abstract-lightning
42 changes: 42 additions & 0 deletions modules/abstract-lightning/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "@bitgo/abstract-lightning",
"version": "1.0.0",
"description": "BitGo SDK coin library for base Lightning Network coin implementation",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
"build": "yarn tsc --build --incremental --verbose .",
"fmt": "prettier --write .",
"check-fmt": "prettier --check .",
"clean": "rm -r ./dist",
"lint": "eslint --quiet .",
"prepare": "npm run build"
},
"author": "BitGo SDK Team <[email protected]>",
"license": "MIT",
"engines": {
"node": ">=18 <21"
},
"repository": {
"type": "git",
"url": "https://github.com/BitGo/BitGoJS.git",
"directory": "modules/abstract-lightning"
},
"lint-staged": {
"*.{js,ts}": [
"yarn prettier --write",
"yarn eslint --fix"
]
},
"publishConfig": {
"access": "public"
},
"nyc": {
"extension": [
".ts"
]
},
"dependencies": {
"@bitgo/sdk-core": "^27.1.0"
}
}
49 changes: 49 additions & 0 deletions modules/abstract-lightning/src/abstractLightningCoin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import {
BaseCoin,
BitGoBase,
KeyPair,
ParsedTransaction,
ParseTransactionOptions,
SignedTransaction,
SignTransactionOptions,
VerifyAddressOptions,
VerifyTransactionOptions,
} from '@bitgo/sdk-core';

export abstract class AbstractLightningCoin extends BaseCoin {
protected constructor(bitgo: BitGoBase) {
super(bitgo);
}

getBaseFactor(): number {
throw new Error('Method not implemented.');
}

verifyTransaction(params: VerifyTransactionOptions): Promise<boolean> {
throw new Error('Method not implemented.');
}

isWalletAddress(params: VerifyAddressOptions): Promise<boolean> {
throw new Error('Method not implemented.');
}

parseTransaction(params: ParseTransactionOptions): Promise<ParsedTransaction> {
throw new Error('Method not implemented.');
}

generateKeyPair(seed?: Buffer): KeyPair {
throw new Error('Method not implemented.');
}

isValidPub(pub: string): boolean {
throw new Error('Method not implemented.');
}

isValidAddress(address: string): boolean {
throw new Error('Method not implemented.');
}

signTransaction(params: SignTransactionOptions): Promise<SignedTransaction> {
throw new Error('Method not implemented.');
}
}
1 change: 1 addition & 0 deletions modules/abstract-lightning/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './abstractLightningCoin';
23 changes: 23 additions & 0 deletions modules/abstract-lightning/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./",
"strictPropertyInitialization": false,
"esModuleInterop": true,
"typeRoots": ["../../types", "./node_modules/@types", "../../node_modules/@types"]
},
"include": ["src/**/*", "test/**/*"],
"exclude": ["node_modules"],
"references": [
{
"path": "../sdk-api"
},
{
"path": "../sdk-core"
},
{
"path": "../sdk-test"
}
]
}
2 changes: 2 additions & 0 deletions modules/bitgo/src/v2/coins/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { AbstractUtxoCoin } from '@bitgo/abstract-utxo';
import { AbstractLightningCoin } from '@bitgo/abstract-lightning';
import { Ada, Tada } from '@bitgo/sdk-coin-ada';
import { Algo, AlgoToken, Talgo } from '@bitgo/sdk-coin-algo';
import { Arbeth, Tarbeth, ArbethToken } from '@bitgo/sdk-coin-arbeth';
Expand Down Expand Up @@ -49,6 +50,7 @@ import { Tzeta, Zeta } from '@bitgo/sdk-coin-zeta';
import { Zketh, Tzketh, ZkethToken } from '@bitgo/sdk-coin-zketh';

export { AbstractUtxoCoin };
export { AbstractLightningCoin };
export { Algo, AlgoToken, Talgo };
export { Arbeth, Tarbeth, ArbethToken };
export { Ada, Tada };
Expand Down
1 change: 1 addition & 0 deletions modules/bitgo/test/browser/browser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('Coins', () => {
// these objects are defined in BitGoJS.Coin, but are not coins in the traditional sense
const excludedKeys = {
AbstractUtxoCoin: 1,
AbstractLightningCoin: 1,
Erc20Token: 1,
EthLikeCoin: 1,
TethLikeCoin: 1,
Expand Down
3 changes: 3 additions & 0 deletions modules/bitgo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
{
"path": "../abstract-utxo"
},
{
"path": "../abstract-lightning"
},
{
"path": "../sdk-api"
},
Expand Down
57 changes: 57 additions & 0 deletions modules/statics/src/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,63 @@ export const coins = CoinMap.fromCoins([
UnderlyingAsset['sol:hnt'],
SOL_TOKEN_FEATURES
),
tofcsolToken(
'24d678cf-e0f0-4cde-a338-d754289c5b27',
'ofctsol:slnd',
'testnet SOLEND',
9,
UnderlyingAsset['sol:slnd'],
SOL_TOKEN_FEATURES
),
tofcsolToken(
'5610a965-d046-46e2-9077-40f496be3f18',
'ofctsol:orca',
'testnet ORCA',
9,
UnderlyingAsset['sol:orca'],
SOL_TOKEN_FEATURES
),
tofcsolToken(
'6fd31137-ab29-441e-9136-8b4bad4f0477',
'ofctsol:usdc',
'testnet USD Coin',
6,
UnderlyingAsset['sol:usdc'],
SOL_TOKEN_FEATURES
),
tofcsolToken(
'431a593e-0396-4d68-9db6-901d312df47d',
'ofctsol:ray',
'testnet Raydium',
9,
UnderlyingAsset['sol:ray'],
SOL_TOKEN_FEATURES
),
tofcsolToken(
'ff1955c9-988d-4c9e-86e7-cf589bb3d66f',
'ofctsol:gmt',
'testnet GMT',
9,
UnderlyingAsset['sol:gmt'],
SOL_TOKEN_FEATURES
),
tofcsolToken(
'308d63c0-3a74-49c9-98d8-a4fe52e58226',
'ofctsol:usdt',
'testnet USD Tether',
9,
UnderlyingAsset['sol:usdt'],
SOL_TOKEN_FEATURES
),
tofcsolToken(
'73a332da-1abf-4c4b-b5b5-f03fe36738cb',
'ofctsol:srm',
'testnet Serum',
9,
UnderlyingAsset['sol:srm'],
SOL_TOKEN_FEATURES
),

tofcsolToken(
'20b20bc7-86b8-4f58-a8e9-a7cedbc2a507',
'ofctsol:gari',
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
{
"path": "./modules/abstract-utxo"
},
{
"path": "./modules/abstract-lightning"
},
{
"path": "./modules/account-lib"
},
Expand Down

0 comments on commit 325451f

Please sign in to comment.