Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sdk new release updates #690

Merged
merged 32 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
dff3f98
Update api-kit reference
yagopv Feb 10, 2025
f771e33
Reflect protocol-kit breaking changes
yagopv Feb 10, 2025
33d1906
FeeEstimator API change
yagopv Feb 10, 2025
b3a7859
Updates for custom nonces
yagopv Feb 10, 2025
0a7602d
Update Safe4337 guide
yagopv Feb 11, 2025
deea304
Add default module version
yagopv Feb 13, 2025
0f31f34
Update migration guide
yagopv Feb 14, 2025
3f198ac
Some updates
yagopv Feb 14, 2025
c64d5e4
Remove banner
yagopv Feb 14, 2025
fac62a2
Updates api-kit
yagopv Feb 14, 2025
fe70d1c
Update pages/reference-sdk-api-kit/getincomingtransactions.mdx
yagopv Feb 17, 2025
16a8740
Update pages/reference-sdk-api-kit/getpendingsafeoperations.mdx
yagopv Feb 17, 2025
ebce722
Rename file
yagopv Feb 17, 2025
4351536
Update pages/reference-sdk-api-kit/getsafeoperationsbyaddress.mdx
yagopv Feb 17, 2025
892b37f
Align type names
yagopv Feb 17, 2025
9ad9d9d
Publish api-kit migration guide
yagopv Feb 17, 2025
abe2779
Update pages/sdk/protocol-kit/guides/migrate-to-v6.md
yagopv Feb 20, 2025
a7e2e63
Set default safeModulesVersion to 0.2.0
yagopv Feb 20, 2025
37277d1
Merge branch 'sdk-new-release-updates' of https://github.com/safe-glo…
yagopv Feb 20, 2025
b0df31d
Add information about safe-operation endpoints in the api-kit
yagopv Feb 20, 2025
21bafc0
Update pages/core-api/transaction-service-guides/messages.mdx
louis-md Feb 27, 2025
44f38bf
Update pages/core-api/transaction-service-guides/messages.mdx
louis-md Feb 27, 2025
9dd7960
Update pages/core-api/transaction-service-guides/messages.mdx
louis-md Feb 27, 2025
682eea4
Update pages/core-api/transaction-service-guides/messages.mdx
louis-md Feb 27, 2025
3fcb5ef
Update pages/core-api/transaction-service-guides/messages.mdx
louis-md Feb 27, 2025
76b9b60
Update pages/core-api/transaction-service-guides/messages.mdx
louis-md Feb 27, 2025
d8fc924
Update pages/core-api/transaction-service-guides/messages.mdx
louis-md Feb 27, 2025
fb86666
Update pages/core-api/transaction-service-guides/messages.mdx
louis-md Feb 27, 2025
53855c5
Update pages/core-api/transaction-service-guides/messages.mdx
louis-md Feb 27, 2025
a3a6fc2
Update pages/core-api/transaction-service-guides/messages.mdx
louis-md Feb 27, 2025
58b38ac
Update pages/core-api/transaction-service-guides/messages.mdx
louis-md Feb 27, 2025
a9c29ba
Merge branch 'main' into sdk-new-release-updates
louis-md Feb 27, 2025
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
3 changes: 2 additions & 1 deletion pages/reference-sdk-api-kit/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"constructor": "constructor",
"getserviceinfo": "getServiceInfo",
"getservicesingletonsinfo": "getServiceSingletonsInfo",
"decodeddata": "decodedData",
"decodedata": "decodeData",
"getsafesbyowner": "getSafesByOwner",
"getsafesbymodule": "getSafesByModule",
"gettransaction": "getTransaction",
Expand All @@ -37,6 +37,7 @@
"addmessage": "addMessage",
"addmessagesignature": "addMessageSignature",
"getsafeoperationsbyaddress": "getSafeOperationsByAddress",
"getpendingsafeoperations": "getPendingSafeOperations",
"getsafeoperation": "getSafeOperation",
"addsafeoperation": "addSafeOperation",
"getsafeoperationconfirmations": "getSafeOperationConfirmations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,17 @@ Decodes the specified Safe transaction data.

## Returns

`Promise<any>`
`Promise<DataDecoded>`

The transaction data decoded.

```typescript
type DataDecoded = {
readonly method: string
readonly parameters: DecodedParameters[]
}
```

## Parameters

### `data`
Expand All @@ -45,8 +52,19 @@ The transaction data decoded.

The Safe transaction data to decode.

```typescript focus=2
```typescript
const decodedData = await apiKit.decodeData('0x...')
```

### `to` (Optional)

- **Type:** `string`

The address of the receiving contract. If provided, the decoded data will be more accurate, as in case of an ABI collision the Safe Transaction Service would know which ABI to use

```typescript
const decodedData = await apiKit.decodeData(
'0x...',
'0x...'
)
```
25 changes: 24 additions & 1 deletion pages/reference-sdk-api-kit/getincomingtransactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ Returns the history of incoming transactions of a Safe account.
import { apiKit } from './setup.ts'

const safeAddress = '0x...'
const options = {
_from: '0x...',
limit: 10,
offset: 10
}

const incomingTxs = await apiKit.getIncomingTransactions(safeAddress)
const incomingTxs = await apiKit.getIncomingTransactions(safeAddress, options)
```
</Tabs.Tab>
<Tabs.Tab>
Expand Down Expand Up @@ -50,3 +55,21 @@ const incomingTxs = await apiKit.getIncomingTransactions(
'0x...'
)
```

### `options.from` (Optional)

- **Type:** `string`

The transaction sender address.

### `options.limit` (Optional)

- **Type:** `number`

The number of results to return per page.

### `options.offset` (Optional)

- **Type:** `number`

The initial index from which to return the results.
27 changes: 24 additions & 3 deletions pages/reference-sdk-api-kit/getmoduletransactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ Returns the history of module transactions of a Safe account.
import { apiKit } from './setup.ts'

const safeAddress = '0x...'
const options = {
module: '0x...',
limit: 10,
offset: 10
}

const moduleTxs = await apiKit.getModuleTransactions(
safeAddress
)
const moduleTxs = await apiKit.getModuleTransactions(safeAddress, options)
```
</Tabs.Tab>
<Tabs.Tab>
Expand Down Expand Up @@ -52,3 +55,21 @@ const moduleTxs = await apiKit.getModuleTransactions(
'0x...'
)
```

### `options.module` (Optional)

- **Type:** `string`

The module to get the transactions from.

### `options.limit` (Optional)

- **Type:** `number`

The number of results to return per page.

### `options.offset` (Optional)

- **Type:** `number`

The initial index from which to return the results.
43 changes: 39 additions & 4 deletions pages/reference-sdk-api-kit/getmultisigtransactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ Returns the history of multi-signature transactions of a Safe account.
import { apiKit } from './setup.ts'

const safeAddress = '0x...'

const multisigTxs = await apiKit.getMultisigTransactions(
safeAddress
)
const options = {
executed: true,
nonce: '0x...',
ordering: 'created',
limit: 10,
offset: 10
}

const multisigTxs = await apiKit.getMultisigTransactions(safeAddress, options)
```
</Tabs.Tab>
<Tabs.Tab>
Expand Down Expand Up @@ -52,3 +57,33 @@ const multisigTxs = await apiKit.getMultisigTransactions(
'0x...'
)
```

### `options.executed` (Optional)

- **Type:** `boolean`

Filter the executed transactions if `true`.

### `options.nonce` (Optional)

- **Type:** `string`

The nonce used to return the results.

### `options.ordering` (Optional)

- **Type:** `string`

The field used to sort the results.

### `options.limit` (Optional)

- **Type:** `number`

The number of results to return per page.

### `options.offset` (Optional)

- **Type:** `number`

The initial index from which to return the results.
106 changes: 106 additions & 0 deletions pages/reference-sdk-api-kit/getpendingsafeoperations.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import { Tabs } from 'nextra/components'

# `getPendingSafeOperations`

Returns the list of Safe operations which are pending to be executed through a bundler.

## Usage

{/* <!-- vale off --> */}

<Tabs items={['example.ts', 'setup.ts']}>
<Tabs.Tab>
```typescript
import { GetSafeOperationListProps } from '@safe-global/api-kit'
import { apiKit } from './setup.ts'

const safeAddress = '0x...'
const options: GetPendingSafeOperationListOptions = {
ordering: 'created', // Optional
limit: '10', // Optional
offset: '50' // Optional
}

const safeOperationsResponse = await apiKit.getPendingSafeOperations(safeAddress, options)
```
</Tabs.Tab>
<Tabs.Tab>
```typescript
import SafeApiKit from '@safe-global/api-kit'

export const apiKit = new SafeApiKit({
chainId: 1n, // Mainnet
})
```
</Tabs.Tab>
</Tabs>

{/* <!-- vale on --> */}

## Returns

`Promise<GetSafeOperationListResponse>`

The paginated list of Safe operations.

## Parameters

### `safeAddress`

- **Type:** `string`

The Safe address.

```typescript focus=2
const safeOperationsResponse = await apiKit.getPendingSafeOperations({
safeAddress: '0x...'
})
```

### `options.ordering` (Optional)

- **Type:** `string`
- **Default:** `-user_operation__nonce`

The field used when ordering the results.

Can be one of: `-user_operation__nonce`, `-created`, `created`.

```typescript focus=4
const safeOperationsResponse = await apiKit.getPendingSafeOperations(
{
safeAddress: '0x...',
ordering: 'created'
}
)
```

### `options.limit` (Optional)

- **Type:** `number`

The number of results to return per page.

```typescript focus=4
const safeOperationsResponse = await apiKit.getPendingSafeOperations(
{
safeAddress: '0x...',
limit: 10
}
)
```

### `options.offset` (Optional)

- **Type:** `number`

The initial index from which to return the results.

```typescript focus=4
const safeOperationsResponse = await apiKit.getPendingSafeOperations(
{
safeAddress: '0x...',
offset: 50
}
)
```
49 changes: 34 additions & 15 deletions pages/reference-sdk-api-kit/getpendingtransactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ Returns the list of multi-signature transactions that are waiting for the confir
```typescript
import { apiKit } from './setup.ts'

const safeAddress = '0x...'

const currentNonce = 10

const pendingTxs = await apiKit.getPendingTransactions(
safeAddress,
currentNonce // Optional
)
const safeAddress = '0x...'
const options = {
currentNonce: 0,
hasConfirmations: true,
ordering: 'created',
limit: 10,
offset: 10
}

const pendingTxs = await apiKit.getPendingTransactions(safeAddress, options)
```
</Tabs.Tab>
<Tabs.Tab>
Expand Down Expand Up @@ -56,15 +58,32 @@ const pendingTxs = await apiKit.getPendingTransactions(
)
```

### `currentNonce` (Optional)
### `options.currentNonce` (Optional)

- **Type:** `number`

The current nonce of the Safe.

```typescript focus=3
const pendingTxs = await apiKit.getPendingTransactions(
'0x...',
10
)
```
### `options.hasConfirmations` (Optional)

- **Type:** `boolean`

Filter transactions with al least one confirmation.

### `options.ordering` (Optional)

- **Type:** `string`

The field used to sort the results.

### `options.limit` (Optional)

- **Type:** `number`

The number of results to return per page.

### `options.offset` (Optional)

- **Type:** `number`

The initial index from which to return the results.
Loading
Loading