Skip to content

Commit

Permalink
chore: bump @iota/sdk from 1.0.9 to 1.1.0 in /packages/shared (#872)
Browse files Browse the repository at this point in the history
* chore: bump @iota/sdk from 1.0.9 to 1.1.0 in /packages/shared

Bumps [@iota/sdk](https://github.com/iotaledger/iota-sdk) from 1.0.9 to 1.1.0.
- [Release notes](https://github.com/iotaledger/iota-sdk/releases)
- [Changelog](https://github.com/iotaledger/iota-sdk/blob/develop/CHANGELOG.md)
- [Commits](iotaledger/iota-sdk@iota-sdk-nodejs-v1.0.9...cli-wallet-v1.1.0)

---
updated-dependencies:
- dependency-name: "@iota/sdk"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore: update yarn.lock

* chore: update account interface with new methods

* feat: use backend filter

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tuditi <[email protected]>
Co-authored-by: Tuditi <[email protected]>
  • Loading branch information
3 people authored Oct 4, 2023
1 parent f36c2fb commit d9a672a
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@iota/transaction-converter": "1.0.0-beta.30",
"@iota/unit-converter": "1.0.0-beta.30",
"@iota/util.js": "2.0.0-rc.2",
"@iota/sdk": "1.0.9",
"@iota/sdk": "1.1.0",
"@sveltejs/svelte-virtual-list": "3.0.1",
"@walletconnect/jsonrpc-types": "1.0.3",
"@walletconnect/types": "2.9.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,20 @@ import type {
SendParams,
SignedTransactionEssence,
SyncOptions,
TokenId,
Transaction,
TransactionOptions,
} from '@iota/sdk'

export interface IAccount {
addresses(): Promise<AccountAddress[]>
addressesWithUnspentOutputs(): Promise<AddressWithUnspentOutputs[]>
burn(burn: Burn, transactionOptions?: TransactionOptions): Promise<Transaction>
consolidateOutputs(params: ConsolidationParams): Promise<Transaction>
claimableOutputs(outputs: OutputsToClaim): Promise<string[]>
claimOutputs(outputIds: string[]): Promise<Transaction>
createAliasOutput(params?: AliasOutputParams, transactionOptions?: TransactionOptions): Promise<Transaction>
createNativeToken(params: CreateNativeTokenParams, transactionOptions?: TransactionOptions): Promise<Transaction>
deregisterParticipationEvent(eventId: string): Promise<void>
generateEd25519Addresses(amount: number, options?: GenerateAddressOptions): Promise<AccountAddress[]>
getBalance(): Promise<Balance>
Expand All @@ -55,6 +60,9 @@ export interface IAccount {
getTransaction(transactionId: string): Promise<Transaction>
incomingTransactions(): Promise<Transaction[]>
outputs(filterOptions?: FilterOptions): Promise<OutputData[]>
meltNativeToken(tokenId: TokenId, meltAmount: bigint, transactionOptions?: TransactionOptions): Promise<Transaction>
mintNativeToken(tokenId: TokenId, mintAmount: bigint, transactionOptions?: TransactionOptions): Promise<Transaction>
mintNfts(params: MintNftParams[], transactionOptions?: TransactionOptions): Promise<Transaction>
pendingTransactions(): Promise<Transaction[]>
prepareBurn(burn: Burn, transactionOptions?: TransactionOptions): Promise<PreparedTransaction>
prepareBurnNativeToken(
Expand Down Expand Up @@ -102,6 +110,9 @@ export interface IAccount {
requestFundsFromFaucet(url: string, address: string): Promise<string>
send(amount: bigint | string, address: string, transactionOptions?: TransactionOptions): Promise<Transaction>
sendOutputs(outputs: Output[], transactionOptions?: TransactionOptions): Promise<Transaction>
sendNativeTokens(params: SendNativeTokensParams[], transactionOptions?: TransactionOptions): Promise<Transaction>
sendTransaction(outputs: Output[], options?: TransactionOptions): Promise<Transaction>
sendNft(params: SendNftParams[], transactionOptions?: TransactionOptions): Promise<Transaction>
sendWithParams(params: SendParams[], transactionOptions?: TransactionOptions): Promise<Transaction>
setAlias(alias: string): Promise<void>
setDefaultSyncOptions(options: SyncOptions): Promise<void>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ async function loadNftsForAccount(account: IAccountState): Promise<void> {
}
}

const allOutputs = await account.outputs()
const sortedNftOutputs = allOutputs
.filter((output) => output.output.type === OutputType.Nft)
.sort((a, b) => b.metadata.milestoneTimestampBooked - a.metadata.milestoneTimestampBooked)
const nftOutputs = await account.outputs({ outputTypes: [OutputType.Nft] })
const sortedNftOutputs = nftOutputs.sort(
(a, b) => b.metadata.milestoneTimestampBooked - a.metadata.milestoneTimestampBooked
)
for (const outputData of sortedNftOutputs) {
if (outputData.output.type === OutputType.Nft) {
const nftOutput = outputData.output as NftOutput
Expand Down
44 changes: 44 additions & 0 deletions packages/shared/test/mocks/account.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export class AccountMock implements IAccount {
return Promise.resolve([])
}

burn(burn: Burn, transactionOptions?: TransactionOptions): Promise<Transaction> {
throw new Error('Method not implemented.')
}

consolidateOutputs(params: ConsolidationParams): Promise<Transaction> {
throw new Error('Method not implemented.')
}
Expand All @@ -66,6 +70,14 @@ export class AccountMock implements IAccount {
throw new Error('Method not implemented.')
}

createAliasOutput(params?: AliasOutputParams, transactionOptions?: TransactionOptions): Promise<Transaction> {
throw new Error('Method not implemented.')
}

createNativeToken(params: CreateNativeTokenParams, transactionOptions?: TransactionOptions): Promise<Transaction> {
throw new Error('Method not implemented.')
}

deregisterParticipationEvent(eventId: string): Promise<void> {
throw new Error('Method not implemented.')
}
Expand Down Expand Up @@ -153,6 +165,26 @@ export class AccountMock implements IAccount {
throw new Error('Method not implemented.')
}

meltNativeToken(
tokenId: TokenId,
meltAmount: bigint,
transactionOptions?: TransactionOptions
): Promise<Transaction> {
throw new Error('Method not implemented.')
}

mintNativeToken(
tokenId: TokenId,
mintAmount: bigint,
transactionOptions?: TransactionOptions
): Promise<Transaction> {
throw new Error('Method not implemented.')
}

mintNfts(params: MintNftParams[], transactionOptions?: TransactionOptions): Promise<Transaction> {
throw new Error('Method not implemented.')
}

outputs(filterOptions?: FilterOptions): Promise<[]> {
return Promise.resolve([])
}
Expand Down Expand Up @@ -278,6 +310,18 @@ export class AccountMock implements IAccount {
throw new Error('Method not implemented.')
}

sendNativeTokens(params: SendNativeTokensParams[], transactionOptions?: TransactionOptions): Promise<Transaction> {
throw new Error('Method not implemented.')
}

sendTransaction(outputs: Output[], options?: TransactionOptions): Promise<Transaction> {
throw new Error('Method not implemented.')
}

sendNft(params: SendNftParams[], transactionOptions?: TransactionOptions): Promise<Transaction> {
throw new Error('Method not implemented.')
}

sendOutputs(outputs: Output[], transactionOptions?: TransactionOptions): Promise<Transaction> {
throw new Error('Method not implemented.')
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1358,10 +1358,10 @@
resolved "https://registry.yarnpkg.com/@iota/pad/-/pad-1.0.0-beta.30.tgz#de19728f8f1b09c20e2365d0da34945006760082"
integrity sha512-fnhPMPul18WunLq9Ni4rxzBFmhna6eaG8WroDg6GdQqSK/eN62uFHV8tpspJHXuCqwgCUVp6NpuUna7+B2OV9g==

"@iota/sdk@1.0.9":
version "1.0.9"
resolved "https://registry.yarnpkg.com/@iota/sdk/-/sdk-1.0.9.tgz#5aa791b8dd28332fbf97f42dc9e53bc72cd3a435"
integrity sha512-7q/TGh0ABGu+wkhpjS/H7rNuKFwV+4ayDvTGvvdGu4C6o3siDFJkeYrMgbcsMq2O6qEN1w2TJnIE9BYl0yyz9A==
"@iota/sdk@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@iota/sdk/-/sdk-1.1.0.tgz#0566f80071abf6699febc57403a90146ddc8ebce"
integrity sha512-+sPYFPICCTk5/Gr+7nGUma2GWtd335g0CQyQcpALe1ivexn/HcuExwcMs4naJPx41/4f3WAD27cIHa59yIZrgA==
dependencies:
"@types/node" "^18.15.12"
cargo-cp-artifact "^0.1.6"
Expand Down

0 comments on commit d9a672a

Please sign in to comment.