const options = {method: 'GET'};
fetch('https://swap.ggp.gg/api/{blockchain}/permit/data', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"alreadyApproved": true,
"alreadyPermit": true,
"data": {
"permit": {
"details": {
"amount": "0xffffffffffffffffffffffffffffffffffffffff",
"expiration": "0x69daab1d",
"nonce": "0x0",
"token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
},
"sigDeadline": "0x69b46f9d",
"spender": "0xeee3fdcc5b9d7821570294b26070b2f45cfd8aec"
},
"typedData": {
"domain": {
"chainId": "0x1",
"name": "Permit2",
"verifyingContract": "0x000000000022d473030f116ddee9f6b43ac78ba3"
},
"message": {
"details": {
"amount": "0xffffffffffffffffffffffffffffffffffffffff",
"expiration": "0x69daab1d",
"nonce": "0x0",
"token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
},
"sigDeadline": "0x69b46f9d",
"spender": "0xeee3fdcc5b9d7821570294b26070b2f45cfd8aec"
},
"primaryType": "PermitSingle",
"types": {
"EIP712Domain": [
{
"name": "name",
"type": "string"
},
{
"name": "chainId",
"type": "uint256"
},
{
"name": "verifyingContract",
"type": "address"
}
],
"PermitDetails": [
{
"name": "token",
"type": "address"
},
{
"name": "amount",
"type": "uint160"
},
{
"name": "expiration",
"type": "uint48"
},
{
"name": "nonce",
"type": "uint48"
}
],
"PermitSingle": [
{
"name": "details",
"type": "PermitDetails"
},
{
"name": "spender",
"type": "address"
},
{
"name": "sigDeadline",
"type": "uint256"
}
]
}
}
}
}GET Permit/Approve info or EIP-2612 signature
const options = {method: 'GET'};
fetch('https://swap.ggp.gg/api/{blockchain}/permit/data', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"alreadyApproved": true,
"alreadyPermit": true,
"data": {
"permit": {
"details": {
"amount": "0xffffffffffffffffffffffffffffffffffffffff",
"expiration": "0x69daab1d",
"nonce": "0x0",
"token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
},
"sigDeadline": "0x69b46f9d",
"spender": "0xeee3fdcc5b9d7821570294b26070b2f45cfd8aec"
},
"typedData": {
"domain": {
"chainId": "0x1",
"name": "Permit2",
"verifyingContract": "0x000000000022d473030f116ddee9f6b43ac78ba3"
},
"message": {
"details": {
"amount": "0xffffffffffffffffffffffffffffffffffffffff",
"expiration": "0x69daab1d",
"nonce": "0x0",
"token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
},
"sigDeadline": "0x69b46f9d",
"spender": "0xeee3fdcc5b9d7821570294b26070b2f45cfd8aec"
},
"primaryType": "PermitSingle",
"types": {
"EIP712Domain": [
{
"name": "name",
"type": "string"
},
{
"name": "chainId",
"type": "uint256"
},
{
"name": "verifyingContract",
"type": "address"
}
],
"PermitDetails": [
{
"name": "token",
"type": "address"
},
{
"name": "amount",
"type": "uint160"
},
{
"name": "expiration",
"type": "uint48"
},
{
"name": "nonce",
"type": "uint48"
}
],
"PermitSingle": [
{
"name": "details",
"type": "PermitDetails"
},
{
"name": "spender",
"type": "address"
},
{
"name": "sigDeadline",
"type": "uint256"
}
]
}
}
}
}ethereum, bsc, arbitrum Source token contract address (ERC20 or native token)
Destination/taker wallet or contract
Amount of source token to swap (in token's normalized unit, e.g., eth for ETH)
Permit/Approve info or EIP-2612 signature for maker address
Whether the token has already been approved
Whether the permit has already been signed
Show child attributes
{
"permit": {
"details": {
"amount": "0xffffffffffffffffffffffffffffffffffffffff",
"expiration": "0x69daab1d",
"nonce": "0x0",
"token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
},
"sigDeadline": "0x69b46f9d",
"spender": "0xeee3fdcc5b9d7821570294b26070b2f45cfd8aec"
},
"typedData": {
"domain": {
"chainId": "0x1",
"name": "Permit2",
"verifyingContract": "0x000000000022d473030f116ddee9f6b43ac78ba3"
},
"message": {
"details": {
"amount": "0xffffffffffffffffffffffffffffffffffffffff",
"expiration": "0x69daab1d",
"nonce": "0x0",
"token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
},
"sigDeadline": "0x69b46f9d",
"spender": "0xeee3fdcc5b9d7821570294b26070b2f45cfd8aec"
},
"primaryType": "PermitSingle",
"types": {
"EIP712Domain": [
{ "name": "name", "type": "string" },
{ "name": "chainId", "type": "uint256" },
{
"name": "verifyingContract",
"type": "address"
}
],
"PermitDetails": [
{ "name": "token", "type": "address" },
{ "name": "amount", "type": "uint160" },
{ "name": "expiration", "type": "uint48" },
{ "name": "nonce", "type": "uint48" }
],
"PermitSingle": [
{
"name": "details",
"type": "PermitDetails"
},
{ "name": "spender", "type": "address" },
{ "name": "sigDeadline", "type": "uint256" }
]
}
}
}