-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stub out new package for Sui CCTP protocol
- Loading branch information
1 parent
fa4ba4b
commit 8449747
Showing
6 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
"name": "@wormhole-foundation/sdk-sui-cctp", | ||
"version": "0.10.9", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/wormhole-foundation/wormhole-sdk-ts.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/wormhole-foundation/wormhole-sdk-ts/issues" | ||
}, | ||
"homepage": "https://github.com/wormhole-foundation/wormhole-sdk-ts#readme", | ||
"directories": { | ||
"test": "tests" | ||
}, | ||
"license": "Apache-2.0", | ||
"main": "./dist/cjs/index.js", | ||
"types": "./dist/cjs/index.d.ts", | ||
"module": "./dist/esm/index.js", | ||
"description": "SDK for Sui chains, used in conjunction with @wormhole-foundation/sdk", | ||
"files": [ | ||
"dist/esm", | ||
"dist/cjs" | ||
], | ||
"keywords": [ | ||
"wormhole", | ||
"sdk", | ||
"typescript", | ||
"connect", | ||
"sui" | ||
], | ||
"engines": { | ||
"node": ">=16" | ||
}, | ||
"sideEffects": [ | ||
"./dist/cjs/index.js", | ||
"./dist/esm/index.js" | ||
], | ||
"scripts": { | ||
"build:cjs": "tsc -p ./tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json", | ||
"build:esm": "tsc -p ./tsconfig.esm.json", | ||
"build": "npm run build:esm && npm run build:cjs", | ||
"rebuild": "npm run clean && npm run build", | ||
"clean": "rm -rf ./dist && rm -rf ./.turbo", | ||
"lint": "npm run prettier && eslint --fix ./src --ext .ts", | ||
"prettier": "prettier --write ./src" | ||
}, | ||
"dependencies": { | ||
"@mysten/sui.js": "^0.50.1", | ||
"@wormhole-foundation/sdk-connect": "0.10.9", | ||
"@wormhole-foundation/sdk-sui": "0.10.9" | ||
}, | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"react-native": { | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/cjs/index.js", | ||
"types": "./dist/cjs/index.d.ts", | ||
"default": "./dist/cjs/index.js" | ||
}, | ||
"import": { | ||
"types": "./dist/esm/index.d.ts", | ||
"default": "./dist/esm/index.js" | ||
}, | ||
"require": { | ||
"types": "./dist/cjs/index.d.ts", | ||
"default": "./dist/cjs/index.js" | ||
}, | ||
"default": { | ||
"types": "./dist/cjs/index.d.ts", | ||
"default": "./dist/cjs/index.js" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import type { SuiBuildOutput, SuiChains, SuiUnsignedTransaction } from "@wormhole-foundation/sdk-sui"; | ||
import { AccountAddress, ChainAddress, CircleBridge, CircleTransferMessage, circle } from '@wormhole-foundation/sdk-connect'; | ||
|
||
export class SuiCircleBridge<N extends Network, C extends SuiChains> | ||
implements CircleBridge<N, C> { | ||
|
||
async *transfer( | ||
sender: AccountAddress<C>, | ||
recipient: ChainAddress, | ||
amount: bigint, | ||
): AsyncGenerator<SuiUnsignedTransaction<N, C>> { | ||
/* TODO */ | ||
} | ||
|
||
async isTransferCompleted(message: CircleBridge.Message): Promise<boolean> { | ||
/* TODO */ | ||
return false; | ||
} | ||
|
||
async *redeem( | ||
sender: AccountAddress<C>, | ||
message: CircleBridge.Message, | ||
attestation: string, | ||
): AsyncGenerator<SuiUnsignedTransaction<N, C>> { | ||
/* TODO */ | ||
} | ||
|
||
async parseTransactionDetails(txid: string): Promise<CircleTransferMessage> { | ||
/* TODO */ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { registerProtocol } from '@wormhole-foundation/sdk-connect'; | ||
|
||
import { _platform } from '@wormhole-foundation/sdk-solana'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "../../../../tsconfig.cjs.json", | ||
"include": ["src"], | ||
"compilerOptions": { | ||
"outDir": "dist/cjs", | ||
"rootDir": "src" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "../../../../tsconfig.esm.json", | ||
"include": ["src"], | ||
"compilerOptions": { | ||
"outDir": "dist/esm", | ||
"rootDir": "src" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": ["../../../../typedoc.base.json"], | ||
"entryPoints": ["src/index.ts"], | ||
} |